##// END OF EJS Templates
Track and report compilation time if significant....
fperez -
Show More
@@ -1,3231 +1,3264 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 2763 2007-09-14 06:35:44Z fperez $"""
4 $Id: Magic.py 2841 2007-10-10 00:17:26Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
9 #
9 #
10 # Distributed under the terms of the BSD License. The full license is in
10 # Distributed under the terms of the BSD License. The full license is in
11 # the file COPYING, distributed as part of this software.
11 # the file COPYING, distributed as part of this software.
12 #*****************************************************************************
12 #*****************************************************************************
13
13
14 #****************************************************************************
14 #****************************************************************************
15 # Modules and globals
15 # Modules and globals
16
16
17 from IPython import Release
17 from IPython import Release
18 __author__ = '%s <%s>\n%s <%s>' % \
18 __author__ = '%s <%s>\n%s <%s>' % \
19 ( Release.authors['Janko'] + Release.authors['Fernando'] )
19 ( Release.authors['Janko'] + Release.authors['Fernando'] )
20 __license__ = Release.license
20 __license__ = Release.license
21
21
22 # Python standard modules
22 # Python standard modules
23 import __builtin__
23 import __builtin__
24 import bdb
24 import bdb
25 import inspect
25 import inspect
26 import os
26 import os
27 import pdb
27 import pdb
28 import pydoc
28 import pydoc
29 import sys
29 import sys
30 import re
30 import re
31 import tempfile
31 import tempfile
32 import time
32 import time
33 import cPickle as pickle
33 import cPickle as pickle
34 import textwrap
34 import textwrap
35 from cStringIO import StringIO
35 from cStringIO import StringIO
36 from getopt import getopt,GetoptError
36 from getopt import getopt,GetoptError
37 from pprint import pprint, pformat
37 from pprint import pprint, pformat
38 from sets import Set
38 from sets import Set
39
39
40 # cProfile was added in Python2.5
40 # cProfile was added in Python2.5
41 try:
41 try:
42 import cProfile as profile
42 import cProfile as profile
43 import pstats
43 import pstats
44 except ImportError:
44 except ImportError:
45 # profile isn't bundled by default in Debian for license reasons
45 # profile isn't bundled by default in Debian for license reasons
46 try:
46 try:
47 import profile,pstats
47 import profile,pstats
48 except ImportError:
48 except ImportError:
49 profile = pstats = None
49 profile = pstats = None
50
50
51 # Homebrewed
51 # Homebrewed
52 import IPython
52 import IPython
53 from IPython import Debugger, OInspect, wildcard
53 from IPython import Debugger, OInspect, wildcard
54 from IPython.FakeModule import FakeModule
54 from IPython.FakeModule import FakeModule
55 from IPython.Itpl import Itpl, itpl, printpl,itplns
55 from IPython.Itpl import Itpl, itpl, printpl,itplns
56 from IPython.PyColorize import Parser
56 from IPython.PyColorize import Parser
57 from IPython.ipstruct import Struct
57 from IPython.ipstruct import Struct
58 from IPython.macro import Macro
58 from IPython.macro import Macro
59 from IPython.genutils import *
59 from IPython.genutils import *
60 from IPython import platutils
60 from IPython import platutils
61 import IPython.generics
61 import IPython.generics
62 import IPython.ipapi
62 import IPython.ipapi
63 from IPython.ipapi import UsageError
63 from IPython.ipapi import UsageError
64 #***************************************************************************
64 #***************************************************************************
65 # Utility functions
65 # Utility functions
66 def on_off(tag):
66 def on_off(tag):
67 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
67 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
68 return ['OFF','ON'][tag]
68 return ['OFF','ON'][tag]
69
69
70 class Bunch: pass
70 class Bunch: pass
71
71
72 def compress_dhist(dh):
72 def compress_dhist(dh):
73 head, tail = dh[:-10], dh[-10:]
73 head, tail = dh[:-10], dh[-10:]
74
74
75 newhead = []
75 newhead = []
76 done = Set()
76 done = Set()
77 for h in head:
77 for h in head:
78 if h in done:
78 if h in done:
79 continue
79 continue
80 newhead.append(h)
80 newhead.append(h)
81 done.add(h)
81 done.add(h)
82
82
83 return newhead + tail
83 return newhead + tail
84
84
85
85
86 #***************************************************************************
86 #***************************************************************************
87 # Main class implementing Magic functionality
87 # Main class implementing Magic functionality
88 class Magic:
88 class Magic:
89 """Magic functions for InteractiveShell.
89 """Magic functions for InteractiveShell.
90
90
91 Shell functions which can be reached as %function_name. All magic
91 Shell functions which can be reached as %function_name. All magic
92 functions should accept a string, which they can parse for their own
92 functions should accept a string, which they can parse for their own
93 needs. This can make some functions easier to type, eg `%cd ../`
93 needs. This can make some functions easier to type, eg `%cd ../`
94 vs. `%cd("../")`
94 vs. `%cd("../")`
95
95
96 ALL definitions MUST begin with the prefix magic_. The user won't need it
96 ALL definitions MUST begin with the prefix magic_. The user won't need it
97 at the command line, but it is is needed in the definition. """
97 at the command line, but it is is needed in the definition. """
98
98
99 # class globals
99 # class globals
100 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
100 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
101 'Automagic is ON, % prefix NOT needed for magic functions.']
101 'Automagic is ON, % prefix NOT needed for magic functions.']
102
102
103 #......................................................................
103 #......................................................................
104 # some utility functions
104 # some utility functions
105
105
106 def __init__(self,shell):
106 def __init__(self,shell):
107
107
108 self.options_table = {}
108 self.options_table = {}
109 if profile is None:
109 if profile is None:
110 self.magic_prun = self.profile_missing_notice
110 self.magic_prun = self.profile_missing_notice
111 self.shell = shell
111 self.shell = shell
112
112
113 # namespace for holding state we may need
113 # namespace for holding state we may need
114 self._magic_state = Bunch()
114 self._magic_state = Bunch()
115
115
116 def profile_missing_notice(self, *args, **kwargs):
116 def profile_missing_notice(self, *args, **kwargs):
117 error("""\
117 error("""\
118 The profile module could not be found. If you are a Debian user,
118 The profile module could not be found. If you are a Debian user,
119 it has been removed from the standard Debian package because of its non-free
119 it has been removed from the standard Debian package because of its non-free
120 license. To use profiling, please install"python2.3-profiler" from non-free.""")
120 license. To use profiling, please install"python2.3-profiler" from non-free.""")
121
121
122 def default_option(self,fn,optstr):
122 def default_option(self,fn,optstr):
123 """Make an entry in the options_table for fn, with value optstr"""
123 """Make an entry in the options_table for fn, with value optstr"""
124
124
125 if fn not in self.lsmagic():
125 if fn not in self.lsmagic():
126 error("%s is not a magic function" % fn)
126 error("%s is not a magic function" % fn)
127 self.options_table[fn] = optstr
127 self.options_table[fn] = optstr
128
128
129 def lsmagic(self):
129 def lsmagic(self):
130 """Return a list of currently available magic functions.
130 """Return a list of currently available magic functions.
131
131
132 Gives a list of the bare names after mangling (['ls','cd', ...], not
132 Gives a list of the bare names after mangling (['ls','cd', ...], not
133 ['magic_ls','magic_cd',...]"""
133 ['magic_ls','magic_cd',...]"""
134
134
135 # FIXME. This needs a cleanup, in the way the magics list is built.
135 # FIXME. This needs a cleanup, in the way the magics list is built.
136
136
137 # magics in class definition
137 # magics in class definition
138 class_magic = lambda fn: fn.startswith('magic_') and \
138 class_magic = lambda fn: fn.startswith('magic_') and \
139 callable(Magic.__dict__[fn])
139 callable(Magic.__dict__[fn])
140 # in instance namespace (run-time user additions)
140 # in instance namespace (run-time user additions)
141 inst_magic = lambda fn: fn.startswith('magic_') and \
141 inst_magic = lambda fn: fn.startswith('magic_') and \
142 callable(self.__dict__[fn])
142 callable(self.__dict__[fn])
143 # and bound magics by user (so they can access self):
143 # and bound magics by user (so they can access self):
144 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
144 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
145 callable(self.__class__.__dict__[fn])
145 callable(self.__class__.__dict__[fn])
146 magics = filter(class_magic,Magic.__dict__.keys()) + \
146 magics = filter(class_magic,Magic.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
149 out = []
149 out = []
150 for fn in magics:
150 for fn in magics:
151 out.append(fn.replace('magic_','',1))
151 out.append(fn.replace('magic_','',1))
152 out.sort()
152 out.sort()
153 return out
153 return out
154
154
155 def extract_input_slices(self,slices,raw=False):
155 def extract_input_slices(self,slices,raw=False):
156 """Return as a string a set of input history slices.
156 """Return as a string a set of input history slices.
157
157
158 Inputs:
158 Inputs:
159
159
160 - slices: the set of slices is given as a list of strings (like
160 - slices: the set of slices is given as a list of strings (like
161 ['1','4:8','9'], since this function is for use by magic functions
161 ['1','4:8','9'], since this function is for use by magic functions
162 which get their arguments as strings.
162 which get their arguments as strings.
163
163
164 Optional inputs:
164 Optional inputs:
165
165
166 - raw(False): by default, the processed input is used. If this is
166 - raw(False): by default, the processed input is used. If this is
167 true, the raw input history is used instead.
167 true, the raw input history is used instead.
168
168
169 Note that slices can be called with two notations:
169 Note that slices can be called with two notations:
170
170
171 N:M -> standard python form, means including items N...(M-1).
171 N:M -> standard python form, means including items N...(M-1).
172
172
173 N-M -> include items N..M (closed endpoint)."""
173 N-M -> include items N..M (closed endpoint)."""
174
174
175 if raw:
175 if raw:
176 hist = self.shell.input_hist_raw
176 hist = self.shell.input_hist_raw
177 else:
177 else:
178 hist = self.shell.input_hist
178 hist = self.shell.input_hist
179
179
180 cmds = []
180 cmds = []
181 for chunk in slices:
181 for chunk in slices:
182 if ':' in chunk:
182 if ':' in chunk:
183 ini,fin = map(int,chunk.split(':'))
183 ini,fin = map(int,chunk.split(':'))
184 elif '-' in chunk:
184 elif '-' in chunk:
185 ini,fin = map(int,chunk.split('-'))
185 ini,fin = map(int,chunk.split('-'))
186 fin += 1
186 fin += 1
187 else:
187 else:
188 ini = int(chunk)
188 ini = int(chunk)
189 fin = ini+1
189 fin = ini+1
190 cmds.append(hist[ini:fin])
190 cmds.append(hist[ini:fin])
191 return cmds
191 return cmds
192
192
193 def _ofind(self, oname, namespaces=None):
193 def _ofind(self, oname, namespaces=None):
194 """Find an object in the available namespaces.
194 """Find an object in the available namespaces.
195
195
196 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
196 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
197
197
198 Has special code to detect magic functions.
198 Has special code to detect magic functions.
199 """
199 """
200
200
201 oname = oname.strip()
201 oname = oname.strip()
202
202
203 alias_ns = None
203 alias_ns = None
204 if namespaces is None:
204 if namespaces is None:
205 # Namespaces to search in:
205 # Namespaces to search in:
206 # Put them in a list. The order is important so that we
206 # Put them in a list. The order is important so that we
207 # find things in the same order that Python finds them.
207 # find things in the same order that Python finds them.
208 namespaces = [ ('Interactive', self.shell.user_ns),
208 namespaces = [ ('Interactive', self.shell.user_ns),
209 ('IPython internal', self.shell.internal_ns),
209 ('IPython internal', self.shell.internal_ns),
210 ('Python builtin', __builtin__.__dict__),
210 ('Python builtin', __builtin__.__dict__),
211 ('Alias', self.shell.alias_table),
211 ('Alias', self.shell.alias_table),
212 ]
212 ]
213 alias_ns = self.shell.alias_table
213 alias_ns = self.shell.alias_table
214
214
215 # initialize results to 'null'
215 # initialize results to 'null'
216 found = 0; obj = None; ospace = None; ds = None;
216 found = 0; obj = None; ospace = None; ds = None;
217 ismagic = 0; isalias = 0; parent = None
217 ismagic = 0; isalias = 0; parent = None
218
218
219 # Look for the given name by splitting it in parts. If the head is
219 # Look for the given name by splitting it in parts. If the head is
220 # found, then we look for all the remaining parts as members, and only
220 # found, then we look for all the remaining parts as members, and only
221 # declare success if we can find them all.
221 # declare success if we can find them all.
222 oname_parts = oname.split('.')
222 oname_parts = oname.split('.')
223 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
223 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
224 for nsname,ns in namespaces:
224 for nsname,ns in namespaces:
225 try:
225 try:
226 obj = ns[oname_head]
226 obj = ns[oname_head]
227 except KeyError:
227 except KeyError:
228 continue
228 continue
229 else:
229 else:
230 #print 'oname_rest:', oname_rest # dbg
230 #print 'oname_rest:', oname_rest # dbg
231 for part in oname_rest:
231 for part in oname_rest:
232 try:
232 try:
233 parent = obj
233 parent = obj
234 obj = getattr(obj,part)
234 obj = getattr(obj,part)
235 except:
235 except:
236 # Blanket except b/c some badly implemented objects
236 # Blanket except b/c some badly implemented objects
237 # allow __getattr__ to raise exceptions other than
237 # allow __getattr__ to raise exceptions other than
238 # AttributeError, which then crashes IPython.
238 # AttributeError, which then crashes IPython.
239 break
239 break
240 else:
240 else:
241 # If we finish the for loop (no break), we got all members
241 # If we finish the for loop (no break), we got all members
242 found = 1
242 found = 1
243 ospace = nsname
243 ospace = nsname
244 if ns == alias_ns:
244 if ns == alias_ns:
245 isalias = 1
245 isalias = 1
246 break # namespace loop
246 break # namespace loop
247
247
248 # Try to see if it's magic
248 # Try to see if it's magic
249 if not found:
249 if not found:
250 if oname.startswith(self.shell.ESC_MAGIC):
250 if oname.startswith(self.shell.ESC_MAGIC):
251 oname = oname[1:]
251 oname = oname[1:]
252 obj = getattr(self,'magic_'+oname,None)
252 obj = getattr(self,'magic_'+oname,None)
253 if obj is not None:
253 if obj is not None:
254 found = 1
254 found = 1
255 ospace = 'IPython internal'
255 ospace = 'IPython internal'
256 ismagic = 1
256 ismagic = 1
257
257
258 # Last try: special-case some literals like '', [], {}, etc:
258 # Last try: special-case some literals like '', [], {}, etc:
259 if not found and oname_head in ["''",'""','[]','{}','()']:
259 if not found and oname_head in ["''",'""','[]','{}','()']:
260 obj = eval(oname_head)
260 obj = eval(oname_head)
261 found = 1
261 found = 1
262 ospace = 'Interactive'
262 ospace = 'Interactive'
263
263
264 return {'found':found, 'obj':obj, 'namespace':ospace,
264 return {'found':found, 'obj':obj, 'namespace':ospace,
265 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
265 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
266
266
267 def arg_err(self,func):
267 def arg_err(self,func):
268 """Print docstring if incorrect arguments were passed"""
268 """Print docstring if incorrect arguments were passed"""
269 print 'Error in arguments:'
269 print 'Error in arguments:'
270 print OInspect.getdoc(func)
270 print OInspect.getdoc(func)
271
271
272 def format_latex(self,strng):
272 def format_latex(self,strng):
273 """Format a string for latex inclusion."""
273 """Format a string for latex inclusion."""
274
274
275 # Characters that need to be escaped for latex:
275 # Characters that need to be escaped for latex:
276 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
276 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
277 # Magic command names as headers:
277 # Magic command names as headers:
278 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
278 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
279 re.MULTILINE)
279 re.MULTILINE)
280 # Magic commands
280 # Magic commands
281 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
281 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
282 re.MULTILINE)
282 re.MULTILINE)
283 # Paragraph continue
283 # Paragraph continue
284 par_re = re.compile(r'\\$',re.MULTILINE)
284 par_re = re.compile(r'\\$',re.MULTILINE)
285
285
286 # The "\n" symbol
286 # The "\n" symbol
287 newline_re = re.compile(r'\\n')
287 newline_re = re.compile(r'\\n')
288
288
289 # Now build the string for output:
289 # Now build the string for output:
290 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
290 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
291 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
291 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
292 strng)
292 strng)
293 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
293 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
294 strng = par_re.sub(r'\\\\',strng)
294 strng = par_re.sub(r'\\\\',strng)
295 strng = escape_re.sub(r'\\\1',strng)
295 strng = escape_re.sub(r'\\\1',strng)
296 strng = newline_re.sub(r'\\textbackslash{}n',strng)
296 strng = newline_re.sub(r'\\textbackslash{}n',strng)
297 return strng
297 return strng
298
298
299 def format_screen(self,strng):
299 def format_screen(self,strng):
300 """Format a string for screen printing.
300 """Format a string for screen printing.
301
301
302 This removes some latex-type format codes."""
302 This removes some latex-type format codes."""
303 # Paragraph continue
303 # Paragraph continue
304 par_re = re.compile(r'\\$',re.MULTILINE)
304 par_re = re.compile(r'\\$',re.MULTILINE)
305 strng = par_re.sub('',strng)
305 strng = par_re.sub('',strng)
306 return strng
306 return strng
307
307
308 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
308 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
309 """Parse options passed to an argument string.
309 """Parse options passed to an argument string.
310
310
311 The interface is similar to that of getopt(), but it returns back a
311 The interface is similar to that of getopt(), but it returns back a
312 Struct with the options as keys and the stripped argument string still
312 Struct with the options as keys and the stripped argument string still
313 as a string.
313 as a string.
314
314
315 arg_str is quoted as a true sys.argv vector by using shlex.split.
315 arg_str is quoted as a true sys.argv vector by using shlex.split.
316 This allows us to easily expand variables, glob files, quote
316 This allows us to easily expand variables, glob files, quote
317 arguments, etc.
317 arguments, etc.
318
318
319 Options:
319 Options:
320 -mode: default 'string'. If given as 'list', the argument string is
320 -mode: default 'string'. If given as 'list', the argument string is
321 returned as a list (split on whitespace) instead of a string.
321 returned as a list (split on whitespace) instead of a string.
322
322
323 -list_all: put all option values in lists. Normally only options
323 -list_all: put all option values in lists. Normally only options
324 appearing more than once are put in a list.
324 appearing more than once are put in a list.
325
325
326 -posix (True): whether to split the input line in POSIX mode or not,
326 -posix (True): whether to split the input line in POSIX mode or not,
327 as per the conventions outlined in the shlex module from the
327 as per the conventions outlined in the shlex module from the
328 standard library."""
328 standard library."""
329
329
330 # inject default options at the beginning of the input line
330 # inject default options at the beginning of the input line
331 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
331 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
332 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
332 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
333
333
334 mode = kw.get('mode','string')
334 mode = kw.get('mode','string')
335 if mode not in ['string','list']:
335 if mode not in ['string','list']:
336 raise ValueError,'incorrect mode given: %s' % mode
336 raise ValueError,'incorrect mode given: %s' % mode
337 # Get options
337 # Get options
338 list_all = kw.get('list_all',0)
338 list_all = kw.get('list_all',0)
339 posix = kw.get('posix',True)
339 posix = kw.get('posix',True)
340
340
341 # Check if we have more than one argument to warrant extra processing:
341 # Check if we have more than one argument to warrant extra processing:
342 odict = {} # Dictionary with options
342 odict = {} # Dictionary with options
343 args = arg_str.split()
343 args = arg_str.split()
344 if len(args) >= 1:
344 if len(args) >= 1:
345 # If the list of inputs only has 0 or 1 thing in it, there's no
345 # If the list of inputs only has 0 or 1 thing in it, there's no
346 # need to look for options
346 # need to look for options
347 argv = arg_split(arg_str,posix)
347 argv = arg_split(arg_str,posix)
348 # Do regular option processing
348 # Do regular option processing
349 try:
349 try:
350 opts,args = getopt(argv,opt_str,*long_opts)
350 opts,args = getopt(argv,opt_str,*long_opts)
351 except GetoptError,e:
351 except GetoptError,e:
352 raise UsageError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
352 raise UsageError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
353 " ".join(long_opts)))
353 " ".join(long_opts)))
354 for o,a in opts:
354 for o,a in opts:
355 if o.startswith('--'):
355 if o.startswith('--'):
356 o = o[2:]
356 o = o[2:]
357 else:
357 else:
358 o = o[1:]
358 o = o[1:]
359 try:
359 try:
360 odict[o].append(a)
360 odict[o].append(a)
361 except AttributeError:
361 except AttributeError:
362 odict[o] = [odict[o],a]
362 odict[o] = [odict[o],a]
363 except KeyError:
363 except KeyError:
364 if list_all:
364 if list_all:
365 odict[o] = [a]
365 odict[o] = [a]
366 else:
366 else:
367 odict[o] = a
367 odict[o] = a
368
368
369 # Prepare opts,args for return
369 # Prepare opts,args for return
370 opts = Struct(odict)
370 opts = Struct(odict)
371 if mode == 'string':
371 if mode == 'string':
372 args = ' '.join(args)
372 args = ' '.join(args)
373
373
374 return opts,args
374 return opts,args
375
375
376 #......................................................................
376 #......................................................................
377 # And now the actual magic functions
377 # And now the actual magic functions
378
378
379 # Functions for IPython shell work (vars,funcs, config, etc)
379 # Functions for IPython shell work (vars,funcs, config, etc)
380 def magic_lsmagic(self, parameter_s = ''):
380 def magic_lsmagic(self, parameter_s = ''):
381 """List currently available magic functions."""
381 """List currently available magic functions."""
382 mesc = self.shell.ESC_MAGIC
382 mesc = self.shell.ESC_MAGIC
383 print 'Available magic functions:\n'+mesc+\
383 print 'Available magic functions:\n'+mesc+\
384 (' '+mesc).join(self.lsmagic())
384 (' '+mesc).join(self.lsmagic())
385 print '\n' + Magic.auto_status[self.shell.rc.automagic]
385 print '\n' + Magic.auto_status[self.shell.rc.automagic]
386 return None
386 return None
387
387
388 def magic_magic(self, parameter_s = ''):
388 def magic_magic(self, parameter_s = ''):
389 """Print information about the magic function system."""
389 """Print information about the magic function system."""
390
390
391 mode = ''
391 mode = ''
392 try:
392 try:
393 if parameter_s.split()[0] == '-latex':
393 if parameter_s.split()[0] == '-latex':
394 mode = 'latex'
394 mode = 'latex'
395 if parameter_s.split()[0] == '-brief':
395 if parameter_s.split()[0] == '-brief':
396 mode = 'brief'
396 mode = 'brief'
397 except:
397 except:
398 pass
398 pass
399
399
400 magic_docs = []
400 magic_docs = []
401 for fname in self.lsmagic():
401 for fname in self.lsmagic():
402 mname = 'magic_' + fname
402 mname = 'magic_' + fname
403 for space in (Magic,self,self.__class__):
403 for space in (Magic,self,self.__class__):
404 try:
404 try:
405 fn = space.__dict__[mname]
405 fn = space.__dict__[mname]
406 except KeyError:
406 except KeyError:
407 pass
407 pass
408 else:
408 else:
409 break
409 break
410 if mode == 'brief':
410 if mode == 'brief':
411 # only first line
411 # only first line
412 fndoc = fn.__doc__.split('\n',1)[0]
412 fndoc = fn.__doc__.split('\n',1)[0]
413 else:
413 else:
414 fndoc = fn.__doc__
414 fndoc = fn.__doc__
415
415
416 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
416 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
417 fname,fndoc))
417 fname,fndoc))
418 magic_docs = ''.join(magic_docs)
418 magic_docs = ''.join(magic_docs)
419
419
420 if mode == 'latex':
420 if mode == 'latex':
421 print self.format_latex(magic_docs)
421 print self.format_latex(magic_docs)
422 return
422 return
423 else:
423 else:
424 magic_docs = self.format_screen(magic_docs)
424 magic_docs = self.format_screen(magic_docs)
425 if mode == 'brief':
425 if mode == 'brief':
426 return magic_docs
426 return magic_docs
427
427
428 outmsg = """
428 outmsg = """
429 IPython's 'magic' functions
429 IPython's 'magic' functions
430 ===========================
430 ===========================
431
431
432 The magic function system provides a series of functions which allow you to
432 The magic function system provides a series of functions which allow you to
433 control the behavior of IPython itself, plus a lot of system-type
433 control the behavior of IPython itself, plus a lot of system-type
434 features. All these functions are prefixed with a % character, but parameters
434 features. All these functions are prefixed with a % character, but parameters
435 are given without parentheses or quotes.
435 are given without parentheses or quotes.
436
436
437 NOTE: If you have 'automagic' enabled (via the command line option or with the
437 NOTE: If you have 'automagic' enabled (via the command line option or with the
438 %automagic function), you don't need to type in the % explicitly. By default,
438 %automagic function), you don't need to type in the % explicitly. By default,
439 IPython ships with automagic on, so you should only rarely need the % escape.
439 IPython ships with automagic on, so you should only rarely need the % escape.
440
440
441 Example: typing '%cd mydir' (without the quotes) changes you working directory
441 Example: typing '%cd mydir' (without the quotes) changes you working directory
442 to 'mydir', if it exists.
442 to 'mydir', if it exists.
443
443
444 You can define your own magic functions to extend the system. See the supplied
444 You can define your own magic functions to extend the system. See the supplied
445 ipythonrc and example-magic.py files for details (in your ipython
445 ipythonrc and example-magic.py files for details (in your ipython
446 configuration directory, typically $HOME/.ipython/).
446 configuration directory, typically $HOME/.ipython/).
447
447
448 You can also define your own aliased names for magic functions. In your
448 You can also define your own aliased names for magic functions. In your
449 ipythonrc file, placing a line like:
449 ipythonrc file, placing a line like:
450
450
451 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
451 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
452
452
453 will define %pf as a new name for %profile.
453 will define %pf as a new name for %profile.
454
454
455 You can also call magics in code using the ipmagic() function, which IPython
455 You can also call magics in code using the ipmagic() function, which IPython
456 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
456 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
457
457
458 For a list of the available magic functions, use %lsmagic. For a description
458 For a list of the available magic functions, use %lsmagic. For a description
459 of any of them, type %magic_name?, e.g. '%cd?'.
459 of any of them, type %magic_name?, e.g. '%cd?'.
460
460
461 Currently the magic system has the following functions:\n"""
461 Currently the magic system has the following functions:\n"""
462
462
463 mesc = self.shell.ESC_MAGIC
463 mesc = self.shell.ESC_MAGIC
464 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
464 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
465 "\n\n%s%s\n\n%s" % (outmsg,
465 "\n\n%s%s\n\n%s" % (outmsg,
466 magic_docs,mesc,mesc,
466 magic_docs,mesc,mesc,
467 (' '+mesc).join(self.lsmagic()),
467 (' '+mesc).join(self.lsmagic()),
468 Magic.auto_status[self.shell.rc.automagic] ) )
468 Magic.auto_status[self.shell.rc.automagic] ) )
469
469
470 page(outmsg,screen_lines=self.shell.rc.screen_length)
470 page(outmsg,screen_lines=self.shell.rc.screen_length)
471
471
472
472
473 def magic_autoindent(self, parameter_s = ''):
473 def magic_autoindent(self, parameter_s = ''):
474 """Toggle autoindent on/off (if available)."""
474 """Toggle autoindent on/off (if available)."""
475
475
476 self.shell.set_autoindent()
476 self.shell.set_autoindent()
477 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
477 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
478
478
479
479
480 def magic_automagic(self, parameter_s = ''):
480 def magic_automagic(self, parameter_s = ''):
481 """Make magic functions callable without having to type the initial %.
481 """Make magic functions callable without having to type the initial %.
482
482
483 Without argumentsl toggles on/off (when off, you must call it as
483 Without argumentsl toggles on/off (when off, you must call it as
484 %automagic, of course). With arguments it sets the value, and you can
484 %automagic, of course). With arguments it sets the value, and you can
485 use any of (case insensitive):
485 use any of (case insensitive):
486
486
487 - on,1,True: to activate
487 - on,1,True: to activate
488
488
489 - off,0,False: to deactivate.
489 - off,0,False: to deactivate.
490
490
491 Note that magic functions have lowest priority, so if there's a
491 Note that magic functions have lowest priority, so if there's a
492 variable whose name collides with that of a magic fn, automagic won't
492 variable whose name collides with that of a magic fn, automagic won't
493 work for that function (you get the variable instead). However, if you
493 work for that function (you get the variable instead). However, if you
494 delete the variable (del var), the previously shadowed magic function
494 delete the variable (del var), the previously shadowed magic function
495 becomes visible to automagic again."""
495 becomes visible to automagic again."""
496
496
497 rc = self.shell.rc
497 rc = self.shell.rc
498 arg = parameter_s.lower()
498 arg = parameter_s.lower()
499 if parameter_s in ('on','1','true'):
499 if parameter_s in ('on','1','true'):
500 rc.automagic = True
500 rc.automagic = True
501 elif parameter_s in ('off','0','false'):
501 elif parameter_s in ('off','0','false'):
502 rc.automagic = False
502 rc.automagic = False
503 else:
503 else:
504 rc.automagic = not rc.automagic
504 rc.automagic = not rc.automagic
505 print '\n' + Magic.auto_status[rc.automagic]
505 print '\n' + Magic.auto_status[rc.automagic]
506
506
507
507
508 def magic_autocall(self, parameter_s = ''):
508 def magic_autocall(self, parameter_s = ''):
509 """Make functions callable without having to type parentheses.
509 """Make functions callable without having to type parentheses.
510
510
511 Usage:
511 Usage:
512
512
513 %autocall [mode]
513 %autocall [mode]
514
514
515 The mode can be one of: 0->Off, 1->Smart, 2->Full. If not given, the
515 The mode can be one of: 0->Off, 1->Smart, 2->Full. If not given, the
516 value is toggled on and off (remembering the previous state).
516 value is toggled on and off (remembering the previous state).
517
517
518 In more detail, these values mean:
518 In more detail, these values mean:
519
519
520 0 -> fully disabled
520 0 -> fully disabled
521
521
522 1 -> active, but do not apply if there are no arguments on the line.
522 1 -> active, but do not apply if there are no arguments on the line.
523
523
524 In this mode, you get:
524 In this mode, you get:
525
525
526 In [1]: callable
526 In [1]: callable
527 Out[1]: <built-in function callable>
527 Out[1]: <built-in function callable>
528
528
529 In [2]: callable 'hello'
529 In [2]: callable 'hello'
530 ------> callable('hello')
530 ------> callable('hello')
531 Out[2]: False
531 Out[2]: False
532
532
533 2 -> Active always. Even if no arguments are present, the callable
533 2 -> Active always. Even if no arguments are present, the callable
534 object is called:
534 object is called:
535
535
536 In [4]: callable
536 In [4]: callable
537 ------> callable()
537 ------> callable()
538
538
539 Note that even with autocall off, you can still use '/' at the start of
539 Note that even with autocall off, you can still use '/' at the start of
540 a line to treat the first argument on the command line as a function
540 a line to treat the first argument on the command line as a function
541 and add parentheses to it:
541 and add parentheses to it:
542
542
543 In [8]: /str 43
543 In [8]: /str 43
544 ------> str(43)
544 ------> str(43)
545 Out[8]: '43'
545 Out[8]: '43'
546 """
546 """
547
547
548 rc = self.shell.rc
548 rc = self.shell.rc
549
549
550 if parameter_s:
550 if parameter_s:
551 arg = int(parameter_s)
551 arg = int(parameter_s)
552 else:
552 else:
553 arg = 'toggle'
553 arg = 'toggle'
554
554
555 if not arg in (0,1,2,'toggle'):
555 if not arg in (0,1,2,'toggle'):
556 error('Valid modes: (0->Off, 1->Smart, 2->Full')
556 error('Valid modes: (0->Off, 1->Smart, 2->Full')
557 return
557 return
558
558
559 if arg in (0,1,2):
559 if arg in (0,1,2):
560 rc.autocall = arg
560 rc.autocall = arg
561 else: # toggle
561 else: # toggle
562 if rc.autocall:
562 if rc.autocall:
563 self._magic_state.autocall_save = rc.autocall
563 self._magic_state.autocall_save = rc.autocall
564 rc.autocall = 0
564 rc.autocall = 0
565 else:
565 else:
566 try:
566 try:
567 rc.autocall = self._magic_state.autocall_save
567 rc.autocall = self._magic_state.autocall_save
568 except AttributeError:
568 except AttributeError:
569 rc.autocall = self._magic_state.autocall_save = 1
569 rc.autocall = self._magic_state.autocall_save = 1
570
570
571 print "Automatic calling is:",['OFF','Smart','Full'][rc.autocall]
571 print "Automatic calling is:",['OFF','Smart','Full'][rc.autocall]
572
572
573 def magic_system_verbose(self, parameter_s = ''):
573 def magic_system_verbose(self, parameter_s = ''):
574 """Set verbose printing of system calls.
574 """Set verbose printing of system calls.
575
575
576 If called without an argument, act as a toggle"""
576 If called without an argument, act as a toggle"""
577
577
578 if parameter_s:
578 if parameter_s:
579 val = bool(eval(parameter_s))
579 val = bool(eval(parameter_s))
580 else:
580 else:
581 val = None
581 val = None
582
582
583 self.shell.rc_set_toggle('system_verbose',val)
583 self.shell.rc_set_toggle('system_verbose',val)
584 print "System verbose printing is:",\
584 print "System verbose printing is:",\
585 ['OFF','ON'][self.shell.rc.system_verbose]
585 ['OFF','ON'][self.shell.rc.system_verbose]
586
586
587
587
588 def magic_page(self, parameter_s=''):
588 def magic_page(self, parameter_s=''):
589 """Pretty print the object and display it through a pager.
589 """Pretty print the object and display it through a pager.
590
590
591 %page [options] OBJECT
591 %page [options] OBJECT
592
592
593 If no object is given, use _ (last output).
593 If no object is given, use _ (last output).
594
594
595 Options:
595 Options:
596
596
597 -r: page str(object), don't pretty-print it."""
597 -r: page str(object), don't pretty-print it."""
598
598
599 # After a function contributed by Olivier Aubert, slightly modified.
599 # After a function contributed by Olivier Aubert, slightly modified.
600
600
601 # Process options/args
601 # Process options/args
602 opts,args = self.parse_options(parameter_s,'r')
602 opts,args = self.parse_options(parameter_s,'r')
603 raw = 'r' in opts
603 raw = 'r' in opts
604
604
605 oname = args and args or '_'
605 oname = args and args or '_'
606 info = self._ofind(oname)
606 info = self._ofind(oname)
607 if info['found']:
607 if info['found']:
608 txt = (raw and str or pformat)( info['obj'] )
608 txt = (raw and str or pformat)( info['obj'] )
609 page(txt)
609 page(txt)
610 else:
610 else:
611 print 'Object `%s` not found' % oname
611 print 'Object `%s` not found' % oname
612
612
613 def magic_profile(self, parameter_s=''):
613 def magic_profile(self, parameter_s=''):
614 """Print your currently active IPyhton profile."""
614 """Print your currently active IPyhton profile."""
615 if self.shell.rc.profile:
615 if self.shell.rc.profile:
616 printpl('Current IPython profile: $self.shell.rc.profile.')
616 printpl('Current IPython profile: $self.shell.rc.profile.')
617 else:
617 else:
618 print 'No profile active.'
618 print 'No profile active.'
619
619
620 def magic_pinfo(self, parameter_s='', namespaces=None):
620 def magic_pinfo(self, parameter_s='', namespaces=None):
621 """Provide detailed information about an object.
621 """Provide detailed information about an object.
622
622
623 '%pinfo object' is just a synonym for object? or ?object."""
623 '%pinfo object' is just a synonym for object? or ?object."""
624
624
625 #print 'pinfo par: <%s>' % parameter_s # dbg
625 #print 'pinfo par: <%s>' % parameter_s # dbg
626
626
627
627
628 # detail_level: 0 -> obj? , 1 -> obj??
628 # detail_level: 0 -> obj? , 1 -> obj??
629 detail_level = 0
629 detail_level = 0
630 # We need to detect if we got called as 'pinfo pinfo foo', which can
630 # We need to detect if we got called as 'pinfo pinfo foo', which can
631 # happen if the user types 'pinfo foo?' at the cmd line.
631 # happen if the user types 'pinfo foo?' at the cmd line.
632 pinfo,qmark1,oname,qmark2 = \
632 pinfo,qmark1,oname,qmark2 = \
633 re.match('(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
633 re.match('(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
634 if pinfo or qmark1 or qmark2:
634 if pinfo or qmark1 or qmark2:
635 detail_level = 1
635 detail_level = 1
636 if "*" in oname:
636 if "*" in oname:
637 self.magic_psearch(oname)
637 self.magic_psearch(oname)
638 else:
638 else:
639 self._inspect('pinfo', oname, detail_level=detail_level,
639 self._inspect('pinfo', oname, detail_level=detail_level,
640 namespaces=namespaces)
640 namespaces=namespaces)
641
641
642 def magic_pdef(self, parameter_s='', namespaces=None):
642 def magic_pdef(self, parameter_s='', namespaces=None):
643 """Print the definition header for any callable object.
643 """Print the definition header for any callable object.
644
644
645 If the object is a class, print the constructor information."""
645 If the object is a class, print the constructor information."""
646 self._inspect('pdef',parameter_s, namespaces)
646 self._inspect('pdef',parameter_s, namespaces)
647
647
648 def magic_pdoc(self, parameter_s='', namespaces=None):
648 def magic_pdoc(self, parameter_s='', namespaces=None):
649 """Print the docstring for an object.
649 """Print the docstring for an object.
650
650
651 If the given object is a class, it will print both the class and the
651 If the given object is a class, it will print both the class and the
652 constructor docstrings."""
652 constructor docstrings."""
653 self._inspect('pdoc',parameter_s, namespaces)
653 self._inspect('pdoc',parameter_s, namespaces)
654
654
655 def magic_psource(self, parameter_s='', namespaces=None):
655 def magic_psource(self, parameter_s='', namespaces=None):
656 """Print (or run through pager) the source code for an object."""
656 """Print (or run through pager) the source code for an object."""
657 self._inspect('psource',parameter_s, namespaces)
657 self._inspect('psource',parameter_s, namespaces)
658
658
659 def magic_pfile(self, parameter_s=''):
659 def magic_pfile(self, parameter_s=''):
660 """Print (or run through pager) the file where an object is defined.
660 """Print (or run through pager) the file where an object is defined.
661
661
662 The file opens at the line where the object definition begins. IPython
662 The file opens at the line where the object definition begins. IPython
663 will honor the environment variable PAGER if set, and otherwise will
663 will honor the environment variable PAGER if set, and otherwise will
664 do its best to print the file in a convenient form.
664 do its best to print the file in a convenient form.
665
665
666 If the given argument is not an object currently defined, IPython will
666 If the given argument is not an object currently defined, IPython will
667 try to interpret it as a filename (automatically adding a .py extension
667 try to interpret it as a filename (automatically adding a .py extension
668 if needed). You can thus use %pfile as a syntax highlighting code
668 if needed). You can thus use %pfile as a syntax highlighting code
669 viewer."""
669 viewer."""
670
670
671 # first interpret argument as an object name
671 # first interpret argument as an object name
672 out = self._inspect('pfile',parameter_s)
672 out = self._inspect('pfile',parameter_s)
673 # if not, try the input as a filename
673 # if not, try the input as a filename
674 if out == 'not found':
674 if out == 'not found':
675 try:
675 try:
676 filename = get_py_filename(parameter_s)
676 filename = get_py_filename(parameter_s)
677 except IOError,msg:
677 except IOError,msg:
678 print msg
678 print msg
679 return
679 return
680 page(self.shell.inspector.format(file(filename).read()))
680 page(self.shell.inspector.format(file(filename).read()))
681
681
682 def _inspect(self,meth,oname,namespaces=None,**kw):
682 def _inspect(self,meth,oname,namespaces=None,**kw):
683 """Generic interface to the inspector system.
683 """Generic interface to the inspector system.
684
684
685 This function is meant to be called by pdef, pdoc & friends."""
685 This function is meant to be called by pdef, pdoc & friends."""
686
686
687 #oname = oname.strip()
687 #oname = oname.strip()
688 #print '1- oname: <%r>' % oname # dbg
688 #print '1- oname: <%r>' % oname # dbg
689 try:
689 try:
690 oname = oname.strip().encode('ascii')
690 oname = oname.strip().encode('ascii')
691 #print '2- oname: <%r>' % oname # dbg
691 #print '2- oname: <%r>' % oname # dbg
692 except UnicodeEncodeError:
692 except UnicodeEncodeError:
693 print 'Python identifiers can only contain ascii characters.'
693 print 'Python identifiers can only contain ascii characters.'
694 return 'not found'
694 return 'not found'
695
695
696 info = Struct(self._ofind(oname, namespaces))
696 info = Struct(self._ofind(oname, namespaces))
697
697
698 if info.found:
698 if info.found:
699 try:
699 try:
700 IPython.generics.inspect_object(info.obj)
700 IPython.generics.inspect_object(info.obj)
701 return
701 return
702 except IPython.ipapi.TryNext:
702 except IPython.ipapi.TryNext:
703 pass
703 pass
704 # Get the docstring of the class property if it exists.
704 # Get the docstring of the class property if it exists.
705 path = oname.split('.')
705 path = oname.split('.')
706 root = '.'.join(path[:-1])
706 root = '.'.join(path[:-1])
707 if info.parent is not None:
707 if info.parent is not None:
708 try:
708 try:
709 target = getattr(info.parent, '__class__')
709 target = getattr(info.parent, '__class__')
710 # The object belongs to a class instance.
710 # The object belongs to a class instance.
711 try:
711 try:
712 target = getattr(target, path[-1])
712 target = getattr(target, path[-1])
713 # The class defines the object.
713 # The class defines the object.
714 if isinstance(target, property):
714 if isinstance(target, property):
715 oname = root + '.__class__.' + path[-1]
715 oname = root + '.__class__.' + path[-1]
716 info = Struct(self._ofind(oname))
716 info = Struct(self._ofind(oname))
717 except AttributeError: pass
717 except AttributeError: pass
718 except AttributeError: pass
718 except AttributeError: pass
719
719
720 pmethod = getattr(self.shell.inspector,meth)
720 pmethod = getattr(self.shell.inspector,meth)
721 formatter = info.ismagic and self.format_screen or None
721 formatter = info.ismagic and self.format_screen or None
722 if meth == 'pdoc':
722 if meth == 'pdoc':
723 pmethod(info.obj,oname,formatter)
723 pmethod(info.obj,oname,formatter)
724 elif meth == 'pinfo':
724 elif meth == 'pinfo':
725 pmethod(info.obj,oname,formatter,info,**kw)
725 pmethod(info.obj,oname,formatter,info,**kw)
726 else:
726 else:
727 pmethod(info.obj,oname)
727 pmethod(info.obj,oname)
728 else:
728 else:
729 print 'Object `%s` not found.' % oname
729 print 'Object `%s` not found.' % oname
730 return 'not found' # so callers can take other action
730 return 'not found' # so callers can take other action
731
731
732 def magic_psearch(self, parameter_s=''):
732 def magic_psearch(self, parameter_s=''):
733 """Search for object in namespaces by wildcard.
733 """Search for object in namespaces by wildcard.
734
734
735 %psearch [options] PATTERN [OBJECT TYPE]
735 %psearch [options] PATTERN [OBJECT TYPE]
736
736
737 Note: ? can be used as a synonym for %psearch, at the beginning or at
737 Note: ? can be used as a synonym for %psearch, at the beginning or at
738 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
738 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
739 rest of the command line must be unchanged (options come first), so
739 rest of the command line must be unchanged (options come first), so
740 for example the following forms are equivalent
740 for example the following forms are equivalent
741
741
742 %psearch -i a* function
742 %psearch -i a* function
743 -i a* function?
743 -i a* function?
744 ?-i a* function
744 ?-i a* function
745
745
746 Arguments:
746 Arguments:
747
747
748 PATTERN
748 PATTERN
749
749
750 where PATTERN is a string containing * as a wildcard similar to its
750 where PATTERN is a string containing * as a wildcard similar to its
751 use in a shell. The pattern is matched in all namespaces on the
751 use in a shell. The pattern is matched in all namespaces on the
752 search path. By default objects starting with a single _ are not
752 search path. By default objects starting with a single _ are not
753 matched, many IPython generated objects have a single
753 matched, many IPython generated objects have a single
754 underscore. The default is case insensitive matching. Matching is
754 underscore. The default is case insensitive matching. Matching is
755 also done on the attributes of objects and not only on the objects
755 also done on the attributes of objects and not only on the objects
756 in a module.
756 in a module.
757
757
758 [OBJECT TYPE]
758 [OBJECT TYPE]
759
759
760 Is the name of a python type from the types module. The name is
760 Is the name of a python type from the types module. The name is
761 given in lowercase without the ending type, ex. StringType is
761 given in lowercase without the ending type, ex. StringType is
762 written string. By adding a type here only objects matching the
762 written string. By adding a type here only objects matching the
763 given type are matched. Using all here makes the pattern match all
763 given type are matched. Using all here makes the pattern match all
764 types (this is the default).
764 types (this is the default).
765
765
766 Options:
766 Options:
767
767
768 -a: makes the pattern match even objects whose names start with a
768 -a: makes the pattern match even objects whose names start with a
769 single underscore. These names are normally ommitted from the
769 single underscore. These names are normally ommitted from the
770 search.
770 search.
771
771
772 -i/-c: make the pattern case insensitive/sensitive. If neither of
772 -i/-c: make the pattern case insensitive/sensitive. If neither of
773 these options is given, the default is read from your ipythonrc
773 these options is given, the default is read from your ipythonrc
774 file. The option name which sets this value is
774 file. The option name which sets this value is
775 'wildcards_case_sensitive'. If this option is not specified in your
775 'wildcards_case_sensitive'. If this option is not specified in your
776 ipythonrc file, IPython's internal default is to do a case sensitive
776 ipythonrc file, IPython's internal default is to do a case sensitive
777 search.
777 search.
778
778
779 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
779 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
780 specifiy can be searched in any of the following namespaces:
780 specifiy can be searched in any of the following namespaces:
781 'builtin', 'user', 'user_global','internal', 'alias', where
781 'builtin', 'user', 'user_global','internal', 'alias', where
782 'builtin' and 'user' are the search defaults. Note that you should
782 'builtin' and 'user' are the search defaults. Note that you should
783 not use quotes when specifying namespaces.
783 not use quotes when specifying namespaces.
784
784
785 'Builtin' contains the python module builtin, 'user' contains all
785 'Builtin' contains the python module builtin, 'user' contains all
786 user data, 'alias' only contain the shell aliases and no python
786 user data, 'alias' only contain the shell aliases and no python
787 objects, 'internal' contains objects used by IPython. The
787 objects, 'internal' contains objects used by IPython. The
788 'user_global' namespace is only used by embedded IPython instances,
788 'user_global' namespace is only used by embedded IPython instances,
789 and it contains module-level globals. You can add namespaces to the
789 and it contains module-level globals. You can add namespaces to the
790 search with -s or exclude them with -e (these options can be given
790 search with -s or exclude them with -e (these options can be given
791 more than once).
791 more than once).
792
792
793 Examples:
793 Examples:
794
794
795 %psearch a* -> objects beginning with an a
795 %psearch a* -> objects beginning with an a
796 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
796 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
797 %psearch a* function -> all functions beginning with an a
797 %psearch a* function -> all functions beginning with an a
798 %psearch re.e* -> objects beginning with an e in module re
798 %psearch re.e* -> objects beginning with an e in module re
799 %psearch r*.e* -> objects that start with e in modules starting in r
799 %psearch r*.e* -> objects that start with e in modules starting in r
800 %psearch r*.* string -> all strings in modules beginning with r
800 %psearch r*.* string -> all strings in modules beginning with r
801
801
802 Case sensitve search:
802 Case sensitve search:
803
803
804 %psearch -c a* list all object beginning with lower case a
804 %psearch -c a* list all object beginning with lower case a
805
805
806 Show objects beginning with a single _:
806 Show objects beginning with a single _:
807
807
808 %psearch -a _* list objects beginning with a single underscore"""
808 %psearch -a _* list objects beginning with a single underscore"""
809 try:
809 try:
810 parameter_s = parameter_s.encode('ascii')
810 parameter_s = parameter_s.encode('ascii')
811 except UnicodeEncodeError:
811 except UnicodeEncodeError:
812 print 'Python identifiers can only contain ascii characters.'
812 print 'Python identifiers can only contain ascii characters.'
813 return
813 return
814
814
815 # default namespaces to be searched
815 # default namespaces to be searched
816 def_search = ['user','builtin']
816 def_search = ['user','builtin']
817
817
818 # Process options/args
818 # Process options/args
819 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
819 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
820 opt = opts.get
820 opt = opts.get
821 shell = self.shell
821 shell = self.shell
822 psearch = shell.inspector.psearch
822 psearch = shell.inspector.psearch
823
823
824 # select case options
824 # select case options
825 if opts.has_key('i'):
825 if opts.has_key('i'):
826 ignore_case = True
826 ignore_case = True
827 elif opts.has_key('c'):
827 elif opts.has_key('c'):
828 ignore_case = False
828 ignore_case = False
829 else:
829 else:
830 ignore_case = not shell.rc.wildcards_case_sensitive
830 ignore_case = not shell.rc.wildcards_case_sensitive
831
831
832 # Build list of namespaces to search from user options
832 # Build list of namespaces to search from user options
833 def_search.extend(opt('s',[]))
833 def_search.extend(opt('s',[]))
834 ns_exclude = ns_exclude=opt('e',[])
834 ns_exclude = ns_exclude=opt('e',[])
835 ns_search = [nm for nm in def_search if nm not in ns_exclude]
835 ns_search = [nm for nm in def_search if nm not in ns_exclude]
836
836
837 # Call the actual search
837 # Call the actual search
838 try:
838 try:
839 psearch(args,shell.ns_table,ns_search,
839 psearch(args,shell.ns_table,ns_search,
840 show_all=opt('a'),ignore_case=ignore_case)
840 show_all=opt('a'),ignore_case=ignore_case)
841 except:
841 except:
842 shell.showtraceback()
842 shell.showtraceback()
843
843
844 def magic_who_ls(self, parameter_s=''):
844 def magic_who_ls(self, parameter_s=''):
845 """Return a sorted list of all interactive variables.
845 """Return a sorted list of all interactive variables.
846
846
847 If arguments are given, only variables of types matching these
847 If arguments are given, only variables of types matching these
848 arguments are returned."""
848 arguments are returned."""
849
849
850 user_ns = self.shell.user_ns
850 user_ns = self.shell.user_ns
851 internal_ns = self.shell.internal_ns
851 internal_ns = self.shell.internal_ns
852 user_config_ns = self.shell.user_config_ns
852 user_config_ns = self.shell.user_config_ns
853 out = []
853 out = []
854 typelist = parameter_s.split()
854 typelist = parameter_s.split()
855
855
856 for i in user_ns:
856 for i in user_ns:
857 if not (i.startswith('_') or i.startswith('_i')) \
857 if not (i.startswith('_') or i.startswith('_i')) \
858 and not (i in internal_ns or i in user_config_ns):
858 and not (i in internal_ns or i in user_config_ns):
859 if typelist:
859 if typelist:
860 if type(user_ns[i]).__name__ in typelist:
860 if type(user_ns[i]).__name__ in typelist:
861 out.append(i)
861 out.append(i)
862 else:
862 else:
863 out.append(i)
863 out.append(i)
864 out.sort()
864 out.sort()
865 return out
865 return out
866
866
867 def magic_who(self, parameter_s=''):
867 def magic_who(self, parameter_s=''):
868 """Print all interactive variables, with some minimal formatting.
868 """Print all interactive variables, with some minimal formatting.
869
869
870 If any arguments are given, only variables whose type matches one of
870 If any arguments are given, only variables whose type matches one of
871 these are printed. For example:
871 these are printed. For example:
872
872
873 %who function str
873 %who function str
874
874
875 will only list functions and strings, excluding all other types of
875 will only list functions and strings, excluding all other types of
876 variables. To find the proper type names, simply use type(var) at a
876 variables. To find the proper type names, simply use type(var) at a
877 command line to see how python prints type names. For example:
877 command line to see how python prints type names. For example:
878
878
879 In [1]: type('hello')\\
879 In [1]: type('hello')\\
880 Out[1]: <type 'str'>
880 Out[1]: <type 'str'>
881
881
882 indicates that the type name for strings is 'str'.
882 indicates that the type name for strings is 'str'.
883
883
884 %who always excludes executed names loaded through your configuration
884 %who always excludes executed names loaded through your configuration
885 file and things which are internal to IPython.
885 file and things which are internal to IPython.
886
886
887 This is deliberate, as typically you may load many modules and the
887 This is deliberate, as typically you may load many modules and the
888 purpose of %who is to show you only what you've manually defined."""
888 purpose of %who is to show you only what you've manually defined."""
889
889
890 varlist = self.magic_who_ls(parameter_s)
890 varlist = self.magic_who_ls(parameter_s)
891 if not varlist:
891 if not varlist:
892 if parameter_s:
892 if parameter_s:
893 print 'No variables match your requested type.'
893 print 'No variables match your requested type.'
894 else:
894 else:
895 print 'Interactive namespace is empty.'
895 print 'Interactive namespace is empty.'
896 return
896 return
897
897
898 # if we have variables, move on...
898 # if we have variables, move on...
899 count = 0
899 count = 0
900 for i in varlist:
900 for i in varlist:
901 print i+'\t',
901 print i+'\t',
902 count += 1
902 count += 1
903 if count > 8:
903 if count > 8:
904 count = 0
904 count = 0
905 print
905 print
906 print
906 print
907
907
908 def magic_whos(self, parameter_s=''):
908 def magic_whos(self, parameter_s=''):
909 """Like %who, but gives some extra information about each variable.
909 """Like %who, but gives some extra information about each variable.
910
910
911 The same type filtering of %who can be applied here.
911 The same type filtering of %who can be applied here.
912
912
913 For all variables, the type is printed. Additionally it prints:
913 For all variables, the type is printed. Additionally it prints:
914
914
915 - For {},[],(): their length.
915 - For {},[],(): their length.
916
916
917 - For numpy and Numeric arrays, a summary with shape, number of
917 - For numpy and Numeric arrays, a summary with shape, number of
918 elements, typecode and size in memory.
918 elements, typecode and size in memory.
919
919
920 - Everything else: a string representation, snipping their middle if
920 - Everything else: a string representation, snipping their middle if
921 too long."""
921 too long."""
922
922
923 varnames = self.magic_who_ls(parameter_s)
923 varnames = self.magic_who_ls(parameter_s)
924 if not varnames:
924 if not varnames:
925 if parameter_s:
925 if parameter_s:
926 print 'No variables match your requested type.'
926 print 'No variables match your requested type.'
927 else:
927 else:
928 print 'Interactive namespace is empty.'
928 print 'Interactive namespace is empty.'
929 return
929 return
930
930
931 # if we have variables, move on...
931 # if we have variables, move on...
932
932
933 # for these types, show len() instead of data:
933 # for these types, show len() instead of data:
934 seq_types = [types.DictType,types.ListType,types.TupleType]
934 seq_types = [types.DictType,types.ListType,types.TupleType]
935
935
936 # for numpy/Numeric arrays, display summary info
936 # for numpy/Numeric arrays, display summary info
937 try:
937 try:
938 import numpy
938 import numpy
939 except ImportError:
939 except ImportError:
940 ndarray_type = None
940 ndarray_type = None
941 else:
941 else:
942 ndarray_type = numpy.ndarray.__name__
942 ndarray_type = numpy.ndarray.__name__
943 try:
943 try:
944 import Numeric
944 import Numeric
945 except ImportError:
945 except ImportError:
946 array_type = None
946 array_type = None
947 else:
947 else:
948 array_type = Numeric.ArrayType.__name__
948 array_type = Numeric.ArrayType.__name__
949
949
950 # Find all variable names and types so we can figure out column sizes
950 # Find all variable names and types so we can figure out column sizes
951 def get_vars(i):
951 def get_vars(i):
952 return self.shell.user_ns[i]
952 return self.shell.user_ns[i]
953
953
954 # some types are well known and can be shorter
954 # some types are well known and can be shorter
955 abbrevs = {'IPython.macro.Macro' : 'Macro'}
955 abbrevs = {'IPython.macro.Macro' : 'Macro'}
956 def type_name(v):
956 def type_name(v):
957 tn = type(v).__name__
957 tn = type(v).__name__
958 return abbrevs.get(tn,tn)
958 return abbrevs.get(tn,tn)
959
959
960 varlist = map(get_vars,varnames)
960 varlist = map(get_vars,varnames)
961
961
962 typelist = []
962 typelist = []
963 for vv in varlist:
963 for vv in varlist:
964 tt = type_name(vv)
964 tt = type_name(vv)
965
965
966 if tt=='instance':
966 if tt=='instance':
967 typelist.append( abbrevs.get(str(vv.__class__),
967 typelist.append( abbrevs.get(str(vv.__class__),
968 str(vv.__class__)))
968 str(vv.__class__)))
969 else:
969 else:
970 typelist.append(tt)
970 typelist.append(tt)
971
971
972 # column labels and # of spaces as separator
972 # column labels and # of spaces as separator
973 varlabel = 'Variable'
973 varlabel = 'Variable'
974 typelabel = 'Type'
974 typelabel = 'Type'
975 datalabel = 'Data/Info'
975 datalabel = 'Data/Info'
976 colsep = 3
976 colsep = 3
977 # variable format strings
977 # variable format strings
978 vformat = "$vname.ljust(varwidth)$vtype.ljust(typewidth)"
978 vformat = "$vname.ljust(varwidth)$vtype.ljust(typewidth)"
979 vfmt_short = '$vstr[:25]<...>$vstr[-25:]'
979 vfmt_short = '$vstr[:25]<...>$vstr[-25:]'
980 aformat = "%s: %s elems, type `%s`, %s bytes"
980 aformat = "%s: %s elems, type `%s`, %s bytes"
981 # find the size of the columns to format the output nicely
981 # find the size of the columns to format the output nicely
982 varwidth = max(max(map(len,varnames)), len(varlabel)) + colsep
982 varwidth = max(max(map(len,varnames)), len(varlabel)) + colsep
983 typewidth = max(max(map(len,typelist)), len(typelabel)) + colsep
983 typewidth = max(max(map(len,typelist)), len(typelabel)) + colsep
984 # table header
984 # table header
985 print varlabel.ljust(varwidth) + typelabel.ljust(typewidth) + \
985 print varlabel.ljust(varwidth) + typelabel.ljust(typewidth) + \
986 ' '+datalabel+'\n' + '-'*(varwidth+typewidth+len(datalabel)+1)
986 ' '+datalabel+'\n' + '-'*(varwidth+typewidth+len(datalabel)+1)
987 # and the table itself
987 # and the table itself
988 kb = 1024
988 kb = 1024
989 Mb = 1048576 # kb**2
989 Mb = 1048576 # kb**2
990 for vname,var,vtype in zip(varnames,varlist,typelist):
990 for vname,var,vtype in zip(varnames,varlist,typelist):
991 print itpl(vformat),
991 print itpl(vformat),
992 if vtype in seq_types:
992 if vtype in seq_types:
993 print len(var)
993 print len(var)
994 elif vtype in [array_type,ndarray_type]:
994 elif vtype in [array_type,ndarray_type]:
995 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
995 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
996 if vtype==ndarray_type:
996 if vtype==ndarray_type:
997 # numpy
997 # numpy
998 vsize = var.size
998 vsize = var.size
999 vbytes = vsize*var.itemsize
999 vbytes = vsize*var.itemsize
1000 vdtype = var.dtype
1000 vdtype = var.dtype
1001 else:
1001 else:
1002 # Numeric
1002 # Numeric
1003 vsize = Numeric.size(var)
1003 vsize = Numeric.size(var)
1004 vbytes = vsize*var.itemsize()
1004 vbytes = vsize*var.itemsize()
1005 vdtype = var.typecode()
1005 vdtype = var.typecode()
1006
1006
1007 if vbytes < 100000:
1007 if vbytes < 100000:
1008 print aformat % (vshape,vsize,vdtype,vbytes)
1008 print aformat % (vshape,vsize,vdtype,vbytes)
1009 else:
1009 else:
1010 print aformat % (vshape,vsize,vdtype,vbytes),
1010 print aformat % (vshape,vsize,vdtype,vbytes),
1011 if vbytes < Mb:
1011 if vbytes < Mb:
1012 print '(%s kb)' % (vbytes/kb,)
1012 print '(%s kb)' % (vbytes/kb,)
1013 else:
1013 else:
1014 print '(%s Mb)' % (vbytes/Mb,)
1014 print '(%s Mb)' % (vbytes/Mb,)
1015 else:
1015 else:
1016 try:
1016 try:
1017 vstr = str(var)
1017 vstr = str(var)
1018 except UnicodeEncodeError:
1018 except UnicodeEncodeError:
1019 vstr = unicode(var).encode(sys.getdefaultencoding(),
1019 vstr = unicode(var).encode(sys.getdefaultencoding(),
1020 'backslashreplace')
1020 'backslashreplace')
1021 vstr = vstr.replace('\n','\\n')
1021 vstr = vstr.replace('\n','\\n')
1022 if len(vstr) < 50:
1022 if len(vstr) < 50:
1023 print vstr
1023 print vstr
1024 else:
1024 else:
1025 printpl(vfmt_short)
1025 printpl(vfmt_short)
1026
1026
1027 def magic_reset(self, parameter_s=''):
1027 def magic_reset(self, parameter_s=''):
1028 """Resets the namespace by removing all names defined by the user.
1028 """Resets the namespace by removing all names defined by the user.
1029
1029
1030 Input/Output history are left around in case you need them."""
1030 Input/Output history are left around in case you need them."""
1031
1031
1032 ans = self.shell.ask_yes_no(
1032 ans = self.shell.ask_yes_no(
1033 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
1033 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
1034 if not ans:
1034 if not ans:
1035 print 'Nothing done.'
1035 print 'Nothing done.'
1036 return
1036 return
1037 user_ns = self.shell.user_ns
1037 user_ns = self.shell.user_ns
1038 for i in self.magic_who_ls():
1038 for i in self.magic_who_ls():
1039 del(user_ns[i])
1039 del(user_ns[i])
1040
1040
1041 # Also flush the private list of module references kept for script
1041 # Also flush the private list of module references kept for script
1042 # execution protection
1042 # execution protection
1043 self.shell._user_main_modules[:] = []
1043 self.shell._user_main_modules[:] = []
1044
1044
1045 def magic_logstart(self,parameter_s=''):
1045 def magic_logstart(self,parameter_s=''):
1046 """Start logging anywhere in a session.
1046 """Start logging anywhere in a session.
1047
1047
1048 %logstart [-o|-r|-t] [log_name [log_mode]]
1048 %logstart [-o|-r|-t] [log_name [log_mode]]
1049
1049
1050 If no name is given, it defaults to a file named 'ipython_log.py' in your
1050 If no name is given, it defaults to a file named 'ipython_log.py' in your
1051 current directory, in 'rotate' mode (see below).
1051 current directory, in 'rotate' mode (see below).
1052
1052
1053 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
1053 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
1054 history up to that point and then continues logging.
1054 history up to that point and then continues logging.
1055
1055
1056 %logstart takes a second optional parameter: logging mode. This can be one
1056 %logstart takes a second optional parameter: logging mode. This can be one
1057 of (note that the modes are given unquoted):\\
1057 of (note that the modes are given unquoted):\\
1058 append: well, that says it.\\
1058 append: well, that says it.\\
1059 backup: rename (if exists) to name~ and start name.\\
1059 backup: rename (if exists) to name~ and start name.\\
1060 global: single logfile in your home dir, appended to.\\
1060 global: single logfile in your home dir, appended to.\\
1061 over : overwrite existing log.\\
1061 over : overwrite existing log.\\
1062 rotate: create rotating logs name.1~, name.2~, etc.
1062 rotate: create rotating logs name.1~, name.2~, etc.
1063
1063
1064 Options:
1064 Options:
1065
1065
1066 -o: log also IPython's output. In this mode, all commands which
1066 -o: log also IPython's output. In this mode, all commands which
1067 generate an Out[NN] prompt are recorded to the logfile, right after
1067 generate an Out[NN] prompt are recorded to the logfile, right after
1068 their corresponding input line. The output lines are always
1068 their corresponding input line. The output lines are always
1069 prepended with a '#[Out]# ' marker, so that the log remains valid
1069 prepended with a '#[Out]# ' marker, so that the log remains valid
1070 Python code.
1070 Python code.
1071
1071
1072 Since this marker is always the same, filtering only the output from
1072 Since this marker is always the same, filtering only the output from
1073 a log is very easy, using for example a simple awk call:
1073 a log is very easy, using for example a simple awk call:
1074
1074
1075 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
1075 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
1076
1076
1077 -r: log 'raw' input. Normally, IPython's logs contain the processed
1077 -r: log 'raw' input. Normally, IPython's logs contain the processed
1078 input, so that user lines are logged in their final form, converted
1078 input, so that user lines are logged in their final form, converted
1079 into valid Python. For example, %Exit is logged as
1079 into valid Python. For example, %Exit is logged as
1080 '_ip.magic("Exit"). If the -r flag is given, all input is logged
1080 '_ip.magic("Exit"). If the -r flag is given, all input is logged
1081 exactly as typed, with no transformations applied.
1081 exactly as typed, with no transformations applied.
1082
1082
1083 -t: put timestamps before each input line logged (these are put in
1083 -t: put timestamps before each input line logged (these are put in
1084 comments)."""
1084 comments)."""
1085
1085
1086 opts,par = self.parse_options(parameter_s,'ort')
1086 opts,par = self.parse_options(parameter_s,'ort')
1087 log_output = 'o' in opts
1087 log_output = 'o' in opts
1088 log_raw_input = 'r' in opts
1088 log_raw_input = 'r' in opts
1089 timestamp = 't' in opts
1089 timestamp = 't' in opts
1090
1090
1091 rc = self.shell.rc
1091 rc = self.shell.rc
1092 logger = self.shell.logger
1092 logger = self.shell.logger
1093
1093
1094 # if no args are given, the defaults set in the logger constructor by
1094 # if no args are given, the defaults set in the logger constructor by
1095 # ipytohn remain valid
1095 # ipytohn remain valid
1096 if par:
1096 if par:
1097 try:
1097 try:
1098 logfname,logmode = par.split()
1098 logfname,logmode = par.split()
1099 except:
1099 except:
1100 logfname = par
1100 logfname = par
1101 logmode = 'backup'
1101 logmode = 'backup'
1102 else:
1102 else:
1103 logfname = logger.logfname
1103 logfname = logger.logfname
1104 logmode = logger.logmode
1104 logmode = logger.logmode
1105 # put logfname into rc struct as if it had been called on the command
1105 # put logfname into rc struct as if it had been called on the command
1106 # line, so it ends up saved in the log header Save it in case we need
1106 # line, so it ends up saved in the log header Save it in case we need
1107 # to restore it...
1107 # to restore it...
1108 old_logfile = rc.opts.get('logfile','')
1108 old_logfile = rc.opts.get('logfile','')
1109 if logfname:
1109 if logfname:
1110 logfname = os.path.expanduser(logfname)
1110 logfname = os.path.expanduser(logfname)
1111 rc.opts.logfile = logfname
1111 rc.opts.logfile = logfname
1112 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
1112 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
1113 try:
1113 try:
1114 started = logger.logstart(logfname,loghead,logmode,
1114 started = logger.logstart(logfname,loghead,logmode,
1115 log_output,timestamp,log_raw_input)
1115 log_output,timestamp,log_raw_input)
1116 except:
1116 except:
1117 rc.opts.logfile = old_logfile
1117 rc.opts.logfile = old_logfile
1118 warn("Couldn't start log: %s" % sys.exc_info()[1])
1118 warn("Couldn't start log: %s" % sys.exc_info()[1])
1119 else:
1119 else:
1120 # log input history up to this point, optionally interleaving
1120 # log input history up to this point, optionally interleaving
1121 # output if requested
1121 # output if requested
1122
1122
1123 if timestamp:
1123 if timestamp:
1124 # disable timestamping for the previous history, since we've
1124 # disable timestamping for the previous history, since we've
1125 # lost those already (no time machine here).
1125 # lost those already (no time machine here).
1126 logger.timestamp = False
1126 logger.timestamp = False
1127
1127
1128 if log_raw_input:
1128 if log_raw_input:
1129 input_hist = self.shell.input_hist_raw
1129 input_hist = self.shell.input_hist_raw
1130 else:
1130 else:
1131 input_hist = self.shell.input_hist
1131 input_hist = self.shell.input_hist
1132
1132
1133 if log_output:
1133 if log_output:
1134 log_write = logger.log_write
1134 log_write = logger.log_write
1135 output_hist = self.shell.output_hist
1135 output_hist = self.shell.output_hist
1136 for n in range(1,len(input_hist)-1):
1136 for n in range(1,len(input_hist)-1):
1137 log_write(input_hist[n].rstrip())
1137 log_write(input_hist[n].rstrip())
1138 if n in output_hist:
1138 if n in output_hist:
1139 log_write(repr(output_hist[n]),'output')
1139 log_write(repr(output_hist[n]),'output')
1140 else:
1140 else:
1141 logger.log_write(input_hist[1:])
1141 logger.log_write(input_hist[1:])
1142 if timestamp:
1142 if timestamp:
1143 # re-enable timestamping
1143 # re-enable timestamping
1144 logger.timestamp = True
1144 logger.timestamp = True
1145
1145
1146 print ('Activating auto-logging. '
1146 print ('Activating auto-logging. '
1147 'Current session state plus future input saved.')
1147 'Current session state plus future input saved.')
1148 logger.logstate()
1148 logger.logstate()
1149
1149
1150 def magic_logoff(self,parameter_s=''):
1150 def magic_logoff(self,parameter_s=''):
1151 """Temporarily stop logging.
1151 """Temporarily stop logging.
1152
1152
1153 You must have previously started logging."""
1153 You must have previously started logging."""
1154 self.shell.logger.switch_log(0)
1154 self.shell.logger.switch_log(0)
1155
1155
1156 def magic_logon(self,parameter_s=''):
1156 def magic_logon(self,parameter_s=''):
1157 """Restart logging.
1157 """Restart logging.
1158
1158
1159 This function is for restarting logging which you've temporarily
1159 This function is for restarting logging which you've temporarily
1160 stopped with %logoff. For starting logging for the first time, you
1160 stopped with %logoff. For starting logging for the first time, you
1161 must use the %logstart function, which allows you to specify an
1161 must use the %logstart function, which allows you to specify an
1162 optional log filename."""
1162 optional log filename."""
1163
1163
1164 self.shell.logger.switch_log(1)
1164 self.shell.logger.switch_log(1)
1165
1165
1166 def magic_logstate(self,parameter_s=''):
1166 def magic_logstate(self,parameter_s=''):
1167 """Print the status of the logging system."""
1167 """Print the status of the logging system."""
1168
1168
1169 self.shell.logger.logstate()
1169 self.shell.logger.logstate()
1170
1170
1171 def magic_pdb(self, parameter_s=''):
1171 def magic_pdb(self, parameter_s=''):
1172 """Control the automatic calling of the pdb interactive debugger.
1172 """Control the automatic calling of the pdb interactive debugger.
1173
1173
1174 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1174 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1175 argument it works as a toggle.
1175 argument it works as a toggle.
1176
1176
1177 When an exception is triggered, IPython can optionally call the
1177 When an exception is triggered, IPython can optionally call the
1178 interactive pdb debugger after the traceback printout. %pdb toggles
1178 interactive pdb debugger after the traceback printout. %pdb toggles
1179 this feature on and off.
1179 this feature on and off.
1180
1180
1181 The initial state of this feature is set in your ipythonrc
1181 The initial state of this feature is set in your ipythonrc
1182 configuration file (the variable is called 'pdb').
1182 configuration file (the variable is called 'pdb').
1183
1183
1184 If you want to just activate the debugger AFTER an exception has fired,
1184 If you want to just activate the debugger AFTER an exception has fired,
1185 without having to type '%pdb on' and rerunning your code, you can use
1185 without having to type '%pdb on' and rerunning your code, you can use
1186 the %debug magic."""
1186 the %debug magic."""
1187
1187
1188 par = parameter_s.strip().lower()
1188 par = parameter_s.strip().lower()
1189
1189
1190 if par:
1190 if par:
1191 try:
1191 try:
1192 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1192 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1193 except KeyError:
1193 except KeyError:
1194 print ('Incorrect argument. Use on/1, off/0, '
1194 print ('Incorrect argument. Use on/1, off/0, '
1195 'or nothing for a toggle.')
1195 'or nothing for a toggle.')
1196 return
1196 return
1197 else:
1197 else:
1198 # toggle
1198 # toggle
1199 new_pdb = not self.shell.call_pdb
1199 new_pdb = not self.shell.call_pdb
1200
1200
1201 # set on the shell
1201 # set on the shell
1202 self.shell.call_pdb = new_pdb
1202 self.shell.call_pdb = new_pdb
1203 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1203 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1204
1204
1205 def magic_debug(self, parameter_s=''):
1205 def magic_debug(self, parameter_s=''):
1206 """Activate the interactive debugger in post-mortem mode.
1206 """Activate the interactive debugger in post-mortem mode.
1207
1207
1208 If an exception has just occurred, this lets you inspect its stack
1208 If an exception has just occurred, this lets you inspect its stack
1209 frames interactively. Note that this will always work only on the last
1209 frames interactively. Note that this will always work only on the last
1210 traceback that occurred, so you must call this quickly after an
1210 traceback that occurred, so you must call this quickly after an
1211 exception that you wish to inspect has fired, because if another one
1211 exception that you wish to inspect has fired, because if another one
1212 occurs, it clobbers the previous one.
1212 occurs, it clobbers the previous one.
1213
1213
1214 If you want IPython to automatically do this on every exception, see
1214 If you want IPython to automatically do this on every exception, see
1215 the %pdb magic for more details.
1215 the %pdb magic for more details.
1216 """
1216 """
1217
1217
1218 self.shell.debugger(force=True)
1218 self.shell.debugger(force=True)
1219
1219
1220 def magic_prun(self, parameter_s ='',user_mode=1,
1220 def magic_prun(self, parameter_s ='',user_mode=1,
1221 opts=None,arg_lst=None,prog_ns=None):
1221 opts=None,arg_lst=None,prog_ns=None):
1222
1222
1223 """Run a statement through the python code profiler.
1223 """Run a statement through the python code profiler.
1224
1224
1225 Usage:\\
1225 Usage:\\
1226 %prun [options] statement
1226 %prun [options] statement
1227
1227
1228 The given statement (which doesn't require quote marks) is run via the
1228 The given statement (which doesn't require quote marks) is run via the
1229 python profiler in a manner similar to the profile.run() function.
1229 python profiler in a manner similar to the profile.run() function.
1230 Namespaces are internally managed to work correctly; profile.run
1230 Namespaces are internally managed to work correctly; profile.run
1231 cannot be used in IPython because it makes certain assumptions about
1231 cannot be used in IPython because it makes certain assumptions about
1232 namespaces which do not hold under IPython.
1232 namespaces which do not hold under IPython.
1233
1233
1234 Options:
1234 Options:
1235
1235
1236 -l <limit>: you can place restrictions on what or how much of the
1236 -l <limit>: you can place restrictions on what or how much of the
1237 profile gets printed. The limit value can be:
1237 profile gets printed. The limit value can be:
1238
1238
1239 * A string: only information for function names containing this string
1239 * A string: only information for function names containing this string
1240 is printed.
1240 is printed.
1241
1241
1242 * An integer: only these many lines are printed.
1242 * An integer: only these many lines are printed.
1243
1243
1244 * A float (between 0 and 1): this fraction of the report is printed
1244 * A float (between 0 and 1): this fraction of the report is printed
1245 (for example, use a limit of 0.4 to see the topmost 40% only).
1245 (for example, use a limit of 0.4 to see the topmost 40% only).
1246
1246
1247 You can combine several limits with repeated use of the option. For
1247 You can combine several limits with repeated use of the option. For
1248 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1248 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1249 information about class constructors.
1249 information about class constructors.
1250
1250
1251 -r: return the pstats.Stats object generated by the profiling. This
1251 -r: return the pstats.Stats object generated by the profiling. This
1252 object has all the information about the profile in it, and you can
1252 object has all the information about the profile in it, and you can
1253 later use it for further analysis or in other functions.
1253 later use it for further analysis or in other functions.
1254
1254
1255 -s <key>: sort profile by given key. You can provide more than one key
1255 -s <key>: sort profile by given key. You can provide more than one key
1256 by using the option several times: '-s key1 -s key2 -s key3...'. The
1256 by using the option several times: '-s key1 -s key2 -s key3...'. The
1257 default sorting key is 'time'.
1257 default sorting key is 'time'.
1258
1258
1259 The following is copied verbatim from the profile documentation
1259 The following is copied verbatim from the profile documentation
1260 referenced below:
1260 referenced below:
1261
1261
1262 When more than one key is provided, additional keys are used as
1262 When more than one key is provided, additional keys are used as
1263 secondary criteria when the there is equality in all keys selected
1263 secondary criteria when the there is equality in all keys selected
1264 before them.
1264 before them.
1265
1265
1266 Abbreviations can be used for any key names, as long as the
1266 Abbreviations can be used for any key names, as long as the
1267 abbreviation is unambiguous. The following are the keys currently
1267 abbreviation is unambiguous. The following are the keys currently
1268 defined:
1268 defined:
1269
1269
1270 Valid Arg Meaning\\
1270 Valid Arg Meaning\\
1271 "calls" call count\\
1271 "calls" call count\\
1272 "cumulative" cumulative time\\
1272 "cumulative" cumulative time\\
1273 "file" file name\\
1273 "file" file name\\
1274 "module" file name\\
1274 "module" file name\\
1275 "pcalls" primitive call count\\
1275 "pcalls" primitive call count\\
1276 "line" line number\\
1276 "line" line number\\
1277 "name" function name\\
1277 "name" function name\\
1278 "nfl" name/file/line\\
1278 "nfl" name/file/line\\
1279 "stdname" standard name\\
1279 "stdname" standard name\\
1280 "time" internal time
1280 "time" internal time
1281
1281
1282 Note that all sorts on statistics are in descending order (placing
1282 Note that all sorts on statistics are in descending order (placing
1283 most time consuming items first), where as name, file, and line number
1283 most time consuming items first), where as name, file, and line number
1284 searches are in ascending order (i.e., alphabetical). The subtle
1284 searches are in ascending order (i.e., alphabetical). The subtle
1285 distinction between "nfl" and "stdname" is that the standard name is a
1285 distinction between "nfl" and "stdname" is that the standard name is a
1286 sort of the name as printed, which means that the embedded line
1286 sort of the name as printed, which means that the embedded line
1287 numbers get compared in an odd way. For example, lines 3, 20, and 40
1287 numbers get compared in an odd way. For example, lines 3, 20, and 40
1288 would (if the file names were the same) appear in the string order
1288 would (if the file names were the same) appear in the string order
1289 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1289 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1290 line numbers. In fact, sort_stats("nfl") is the same as
1290 line numbers. In fact, sort_stats("nfl") is the same as
1291 sort_stats("name", "file", "line").
1291 sort_stats("name", "file", "line").
1292
1292
1293 -T <filename>: save profile results as shown on screen to a text
1293 -T <filename>: save profile results as shown on screen to a text
1294 file. The profile is still shown on screen.
1294 file. The profile is still shown on screen.
1295
1295
1296 -D <filename>: save (via dump_stats) profile statistics to given
1296 -D <filename>: save (via dump_stats) profile statistics to given
1297 filename. This data is in a format understod by the pstats module, and
1297 filename. This data is in a format understod by the pstats module, and
1298 is generated by a call to the dump_stats() method of profile
1298 is generated by a call to the dump_stats() method of profile
1299 objects. The profile is still shown on screen.
1299 objects. The profile is still shown on screen.
1300
1300
1301 If you want to run complete programs under the profiler's control, use
1301 If you want to run complete programs under the profiler's control, use
1302 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1302 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1303 contains profiler specific options as described here.
1303 contains profiler specific options as described here.
1304
1304
1305 You can read the complete documentation for the profile module with:\\
1305 You can read the complete documentation for the profile module with:\\
1306 In [1]: import profile; profile.help() """
1306 In [1]: import profile; profile.help() """
1307
1307
1308 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1308 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1309 # protect user quote marks
1309 # protect user quote marks
1310 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1310 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1311
1311
1312 if user_mode: # regular user call
1312 if user_mode: # regular user call
1313 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1313 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1314 list_all=1)
1314 list_all=1)
1315 namespace = self.shell.user_ns
1315 namespace = self.shell.user_ns
1316 else: # called to run a program by %run -p
1316 else: # called to run a program by %run -p
1317 try:
1317 try:
1318 filename = get_py_filename(arg_lst[0])
1318 filename = get_py_filename(arg_lst[0])
1319 except IOError,msg:
1319 except IOError,msg:
1320 error(msg)
1320 error(msg)
1321 return
1321 return
1322
1322
1323 arg_str = 'execfile(filename,prog_ns)'
1323 arg_str = 'execfile(filename,prog_ns)'
1324 namespace = locals()
1324 namespace = locals()
1325
1325
1326 opts.merge(opts_def)
1326 opts.merge(opts_def)
1327
1327
1328 prof = profile.Profile()
1328 prof = profile.Profile()
1329 try:
1329 try:
1330 prof = prof.runctx(arg_str,namespace,namespace)
1330 prof = prof.runctx(arg_str,namespace,namespace)
1331 sys_exit = ''
1331 sys_exit = ''
1332 except SystemExit:
1332 except SystemExit:
1333 sys_exit = """*** SystemExit exception caught in code being profiled."""
1333 sys_exit = """*** SystemExit exception caught in code being profiled."""
1334
1334
1335 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1335 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1336
1336
1337 lims = opts.l
1337 lims = opts.l
1338 if lims:
1338 if lims:
1339 lims = [] # rebuild lims with ints/floats/strings
1339 lims = [] # rebuild lims with ints/floats/strings
1340 for lim in opts.l:
1340 for lim in opts.l:
1341 try:
1341 try:
1342 lims.append(int(lim))
1342 lims.append(int(lim))
1343 except ValueError:
1343 except ValueError:
1344 try:
1344 try:
1345 lims.append(float(lim))
1345 lims.append(float(lim))
1346 except ValueError:
1346 except ValueError:
1347 lims.append(lim)
1347 lims.append(lim)
1348
1348
1349 # Trap output.
1349 # Trap output.
1350 stdout_trap = StringIO()
1350 stdout_trap = StringIO()
1351
1351
1352 if hasattr(stats,'stream'):
1352 if hasattr(stats,'stream'):
1353 # In newer versions of python, the stats object has a 'stream'
1353 # In newer versions of python, the stats object has a 'stream'
1354 # attribute to write into.
1354 # attribute to write into.
1355 stats.stream = stdout_trap
1355 stats.stream = stdout_trap
1356 stats.print_stats(*lims)
1356 stats.print_stats(*lims)
1357 else:
1357 else:
1358 # For older versions, we manually redirect stdout during printing
1358 # For older versions, we manually redirect stdout during printing
1359 sys_stdout = sys.stdout
1359 sys_stdout = sys.stdout
1360 try:
1360 try:
1361 sys.stdout = stdout_trap
1361 sys.stdout = stdout_trap
1362 stats.print_stats(*lims)
1362 stats.print_stats(*lims)
1363 finally:
1363 finally:
1364 sys.stdout = sys_stdout
1364 sys.stdout = sys_stdout
1365
1365
1366 output = stdout_trap.getvalue()
1366 output = stdout_trap.getvalue()
1367 output = output.rstrip()
1367 output = output.rstrip()
1368
1368
1369 page(output,screen_lines=self.shell.rc.screen_length)
1369 page(output,screen_lines=self.shell.rc.screen_length)
1370 print sys_exit,
1370 print sys_exit,
1371
1371
1372 dump_file = opts.D[0]
1372 dump_file = opts.D[0]
1373 text_file = opts.T[0]
1373 text_file = opts.T[0]
1374 if dump_file:
1374 if dump_file:
1375 prof.dump_stats(dump_file)
1375 prof.dump_stats(dump_file)
1376 print '\n*** Profile stats marshalled to file',\
1376 print '\n*** Profile stats marshalled to file',\
1377 `dump_file`+'.',sys_exit
1377 `dump_file`+'.',sys_exit
1378 if text_file:
1378 if text_file:
1379 pfile = file(text_file,'w')
1379 pfile = file(text_file,'w')
1380 pfile.write(output)
1380 pfile.write(output)
1381 pfile.close()
1381 pfile.close()
1382 print '\n*** Profile printout saved to text file',\
1382 print '\n*** Profile printout saved to text file',\
1383 `text_file`+'.',sys_exit
1383 `text_file`+'.',sys_exit
1384
1384
1385 if opts.has_key('r'):
1385 if opts.has_key('r'):
1386 return stats
1386 return stats
1387 else:
1387 else:
1388 return None
1388 return None
1389
1389
1390 def magic_run(self, parameter_s ='',runner=None):
1390 def magic_run(self, parameter_s ='',runner=None):
1391 """Run the named file inside IPython as a program.
1391 """Run the named file inside IPython as a program.
1392
1392
1393 Usage:\\
1393 Usage:\\
1394 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1394 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1395
1395
1396 Parameters after the filename are passed as command-line arguments to
1396 Parameters after the filename are passed as command-line arguments to
1397 the program (put in sys.argv). Then, control returns to IPython's
1397 the program (put in sys.argv). Then, control returns to IPython's
1398 prompt.
1398 prompt.
1399
1399
1400 This is similar to running at a system prompt:\\
1400 This is similar to running at a system prompt:\\
1401 $ python file args\\
1401 $ python file args\\
1402 but with the advantage of giving you IPython's tracebacks, and of
1402 but with the advantage of giving you IPython's tracebacks, and of
1403 loading all variables into your interactive namespace for further use
1403 loading all variables into your interactive namespace for further use
1404 (unless -p is used, see below).
1404 (unless -p is used, see below).
1405
1405
1406 The file is executed in a namespace initially consisting only of
1406 The file is executed in a namespace initially consisting only of
1407 __name__=='__main__' and sys.argv constructed as indicated. It thus
1407 __name__=='__main__' and sys.argv constructed as indicated. It thus
1408 sees its environment as if it were being run as a stand-alone
1408 sees its environment as if it were being run as a stand-alone
1409 program. But after execution, the IPython interactive namespace gets
1409 program. But after execution, the IPython interactive namespace gets
1410 updated with all variables defined in the program (except for __name__
1410 updated with all variables defined in the program (except for __name__
1411 and sys.argv). This allows for very convenient loading of code for
1411 and sys.argv). This allows for very convenient loading of code for
1412 interactive work, while giving each program a 'clean sheet' to run in.
1412 interactive work, while giving each program a 'clean sheet' to run in.
1413
1413
1414 Options:
1414 Options:
1415
1415
1416 -n: __name__ is NOT set to '__main__', but to the running file's name
1416 -n: __name__ is NOT set to '__main__', but to the running file's name
1417 without extension (as python does under import). This allows running
1417 without extension (as python does under import). This allows running
1418 scripts and reloading the definitions in them without calling code
1418 scripts and reloading the definitions in them without calling code
1419 protected by an ' if __name__ == "__main__" ' clause.
1419 protected by an ' if __name__ == "__main__" ' clause.
1420
1420
1421 -i: run the file in IPython's namespace instead of an empty one. This
1421 -i: run the file in IPython's namespace instead of an empty one. This
1422 is useful if you are experimenting with code written in a text editor
1422 is useful if you are experimenting with code written in a text editor
1423 which depends on variables defined interactively.
1423 which depends on variables defined interactively.
1424
1424
1425 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1425 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1426 being run. This is particularly useful if IPython is being used to
1426 being run. This is particularly useful if IPython is being used to
1427 run unittests, which always exit with a sys.exit() call. In such
1427 run unittests, which always exit with a sys.exit() call. In such
1428 cases you are interested in the output of the test results, not in
1428 cases you are interested in the output of the test results, not in
1429 seeing a traceback of the unittest module.
1429 seeing a traceback of the unittest module.
1430
1430
1431 -t: print timing information at the end of the run. IPython will give
1431 -t: print timing information at the end of the run. IPython will give
1432 you an estimated CPU time consumption for your script, which under
1432 you an estimated CPU time consumption for your script, which under
1433 Unix uses the resource module to avoid the wraparound problems of
1433 Unix uses the resource module to avoid the wraparound problems of
1434 time.clock(). Under Unix, an estimate of time spent on system tasks
1434 time.clock(). Under Unix, an estimate of time spent on system tasks
1435 is also given (for Windows platforms this is reported as 0.0).
1435 is also given (for Windows platforms this is reported as 0.0).
1436
1436
1437 If -t is given, an additional -N<N> option can be given, where <N>
1437 If -t is given, an additional -N<N> option can be given, where <N>
1438 must be an integer indicating how many times you want the script to
1438 must be an integer indicating how many times you want the script to
1439 run. The final timing report will include total and per run results.
1439 run. The final timing report will include total and per run results.
1440
1440
1441 For example (testing the script uniq_stable.py):
1441 For example (testing the script uniq_stable.py):
1442
1442
1443 In [1]: run -t uniq_stable
1443 In [1]: run -t uniq_stable
1444
1444
1445 IPython CPU timings (estimated):\\
1445 IPython CPU timings (estimated):\\
1446 User : 0.19597 s.\\
1446 User : 0.19597 s.\\
1447 System: 0.0 s.\\
1447 System: 0.0 s.\\
1448
1448
1449 In [2]: run -t -N5 uniq_stable
1449 In [2]: run -t -N5 uniq_stable
1450
1450
1451 IPython CPU timings (estimated):\\
1451 IPython CPU timings (estimated):\\
1452 Total runs performed: 5\\
1452 Total runs performed: 5\\
1453 Times : Total Per run\\
1453 Times : Total Per run\\
1454 User : 0.910862 s, 0.1821724 s.\\
1454 User : 0.910862 s, 0.1821724 s.\\
1455 System: 0.0 s, 0.0 s.
1455 System: 0.0 s, 0.0 s.
1456
1456
1457 -d: run your program under the control of pdb, the Python debugger.
1457 -d: run your program under the control of pdb, the Python debugger.
1458 This allows you to execute your program step by step, watch variables,
1458 This allows you to execute your program step by step, watch variables,
1459 etc. Internally, what IPython does is similar to calling:
1459 etc. Internally, what IPython does is similar to calling:
1460
1460
1461 pdb.run('execfile("YOURFILENAME")')
1461 pdb.run('execfile("YOURFILENAME")')
1462
1462
1463 with a breakpoint set on line 1 of your file. You can change the line
1463 with a breakpoint set on line 1 of your file. You can change the line
1464 number for this automatic breakpoint to be <N> by using the -bN option
1464 number for this automatic breakpoint to be <N> by using the -bN option
1465 (where N must be an integer). For example:
1465 (where N must be an integer). For example:
1466
1466
1467 %run -d -b40 myscript
1467 %run -d -b40 myscript
1468
1468
1469 will set the first breakpoint at line 40 in myscript.py. Note that
1469 will set the first breakpoint at line 40 in myscript.py. Note that
1470 the first breakpoint must be set on a line which actually does
1470 the first breakpoint must be set on a line which actually does
1471 something (not a comment or docstring) for it to stop execution.
1471 something (not a comment or docstring) for it to stop execution.
1472
1472
1473 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1473 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1474 first enter 'c' (without qoutes) to start execution up to the first
1474 first enter 'c' (without qoutes) to start execution up to the first
1475 breakpoint.
1475 breakpoint.
1476
1476
1477 Entering 'help' gives information about the use of the debugger. You
1477 Entering 'help' gives information about the use of the debugger. You
1478 can easily see pdb's full documentation with "import pdb;pdb.help()"
1478 can easily see pdb's full documentation with "import pdb;pdb.help()"
1479 at a prompt.
1479 at a prompt.
1480
1480
1481 -p: run program under the control of the Python profiler module (which
1481 -p: run program under the control of the Python profiler module (which
1482 prints a detailed report of execution times, function calls, etc).
1482 prints a detailed report of execution times, function calls, etc).
1483
1483
1484 You can pass other options after -p which affect the behavior of the
1484 You can pass other options after -p which affect the behavior of the
1485 profiler itself. See the docs for %prun for details.
1485 profiler itself. See the docs for %prun for details.
1486
1486
1487 In this mode, the program's variables do NOT propagate back to the
1487 In this mode, the program's variables do NOT propagate back to the
1488 IPython interactive namespace (because they remain in the namespace
1488 IPython interactive namespace (because they remain in the namespace
1489 where the profiler executes them).
1489 where the profiler executes them).
1490
1490
1491 Internally this triggers a call to %prun, see its documentation for
1491 Internally this triggers a call to %prun, see its documentation for
1492 details on the options available specifically for profiling.
1492 details on the options available specifically for profiling.
1493
1493
1494 There is one special usage for which the text above doesn't apply:
1494 There is one special usage for which the text above doesn't apply:
1495 if the filename ends with .ipy, the file is run as ipython script,
1495 if the filename ends with .ipy, the file is run as ipython script,
1496 just as if the commands were written on IPython prompt.
1496 just as if the commands were written on IPython prompt.
1497 """
1497 """
1498
1498
1499 # get arguments and set sys.argv for program to be run.
1499 # get arguments and set sys.argv for program to be run.
1500 opts,arg_lst = self.parse_options(parameter_s,'nidtN:b:pD:l:rs:T:e',
1500 opts,arg_lst = self.parse_options(parameter_s,'nidtN:b:pD:l:rs:T:e',
1501 mode='list',list_all=1)
1501 mode='list',list_all=1)
1502
1502
1503 try:
1503 try:
1504 filename = get_py_filename(arg_lst[0])
1504 filename = get_py_filename(arg_lst[0])
1505 except IndexError:
1505 except IndexError:
1506 warn('you must provide at least a filename.')
1506 warn('you must provide at least a filename.')
1507 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1507 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1508 return
1508 return
1509 except IOError,msg:
1509 except IOError,msg:
1510 error(msg)
1510 error(msg)
1511 return
1511 return
1512
1512
1513 if filename.lower().endswith('.ipy'):
1513 if filename.lower().endswith('.ipy'):
1514 self.api.runlines(open(filename).read())
1514 self.api.runlines(open(filename).read())
1515 return
1515 return
1516
1516
1517 # Control the response to exit() calls made by the script being run
1517 # Control the response to exit() calls made by the script being run
1518 exit_ignore = opts.has_key('e')
1518 exit_ignore = opts.has_key('e')
1519
1519
1520 # Make sure that the running script gets a proper sys.argv as if it
1520 # Make sure that the running script gets a proper sys.argv as if it
1521 # were run from a system shell.
1521 # were run from a system shell.
1522 save_argv = sys.argv # save it for later restoring
1522 save_argv = sys.argv # save it for later restoring
1523 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1523 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1524
1524
1525 if opts.has_key('i'):
1525 if opts.has_key('i'):
1526 # Run in user's interactive namespace
1526 # Run in user's interactive namespace
1527 prog_ns = self.shell.user_ns
1527 prog_ns = self.shell.user_ns
1528 __name__save = self.shell.user_ns['__name__']
1528 __name__save = self.shell.user_ns['__name__']
1529 prog_ns['__name__'] = '__main__'
1529 prog_ns['__name__'] = '__main__'
1530 main_mod = FakeModule(prog_ns)
1530 main_mod = FakeModule(prog_ns)
1531 else:
1531 else:
1532 # Run in a fresh, empty namespace
1532 # Run in a fresh, empty namespace
1533 if opts.has_key('n'):
1533 if opts.has_key('n'):
1534 name = os.path.splitext(os.path.basename(filename))[0]
1534 name = os.path.splitext(os.path.basename(filename))[0]
1535 else:
1535 else:
1536 name = '__main__'
1536 name = '__main__'
1537 main_mod = FakeModule()
1537 main_mod = FakeModule()
1538 prog_ns = main_mod.__dict__
1538 prog_ns = main_mod.__dict__
1539 prog_ns['__name__'] = name
1539 prog_ns['__name__'] = name
1540 # The shell MUST hold a reference to main_mod so after %run exits,
1540 # The shell MUST hold a reference to main_mod so after %run exits,
1541 # the python deletion mechanism doesn't zero it out (leaving
1541 # the python deletion mechanism doesn't zero it out (leaving
1542 # dangling references)
1542 # dangling references)
1543 self.shell._user_main_modules.append(main_mod)
1543 self.shell._user_main_modules.append(main_mod)
1544
1544
1545 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1545 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1546 # set the __file__ global in the script's namespace
1546 # set the __file__ global in the script's namespace
1547 prog_ns['__file__'] = filename
1547 prog_ns['__file__'] = filename
1548
1548
1549 # pickle fix. See iplib for an explanation. But we need to make sure
1549 # pickle fix. See iplib for an explanation. But we need to make sure
1550 # that, if we overwrite __main__, we replace it at the end
1550 # that, if we overwrite __main__, we replace it at the end
1551 if prog_ns['__name__'] == '__main__':
1551 if prog_ns['__name__'] == '__main__':
1552 restore_main = sys.modules['__main__']
1552 restore_main = sys.modules['__main__']
1553 else:
1553 else:
1554 restore_main = False
1554 restore_main = False
1555
1555
1556 sys.modules[prog_ns['__name__']] = main_mod
1556 sys.modules[prog_ns['__name__']] = main_mod
1557
1557
1558 stats = None
1558 stats = None
1559 try:
1559 try:
1560 if self.shell.has_readline:
1560 if self.shell.has_readline:
1561 self.shell.savehist()
1561 self.shell.savehist()
1562
1562
1563 if opts.has_key('p'):
1563 if opts.has_key('p'):
1564 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1564 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1565 else:
1565 else:
1566 if opts.has_key('d'):
1566 if opts.has_key('d'):
1567 deb = Debugger.Pdb(self.shell.rc.colors)
1567 deb = Debugger.Pdb(self.shell.rc.colors)
1568 # reset Breakpoint state, which is moronically kept
1568 # reset Breakpoint state, which is moronically kept
1569 # in a class
1569 # in a class
1570 bdb.Breakpoint.next = 1
1570 bdb.Breakpoint.next = 1
1571 bdb.Breakpoint.bplist = {}
1571 bdb.Breakpoint.bplist = {}
1572 bdb.Breakpoint.bpbynumber = [None]
1572 bdb.Breakpoint.bpbynumber = [None]
1573 # Set an initial breakpoint to stop execution
1573 # Set an initial breakpoint to stop execution
1574 maxtries = 10
1574 maxtries = 10
1575 bp = int(opts.get('b',[1])[0])
1575 bp = int(opts.get('b',[1])[0])
1576 checkline = deb.checkline(filename,bp)
1576 checkline = deb.checkline(filename,bp)
1577 if not checkline:
1577 if not checkline:
1578 for bp in range(bp+1,bp+maxtries+1):
1578 for bp in range(bp+1,bp+maxtries+1):
1579 if deb.checkline(filename,bp):
1579 if deb.checkline(filename,bp):
1580 break
1580 break
1581 else:
1581 else:
1582 msg = ("\nI failed to find a valid line to set "
1582 msg = ("\nI failed to find a valid line to set "
1583 "a breakpoint\n"
1583 "a breakpoint\n"
1584 "after trying up to line: %s.\n"
1584 "after trying up to line: %s.\n"
1585 "Please set a valid breakpoint manually "
1585 "Please set a valid breakpoint manually "
1586 "with the -b option." % bp)
1586 "with the -b option." % bp)
1587 error(msg)
1587 error(msg)
1588 return
1588 return
1589 # if we find a good linenumber, set the breakpoint
1589 # if we find a good linenumber, set the breakpoint
1590 deb.do_break('%s:%s' % (filename,bp))
1590 deb.do_break('%s:%s' % (filename,bp))
1591 # Start file run
1591 # Start file run
1592 print "NOTE: Enter 'c' at the",
1592 print "NOTE: Enter 'c' at the",
1593 print "%s prompt to start your script." % deb.prompt
1593 print "%s prompt to start your script." % deb.prompt
1594 try:
1594 try:
1595 deb.run('execfile("%s")' % filename,prog_ns)
1595 deb.run('execfile("%s")' % filename,prog_ns)
1596
1596
1597 except:
1597 except:
1598 etype, value, tb = sys.exc_info()
1598 etype, value, tb = sys.exc_info()
1599 # Skip three frames in the traceback: the %run one,
1599 # Skip three frames in the traceback: the %run one,
1600 # one inside bdb.py, and the command-line typed by the
1600 # one inside bdb.py, and the command-line typed by the
1601 # user (run by exec in pdb itself).
1601 # user (run by exec in pdb itself).
1602 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1602 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1603 else:
1603 else:
1604 if runner is None:
1604 if runner is None:
1605 runner = self.shell.safe_execfile
1605 runner = self.shell.safe_execfile
1606 if opts.has_key('t'):
1606 if opts.has_key('t'):
1607 # timed execution
1607 # timed execution
1608 try:
1608 try:
1609 nruns = int(opts['N'][0])
1609 nruns = int(opts['N'][0])
1610 if nruns < 1:
1610 if nruns < 1:
1611 error('Number of runs must be >=1')
1611 error('Number of runs must be >=1')
1612 return
1612 return
1613 except (KeyError):
1613 except (KeyError):
1614 nruns = 1
1614 nruns = 1
1615 if nruns == 1:
1615 if nruns == 1:
1616 t0 = clock2()
1616 t0 = clock2()
1617 runner(filename,prog_ns,prog_ns,
1617 runner(filename,prog_ns,prog_ns,
1618 exit_ignore=exit_ignore)
1618 exit_ignore=exit_ignore)
1619 t1 = clock2()
1619 t1 = clock2()
1620 t_usr = t1[0]-t0[0]
1620 t_usr = t1[0]-t0[0]
1621 t_sys = t1[1]-t1[1]
1621 t_sys = t1[1]-t1[1]
1622 print "\nIPython CPU timings (estimated):"
1622 print "\nIPython CPU timings (estimated):"
1623 print " User : %10s s." % t_usr
1623 print " User : %10s s." % t_usr
1624 print " System: %10s s." % t_sys
1624 print " System: %10s s." % t_sys
1625 else:
1625 else:
1626 runs = range(nruns)
1626 runs = range(nruns)
1627 t0 = clock2()
1627 t0 = clock2()
1628 for nr in runs:
1628 for nr in runs:
1629 runner(filename,prog_ns,prog_ns,
1629 runner(filename,prog_ns,prog_ns,
1630 exit_ignore=exit_ignore)
1630 exit_ignore=exit_ignore)
1631 t1 = clock2()
1631 t1 = clock2()
1632 t_usr = t1[0]-t0[0]
1632 t_usr = t1[0]-t0[0]
1633 t_sys = t1[1]-t1[1]
1633 t_sys = t1[1]-t1[1]
1634 print "\nIPython CPU timings (estimated):"
1634 print "\nIPython CPU timings (estimated):"
1635 print "Total runs performed:",nruns
1635 print "Total runs performed:",nruns
1636 print " Times : %10s %10s" % ('Total','Per run')
1636 print " Times : %10s %10s" % ('Total','Per run')
1637 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1637 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1638 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1638 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1639
1639
1640 else:
1640 else:
1641 # regular execution
1641 # regular execution
1642 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1642 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1643 if opts.has_key('i'):
1643 if opts.has_key('i'):
1644 self.shell.user_ns['__name__'] = __name__save
1644 self.shell.user_ns['__name__'] = __name__save
1645 else:
1645 else:
1646 # update IPython interactive namespace
1646 # update IPython interactive namespace
1647 del prog_ns['__name__']
1647 del prog_ns['__name__']
1648 self.shell.user_ns.update(prog_ns)
1648 self.shell.user_ns.update(prog_ns)
1649 finally:
1649 finally:
1650 sys.argv = save_argv
1650 sys.argv = save_argv
1651 if restore_main:
1651 if restore_main:
1652 sys.modules['__main__'] = restore_main
1652 sys.modules['__main__'] = restore_main
1653 self.shell.reloadhist()
1653 self.shell.reloadhist()
1654
1654
1655 return stats
1655 return stats
1656
1656
1657 def magic_runlog(self, parameter_s =''):
1657 def magic_runlog(self, parameter_s =''):
1658 """Run files as logs.
1658 """Run files as logs.
1659
1659
1660 Usage:\\
1660 Usage:\\
1661 %runlog file1 file2 ...
1661 %runlog file1 file2 ...
1662
1662
1663 Run the named files (treating them as log files) in sequence inside
1663 Run the named files (treating them as log files) in sequence inside
1664 the interpreter, and return to the prompt. This is much slower than
1664 the interpreter, and return to the prompt. This is much slower than
1665 %run because each line is executed in a try/except block, but it
1665 %run because each line is executed in a try/except block, but it
1666 allows running files with syntax errors in them.
1666 allows running files with syntax errors in them.
1667
1667
1668 Normally IPython will guess when a file is one of its own logfiles, so
1668 Normally IPython will guess when a file is one of its own logfiles, so
1669 you can typically use %run even for logs. This shorthand allows you to
1669 you can typically use %run even for logs. This shorthand allows you to
1670 force any file to be treated as a log file."""
1670 force any file to be treated as a log file."""
1671
1671
1672 for f in parameter_s.split():
1672 for f in parameter_s.split():
1673 self.shell.safe_execfile(f,self.shell.user_ns,
1673 self.shell.safe_execfile(f,self.shell.user_ns,
1674 self.shell.user_ns,islog=1)
1674 self.shell.user_ns,islog=1)
1675
1675
1676 def magic_timeit(self, parameter_s =''):
1676 def magic_timeit(self, parameter_s =''):
1677 """Time execution of a Python statement or expression
1677 """Time execution of a Python statement or expression
1678
1678
1679 Usage:\\
1679 Usage:\\
1680 %timeit [-n<N> -r<R> [-t|-c]] statement
1680 %timeit [-n<N> -r<R> [-t|-c]] statement
1681
1681
1682 Time execution of a Python statement or expression using the timeit
1682 Time execution of a Python statement or expression using the timeit
1683 module.
1683 module.
1684
1684
1685 Options:
1685 Options:
1686 -n<N>: execute the given statement <N> times in a loop. If this value
1686 -n<N>: execute the given statement <N> times in a loop. If this value
1687 is not given, a fitting value is chosen.
1687 is not given, a fitting value is chosen.
1688
1688
1689 -r<R>: repeat the loop iteration <R> times and take the best result.
1689 -r<R>: repeat the loop iteration <R> times and take the best result.
1690 Default: 3
1690 Default: 3
1691
1691
1692 -t: use time.time to measure the time, which is the default on Unix.
1692 -t: use time.time to measure the time, which is the default on Unix.
1693 This function measures wall time.
1693 This function measures wall time.
1694
1694
1695 -c: use time.clock to measure the time, which is the default on
1695 -c: use time.clock to measure the time, which is the default on
1696 Windows and measures wall time. On Unix, resource.getrusage is used
1696 Windows and measures wall time. On Unix, resource.getrusage is used
1697 instead and returns the CPU user time.
1697 instead and returns the CPU user time.
1698
1698
1699 -p<P>: use a precision of <P> digits to display the timing result.
1699 -p<P>: use a precision of <P> digits to display the timing result.
1700 Default: 3
1700 Default: 3
1701
1701
1702
1702
1703 Examples:\\
1703 Examples:\\
1704 In [1]: %timeit pass
1704 In [1]: %timeit pass
1705 10000000 loops, best of 3: 53.3 ns per loop
1705 10000000 loops, best of 3: 53.3 ns per loop
1706
1706
1707 In [2]: u = None
1707 In [2]: u = None
1708
1708
1709 In [3]: %timeit u is None
1709 In [3]: %timeit u is None
1710 10000000 loops, best of 3: 184 ns per loop
1710 10000000 loops, best of 3: 184 ns per loop
1711
1711
1712 In [4]: %timeit -r 4 u == None
1712 In [4]: %timeit -r 4 u == None
1713 1000000 loops, best of 4: 242 ns per loop
1713 1000000 loops, best of 4: 242 ns per loop
1714
1714
1715 In [5]: import time
1715 In [5]: import time
1716
1716
1717 In [6]: %timeit -n1 time.sleep(2)
1717 In [6]: %timeit -n1 time.sleep(2)
1718 1 loops, best of 3: 2 s per loop
1718 1 loops, best of 3: 2 s per loop
1719
1719
1720
1720
1721 The times reported by %timeit will be slightly higher than those
1721 The times reported by %timeit will be slightly higher than those
1722 reported by the timeit.py script when variables are accessed. This is
1722 reported by the timeit.py script when variables are accessed. This is
1723 due to the fact that %timeit executes the statement in the namespace
1723 due to the fact that %timeit executes the statement in the namespace
1724 of the shell, compared with timeit.py, which uses a single setup
1724 of the shell, compared with timeit.py, which uses a single setup
1725 statement to import function or create variables. Generally, the bias
1725 statement to import function or create variables. Generally, the bias
1726 does not matter as long as results from timeit.py are not mixed with
1726 does not matter as long as results from timeit.py are not mixed with
1727 those from %timeit."""
1727 those from %timeit."""
1728
1728
1729 import timeit
1729 import timeit
1730 import math
1730 import math
1731
1731
1732 units = ["s", "ms", "\xc2\xb5s", "ns"]
1732 units = ["s", "ms", "\xc2\xb5s", "ns"]
1733 scaling = [1, 1e3, 1e6, 1e9]
1733 scaling = [1, 1e3, 1e6, 1e9]
1734
1734
1735 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1735 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1736 posix=False)
1736 posix=False)
1737 if stmt == "":
1737 if stmt == "":
1738 return
1738 return
1739 timefunc = timeit.default_timer
1739 timefunc = timeit.default_timer
1740 number = int(getattr(opts, "n", 0))
1740 number = int(getattr(opts, "n", 0))
1741 repeat = int(getattr(opts, "r", timeit.default_repeat))
1741 repeat = int(getattr(opts, "r", timeit.default_repeat))
1742 precision = int(getattr(opts, "p", 3))
1742 precision = int(getattr(opts, "p", 3))
1743 if hasattr(opts, "t"):
1743 if hasattr(opts, "t"):
1744 timefunc = time.time
1744 timefunc = time.time
1745 if hasattr(opts, "c"):
1745 if hasattr(opts, "c"):
1746 timefunc = clock
1746 timefunc = clock
1747
1747
1748 timer = timeit.Timer(timer=timefunc)
1748 timer = timeit.Timer(timer=timefunc)
1749 # this code has tight coupling to the inner workings of timeit.Timer,
1749 # this code has tight coupling to the inner workings of timeit.Timer,
1750 # but is there a better way to achieve that the code stmt has access
1750 # but is there a better way to achieve that the code stmt has access
1751 # to the shell namespace?
1751 # to the shell namespace?
1752
1752
1753 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1753 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1754 'setup': "pass"}
1754 'setup': "pass"}
1755 # Track compilation time so it can be reported if too long
1756 # Minimum time above which compilation time will be reported
1757 tc_min = 0.1
1758
1759 t0 = clock()
1755 code = compile(src, "<magic-timeit>", "exec")
1760 code = compile(src, "<magic-timeit>", "exec")
1761 tc = clock()-t0
1762
1756 ns = {}
1763 ns = {}
1757 exec code in self.shell.user_ns, ns
1764 exec code in self.shell.user_ns, ns
1758 timer.inner = ns["inner"]
1765 timer.inner = ns["inner"]
1759
1766
1760 if number == 0:
1767 if number == 0:
1761 # determine number so that 0.2 <= total time < 2.0
1768 # determine number so that 0.2 <= total time < 2.0
1762 number = 1
1769 number = 1
1763 for i in range(1, 10):
1770 for i in range(1, 10):
1764 number *= 10
1771 number *= 10
1765 if timer.timeit(number) >= 0.2:
1772 if timer.timeit(number) >= 0.2:
1766 break
1773 break
1767
1774
1768 best = min(timer.repeat(repeat, number)) / number
1775 best = min(timer.repeat(repeat, number)) / number
1769
1776
1770 if best > 0.0:
1777 if best > 0.0:
1771 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1778 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1772 else:
1779 else:
1773 order = 3
1780 order = 3
1774 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1781 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1775 precision,
1782 precision,
1776 best * scaling[order],
1783 best * scaling[order],
1777 units[order])
1784 units[order])
1785 if tc > tc_min:
1786 print "Compiler time: %.2f s" % tc
1778
1787
1779 def magic_time(self,parameter_s = ''):
1788 def magic_time(self,parameter_s = ''):
1780 """Time execution of a Python statement or expression.
1789 """Time execution of a Python statement or expression.
1781
1790
1782 The CPU and wall clock times are printed, and the value of the
1791 The CPU and wall clock times are printed, and the value of the
1783 expression (if any) is returned. Note that under Win32, system time
1792 expression (if any) is returned. Note that under Win32, system time
1784 is always reported as 0, since it can not be measured.
1793 is always reported as 0, since it can not be measured.
1785
1794
1786 This function provides very basic timing functionality. In Python
1795 This function provides very basic timing functionality. In Python
1787 2.3, the timeit module offers more control and sophistication, so this
1796 2.3, the timeit module offers more control and sophistication, so this
1788 could be rewritten to use it (patches welcome).
1797 could be rewritten to use it (patches welcome).
1789
1798
1790 Some examples:
1799 Some examples:
1791
1800
1792 In [1]: time 2**128
1801 In [1]: time 2**128
1793 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1802 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1794 Wall time: 0.00
1803 Wall time: 0.00
1795 Out[1]: 340282366920938463463374607431768211456L
1804 Out[1]: 340282366920938463463374607431768211456L
1796
1805
1797 In [2]: n = 1000000
1806 In [2]: n = 1000000
1798
1807
1799 In [3]: time sum(range(n))
1808 In [3]: time sum(range(n))
1800 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1809 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1801 Wall time: 1.37
1810 Wall time: 1.37
1802 Out[3]: 499999500000L
1811 Out[3]: 499999500000L
1803
1812
1804 In [4]: time print 'hello world'
1813 In [4]: time print 'hello world'
1805 hello world
1814 hello world
1806 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1815 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1807 Wall time: 0.00
1816 Wall time: 0.00
1817
1818 Note that the time needed by Python to compile the given expression
1819 will be reported if it is more than 0.1s. In this example, the
1820 actual exponentiation is done by Python at compilation time, so while
1821 the expression can take a noticeable amount of time to compute, that
1822 time is purely due to the compilation:
1823
1824 In [5]: time 3**9999;
1825 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1826 Wall time: 0.00 s
1827
1828 In [6]: time 3**999999;
1829 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1830 Wall time: 0.00 s
1831 Compiler : 0.78 s
1808 """
1832 """
1809
1833
1810 # fail immediately if the given expression can't be compiled
1834 # fail immediately if the given expression can't be compiled
1811
1835
1812 expr = self.shell.prefilter(parameter_s,False)
1836 expr = self.shell.prefilter(parameter_s,False)
1837
1838 # Minimum time above which compilation time will be reported
1839 tc_min = 0.1
1813
1840
1814 try:
1841 try:
1815 mode = 'eval'
1842 mode = 'eval'
1843 t0 = clock()
1816 code = compile(expr,'<timed eval>',mode)
1844 code = compile(expr,'<timed eval>',mode)
1845 tc = clock()-t0
1817 except SyntaxError:
1846 except SyntaxError:
1818 mode = 'exec'
1847 mode = 'exec'
1848 t0 = clock()
1819 code = compile(expr,'<timed exec>',mode)
1849 code = compile(expr,'<timed exec>',mode)
1850 tc = clock()-t0
1820 # skew measurement as little as possible
1851 # skew measurement as little as possible
1821 glob = self.shell.user_ns
1852 glob = self.shell.user_ns
1822 clk = clock2
1853 clk = clock2
1823 wtime = time.time
1854 wtime = time.time
1824 # time execution
1855 # time execution
1825 wall_st = wtime()
1856 wall_st = wtime()
1826 if mode=='eval':
1857 if mode=='eval':
1827 st = clk()
1858 st = clk()
1828 out = eval(code,glob)
1859 out = eval(code,glob)
1829 end = clk()
1860 end = clk()
1830 else:
1861 else:
1831 st = clk()
1862 st = clk()
1832 exec code in glob
1863 exec code in glob
1833 end = clk()
1864 end = clk()
1834 out = None
1865 out = None
1835 wall_end = wtime()
1866 wall_end = wtime()
1836 # Compute actual times and report
1867 # Compute actual times and report
1837 wall_time = wall_end-wall_st
1868 wall_time = wall_end-wall_st
1838 cpu_user = end[0]-st[0]
1869 cpu_user = end[0]-st[0]
1839 cpu_sys = end[1]-st[1]
1870 cpu_sys = end[1]-st[1]
1840 cpu_tot = cpu_user+cpu_sys
1871 cpu_tot = cpu_user+cpu_sys
1841 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1872 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1842 (cpu_user,cpu_sys,cpu_tot)
1873 (cpu_user,cpu_sys,cpu_tot)
1843 print "Wall time: %.2f" % wall_time
1874 print "Wall time: %.2f s" % wall_time
1875 if tc > tc_min:
1876 print "Compiler : %.2f s" % tc
1844 return out
1877 return out
1845
1878
1846 def magic_macro(self,parameter_s = ''):
1879 def magic_macro(self,parameter_s = ''):
1847 """Define a set of input lines as a macro for future re-execution.
1880 """Define a set of input lines as a macro for future re-execution.
1848
1881
1849 Usage:\\
1882 Usage:\\
1850 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1883 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1851
1884
1852 Options:
1885 Options:
1853
1886
1854 -r: use 'raw' input. By default, the 'processed' history is used,
1887 -r: use 'raw' input. By default, the 'processed' history is used,
1855 so that magics are loaded in their transformed version to valid
1888 so that magics are loaded in their transformed version to valid
1856 Python. If this option is given, the raw input as typed as the
1889 Python. If this option is given, the raw input as typed as the
1857 command line is used instead.
1890 command line is used instead.
1858
1891
1859 This will define a global variable called `name` which is a string
1892 This will define a global variable called `name` which is a string
1860 made of joining the slices and lines you specify (n1,n2,... numbers
1893 made of joining the slices and lines you specify (n1,n2,... numbers
1861 above) from your input history into a single string. This variable
1894 above) from your input history into a single string. This variable
1862 acts like an automatic function which re-executes those lines as if
1895 acts like an automatic function which re-executes those lines as if
1863 you had typed them. You just type 'name' at the prompt and the code
1896 you had typed them. You just type 'name' at the prompt and the code
1864 executes.
1897 executes.
1865
1898
1866 The notation for indicating number ranges is: n1-n2 means 'use line
1899 The notation for indicating number ranges is: n1-n2 means 'use line
1867 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1900 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1868 using the lines numbered 5,6 and 7.
1901 using the lines numbered 5,6 and 7.
1869
1902
1870 Note: as a 'hidden' feature, you can also use traditional python slice
1903 Note: as a 'hidden' feature, you can also use traditional python slice
1871 notation, where N:M means numbers N through M-1.
1904 notation, where N:M means numbers N through M-1.
1872
1905
1873 For example, if your history contains (%hist prints it):
1906 For example, if your history contains (%hist prints it):
1874
1907
1875 44: x=1\\
1908 44: x=1\\
1876 45: y=3\\
1909 45: y=3\\
1877 46: z=x+y\\
1910 46: z=x+y\\
1878 47: print x\\
1911 47: print x\\
1879 48: a=5\\
1912 48: a=5\\
1880 49: print 'x',x,'y',y\\
1913 49: print 'x',x,'y',y\\
1881
1914
1882 you can create a macro with lines 44 through 47 (included) and line 49
1915 you can create a macro with lines 44 through 47 (included) and line 49
1883 called my_macro with:
1916 called my_macro with:
1884
1917
1885 In [51]: %macro my_macro 44-47 49
1918 In [51]: %macro my_macro 44-47 49
1886
1919
1887 Now, typing `my_macro` (without quotes) will re-execute all this code
1920 Now, typing `my_macro` (without quotes) will re-execute all this code
1888 in one pass.
1921 in one pass.
1889
1922
1890 You don't need to give the line-numbers in order, and any given line
1923 You don't need to give the line-numbers in order, and any given line
1891 number can appear multiple times. You can assemble macros with any
1924 number can appear multiple times. You can assemble macros with any
1892 lines from your input history in any order.
1925 lines from your input history in any order.
1893
1926
1894 The macro is a simple object which holds its value in an attribute,
1927 The macro is a simple object which holds its value in an attribute,
1895 but IPython's display system checks for macros and executes them as
1928 but IPython's display system checks for macros and executes them as
1896 code instead of printing them when you type their name.
1929 code instead of printing them when you type their name.
1897
1930
1898 You can view a macro's contents by explicitly printing it with:
1931 You can view a macro's contents by explicitly printing it with:
1899
1932
1900 'print macro_name'.
1933 'print macro_name'.
1901
1934
1902 For one-off cases which DON'T contain magic function calls in them you
1935 For one-off cases which DON'T contain magic function calls in them you
1903 can obtain similar results by explicitly executing slices from your
1936 can obtain similar results by explicitly executing slices from your
1904 input history with:
1937 input history with:
1905
1938
1906 In [60]: exec In[44:48]+In[49]"""
1939 In [60]: exec In[44:48]+In[49]"""
1907
1940
1908 opts,args = self.parse_options(parameter_s,'r',mode='list')
1941 opts,args = self.parse_options(parameter_s,'r',mode='list')
1909 if not args:
1942 if not args:
1910 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1943 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1911 macs.sort()
1944 macs.sort()
1912 return macs
1945 return macs
1913 if len(args) == 1:
1946 if len(args) == 1:
1914 raise UsageError(
1947 raise UsageError(
1915 "%macro insufficient args; usage '%macro name n1-n2 n3-4...")
1948 "%macro insufficient args; usage '%macro name n1-n2 n3-4...")
1916 name,ranges = args[0], args[1:]
1949 name,ranges = args[0], args[1:]
1917
1950
1918 #print 'rng',ranges # dbg
1951 #print 'rng',ranges # dbg
1919 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1952 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1920 macro = Macro(lines)
1953 macro = Macro(lines)
1921 self.shell.user_ns.update({name:macro})
1954 self.shell.user_ns.update({name:macro})
1922 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1955 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1923 print 'Macro contents:'
1956 print 'Macro contents:'
1924 print macro,
1957 print macro,
1925
1958
1926 def magic_save(self,parameter_s = ''):
1959 def magic_save(self,parameter_s = ''):
1927 """Save a set of lines to a given filename.
1960 """Save a set of lines to a given filename.
1928
1961
1929 Usage:\\
1962 Usage:\\
1930 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1963 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1931
1964
1932 Options:
1965 Options:
1933
1966
1934 -r: use 'raw' input. By default, the 'processed' history is used,
1967 -r: use 'raw' input. By default, the 'processed' history is used,
1935 so that magics are loaded in their transformed version to valid
1968 so that magics are loaded in their transformed version to valid
1936 Python. If this option is given, the raw input as typed as the
1969 Python. If this option is given, the raw input as typed as the
1937 command line is used instead.
1970 command line is used instead.
1938
1971
1939 This function uses the same syntax as %macro for line extraction, but
1972 This function uses the same syntax as %macro for line extraction, but
1940 instead of creating a macro it saves the resulting string to the
1973 instead of creating a macro it saves the resulting string to the
1941 filename you specify.
1974 filename you specify.
1942
1975
1943 It adds a '.py' extension to the file if you don't do so yourself, and
1976 It adds a '.py' extension to the file if you don't do so yourself, and
1944 it asks for confirmation before overwriting existing files."""
1977 it asks for confirmation before overwriting existing files."""
1945
1978
1946 opts,args = self.parse_options(parameter_s,'r',mode='list')
1979 opts,args = self.parse_options(parameter_s,'r',mode='list')
1947 fname,ranges = args[0], args[1:]
1980 fname,ranges = args[0], args[1:]
1948 if not fname.endswith('.py'):
1981 if not fname.endswith('.py'):
1949 fname += '.py'
1982 fname += '.py'
1950 if os.path.isfile(fname):
1983 if os.path.isfile(fname):
1951 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1984 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1952 if ans.lower() not in ['y','yes']:
1985 if ans.lower() not in ['y','yes']:
1953 print 'Operation cancelled.'
1986 print 'Operation cancelled.'
1954 return
1987 return
1955 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1988 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1956 f = file(fname,'w')
1989 f = file(fname,'w')
1957 f.write(cmds)
1990 f.write(cmds)
1958 f.close()
1991 f.close()
1959 print 'The following commands were written to file `%s`:' % fname
1992 print 'The following commands were written to file `%s`:' % fname
1960 print cmds
1993 print cmds
1961
1994
1962 def _edit_macro(self,mname,macro):
1995 def _edit_macro(self,mname,macro):
1963 """open an editor with the macro data in a file"""
1996 """open an editor with the macro data in a file"""
1964 filename = self.shell.mktempfile(macro.value)
1997 filename = self.shell.mktempfile(macro.value)
1965 self.shell.hooks.editor(filename)
1998 self.shell.hooks.editor(filename)
1966
1999
1967 # and make a new macro object, to replace the old one
2000 # and make a new macro object, to replace the old one
1968 mfile = open(filename)
2001 mfile = open(filename)
1969 mvalue = mfile.read()
2002 mvalue = mfile.read()
1970 mfile.close()
2003 mfile.close()
1971 self.shell.user_ns[mname] = Macro(mvalue)
2004 self.shell.user_ns[mname] = Macro(mvalue)
1972
2005
1973 def magic_ed(self,parameter_s=''):
2006 def magic_ed(self,parameter_s=''):
1974 """Alias to %edit."""
2007 """Alias to %edit."""
1975 return self.magic_edit(parameter_s)
2008 return self.magic_edit(parameter_s)
1976
2009
1977 def magic_edit(self,parameter_s='',last_call=['','']):
2010 def magic_edit(self,parameter_s='',last_call=['','']):
1978 """Bring up an editor and execute the resulting code.
2011 """Bring up an editor and execute the resulting code.
1979
2012
1980 Usage:
2013 Usage:
1981 %edit [options] [args]
2014 %edit [options] [args]
1982
2015
1983 %edit runs IPython's editor hook. The default version of this hook is
2016 %edit runs IPython's editor hook. The default version of this hook is
1984 set to call the __IPYTHON__.rc.editor command. This is read from your
2017 set to call the __IPYTHON__.rc.editor command. This is read from your
1985 environment variable $EDITOR. If this isn't found, it will default to
2018 environment variable $EDITOR. If this isn't found, it will default to
1986 vi under Linux/Unix and to notepad under Windows. See the end of this
2019 vi under Linux/Unix and to notepad under Windows. See the end of this
1987 docstring for how to change the editor hook.
2020 docstring for how to change the editor hook.
1988
2021
1989 You can also set the value of this editor via the command line option
2022 You can also set the value of this editor via the command line option
1990 '-editor' or in your ipythonrc file. This is useful if you wish to use
2023 '-editor' or in your ipythonrc file. This is useful if you wish to use
1991 specifically for IPython an editor different from your typical default
2024 specifically for IPython an editor different from your typical default
1992 (and for Windows users who typically don't set environment variables).
2025 (and for Windows users who typically don't set environment variables).
1993
2026
1994 This command allows you to conveniently edit multi-line code right in
2027 This command allows you to conveniently edit multi-line code right in
1995 your IPython session.
2028 your IPython session.
1996
2029
1997 If called without arguments, %edit opens up an empty editor with a
2030 If called without arguments, %edit opens up an empty editor with a
1998 temporary file and will execute the contents of this file when you
2031 temporary file and will execute the contents of this file when you
1999 close it (don't forget to save it!).
2032 close it (don't forget to save it!).
2000
2033
2001
2034
2002 Options:
2035 Options:
2003
2036
2004 -n <number>: open the editor at a specified line number. By default,
2037 -n <number>: open the editor at a specified line number. By default,
2005 the IPython editor hook uses the unix syntax 'editor +N filename', but
2038 the IPython editor hook uses the unix syntax 'editor +N filename', but
2006 you can configure this by providing your own modified hook if your
2039 you can configure this by providing your own modified hook if your
2007 favorite editor supports line-number specifications with a different
2040 favorite editor supports line-number specifications with a different
2008 syntax.
2041 syntax.
2009
2042
2010 -p: this will call the editor with the same data as the previous time
2043 -p: this will call the editor with the same data as the previous time
2011 it was used, regardless of how long ago (in your current session) it
2044 it was used, regardless of how long ago (in your current session) it
2012 was.
2045 was.
2013
2046
2014 -r: use 'raw' input. This option only applies to input taken from the
2047 -r: use 'raw' input. This option only applies to input taken from the
2015 user's history. By default, the 'processed' history is used, so that
2048 user's history. By default, the 'processed' history is used, so that
2016 magics are loaded in their transformed version to valid Python. If
2049 magics are loaded in their transformed version to valid Python. If
2017 this option is given, the raw input as typed as the command line is
2050 this option is given, the raw input as typed as the command line is
2018 used instead. When you exit the editor, it will be executed by
2051 used instead. When you exit the editor, it will be executed by
2019 IPython's own processor.
2052 IPython's own processor.
2020
2053
2021 -x: do not execute the edited code immediately upon exit. This is
2054 -x: do not execute the edited code immediately upon exit. This is
2022 mainly useful if you are editing programs which need to be called with
2055 mainly useful if you are editing programs which need to be called with
2023 command line arguments, which you can then do using %run.
2056 command line arguments, which you can then do using %run.
2024
2057
2025
2058
2026 Arguments:
2059 Arguments:
2027
2060
2028 If arguments are given, the following possibilites exist:
2061 If arguments are given, the following possibilites exist:
2029
2062
2030 - The arguments are numbers or pairs of colon-separated numbers (like
2063 - The arguments are numbers or pairs of colon-separated numbers (like
2031 1 4:8 9). These are interpreted as lines of previous input to be
2064 1 4:8 9). These are interpreted as lines of previous input to be
2032 loaded into the editor. The syntax is the same of the %macro command.
2065 loaded into the editor. The syntax is the same of the %macro command.
2033
2066
2034 - If the argument doesn't start with a number, it is evaluated as a
2067 - If the argument doesn't start with a number, it is evaluated as a
2035 variable and its contents loaded into the editor. You can thus edit
2068 variable and its contents loaded into the editor. You can thus edit
2036 any string which contains python code (including the result of
2069 any string which contains python code (including the result of
2037 previous edits).
2070 previous edits).
2038
2071
2039 - If the argument is the name of an object (other than a string),
2072 - If the argument is the name of an object (other than a string),
2040 IPython will try to locate the file where it was defined and open the
2073 IPython will try to locate the file where it was defined and open the
2041 editor at the point where it is defined. You can use `%edit function`
2074 editor at the point where it is defined. You can use `%edit function`
2042 to load an editor exactly at the point where 'function' is defined,
2075 to load an editor exactly at the point where 'function' is defined,
2043 edit it and have the file be executed automatically.
2076 edit it and have the file be executed automatically.
2044
2077
2045 If the object is a macro (see %macro for details), this opens up your
2078 If the object is a macro (see %macro for details), this opens up your
2046 specified editor with a temporary file containing the macro's data.
2079 specified editor with a temporary file containing the macro's data.
2047 Upon exit, the macro is reloaded with the contents of the file.
2080 Upon exit, the macro is reloaded with the contents of the file.
2048
2081
2049 Note: opening at an exact line is only supported under Unix, and some
2082 Note: opening at an exact line is only supported under Unix, and some
2050 editors (like kedit and gedit up to Gnome 2.8) do not understand the
2083 editors (like kedit and gedit up to Gnome 2.8) do not understand the
2051 '+NUMBER' parameter necessary for this feature. Good editors like
2084 '+NUMBER' parameter necessary for this feature. Good editors like
2052 (X)Emacs, vi, jed, pico and joe all do.
2085 (X)Emacs, vi, jed, pico and joe all do.
2053
2086
2054 - If the argument is not found as a variable, IPython will look for a
2087 - If the argument is not found as a variable, IPython will look for a
2055 file with that name (adding .py if necessary) and load it into the
2088 file with that name (adding .py if necessary) and load it into the
2056 editor. It will execute its contents with execfile() when you exit,
2089 editor. It will execute its contents with execfile() when you exit,
2057 loading any code in the file into your interactive namespace.
2090 loading any code in the file into your interactive namespace.
2058
2091
2059 After executing your code, %edit will return as output the code you
2092 After executing your code, %edit will return as output the code you
2060 typed in the editor (except when it was an existing file). This way
2093 typed in the editor (except when it was an existing file). This way
2061 you can reload the code in further invocations of %edit as a variable,
2094 you can reload the code in further invocations of %edit as a variable,
2062 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
2095 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
2063 the output.
2096 the output.
2064
2097
2065 Note that %edit is also available through the alias %ed.
2098 Note that %edit is also available through the alias %ed.
2066
2099
2067 This is an example of creating a simple function inside the editor and
2100 This is an example of creating a simple function inside the editor and
2068 then modifying it. First, start up the editor:
2101 then modifying it. First, start up the editor:
2069
2102
2070 In [1]: ed\\
2103 In [1]: ed\\
2071 Editing... done. Executing edited code...\\
2104 Editing... done. Executing edited code...\\
2072 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
2105 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
2073
2106
2074 We can then call the function foo():
2107 We can then call the function foo():
2075
2108
2076 In [2]: foo()\\
2109 In [2]: foo()\\
2077 foo() was defined in an editing session
2110 foo() was defined in an editing session
2078
2111
2079 Now we edit foo. IPython automatically loads the editor with the
2112 Now we edit foo. IPython automatically loads the editor with the
2080 (temporary) file where foo() was previously defined:
2113 (temporary) file where foo() was previously defined:
2081
2114
2082 In [3]: ed foo\\
2115 In [3]: ed foo\\
2083 Editing... done. Executing edited code...
2116 Editing... done. Executing edited code...
2084
2117
2085 And if we call foo() again we get the modified version:
2118 And if we call foo() again we get the modified version:
2086
2119
2087 In [4]: foo()\\
2120 In [4]: foo()\\
2088 foo() has now been changed!
2121 foo() has now been changed!
2089
2122
2090 Here is an example of how to edit a code snippet successive
2123 Here is an example of how to edit a code snippet successive
2091 times. First we call the editor:
2124 times. First we call the editor:
2092
2125
2093 In [8]: ed\\
2126 In [8]: ed\\
2094 Editing... done. Executing edited code...\\
2127 Editing... done. Executing edited code...\\
2095 hello\\
2128 hello\\
2096 Out[8]: "print 'hello'\\n"
2129 Out[8]: "print 'hello'\\n"
2097
2130
2098 Now we call it again with the previous output (stored in _):
2131 Now we call it again with the previous output (stored in _):
2099
2132
2100 In [9]: ed _\\
2133 In [9]: ed _\\
2101 Editing... done. Executing edited code...\\
2134 Editing... done. Executing edited code...\\
2102 hello world\\
2135 hello world\\
2103 Out[9]: "print 'hello world'\\n"
2136 Out[9]: "print 'hello world'\\n"
2104
2137
2105 Now we call it with the output #8 (stored in _8, also as Out[8]):
2138 Now we call it with the output #8 (stored in _8, also as Out[8]):
2106
2139
2107 In [10]: ed _8\\
2140 In [10]: ed _8\\
2108 Editing... done. Executing edited code...\\
2141 Editing... done. Executing edited code...\\
2109 hello again\\
2142 hello again\\
2110 Out[10]: "print 'hello again'\\n"
2143 Out[10]: "print 'hello again'\\n"
2111
2144
2112
2145
2113 Changing the default editor hook:
2146 Changing the default editor hook:
2114
2147
2115 If you wish to write your own editor hook, you can put it in a
2148 If you wish to write your own editor hook, you can put it in a
2116 configuration file which you load at startup time. The default hook
2149 configuration file which you load at startup time. The default hook
2117 is defined in the IPython.hooks module, and you can use that as a
2150 is defined in the IPython.hooks module, and you can use that as a
2118 starting example for further modifications. That file also has
2151 starting example for further modifications. That file also has
2119 general instructions on how to set a new hook for use once you've
2152 general instructions on how to set a new hook for use once you've
2120 defined it."""
2153 defined it."""
2121
2154
2122 # FIXME: This function has become a convoluted mess. It needs a
2155 # FIXME: This function has become a convoluted mess. It needs a
2123 # ground-up rewrite with clean, simple logic.
2156 # ground-up rewrite with clean, simple logic.
2124
2157
2125 def make_filename(arg):
2158 def make_filename(arg):
2126 "Make a filename from the given args"
2159 "Make a filename from the given args"
2127 try:
2160 try:
2128 filename = get_py_filename(arg)
2161 filename = get_py_filename(arg)
2129 except IOError:
2162 except IOError:
2130 if args.endswith('.py'):
2163 if args.endswith('.py'):
2131 filename = arg
2164 filename = arg
2132 else:
2165 else:
2133 filename = None
2166 filename = None
2134 return filename
2167 return filename
2135
2168
2136 # custom exceptions
2169 # custom exceptions
2137 class DataIsObject(Exception): pass
2170 class DataIsObject(Exception): pass
2138
2171
2139 opts,args = self.parse_options(parameter_s,'prxn:')
2172 opts,args = self.parse_options(parameter_s,'prxn:')
2140 # Set a few locals from the options for convenience:
2173 # Set a few locals from the options for convenience:
2141 opts_p = opts.has_key('p')
2174 opts_p = opts.has_key('p')
2142 opts_r = opts.has_key('r')
2175 opts_r = opts.has_key('r')
2143
2176
2144 # Default line number value
2177 # Default line number value
2145 lineno = opts.get('n',None)
2178 lineno = opts.get('n',None)
2146
2179
2147 if opts_p:
2180 if opts_p:
2148 args = '_%s' % last_call[0]
2181 args = '_%s' % last_call[0]
2149 if not self.shell.user_ns.has_key(args):
2182 if not self.shell.user_ns.has_key(args):
2150 args = last_call[1]
2183 args = last_call[1]
2151
2184
2152 # use last_call to remember the state of the previous call, but don't
2185 # use last_call to remember the state of the previous call, but don't
2153 # let it be clobbered by successive '-p' calls.
2186 # let it be clobbered by successive '-p' calls.
2154 try:
2187 try:
2155 last_call[0] = self.shell.outputcache.prompt_count
2188 last_call[0] = self.shell.outputcache.prompt_count
2156 if not opts_p:
2189 if not opts_p:
2157 last_call[1] = parameter_s
2190 last_call[1] = parameter_s
2158 except:
2191 except:
2159 pass
2192 pass
2160
2193
2161 # by default this is done with temp files, except when the given
2194 # by default this is done with temp files, except when the given
2162 # arg is a filename
2195 # arg is a filename
2163 use_temp = 1
2196 use_temp = 1
2164
2197
2165 if re.match(r'\d',args):
2198 if re.match(r'\d',args):
2166 # Mode where user specifies ranges of lines, like in %macro.
2199 # Mode where user specifies ranges of lines, like in %macro.
2167 # This means that you can't edit files whose names begin with
2200 # This means that you can't edit files whose names begin with
2168 # numbers this way. Tough.
2201 # numbers this way. Tough.
2169 ranges = args.split()
2202 ranges = args.split()
2170 data = ''.join(self.extract_input_slices(ranges,opts_r))
2203 data = ''.join(self.extract_input_slices(ranges,opts_r))
2171 elif args.endswith('.py'):
2204 elif args.endswith('.py'):
2172 filename = make_filename(args)
2205 filename = make_filename(args)
2173 data = ''
2206 data = ''
2174 use_temp = 0
2207 use_temp = 0
2175 elif args:
2208 elif args:
2176 try:
2209 try:
2177 # Load the parameter given as a variable. If not a string,
2210 # Load the parameter given as a variable. If not a string,
2178 # process it as an object instead (below)
2211 # process it as an object instead (below)
2179
2212
2180 #print '*** args',args,'type',type(args) # dbg
2213 #print '*** args',args,'type',type(args) # dbg
2181 data = eval(args,self.shell.user_ns)
2214 data = eval(args,self.shell.user_ns)
2182 if not type(data) in StringTypes:
2215 if not type(data) in StringTypes:
2183 raise DataIsObject
2216 raise DataIsObject
2184
2217
2185 except (NameError,SyntaxError):
2218 except (NameError,SyntaxError):
2186 # given argument is not a variable, try as a filename
2219 # given argument is not a variable, try as a filename
2187 filename = make_filename(args)
2220 filename = make_filename(args)
2188 if filename is None:
2221 if filename is None:
2189 warn("Argument given (%s) can't be found as a variable "
2222 warn("Argument given (%s) can't be found as a variable "
2190 "or as a filename." % args)
2223 "or as a filename." % args)
2191 return
2224 return
2192
2225
2193 data = ''
2226 data = ''
2194 use_temp = 0
2227 use_temp = 0
2195 except DataIsObject:
2228 except DataIsObject:
2196
2229
2197 # macros have a special edit function
2230 # macros have a special edit function
2198 if isinstance(data,Macro):
2231 if isinstance(data,Macro):
2199 self._edit_macro(args,data)
2232 self._edit_macro(args,data)
2200 return
2233 return
2201
2234
2202 # For objects, try to edit the file where they are defined
2235 # For objects, try to edit the file where they are defined
2203 try:
2236 try:
2204 filename = inspect.getabsfile(data)
2237 filename = inspect.getabsfile(data)
2205 datafile = 1
2238 datafile = 1
2206 except TypeError:
2239 except TypeError:
2207 filename = make_filename(args)
2240 filename = make_filename(args)
2208 datafile = 1
2241 datafile = 1
2209 warn('Could not find file where `%s` is defined.\n'
2242 warn('Could not find file where `%s` is defined.\n'
2210 'Opening a file named `%s`' % (args,filename))
2243 'Opening a file named `%s`' % (args,filename))
2211 # Now, make sure we can actually read the source (if it was in
2244 # Now, make sure we can actually read the source (if it was in
2212 # a temp file it's gone by now).
2245 # a temp file it's gone by now).
2213 if datafile:
2246 if datafile:
2214 try:
2247 try:
2215 if lineno is None:
2248 if lineno is None:
2216 lineno = inspect.getsourcelines(data)[1]
2249 lineno = inspect.getsourcelines(data)[1]
2217 except IOError:
2250 except IOError:
2218 filename = make_filename(args)
2251 filename = make_filename(args)
2219 if filename is None:
2252 if filename is None:
2220 warn('The file `%s` where `%s` was defined cannot '
2253 warn('The file `%s` where `%s` was defined cannot '
2221 'be read.' % (filename,data))
2254 'be read.' % (filename,data))
2222 return
2255 return
2223 use_temp = 0
2256 use_temp = 0
2224 else:
2257 else:
2225 data = ''
2258 data = ''
2226
2259
2227 if use_temp:
2260 if use_temp:
2228 filename = self.shell.mktempfile(data)
2261 filename = self.shell.mktempfile(data)
2229 print 'IPython will make a temporary file named:',filename
2262 print 'IPython will make a temporary file named:',filename
2230
2263
2231 # do actual editing here
2264 # do actual editing here
2232 print 'Editing...',
2265 print 'Editing...',
2233 sys.stdout.flush()
2266 sys.stdout.flush()
2234 self.shell.hooks.editor(filename,lineno)
2267 self.shell.hooks.editor(filename,lineno)
2235 if opts.has_key('x'): # -x prevents actual execution
2268 if opts.has_key('x'): # -x prevents actual execution
2236 print
2269 print
2237 else:
2270 else:
2238 print 'done. Executing edited code...'
2271 print 'done. Executing edited code...'
2239 if opts_r:
2272 if opts_r:
2240 self.shell.runlines(file_read(filename))
2273 self.shell.runlines(file_read(filename))
2241 else:
2274 else:
2242 self.shell.safe_execfile(filename,self.shell.user_ns,
2275 self.shell.safe_execfile(filename,self.shell.user_ns,
2243 self.shell.user_ns)
2276 self.shell.user_ns)
2244 if use_temp:
2277 if use_temp:
2245 try:
2278 try:
2246 return open(filename).read()
2279 return open(filename).read()
2247 except IOError,msg:
2280 except IOError,msg:
2248 if msg.filename == filename:
2281 if msg.filename == filename:
2249 warn('File not found. Did you forget to save?')
2282 warn('File not found. Did you forget to save?')
2250 return
2283 return
2251 else:
2284 else:
2252 self.shell.showtraceback()
2285 self.shell.showtraceback()
2253
2286
2254 def magic_xmode(self,parameter_s = ''):
2287 def magic_xmode(self,parameter_s = ''):
2255 """Switch modes for the exception handlers.
2288 """Switch modes for the exception handlers.
2256
2289
2257 Valid modes: Plain, Context and Verbose.
2290 Valid modes: Plain, Context and Verbose.
2258
2291
2259 If called without arguments, acts as a toggle."""
2292 If called without arguments, acts as a toggle."""
2260
2293
2261 def xmode_switch_err(name):
2294 def xmode_switch_err(name):
2262 warn('Error changing %s exception modes.\n%s' %
2295 warn('Error changing %s exception modes.\n%s' %
2263 (name,sys.exc_info()[1]))
2296 (name,sys.exc_info()[1]))
2264
2297
2265 shell = self.shell
2298 shell = self.shell
2266 new_mode = parameter_s.strip().capitalize()
2299 new_mode = parameter_s.strip().capitalize()
2267 try:
2300 try:
2268 shell.InteractiveTB.set_mode(mode=new_mode)
2301 shell.InteractiveTB.set_mode(mode=new_mode)
2269 print 'Exception reporting mode:',shell.InteractiveTB.mode
2302 print 'Exception reporting mode:',shell.InteractiveTB.mode
2270 except:
2303 except:
2271 xmode_switch_err('user')
2304 xmode_switch_err('user')
2272
2305
2273 # threaded shells use a special handler in sys.excepthook
2306 # threaded shells use a special handler in sys.excepthook
2274 if shell.isthreaded:
2307 if shell.isthreaded:
2275 try:
2308 try:
2276 shell.sys_excepthook.set_mode(mode=new_mode)
2309 shell.sys_excepthook.set_mode(mode=new_mode)
2277 except:
2310 except:
2278 xmode_switch_err('threaded')
2311 xmode_switch_err('threaded')
2279
2312
2280 def magic_colors(self,parameter_s = ''):
2313 def magic_colors(self,parameter_s = ''):
2281 """Switch color scheme for prompts, info system and exception handlers.
2314 """Switch color scheme for prompts, info system and exception handlers.
2282
2315
2283 Currently implemented schemes: NoColor, Linux, LightBG.
2316 Currently implemented schemes: NoColor, Linux, LightBG.
2284
2317
2285 Color scheme names are not case-sensitive."""
2318 Color scheme names are not case-sensitive."""
2286
2319
2287 def color_switch_err(name):
2320 def color_switch_err(name):
2288 warn('Error changing %s color schemes.\n%s' %
2321 warn('Error changing %s color schemes.\n%s' %
2289 (name,sys.exc_info()[1]))
2322 (name,sys.exc_info()[1]))
2290
2323
2291
2324
2292 new_scheme = parameter_s.strip()
2325 new_scheme = parameter_s.strip()
2293 if not new_scheme:
2326 if not new_scheme:
2294 raise UsageError(
2327 raise UsageError(
2295 "%colors: you must specify a color scheme. See '%colors?'")
2328 "%colors: you must specify a color scheme. See '%colors?'")
2296 return
2329 return
2297 # local shortcut
2330 # local shortcut
2298 shell = self.shell
2331 shell = self.shell
2299
2332
2300 import IPython.rlineimpl as readline
2333 import IPython.rlineimpl as readline
2301
2334
2302 if not readline.have_readline and sys.platform == "win32":
2335 if not readline.have_readline and sys.platform == "win32":
2303 msg = """\
2336 msg = """\
2304 Proper color support under MS Windows requires the pyreadline library.
2337 Proper color support under MS Windows requires the pyreadline library.
2305 You can find it at:
2338 You can find it at:
2306 http://ipython.scipy.org/moin/PyReadline/Intro
2339 http://ipython.scipy.org/moin/PyReadline/Intro
2307 Gary's readline needs the ctypes module, from:
2340 Gary's readline needs the ctypes module, from:
2308 http://starship.python.net/crew/theller/ctypes
2341 http://starship.python.net/crew/theller/ctypes
2309 (Note that ctypes is already part of Python versions 2.5 and newer).
2342 (Note that ctypes is already part of Python versions 2.5 and newer).
2310
2343
2311 Defaulting color scheme to 'NoColor'"""
2344 Defaulting color scheme to 'NoColor'"""
2312 new_scheme = 'NoColor'
2345 new_scheme = 'NoColor'
2313 warn(msg)
2346 warn(msg)
2314
2347
2315 # readline option is 0
2348 # readline option is 0
2316 if not shell.has_readline:
2349 if not shell.has_readline:
2317 new_scheme = 'NoColor'
2350 new_scheme = 'NoColor'
2318
2351
2319 # Set prompt colors
2352 # Set prompt colors
2320 try:
2353 try:
2321 shell.outputcache.set_colors(new_scheme)
2354 shell.outputcache.set_colors(new_scheme)
2322 except:
2355 except:
2323 color_switch_err('prompt')
2356 color_switch_err('prompt')
2324 else:
2357 else:
2325 shell.rc.colors = \
2358 shell.rc.colors = \
2326 shell.outputcache.color_table.active_scheme_name
2359 shell.outputcache.color_table.active_scheme_name
2327 # Set exception colors
2360 # Set exception colors
2328 try:
2361 try:
2329 shell.InteractiveTB.set_colors(scheme = new_scheme)
2362 shell.InteractiveTB.set_colors(scheme = new_scheme)
2330 shell.SyntaxTB.set_colors(scheme = new_scheme)
2363 shell.SyntaxTB.set_colors(scheme = new_scheme)
2331 except:
2364 except:
2332 color_switch_err('exception')
2365 color_switch_err('exception')
2333
2366
2334 # threaded shells use a verbose traceback in sys.excepthook
2367 # threaded shells use a verbose traceback in sys.excepthook
2335 if shell.isthreaded:
2368 if shell.isthreaded:
2336 try:
2369 try:
2337 shell.sys_excepthook.set_colors(scheme=new_scheme)
2370 shell.sys_excepthook.set_colors(scheme=new_scheme)
2338 except:
2371 except:
2339 color_switch_err('system exception handler')
2372 color_switch_err('system exception handler')
2340
2373
2341 # Set info (for 'object?') colors
2374 # Set info (for 'object?') colors
2342 if shell.rc.color_info:
2375 if shell.rc.color_info:
2343 try:
2376 try:
2344 shell.inspector.set_active_scheme(new_scheme)
2377 shell.inspector.set_active_scheme(new_scheme)
2345 except:
2378 except:
2346 color_switch_err('object inspector')
2379 color_switch_err('object inspector')
2347 else:
2380 else:
2348 shell.inspector.set_active_scheme('NoColor')
2381 shell.inspector.set_active_scheme('NoColor')
2349
2382
2350 def magic_color_info(self,parameter_s = ''):
2383 def magic_color_info(self,parameter_s = ''):
2351 """Toggle color_info.
2384 """Toggle color_info.
2352
2385
2353 The color_info configuration parameter controls whether colors are
2386 The color_info configuration parameter controls whether colors are
2354 used for displaying object details (by things like %psource, %pfile or
2387 used for displaying object details (by things like %psource, %pfile or
2355 the '?' system). This function toggles this value with each call.
2388 the '?' system). This function toggles this value with each call.
2356
2389
2357 Note that unless you have a fairly recent pager (less works better
2390 Note that unless you have a fairly recent pager (less works better
2358 than more) in your system, using colored object information displays
2391 than more) in your system, using colored object information displays
2359 will not work properly. Test it and see."""
2392 will not work properly. Test it and see."""
2360
2393
2361 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2394 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2362 self.magic_colors(self.shell.rc.colors)
2395 self.magic_colors(self.shell.rc.colors)
2363 print 'Object introspection functions have now coloring:',
2396 print 'Object introspection functions have now coloring:',
2364 print ['OFF','ON'][self.shell.rc.color_info]
2397 print ['OFF','ON'][self.shell.rc.color_info]
2365
2398
2366 def magic_Pprint(self, parameter_s=''):
2399 def magic_Pprint(self, parameter_s=''):
2367 """Toggle pretty printing on/off."""
2400 """Toggle pretty printing on/off."""
2368
2401
2369 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2402 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2370 print 'Pretty printing has been turned', \
2403 print 'Pretty printing has been turned', \
2371 ['OFF','ON'][self.shell.rc.pprint]
2404 ['OFF','ON'][self.shell.rc.pprint]
2372
2405
2373 def magic_exit(self, parameter_s=''):
2406 def magic_exit(self, parameter_s=''):
2374 """Exit IPython, confirming if configured to do so.
2407 """Exit IPython, confirming if configured to do so.
2375
2408
2376 You can configure whether IPython asks for confirmation upon exit by
2409 You can configure whether IPython asks for confirmation upon exit by
2377 setting the confirm_exit flag in the ipythonrc file."""
2410 setting the confirm_exit flag in the ipythonrc file."""
2378
2411
2379 self.shell.exit()
2412 self.shell.exit()
2380
2413
2381 def magic_quit(self, parameter_s=''):
2414 def magic_quit(self, parameter_s=''):
2382 """Exit IPython, confirming if configured to do so (like %exit)"""
2415 """Exit IPython, confirming if configured to do so (like %exit)"""
2383
2416
2384 self.shell.exit()
2417 self.shell.exit()
2385
2418
2386 def magic_Exit(self, parameter_s=''):
2419 def magic_Exit(self, parameter_s=''):
2387 """Exit IPython without confirmation."""
2420 """Exit IPython without confirmation."""
2388
2421
2389 self.shell.exit_now = True
2422 self.shell.exit_now = True
2390
2423
2391 #......................................................................
2424 #......................................................................
2392 # Functions to implement unix shell-type things
2425 # Functions to implement unix shell-type things
2393
2426
2394 def magic_alias(self, parameter_s = ''):
2427 def magic_alias(self, parameter_s = ''):
2395 """Define an alias for a system command.
2428 """Define an alias for a system command.
2396
2429
2397 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2430 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2398
2431
2399 Then, typing 'alias_name params' will execute the system command 'cmd
2432 Then, typing 'alias_name params' will execute the system command 'cmd
2400 params' (from your underlying operating system).
2433 params' (from your underlying operating system).
2401
2434
2402 Aliases have lower precedence than magic functions and Python normal
2435 Aliases have lower precedence than magic functions and Python normal
2403 variables, so if 'foo' is both a Python variable and an alias, the
2436 variables, so if 'foo' is both a Python variable and an alias, the
2404 alias can not be executed until 'del foo' removes the Python variable.
2437 alias can not be executed until 'del foo' removes the Python variable.
2405
2438
2406 You can use the %l specifier in an alias definition to represent the
2439 You can use the %l specifier in an alias definition to represent the
2407 whole line when the alias is called. For example:
2440 whole line when the alias is called. For example:
2408
2441
2409 In [2]: alias all echo "Input in brackets: <%l>"\\
2442 In [2]: alias all echo "Input in brackets: <%l>"\\
2410 In [3]: all hello world\\
2443 In [3]: all hello world\\
2411 Input in brackets: <hello world>
2444 Input in brackets: <hello world>
2412
2445
2413 You can also define aliases with parameters using %s specifiers (one
2446 You can also define aliases with parameters using %s specifiers (one
2414 per parameter):
2447 per parameter):
2415
2448
2416 In [1]: alias parts echo first %s second %s\\
2449 In [1]: alias parts echo first %s second %s\\
2417 In [2]: %parts A B\\
2450 In [2]: %parts A B\\
2418 first A second B\\
2451 first A second B\\
2419 In [3]: %parts A\\
2452 In [3]: %parts A\\
2420 Incorrect number of arguments: 2 expected.\\
2453 Incorrect number of arguments: 2 expected.\\
2421 parts is an alias to: 'echo first %s second %s'
2454 parts is an alias to: 'echo first %s second %s'
2422
2455
2423 Note that %l and %s are mutually exclusive. You can only use one or
2456 Note that %l and %s are mutually exclusive. You can only use one or
2424 the other in your aliases.
2457 the other in your aliases.
2425
2458
2426 Aliases expand Python variables just like system calls using ! or !!
2459 Aliases expand Python variables just like system calls using ! or !!
2427 do: all expressions prefixed with '$' get expanded. For details of
2460 do: all expressions prefixed with '$' get expanded. For details of
2428 the semantic rules, see PEP-215:
2461 the semantic rules, see PEP-215:
2429 http://www.python.org/peps/pep-0215.html. This is the library used by
2462 http://www.python.org/peps/pep-0215.html. This is the library used by
2430 IPython for variable expansion. If you want to access a true shell
2463 IPython for variable expansion. If you want to access a true shell
2431 variable, an extra $ is necessary to prevent its expansion by IPython:
2464 variable, an extra $ is necessary to prevent its expansion by IPython:
2432
2465
2433 In [6]: alias show echo\\
2466 In [6]: alias show echo\\
2434 In [7]: PATH='A Python string'\\
2467 In [7]: PATH='A Python string'\\
2435 In [8]: show $PATH\\
2468 In [8]: show $PATH\\
2436 A Python string\\
2469 A Python string\\
2437 In [9]: show $$PATH\\
2470 In [9]: show $$PATH\\
2438 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2471 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2439
2472
2440 You can use the alias facility to acess all of $PATH. See the %rehash
2473 You can use the alias facility to acess all of $PATH. See the %rehash
2441 and %rehashx functions, which automatically create aliases for the
2474 and %rehashx functions, which automatically create aliases for the
2442 contents of your $PATH.
2475 contents of your $PATH.
2443
2476
2444 If called with no parameters, %alias prints the current alias table."""
2477 If called with no parameters, %alias prints the current alias table."""
2445
2478
2446 par = parameter_s.strip()
2479 par = parameter_s.strip()
2447 if not par:
2480 if not par:
2448 stored = self.db.get('stored_aliases', {} )
2481 stored = self.db.get('stored_aliases', {} )
2449 atab = self.shell.alias_table
2482 atab = self.shell.alias_table
2450 aliases = atab.keys()
2483 aliases = atab.keys()
2451 aliases.sort()
2484 aliases.sort()
2452 res = []
2485 res = []
2453 showlast = []
2486 showlast = []
2454 for alias in aliases:
2487 for alias in aliases:
2455 special = False
2488 special = False
2456 try:
2489 try:
2457 tgt = atab[alias][1]
2490 tgt = atab[alias][1]
2458 except (TypeError, AttributeError):
2491 except (TypeError, AttributeError):
2459 # unsubscriptable? probably a callable
2492 # unsubscriptable? probably a callable
2460 tgt = atab[alias]
2493 tgt = atab[alias]
2461 special = True
2494 special = True
2462 # 'interesting' aliases
2495 # 'interesting' aliases
2463 if (alias in stored or
2496 if (alias in stored or
2464 special or
2497 special or
2465 alias.lower() != os.path.splitext(tgt)[0].lower() or
2498 alias.lower() != os.path.splitext(tgt)[0].lower() or
2466 ' ' in tgt):
2499 ' ' in tgt):
2467 showlast.append((alias, tgt))
2500 showlast.append((alias, tgt))
2468 else:
2501 else:
2469 res.append((alias, tgt ))
2502 res.append((alias, tgt ))
2470
2503
2471 # show most interesting aliases last
2504 # show most interesting aliases last
2472 res.extend(showlast)
2505 res.extend(showlast)
2473 print "Total number of aliases:",len(aliases)
2506 print "Total number of aliases:",len(aliases)
2474 return res
2507 return res
2475 try:
2508 try:
2476 alias,cmd = par.split(None,1)
2509 alias,cmd = par.split(None,1)
2477 except:
2510 except:
2478 print OInspect.getdoc(self.magic_alias)
2511 print OInspect.getdoc(self.magic_alias)
2479 else:
2512 else:
2480 nargs = cmd.count('%s')
2513 nargs = cmd.count('%s')
2481 if nargs>0 and cmd.find('%l')>=0:
2514 if nargs>0 and cmd.find('%l')>=0:
2482 error('The %s and %l specifiers are mutually exclusive '
2515 error('The %s and %l specifiers are mutually exclusive '
2483 'in alias definitions.')
2516 'in alias definitions.')
2484 else: # all looks OK
2517 else: # all looks OK
2485 self.shell.alias_table[alias] = (nargs,cmd)
2518 self.shell.alias_table[alias] = (nargs,cmd)
2486 self.shell.alias_table_validate(verbose=0)
2519 self.shell.alias_table_validate(verbose=0)
2487 # end magic_alias
2520 # end magic_alias
2488
2521
2489 def magic_unalias(self, parameter_s = ''):
2522 def magic_unalias(self, parameter_s = ''):
2490 """Remove an alias"""
2523 """Remove an alias"""
2491
2524
2492 aname = parameter_s.strip()
2525 aname = parameter_s.strip()
2493 if aname in self.shell.alias_table:
2526 if aname in self.shell.alias_table:
2494 del self.shell.alias_table[aname]
2527 del self.shell.alias_table[aname]
2495 stored = self.db.get('stored_aliases', {} )
2528 stored = self.db.get('stored_aliases', {} )
2496 if aname in stored:
2529 if aname in stored:
2497 print "Removing %stored alias",aname
2530 print "Removing %stored alias",aname
2498 del stored[aname]
2531 del stored[aname]
2499 self.db['stored_aliases'] = stored
2532 self.db['stored_aliases'] = stored
2500
2533
2501
2534
2502 def magic_rehashx(self, parameter_s = ''):
2535 def magic_rehashx(self, parameter_s = ''):
2503 """Update the alias table with all executable files in $PATH.
2536 """Update the alias table with all executable files in $PATH.
2504
2537
2505 This version explicitly checks that every entry in $PATH is a file
2538 This version explicitly checks that every entry in $PATH is a file
2506 with execute access (os.X_OK), so it is much slower than %rehash.
2539 with execute access (os.X_OK), so it is much slower than %rehash.
2507
2540
2508 Under Windows, it checks executability as a match agains a
2541 Under Windows, it checks executability as a match agains a
2509 '|'-separated string of extensions, stored in the IPython config
2542 '|'-separated string of extensions, stored in the IPython config
2510 variable win_exec_ext. This defaults to 'exe|com|bat'.
2543 variable win_exec_ext. This defaults to 'exe|com|bat'.
2511
2544
2512 This function also resets the root module cache of module completer,
2545 This function also resets the root module cache of module completer,
2513 used on slow filesystems.
2546 used on slow filesystems.
2514 """
2547 """
2515
2548
2516
2549
2517 ip = self.api
2550 ip = self.api
2518
2551
2519 # for the benefit of module completer in ipy_completers.py
2552 # for the benefit of module completer in ipy_completers.py
2520 del ip.db['rootmodules']
2553 del ip.db['rootmodules']
2521
2554
2522 path = [os.path.abspath(os.path.expanduser(p)) for p in
2555 path = [os.path.abspath(os.path.expanduser(p)) for p in
2523 os.environ.get('PATH','').split(os.pathsep)]
2556 os.environ.get('PATH','').split(os.pathsep)]
2524 path = filter(os.path.isdir,path)
2557 path = filter(os.path.isdir,path)
2525
2558
2526 alias_table = self.shell.alias_table
2559 alias_table = self.shell.alias_table
2527 syscmdlist = []
2560 syscmdlist = []
2528 if os.name == 'posix':
2561 if os.name == 'posix':
2529 isexec = lambda fname:os.path.isfile(fname) and \
2562 isexec = lambda fname:os.path.isfile(fname) and \
2530 os.access(fname,os.X_OK)
2563 os.access(fname,os.X_OK)
2531 else:
2564 else:
2532
2565
2533 try:
2566 try:
2534 winext = os.environ['pathext'].replace(';','|').replace('.','')
2567 winext = os.environ['pathext'].replace(';','|').replace('.','')
2535 except KeyError:
2568 except KeyError:
2536 winext = 'exe|com|bat|py'
2569 winext = 'exe|com|bat|py'
2537 if 'py' not in winext:
2570 if 'py' not in winext:
2538 winext += '|py'
2571 winext += '|py'
2539 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2572 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2540 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2573 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2541 savedir = os.getcwd()
2574 savedir = os.getcwd()
2542 try:
2575 try:
2543 # write the whole loop for posix/Windows so we don't have an if in
2576 # write the whole loop for posix/Windows so we don't have an if in
2544 # the innermost part
2577 # the innermost part
2545 if os.name == 'posix':
2578 if os.name == 'posix':
2546 for pdir in path:
2579 for pdir in path:
2547 os.chdir(pdir)
2580 os.chdir(pdir)
2548 for ff in os.listdir(pdir):
2581 for ff in os.listdir(pdir):
2549 if isexec(ff) and ff not in self.shell.no_alias:
2582 if isexec(ff) and ff not in self.shell.no_alias:
2550 # each entry in the alias table must be (N,name),
2583 # each entry in the alias table must be (N,name),
2551 # where N is the number of positional arguments of the
2584 # where N is the number of positional arguments of the
2552 # alias.
2585 # alias.
2553 alias_table[ff] = (0,ff)
2586 alias_table[ff] = (0,ff)
2554 syscmdlist.append(ff)
2587 syscmdlist.append(ff)
2555 else:
2588 else:
2556 for pdir in path:
2589 for pdir in path:
2557 os.chdir(pdir)
2590 os.chdir(pdir)
2558 for ff in os.listdir(pdir):
2591 for ff in os.listdir(pdir):
2559 base, ext = os.path.splitext(ff)
2592 base, ext = os.path.splitext(ff)
2560 if isexec(ff) and base not in self.shell.no_alias:
2593 if isexec(ff) and base not in self.shell.no_alias:
2561 if ext.lower() == '.exe':
2594 if ext.lower() == '.exe':
2562 ff = base
2595 ff = base
2563 alias_table[base.lower()] = (0,ff)
2596 alias_table[base.lower()] = (0,ff)
2564 syscmdlist.append(ff)
2597 syscmdlist.append(ff)
2565 # Make sure the alias table doesn't contain keywords or builtins
2598 # Make sure the alias table doesn't contain keywords or builtins
2566 self.shell.alias_table_validate()
2599 self.shell.alias_table_validate()
2567 # Call again init_auto_alias() so we get 'rm -i' and other
2600 # Call again init_auto_alias() so we get 'rm -i' and other
2568 # modified aliases since %rehashx will probably clobber them
2601 # modified aliases since %rehashx will probably clobber them
2569
2602
2570 # no, we don't want them. if %rehashx clobbers them, good,
2603 # no, we don't want them. if %rehashx clobbers them, good,
2571 # we'll probably get better versions
2604 # we'll probably get better versions
2572 # self.shell.init_auto_alias()
2605 # self.shell.init_auto_alias()
2573 db = ip.db
2606 db = ip.db
2574 db['syscmdlist'] = syscmdlist
2607 db['syscmdlist'] = syscmdlist
2575 finally:
2608 finally:
2576 os.chdir(savedir)
2609 os.chdir(savedir)
2577
2610
2578 def magic_pwd(self, parameter_s = ''):
2611 def magic_pwd(self, parameter_s = ''):
2579 """Return the current working directory path."""
2612 """Return the current working directory path."""
2580 return os.getcwd()
2613 return os.getcwd()
2581
2614
2582 def magic_cd(self, parameter_s=''):
2615 def magic_cd(self, parameter_s=''):
2583 """Change the current working directory.
2616 """Change the current working directory.
2584
2617
2585 This command automatically maintains an internal list of directories
2618 This command automatically maintains an internal list of directories
2586 you visit during your IPython session, in the variable _dh. The
2619 you visit during your IPython session, in the variable _dh. The
2587 command %dhist shows this history nicely formatted. You can also
2620 command %dhist shows this history nicely formatted. You can also
2588 do 'cd -<tab>' to see directory history conveniently.
2621 do 'cd -<tab>' to see directory history conveniently.
2589
2622
2590 Usage:
2623 Usage:
2591
2624
2592 cd 'dir': changes to directory 'dir'.
2625 cd 'dir': changes to directory 'dir'.
2593
2626
2594 cd -: changes to the last visited directory.
2627 cd -: changes to the last visited directory.
2595
2628
2596 cd -<n>: changes to the n-th directory in the directory history.
2629 cd -<n>: changes to the n-th directory in the directory history.
2597
2630
2598 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2631 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2599 (note: cd <bookmark_name> is enough if there is no
2632 (note: cd <bookmark_name> is enough if there is no
2600 directory <bookmark_name>, but a bookmark with the name exists.)
2633 directory <bookmark_name>, but a bookmark with the name exists.)
2601 'cd -b <tab>' allows you to tab-complete bookmark names.
2634 'cd -b <tab>' allows you to tab-complete bookmark names.
2602
2635
2603 Options:
2636 Options:
2604
2637
2605 -q: quiet. Do not print the working directory after the cd command is
2638 -q: quiet. Do not print the working directory after the cd command is
2606 executed. By default IPython's cd command does print this directory,
2639 executed. By default IPython's cd command does print this directory,
2607 since the default prompts do not display path information.
2640 since the default prompts do not display path information.
2608
2641
2609 Note that !cd doesn't work for this purpose because the shell where
2642 Note that !cd doesn't work for this purpose because the shell where
2610 !command runs is immediately discarded after executing 'command'."""
2643 !command runs is immediately discarded after executing 'command'."""
2611
2644
2612 parameter_s = parameter_s.strip()
2645 parameter_s = parameter_s.strip()
2613 #bkms = self.shell.persist.get("bookmarks",{})
2646 #bkms = self.shell.persist.get("bookmarks",{})
2614
2647
2615 numcd = re.match(r'(-)(\d+)$',parameter_s)
2648 numcd = re.match(r'(-)(\d+)$',parameter_s)
2616 # jump in directory history by number
2649 # jump in directory history by number
2617 if numcd:
2650 if numcd:
2618 nn = int(numcd.group(2))
2651 nn = int(numcd.group(2))
2619 try:
2652 try:
2620 ps = self.shell.user_ns['_dh'][nn]
2653 ps = self.shell.user_ns['_dh'][nn]
2621 except IndexError:
2654 except IndexError:
2622 print 'The requested directory does not exist in history.'
2655 print 'The requested directory does not exist in history.'
2623 return
2656 return
2624 else:
2657 else:
2625 opts = {}
2658 opts = {}
2626 else:
2659 else:
2627 #turn all non-space-escaping backslashes to slashes,
2660 #turn all non-space-escaping backslashes to slashes,
2628 # for c:\windows\directory\names\
2661 # for c:\windows\directory\names\
2629 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2662 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2630 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2663 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2631 # jump to previous
2664 # jump to previous
2632 if ps == '-':
2665 if ps == '-':
2633 try:
2666 try:
2634 ps = self.shell.user_ns['_dh'][-2]
2667 ps = self.shell.user_ns['_dh'][-2]
2635 except IndexError:
2668 except IndexError:
2636 raise UsageError('%cd -: No previous directory to change to.')
2669 raise UsageError('%cd -: No previous directory to change to.')
2637 # jump to bookmark if needed
2670 # jump to bookmark if needed
2638 else:
2671 else:
2639 if not os.path.isdir(ps) or opts.has_key('b'):
2672 if not os.path.isdir(ps) or opts.has_key('b'):
2640 bkms = self.db.get('bookmarks', {})
2673 bkms = self.db.get('bookmarks', {})
2641
2674
2642 if bkms.has_key(ps):
2675 if bkms.has_key(ps):
2643 target = bkms[ps]
2676 target = bkms[ps]
2644 print '(bookmark:%s) -> %s' % (ps,target)
2677 print '(bookmark:%s) -> %s' % (ps,target)
2645 ps = target
2678 ps = target
2646 else:
2679 else:
2647 if opts.has_key('b'):
2680 if opts.has_key('b'):
2648 raise UsageError("Bookmark '%s' not found. "
2681 raise UsageError("Bookmark '%s' not found. "
2649 "Use '%%bookmark -l' to see your bookmarks." % ps)
2682 "Use '%%bookmark -l' to see your bookmarks." % ps)
2650
2683
2651 # at this point ps should point to the target dir
2684 # at this point ps should point to the target dir
2652 if ps:
2685 if ps:
2653 try:
2686 try:
2654 os.chdir(os.path.expanduser(ps))
2687 os.chdir(os.path.expanduser(ps))
2655 if self.shell.rc.term_title:
2688 if self.shell.rc.term_title:
2656 #print 'set term title:',self.shell.rc.term_title # dbg
2689 #print 'set term title:',self.shell.rc.term_title # dbg
2657 ttitle = 'IPy ' + abbrev_cwd()
2690 ttitle = 'IPy ' + abbrev_cwd()
2658 platutils.set_term_title(ttitle)
2691 platutils.set_term_title(ttitle)
2659 except OSError:
2692 except OSError:
2660 print sys.exc_info()[1]
2693 print sys.exc_info()[1]
2661 else:
2694 else:
2662 cwd = os.getcwd()
2695 cwd = os.getcwd()
2663 dhist = self.shell.user_ns['_dh']
2696 dhist = self.shell.user_ns['_dh']
2664 dhist.append(cwd)
2697 dhist.append(cwd)
2665 self.db['dhist'] = compress_dhist(dhist)[-100:]
2698 self.db['dhist'] = compress_dhist(dhist)[-100:]
2666
2699
2667 else:
2700 else:
2668 os.chdir(self.shell.home_dir)
2701 os.chdir(self.shell.home_dir)
2669 if self.shell.rc.term_title:
2702 if self.shell.rc.term_title:
2670 platutils.set_term_title("IPy ~")
2703 platutils.set_term_title("IPy ~")
2671 cwd = os.getcwd()
2704 cwd = os.getcwd()
2672 dhist = self.shell.user_ns['_dh']
2705 dhist = self.shell.user_ns['_dh']
2673 dhist.append(cwd)
2706 dhist.append(cwd)
2674 self.db['dhist'] = compress_dhist(dhist)[-100:]
2707 self.db['dhist'] = compress_dhist(dhist)[-100:]
2675 if not 'q' in opts and self.shell.user_ns['_dh']:
2708 if not 'q' in opts and self.shell.user_ns['_dh']:
2676 print self.shell.user_ns['_dh'][-1]
2709 print self.shell.user_ns['_dh'][-1]
2677
2710
2678
2711
2679 def magic_env(self, parameter_s=''):
2712 def magic_env(self, parameter_s=''):
2680 """List environment variables."""
2713 """List environment variables."""
2681
2714
2682 return os.environ.data
2715 return os.environ.data
2683
2716
2684 def magic_pushd(self, parameter_s=''):
2717 def magic_pushd(self, parameter_s=''):
2685 """Place the current dir on stack and change directory.
2718 """Place the current dir on stack and change directory.
2686
2719
2687 Usage:\\
2720 Usage:\\
2688 %pushd ['dirname']
2721 %pushd ['dirname']
2689 """
2722 """
2690
2723
2691 dir_s = self.shell.dir_stack
2724 dir_s = self.shell.dir_stack
2692 tgt = os.path.expanduser(parameter_s)
2725 tgt = os.path.expanduser(parameter_s)
2693 cwd = os.getcwd().replace(self.home_dir,'~')
2726 cwd = os.getcwd().replace(self.home_dir,'~')
2694 if tgt:
2727 if tgt:
2695 self.magic_cd(parameter_s)
2728 self.magic_cd(parameter_s)
2696 dir_s.insert(0,cwd)
2729 dir_s.insert(0,cwd)
2697 return self.magic_dirs()
2730 return self.magic_dirs()
2698
2731
2699 def magic_popd(self, parameter_s=''):
2732 def magic_popd(self, parameter_s=''):
2700 """Change to directory popped off the top of the stack.
2733 """Change to directory popped off the top of the stack.
2701 """
2734 """
2702 if not self.shell.dir_stack:
2735 if not self.shell.dir_stack:
2703 raise UsageError("%popd on empty stack")
2736 raise UsageError("%popd on empty stack")
2704 top = self.shell.dir_stack.pop(0)
2737 top = self.shell.dir_stack.pop(0)
2705 self.magic_cd(top)
2738 self.magic_cd(top)
2706 print "popd ->",top
2739 print "popd ->",top
2707
2740
2708 def magic_dirs(self, parameter_s=''):
2741 def magic_dirs(self, parameter_s=''):
2709 """Return the current directory stack."""
2742 """Return the current directory stack."""
2710
2743
2711 return self.shell.dir_stack
2744 return self.shell.dir_stack
2712
2745
2713 def magic_dhist(self, parameter_s=''):
2746 def magic_dhist(self, parameter_s=''):
2714 """Print your history of visited directories.
2747 """Print your history of visited directories.
2715
2748
2716 %dhist -> print full history\\
2749 %dhist -> print full history\\
2717 %dhist n -> print last n entries only\\
2750 %dhist n -> print last n entries only\\
2718 %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\\
2751 %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\\
2719
2752
2720 This history is automatically maintained by the %cd command, and
2753 This history is automatically maintained by the %cd command, and
2721 always available as the global list variable _dh. You can use %cd -<n>
2754 always available as the global list variable _dh. You can use %cd -<n>
2722 to go to directory number <n>.
2755 to go to directory number <n>.
2723
2756
2724 Note that most of time, you should view directory history by entering
2757 Note that most of time, you should view directory history by entering
2725 cd -<TAB>.
2758 cd -<TAB>.
2726
2759
2727 """
2760 """
2728
2761
2729 dh = self.shell.user_ns['_dh']
2762 dh = self.shell.user_ns['_dh']
2730 if parameter_s:
2763 if parameter_s:
2731 try:
2764 try:
2732 args = map(int,parameter_s.split())
2765 args = map(int,parameter_s.split())
2733 except:
2766 except:
2734 self.arg_err(Magic.magic_dhist)
2767 self.arg_err(Magic.magic_dhist)
2735 return
2768 return
2736 if len(args) == 1:
2769 if len(args) == 1:
2737 ini,fin = max(len(dh)-(args[0]),0),len(dh)
2770 ini,fin = max(len(dh)-(args[0]),0),len(dh)
2738 elif len(args) == 2:
2771 elif len(args) == 2:
2739 ini,fin = args
2772 ini,fin = args
2740 else:
2773 else:
2741 self.arg_err(Magic.magic_dhist)
2774 self.arg_err(Magic.magic_dhist)
2742 return
2775 return
2743 else:
2776 else:
2744 ini,fin = 0,len(dh)
2777 ini,fin = 0,len(dh)
2745 nlprint(dh,
2778 nlprint(dh,
2746 header = 'Directory history (kept in _dh)',
2779 header = 'Directory history (kept in _dh)',
2747 start=ini,stop=fin)
2780 start=ini,stop=fin)
2748
2781
2749
2782
2750 def magic_sc(self, parameter_s=''):
2783 def magic_sc(self, parameter_s=''):
2751 """Shell capture - execute a shell command and capture its output.
2784 """Shell capture - execute a shell command and capture its output.
2752
2785
2753 DEPRECATED. Suboptimal, retained for backwards compatibility.
2786 DEPRECATED. Suboptimal, retained for backwards compatibility.
2754
2787
2755 You should use the form 'var = !command' instead. Example:
2788 You should use the form 'var = !command' instead. Example:
2756
2789
2757 "%sc -l myfiles = ls ~" should now be written as
2790 "%sc -l myfiles = ls ~" should now be written as
2758
2791
2759 "myfiles = !ls ~"
2792 "myfiles = !ls ~"
2760
2793
2761 myfiles.s, myfiles.l and myfiles.n still apply as documented
2794 myfiles.s, myfiles.l and myfiles.n still apply as documented
2762 below.
2795 below.
2763
2796
2764 --
2797 --
2765 %sc [options] varname=command
2798 %sc [options] varname=command
2766
2799
2767 IPython will run the given command using commands.getoutput(), and
2800 IPython will run the given command using commands.getoutput(), and
2768 will then update the user's interactive namespace with a variable
2801 will then update the user's interactive namespace with a variable
2769 called varname, containing the value of the call. Your command can
2802 called varname, containing the value of the call. Your command can
2770 contain shell wildcards, pipes, etc.
2803 contain shell wildcards, pipes, etc.
2771
2804
2772 The '=' sign in the syntax is mandatory, and the variable name you
2805 The '=' sign in the syntax is mandatory, and the variable name you
2773 supply must follow Python's standard conventions for valid names.
2806 supply must follow Python's standard conventions for valid names.
2774
2807
2775 (A special format without variable name exists for internal use)
2808 (A special format without variable name exists for internal use)
2776
2809
2777 Options:
2810 Options:
2778
2811
2779 -l: list output. Split the output on newlines into a list before
2812 -l: list output. Split the output on newlines into a list before
2780 assigning it to the given variable. By default the output is stored
2813 assigning it to the given variable. By default the output is stored
2781 as a single string.
2814 as a single string.
2782
2815
2783 -v: verbose. Print the contents of the variable.
2816 -v: verbose. Print the contents of the variable.
2784
2817
2785 In most cases you should not need to split as a list, because the
2818 In most cases you should not need to split as a list, because the
2786 returned value is a special type of string which can automatically
2819 returned value is a special type of string which can automatically
2787 provide its contents either as a list (split on newlines) or as a
2820 provide its contents either as a list (split on newlines) or as a
2788 space-separated string. These are convenient, respectively, either
2821 space-separated string. These are convenient, respectively, either
2789 for sequential processing or to be passed to a shell command.
2822 for sequential processing or to be passed to a shell command.
2790
2823
2791 For example:
2824 For example:
2792
2825
2793 # Capture into variable a
2826 # Capture into variable a
2794 In [9]: sc a=ls *py
2827 In [9]: sc a=ls *py
2795
2828
2796 # a is a string with embedded newlines
2829 # a is a string with embedded newlines
2797 In [10]: a
2830 In [10]: a
2798 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2831 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2799
2832
2800 # which can be seen as a list:
2833 # which can be seen as a list:
2801 In [11]: a.l
2834 In [11]: a.l
2802 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2835 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2803
2836
2804 # or as a whitespace-separated string:
2837 # or as a whitespace-separated string:
2805 In [12]: a.s
2838 In [12]: a.s
2806 Out[12]: 'setup.py win32_manual_post_install.py'
2839 Out[12]: 'setup.py win32_manual_post_install.py'
2807
2840
2808 # a.s is useful to pass as a single command line:
2841 # a.s is useful to pass as a single command line:
2809 In [13]: !wc -l $a.s
2842 In [13]: !wc -l $a.s
2810 146 setup.py
2843 146 setup.py
2811 130 win32_manual_post_install.py
2844 130 win32_manual_post_install.py
2812 276 total
2845 276 total
2813
2846
2814 # while the list form is useful to loop over:
2847 # while the list form is useful to loop over:
2815 In [14]: for f in a.l:
2848 In [14]: for f in a.l:
2816 ....: !wc -l $f
2849 ....: !wc -l $f
2817 ....:
2850 ....:
2818 146 setup.py
2851 146 setup.py
2819 130 win32_manual_post_install.py
2852 130 win32_manual_post_install.py
2820
2853
2821 Similiarly, the lists returned by the -l option are also special, in
2854 Similiarly, the lists returned by the -l option are also special, in
2822 the sense that you can equally invoke the .s attribute on them to
2855 the sense that you can equally invoke the .s attribute on them to
2823 automatically get a whitespace-separated string from their contents:
2856 automatically get a whitespace-separated string from their contents:
2824
2857
2825 In [1]: sc -l b=ls *py
2858 In [1]: sc -l b=ls *py
2826
2859
2827 In [2]: b
2860 In [2]: b
2828 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2861 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2829
2862
2830 In [3]: b.s
2863 In [3]: b.s
2831 Out[3]: 'setup.py win32_manual_post_install.py'
2864 Out[3]: 'setup.py win32_manual_post_install.py'
2832
2865
2833 In summary, both the lists and strings used for ouptut capture have
2866 In summary, both the lists and strings used for ouptut capture have
2834 the following special attributes:
2867 the following special attributes:
2835
2868
2836 .l (or .list) : value as list.
2869 .l (or .list) : value as list.
2837 .n (or .nlstr): value as newline-separated string.
2870 .n (or .nlstr): value as newline-separated string.
2838 .s (or .spstr): value as space-separated string.
2871 .s (or .spstr): value as space-separated string.
2839 """
2872 """
2840
2873
2841 opts,args = self.parse_options(parameter_s,'lv')
2874 opts,args = self.parse_options(parameter_s,'lv')
2842 # Try to get a variable name and command to run
2875 # Try to get a variable name and command to run
2843 try:
2876 try:
2844 # the variable name must be obtained from the parse_options
2877 # the variable name must be obtained from the parse_options
2845 # output, which uses shlex.split to strip options out.
2878 # output, which uses shlex.split to strip options out.
2846 var,_ = args.split('=',1)
2879 var,_ = args.split('=',1)
2847 var = var.strip()
2880 var = var.strip()
2848 # But the the command has to be extracted from the original input
2881 # But the the command has to be extracted from the original input
2849 # parameter_s, not on what parse_options returns, to avoid the
2882 # parameter_s, not on what parse_options returns, to avoid the
2850 # quote stripping which shlex.split performs on it.
2883 # quote stripping which shlex.split performs on it.
2851 _,cmd = parameter_s.split('=',1)
2884 _,cmd = parameter_s.split('=',1)
2852 except ValueError:
2885 except ValueError:
2853 var,cmd = '',''
2886 var,cmd = '',''
2854 # If all looks ok, proceed
2887 # If all looks ok, proceed
2855 out,err = self.shell.getoutputerror(cmd)
2888 out,err = self.shell.getoutputerror(cmd)
2856 if err:
2889 if err:
2857 print >> Term.cerr,err
2890 print >> Term.cerr,err
2858 if opts.has_key('l'):
2891 if opts.has_key('l'):
2859 out = SList(out.split('\n'))
2892 out = SList(out.split('\n'))
2860 else:
2893 else:
2861 out = LSString(out)
2894 out = LSString(out)
2862 if opts.has_key('v'):
2895 if opts.has_key('v'):
2863 print '%s ==\n%s' % (var,pformat(out))
2896 print '%s ==\n%s' % (var,pformat(out))
2864 if var:
2897 if var:
2865 self.shell.user_ns.update({var:out})
2898 self.shell.user_ns.update({var:out})
2866 else:
2899 else:
2867 return out
2900 return out
2868
2901
2869 def magic_sx(self, parameter_s=''):
2902 def magic_sx(self, parameter_s=''):
2870 """Shell execute - run a shell command and capture its output.
2903 """Shell execute - run a shell command and capture its output.
2871
2904
2872 %sx command
2905 %sx command
2873
2906
2874 IPython will run the given command using commands.getoutput(), and
2907 IPython will run the given command using commands.getoutput(), and
2875 return the result formatted as a list (split on '\\n'). Since the
2908 return the result formatted as a list (split on '\\n'). Since the
2876 output is _returned_, it will be stored in ipython's regular output
2909 output is _returned_, it will be stored in ipython's regular output
2877 cache Out[N] and in the '_N' automatic variables.
2910 cache Out[N] and in the '_N' automatic variables.
2878
2911
2879 Notes:
2912 Notes:
2880
2913
2881 1) If an input line begins with '!!', then %sx is automatically
2914 1) If an input line begins with '!!', then %sx is automatically
2882 invoked. That is, while:
2915 invoked. That is, while:
2883 !ls
2916 !ls
2884 causes ipython to simply issue system('ls'), typing
2917 causes ipython to simply issue system('ls'), typing
2885 !!ls
2918 !!ls
2886 is a shorthand equivalent to:
2919 is a shorthand equivalent to:
2887 %sx ls
2920 %sx ls
2888
2921
2889 2) %sx differs from %sc in that %sx automatically splits into a list,
2922 2) %sx differs from %sc in that %sx automatically splits into a list,
2890 like '%sc -l'. The reason for this is to make it as easy as possible
2923 like '%sc -l'. The reason for this is to make it as easy as possible
2891 to process line-oriented shell output via further python commands.
2924 to process line-oriented shell output via further python commands.
2892 %sc is meant to provide much finer control, but requires more
2925 %sc is meant to provide much finer control, but requires more
2893 typing.
2926 typing.
2894
2927
2895 3) Just like %sc -l, this is a list with special attributes:
2928 3) Just like %sc -l, this is a list with special attributes:
2896
2929
2897 .l (or .list) : value as list.
2930 .l (or .list) : value as list.
2898 .n (or .nlstr): value as newline-separated string.
2931 .n (or .nlstr): value as newline-separated string.
2899 .s (or .spstr): value as whitespace-separated string.
2932 .s (or .spstr): value as whitespace-separated string.
2900
2933
2901 This is very useful when trying to use such lists as arguments to
2934 This is very useful when trying to use such lists as arguments to
2902 system commands."""
2935 system commands."""
2903
2936
2904 if parameter_s:
2937 if parameter_s:
2905 out,err = self.shell.getoutputerror(parameter_s)
2938 out,err = self.shell.getoutputerror(parameter_s)
2906 if err:
2939 if err:
2907 print >> Term.cerr,err
2940 print >> Term.cerr,err
2908 return SList(out.split('\n'))
2941 return SList(out.split('\n'))
2909
2942
2910 def magic_bg(self, parameter_s=''):
2943 def magic_bg(self, parameter_s=''):
2911 """Run a job in the background, in a separate thread.
2944 """Run a job in the background, in a separate thread.
2912
2945
2913 For example,
2946 For example,
2914
2947
2915 %bg myfunc(x,y,z=1)
2948 %bg myfunc(x,y,z=1)
2916
2949
2917 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2950 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2918 execution starts, a message will be printed indicating the job
2951 execution starts, a message will be printed indicating the job
2919 number. If your job number is 5, you can use
2952 number. If your job number is 5, you can use
2920
2953
2921 myvar = jobs.result(5) or myvar = jobs[5].result
2954 myvar = jobs.result(5) or myvar = jobs[5].result
2922
2955
2923 to assign this result to variable 'myvar'.
2956 to assign this result to variable 'myvar'.
2924
2957
2925 IPython has a job manager, accessible via the 'jobs' object. You can
2958 IPython has a job manager, accessible via the 'jobs' object. You can
2926 type jobs? to get more information about it, and use jobs.<TAB> to see
2959 type jobs? to get more information about it, and use jobs.<TAB> to see
2927 its attributes. All attributes not starting with an underscore are
2960 its attributes. All attributes not starting with an underscore are
2928 meant for public use.
2961 meant for public use.
2929
2962
2930 In particular, look at the jobs.new() method, which is used to create
2963 In particular, look at the jobs.new() method, which is used to create
2931 new jobs. This magic %bg function is just a convenience wrapper
2964 new jobs. This magic %bg function is just a convenience wrapper
2932 around jobs.new(), for expression-based jobs. If you want to create a
2965 around jobs.new(), for expression-based jobs. If you want to create a
2933 new job with an explicit function object and arguments, you must call
2966 new job with an explicit function object and arguments, you must call
2934 jobs.new() directly.
2967 jobs.new() directly.
2935
2968
2936 The jobs.new docstring also describes in detail several important
2969 The jobs.new docstring also describes in detail several important
2937 caveats associated with a thread-based model for background job
2970 caveats associated with a thread-based model for background job
2938 execution. Type jobs.new? for details.
2971 execution. Type jobs.new? for details.
2939
2972
2940 You can check the status of all jobs with jobs.status().
2973 You can check the status of all jobs with jobs.status().
2941
2974
2942 The jobs variable is set by IPython into the Python builtin namespace.
2975 The jobs variable is set by IPython into the Python builtin namespace.
2943 If you ever declare a variable named 'jobs', you will shadow this
2976 If you ever declare a variable named 'jobs', you will shadow this
2944 name. You can either delete your global jobs variable to regain
2977 name. You can either delete your global jobs variable to regain
2945 access to the job manager, or make a new name and assign it manually
2978 access to the job manager, or make a new name and assign it manually
2946 to the manager (stored in IPython's namespace). For example, to
2979 to the manager (stored in IPython's namespace). For example, to
2947 assign the job manager to the Jobs name, use:
2980 assign the job manager to the Jobs name, use:
2948
2981
2949 Jobs = __builtins__.jobs"""
2982 Jobs = __builtins__.jobs"""
2950
2983
2951 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2984 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2952
2985
2953 def magic_r(self, parameter_s=''):
2986 def magic_r(self, parameter_s=''):
2954 """Repeat previous input.
2987 """Repeat previous input.
2955
2988
2956 Note: Consider using the more powerfull %rep instead!
2989 Note: Consider using the more powerfull %rep instead!
2957
2990
2958 If given an argument, repeats the previous command which starts with
2991 If given an argument, repeats the previous command which starts with
2959 the same string, otherwise it just repeats the previous input.
2992 the same string, otherwise it just repeats the previous input.
2960
2993
2961 Shell escaped commands (with ! as first character) are not recognized
2994 Shell escaped commands (with ! as first character) are not recognized
2962 by this system, only pure python code and magic commands.
2995 by this system, only pure python code and magic commands.
2963 """
2996 """
2964
2997
2965 start = parameter_s.strip()
2998 start = parameter_s.strip()
2966 esc_magic = self.shell.ESC_MAGIC
2999 esc_magic = self.shell.ESC_MAGIC
2967 # Identify magic commands even if automagic is on (which means
3000 # Identify magic commands even if automagic is on (which means
2968 # the in-memory version is different from that typed by the user).
3001 # the in-memory version is different from that typed by the user).
2969 if self.shell.rc.automagic:
3002 if self.shell.rc.automagic:
2970 start_magic = esc_magic+start
3003 start_magic = esc_magic+start
2971 else:
3004 else:
2972 start_magic = start
3005 start_magic = start
2973 # Look through the input history in reverse
3006 # Look through the input history in reverse
2974 for n in range(len(self.shell.input_hist)-2,0,-1):
3007 for n in range(len(self.shell.input_hist)-2,0,-1):
2975 input = self.shell.input_hist[n]
3008 input = self.shell.input_hist[n]
2976 # skip plain 'r' lines so we don't recurse to infinity
3009 # skip plain 'r' lines so we don't recurse to infinity
2977 if input != '_ip.magic("r")\n' and \
3010 if input != '_ip.magic("r")\n' and \
2978 (input.startswith(start) or input.startswith(start_magic)):
3011 (input.startswith(start) or input.startswith(start_magic)):
2979 #print 'match',`input` # dbg
3012 #print 'match',`input` # dbg
2980 print 'Executing:',input,
3013 print 'Executing:',input,
2981 self.shell.runlines(input)
3014 self.shell.runlines(input)
2982 return
3015 return
2983 print 'No previous input matching `%s` found.' % start
3016 print 'No previous input matching `%s` found.' % start
2984
3017
2985
3018
2986 def magic_bookmark(self, parameter_s=''):
3019 def magic_bookmark(self, parameter_s=''):
2987 """Manage IPython's bookmark system.
3020 """Manage IPython's bookmark system.
2988
3021
2989 %bookmark <name> - set bookmark to current dir
3022 %bookmark <name> - set bookmark to current dir
2990 %bookmark <name> <dir> - set bookmark to <dir>
3023 %bookmark <name> <dir> - set bookmark to <dir>
2991 %bookmark -l - list all bookmarks
3024 %bookmark -l - list all bookmarks
2992 %bookmark -d <name> - remove bookmark
3025 %bookmark -d <name> - remove bookmark
2993 %bookmark -r - remove all bookmarks
3026 %bookmark -r - remove all bookmarks
2994
3027
2995 You can later on access a bookmarked folder with:
3028 You can later on access a bookmarked folder with:
2996 %cd -b <name>
3029 %cd -b <name>
2997 or simply '%cd <name>' if there is no directory called <name> AND
3030 or simply '%cd <name>' if there is no directory called <name> AND
2998 there is such a bookmark defined.
3031 there is such a bookmark defined.
2999
3032
3000 Your bookmarks persist through IPython sessions, but they are
3033 Your bookmarks persist through IPython sessions, but they are
3001 associated with each profile."""
3034 associated with each profile."""
3002
3035
3003 opts,args = self.parse_options(parameter_s,'drl',mode='list')
3036 opts,args = self.parse_options(parameter_s,'drl',mode='list')
3004 if len(args) > 2:
3037 if len(args) > 2:
3005 raise UsageError("%bookmark: too many arguments")
3038 raise UsageError("%bookmark: too many arguments")
3006
3039
3007 bkms = self.db.get('bookmarks',{})
3040 bkms = self.db.get('bookmarks',{})
3008
3041
3009 if opts.has_key('d'):
3042 if opts.has_key('d'):
3010 try:
3043 try:
3011 todel = args[0]
3044 todel = args[0]
3012 except IndexError:
3045 except IndexError:
3013 raise UsageError(
3046 raise UsageError(
3014 "%bookmark -d: must provide a bookmark to delete")
3047 "%bookmark -d: must provide a bookmark to delete")
3015 else:
3048 else:
3016 try:
3049 try:
3017 del bkms[todel]
3050 del bkms[todel]
3018 except KeyError:
3051 except KeyError:
3019 raise UsageError(
3052 raise UsageError(
3020 "%%bookmark -d: Can't delete bookmark '%s'" % todel)
3053 "%%bookmark -d: Can't delete bookmark '%s'" % todel)
3021
3054
3022 elif opts.has_key('r'):
3055 elif opts.has_key('r'):
3023 bkms = {}
3056 bkms = {}
3024 elif opts.has_key('l'):
3057 elif opts.has_key('l'):
3025 bks = bkms.keys()
3058 bks = bkms.keys()
3026 bks.sort()
3059 bks.sort()
3027 if bks:
3060 if bks:
3028 size = max(map(len,bks))
3061 size = max(map(len,bks))
3029 else:
3062 else:
3030 size = 0
3063 size = 0
3031 fmt = '%-'+str(size)+'s -> %s'
3064 fmt = '%-'+str(size)+'s -> %s'
3032 print 'Current bookmarks:'
3065 print 'Current bookmarks:'
3033 for bk in bks:
3066 for bk in bks:
3034 print fmt % (bk,bkms[bk])
3067 print fmt % (bk,bkms[bk])
3035 else:
3068 else:
3036 if not args:
3069 if not args:
3037 raise UsageError("%bookmark: You must specify the bookmark name")
3070 raise UsageError("%bookmark: You must specify the bookmark name")
3038 elif len(args)==1:
3071 elif len(args)==1:
3039 bkms[args[0]] = os.getcwd()
3072 bkms[args[0]] = os.getcwd()
3040 elif len(args)==2:
3073 elif len(args)==2:
3041 bkms[args[0]] = args[1]
3074 bkms[args[0]] = args[1]
3042 self.db['bookmarks'] = bkms
3075 self.db['bookmarks'] = bkms
3043
3076
3044 def magic_pycat(self, parameter_s=''):
3077 def magic_pycat(self, parameter_s=''):
3045 """Show a syntax-highlighted file through a pager.
3078 """Show a syntax-highlighted file through a pager.
3046
3079
3047 This magic is similar to the cat utility, but it will assume the file
3080 This magic is similar to the cat utility, but it will assume the file
3048 to be Python source and will show it with syntax highlighting. """
3081 to be Python source and will show it with syntax highlighting. """
3049
3082
3050 try:
3083 try:
3051 filename = get_py_filename(parameter_s)
3084 filename = get_py_filename(parameter_s)
3052 cont = file_read(filename)
3085 cont = file_read(filename)
3053 except IOError:
3086 except IOError:
3054 try:
3087 try:
3055 cont = eval(parameter_s,self.user_ns)
3088 cont = eval(parameter_s,self.user_ns)
3056 except NameError:
3089 except NameError:
3057 cont = None
3090 cont = None
3058 if cont is None:
3091 if cont is None:
3059 print "Error: no such file or variable"
3092 print "Error: no such file or variable"
3060 return
3093 return
3061
3094
3062 page(self.shell.pycolorize(cont),
3095 page(self.shell.pycolorize(cont),
3063 screen_lines=self.shell.rc.screen_length)
3096 screen_lines=self.shell.rc.screen_length)
3064
3097
3065 def magic_cpaste(self, parameter_s=''):
3098 def magic_cpaste(self, parameter_s=''):
3066 """Allows you to paste & execute a pre-formatted code block from clipboard
3099 """Allows you to paste & execute a pre-formatted code block from clipboard
3067
3100
3068 You must terminate the block with '--' (two minus-signs) alone on the
3101 You must terminate the block with '--' (two minus-signs) alone on the
3069 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
3102 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
3070 is the new sentinel for this operation)
3103 is the new sentinel for this operation)
3071
3104
3072 The block is dedented prior to execution to enable execution of method
3105 The block is dedented prior to execution to enable execution of method
3073 definitions. '>' and '+' characters at the beginning of a line are
3106 definitions. '>' and '+' characters at the beginning of a line are
3074 ignored, to allow pasting directly from e-mails or diff files. The
3107 ignored, to allow pasting directly from e-mails or diff files. The
3075 executed block is also assigned to variable named 'pasted_block' for
3108 executed block is also assigned to variable named 'pasted_block' for
3076 later editing with '%edit pasted_block'.
3109 later editing with '%edit pasted_block'.
3077
3110
3078 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
3111 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
3079 This assigns the pasted block to variable 'foo' as string, without
3112 This assigns the pasted block to variable 'foo' as string, without
3080 dedenting or executing it.
3113 dedenting or executing it.
3081
3114
3082 Do not be alarmed by garbled output on Windows (it's a readline bug).
3115 Do not be alarmed by garbled output on Windows (it's a readline bug).
3083 Just press enter and type -- (and press enter again) and the block
3116 Just press enter and type -- (and press enter again) and the block
3084 will be what was just pasted.
3117 will be what was just pasted.
3085
3118
3086 IPython statements (magics, shell escapes) are not supported (yet).
3119 IPython statements (magics, shell escapes) are not supported (yet).
3087 """
3120 """
3088 opts,args = self.parse_options(parameter_s,'s:',mode='string')
3121 opts,args = self.parse_options(parameter_s,'s:',mode='string')
3089 par = args.strip()
3122 par = args.strip()
3090 sentinel = opts.get('s','--')
3123 sentinel = opts.get('s','--')
3091
3124
3092 from IPython import iplib
3125 from IPython import iplib
3093 lines = []
3126 lines = []
3094 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3127 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3095 while 1:
3128 while 1:
3096 l = iplib.raw_input_original(':')
3129 l = iplib.raw_input_original(':')
3097 if l ==sentinel:
3130 if l ==sentinel:
3098 break
3131 break
3099 lines.append(l.lstrip('>').lstrip('+'))
3132 lines.append(l.lstrip('>').lstrip('+'))
3100 block = "\n".join(lines) + '\n'
3133 block = "\n".join(lines) + '\n'
3101 #print "block:\n",block
3134 #print "block:\n",block
3102 if not par:
3135 if not par:
3103 b = textwrap.dedent(block)
3136 b = textwrap.dedent(block)
3104 exec b in self.user_ns
3137 exec b in self.user_ns
3105 self.user_ns['pasted_block'] = b
3138 self.user_ns['pasted_block'] = b
3106 else:
3139 else:
3107 self.user_ns[par] = block
3140 self.user_ns[par] = block
3108 print "Block assigned to '%s'" % par
3141 print "Block assigned to '%s'" % par
3109
3142
3110 def magic_quickref(self,arg):
3143 def magic_quickref(self,arg):
3111 """ Show a quick reference sheet """
3144 """ Show a quick reference sheet """
3112 import IPython.usage
3145 import IPython.usage
3113 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
3146 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
3114
3147
3115 page(qr)
3148 page(qr)
3116
3149
3117 def magic_upgrade(self,arg):
3150 def magic_upgrade(self,arg):
3118 """ Upgrade your IPython installation
3151 """ Upgrade your IPython installation
3119
3152
3120 This will copy the config files that don't yet exist in your
3153 This will copy the config files that don't yet exist in your
3121 ipython dir from the system config dir. Use this after upgrading
3154 ipython dir from the system config dir. Use this after upgrading
3122 IPython if you don't wish to delete your .ipython dir.
3155 IPython if you don't wish to delete your .ipython dir.
3123
3156
3124 Call with -nolegacy to get rid of ipythonrc* files (recommended for
3157 Call with -nolegacy to get rid of ipythonrc* files (recommended for
3125 new users)
3158 new users)
3126
3159
3127 """
3160 """
3128 ip = self.getapi()
3161 ip = self.getapi()
3129 ipinstallation = path(IPython.__file__).dirname()
3162 ipinstallation = path(IPython.__file__).dirname()
3130 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
3163 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
3131 src_config = ipinstallation / 'UserConfig'
3164 src_config = ipinstallation / 'UserConfig'
3132 userdir = path(ip.options.ipythondir)
3165 userdir = path(ip.options.ipythondir)
3133 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
3166 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
3134 print ">",cmd
3167 print ">",cmd
3135 shell(cmd)
3168 shell(cmd)
3136 if arg == '-nolegacy':
3169 if arg == '-nolegacy':
3137 legacy = userdir.files('ipythonrc*')
3170 legacy = userdir.files('ipythonrc*')
3138 print "Nuking legacy files:",legacy
3171 print "Nuking legacy files:",legacy
3139
3172
3140 [p.remove() for p in legacy]
3173 [p.remove() for p in legacy]
3141 suffix = (sys.platform == 'win32' and '.ini' or '')
3174 suffix = (sys.platform == 'win32' and '.ini' or '')
3142 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
3175 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
3143
3176
3144
3177
3145 def magic_doctest_mode(self,parameter_s=''):
3178 def magic_doctest_mode(self,parameter_s=''):
3146 """Toggle doctest mode on and off.
3179 """Toggle doctest mode on and off.
3147
3180
3148 This mode allows you to toggle the prompt behavior between normal
3181 This mode allows you to toggle the prompt behavior between normal
3149 IPython prompts and ones that are as similar to the default IPython
3182 IPython prompts and ones that are as similar to the default IPython
3150 interpreter as possible.
3183 interpreter as possible.
3151
3184
3152 It also supports the pasting of code snippets that have leading '>>>'
3185 It also supports the pasting of code snippets that have leading '>>>'
3153 and '...' prompts in them. This means that you can paste doctests from
3186 and '...' prompts in them. This means that you can paste doctests from
3154 files or docstrings (even if they have leading whitespace), and the
3187 files or docstrings (even if they have leading whitespace), and the
3155 code will execute correctly. You can then use '%history -tn' to see
3188 code will execute correctly. You can then use '%history -tn' to see
3156 the translated history without line numbers; this will give you the
3189 the translated history without line numbers; this will give you the
3157 input after removal of all the leading prompts and whitespace, which
3190 input after removal of all the leading prompts and whitespace, which
3158 can be pasted back into an editor.
3191 can be pasted back into an editor.
3159
3192
3160 With these features, you can switch into this mode easily whenever you
3193 With these features, you can switch into this mode easily whenever you
3161 need to do testing and changes to doctests, without having to leave
3194 need to do testing and changes to doctests, without having to leave
3162 your existing IPython session.
3195 your existing IPython session.
3163 """
3196 """
3164
3197
3165 # XXX - Fix this to have cleaner activate/deactivate calls.
3198 # XXX - Fix this to have cleaner activate/deactivate calls.
3166 from IPython.Extensions import InterpreterPasteInput as ipaste
3199 from IPython.Extensions import InterpreterPasteInput as ipaste
3167 from IPython.ipstruct import Struct
3200 from IPython.ipstruct import Struct
3168
3201
3169 # Shorthands
3202 # Shorthands
3170 shell = self.shell
3203 shell = self.shell
3171 oc = shell.outputcache
3204 oc = shell.outputcache
3172 rc = shell.rc
3205 rc = shell.rc
3173 meta = shell.meta
3206 meta = shell.meta
3174 # dstore is a data store kept in the instance metadata bag to track any
3207 # dstore is a data store kept in the instance metadata bag to track any
3175 # changes we make, so we can undo them later.
3208 # changes we make, so we can undo them later.
3176 dstore = meta.setdefault('doctest_mode',Struct())
3209 dstore = meta.setdefault('doctest_mode',Struct())
3177 save_dstore = dstore.setdefault
3210 save_dstore = dstore.setdefault
3178
3211
3179 # save a few values we'll need to recover later
3212 # save a few values we'll need to recover later
3180 mode = save_dstore('mode',False)
3213 mode = save_dstore('mode',False)
3181 save_dstore('rc_pprint',rc.pprint)
3214 save_dstore('rc_pprint',rc.pprint)
3182 save_dstore('xmode',shell.InteractiveTB.mode)
3215 save_dstore('xmode',shell.InteractiveTB.mode)
3183 save_dstore('rc_separate_in',rc.separate_in)
3216 save_dstore('rc_separate_in',rc.separate_in)
3184 save_dstore('rc_separate_out',rc.separate_out)
3217 save_dstore('rc_separate_out',rc.separate_out)
3185 save_dstore('rc_separate_out2',rc.separate_out2)
3218 save_dstore('rc_separate_out2',rc.separate_out2)
3186 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
3219 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
3187
3220
3188 if mode == False:
3221 if mode == False:
3189 # turn on
3222 # turn on
3190 ipaste.activate_prefilter()
3223 ipaste.activate_prefilter()
3191
3224
3192 oc.prompt1.p_template = '>>> '
3225 oc.prompt1.p_template = '>>> '
3193 oc.prompt2.p_template = '... '
3226 oc.prompt2.p_template = '... '
3194 oc.prompt_out.p_template = ''
3227 oc.prompt_out.p_template = ''
3195
3228
3196 oc.prompt1.sep = '\n'
3229 oc.prompt1.sep = '\n'
3197 oc.output_sep = ''
3230 oc.output_sep = ''
3198 oc.output_sep2 = ''
3231 oc.output_sep2 = ''
3199
3232
3200 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3233 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3201 oc.prompt_out.pad_left = False
3234 oc.prompt_out.pad_left = False
3202
3235
3203 rc.pprint = False
3236 rc.pprint = False
3204
3237
3205 shell.magic_xmode('Plain')
3238 shell.magic_xmode('Plain')
3206
3239
3207 else:
3240 else:
3208 # turn off
3241 # turn off
3209 ipaste.deactivate_prefilter()
3242 ipaste.deactivate_prefilter()
3210
3243
3211 oc.prompt1.p_template = rc.prompt_in1
3244 oc.prompt1.p_template = rc.prompt_in1
3212 oc.prompt2.p_template = rc.prompt_in2
3245 oc.prompt2.p_template = rc.prompt_in2
3213 oc.prompt_out.p_template = rc.prompt_out
3246 oc.prompt_out.p_template = rc.prompt_out
3214
3247
3215 oc.prompt1.sep = dstore.rc_separate_in
3248 oc.prompt1.sep = dstore.rc_separate_in
3216 oc.output_sep = dstore.rc_separate_out
3249 oc.output_sep = dstore.rc_separate_out
3217 oc.output_sep2 = dstore.rc_separate_out2
3250 oc.output_sep2 = dstore.rc_separate_out2
3218
3251
3219 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3252 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3220 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
3253 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
3221
3254
3222 rc.pprint = dstore.rc_pprint
3255 rc.pprint = dstore.rc_pprint
3223
3256
3224 shell.magic_xmode(dstore.xmode)
3257 shell.magic_xmode(dstore.xmode)
3225
3258
3226 # Store new mode and inform
3259 # Store new mode and inform
3227 dstore.mode = bool(1-int(mode))
3260 dstore.mode = bool(1-int(mode))
3228 print 'Doctest mode is:',
3261 print 'Doctest mode is:',
3229 print ['OFF','ON'][dstore.mode]
3262 print ['OFF','ON'][dstore.mode]
3230
3263
3231 # end Magic
3264 # end Magic
@@ -1,7191 +1,7197 b''
1 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/Magic.py (magic_time): track compilation time and report
4 it if longer than 0.1s (fix done to %time and %timeit). After a
5 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
6
1 2007-09-18 Ville Vainio <vivainio@gmail.com>
7 2007-09-18 Ville Vainio <vivainio@gmail.com>
2
8
3 * genutils.py(make_quoted_expr): Do not use Itpl, it does
9 * genutils.py(make_quoted_expr): Do not use Itpl, it does
4 not support unicode at the moment. Fixes (many) magic calls with
10 not support unicode at the moment. Fixes (many) magic calls with
5 special characters.
11 special characters.
6
12
7 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
13 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
8
14
9 * IPython/genutils.py (doctest_reload): expose the doctest
15 * IPython/genutils.py (doctest_reload): expose the doctest
10 reloader to the user so that people can easily reset doctest while
16 reloader to the user so that people can easily reset doctest while
11 using it interactively. Fixes a problem reported by Jorgen.
17 using it interactively. Fixes a problem reported by Jorgen.
12
18
13 * IPython/iplib.py (InteractiveShell.__init__): protect the
19 * IPython/iplib.py (InteractiveShell.__init__): protect the
14 FakeModule instances used for __main__ in %run calls from
20 FakeModule instances used for __main__ in %run calls from
15 deletion, so that user code defined in them isn't left with
21 deletion, so that user code defined in them isn't left with
16 dangling references due to the Python module deletion machinery.
22 dangling references due to the Python module deletion machinery.
17 This should fix the problems reported by Darren.
23 This should fix the problems reported by Darren.
18
24
19 2007-09-10 Darren Dale <dd55@cornell.edu>
25 2007-09-10 Darren Dale <dd55@cornell.edu>
20
26
21 * Cleanup of IPShellQt and IPShellQt4
27 * Cleanup of IPShellQt and IPShellQt4
22
28
23 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
29 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
24
30
25 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
31 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
26 doctest support.
32 doctest support.
27
33
28 * IPython/iplib.py (safe_execfile): minor docstring improvements.
34 * IPython/iplib.py (safe_execfile): minor docstring improvements.
29
35
30 2007-09-08 Ville Vainio <vivainio@gmail.com>
36 2007-09-08 Ville Vainio <vivainio@gmail.com>
31
37
32 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
38 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
33 directory, not the target directory.
39 directory, not the target directory.
34
40
35 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
41 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
36 exception that won't print the tracebacks. Switched many magics to
42 exception that won't print the tracebacks. Switched many magics to
37 raise them on error situations, also GetoptError is not printed
43 raise them on error situations, also GetoptError is not printed
38 anymore.
44 anymore.
39
45
40 2007-09-07 Ville Vainio <vivainio@gmail.com>
46 2007-09-07 Ville Vainio <vivainio@gmail.com>
41
47
42 * iplib.py: do not auto-alias "dir", it screws up other dir auto
48 * iplib.py: do not auto-alias "dir", it screws up other dir auto
43 aliases.
49 aliases.
44
50
45 * genutils.py: SList.grep() implemented.
51 * genutils.py: SList.grep() implemented.
46
52
47 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
53 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
48 for easy "out of the box" setup of several common editors, so that
54 for easy "out of the box" setup of several common editors, so that
49 e.g. '%edit os.path.isfile' will jump to the correct line
55 e.g. '%edit os.path.isfile' will jump to the correct line
50 automatically. Contributions for command lines of your favourite
56 automatically. Contributions for command lines of your favourite
51 editors welcome.
57 editors welcome.
52
58
53 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
59 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
54
60
55 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
61 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
56 preventing source display in certain cases. In reality I think
62 preventing source display in certain cases. In reality I think
57 the problem is with Ubuntu's Python build, but this change works
63 the problem is with Ubuntu's Python build, but this change works
58 around the issue in some cases (not in all, unfortunately). I'd
64 around the issue in some cases (not in all, unfortunately). I'd
59 filed a Python bug on this with more details, but in the change of
65 filed a Python bug on this with more details, but in the change of
60 bug trackers it seems to have been lost.
66 bug trackers it seems to have been lost.
61
67
62 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
68 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
63 not the same, it's not self-documenting, doesn't allow range
69 not the same, it's not self-documenting, doesn't allow range
64 selection, and sorts alphabetically instead of numerically.
70 selection, and sorts alphabetically instead of numerically.
65 (magic_r): restore %r. No, "up + enter. One char magic" is not
71 (magic_r): restore %r. No, "up + enter. One char magic" is not
66 the same thing, since %r takes parameters to allow fast retrieval
72 the same thing, since %r takes parameters to allow fast retrieval
67 of old commands. I've received emails from users who use this a
73 of old commands. I've received emails from users who use this a
68 LOT, so it stays.
74 LOT, so it stays.
69 (magic_automagic): restore %automagic. "use _ip.option.automagic"
75 (magic_automagic): restore %automagic. "use _ip.option.automagic"
70 is not a valid replacement b/c it doesn't provide an complete
76 is not a valid replacement b/c it doesn't provide an complete
71 explanation (which the automagic docstring does).
77 explanation (which the automagic docstring does).
72 (magic_autocall): restore %autocall, with improved docstring.
78 (magic_autocall): restore %autocall, with improved docstring.
73 Same argument as for others, "use _ip.options.autocall" is not a
79 Same argument as for others, "use _ip.options.autocall" is not a
74 valid replacement.
80 valid replacement.
75 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
81 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
76 tutorials and online docs.
82 tutorials and online docs.
77
83
78 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
84 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
79
85
80 * IPython/usage.py (quick_reference): mention magics in quickref,
86 * IPython/usage.py (quick_reference): mention magics in quickref,
81 modified main banner to mention %quickref.
87 modified main banner to mention %quickref.
82
88
83 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
89 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
84
90
85 2007-09-06 Ville Vainio <vivainio@gmail.com>
91 2007-09-06 Ville Vainio <vivainio@gmail.com>
86
92
87 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
93 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
88 Callable aliases now pass the _ip as first arg. This breaks
94 Callable aliases now pass the _ip as first arg. This breaks
89 compatibility with earlier 0.8.2.svn series! (though they should
95 compatibility with earlier 0.8.2.svn series! (though they should
90 not have been in use yet outside these few extensions)
96 not have been in use yet outside these few extensions)
91
97
92 2007-09-05 Ville Vainio <vivainio@gmail.com>
98 2007-09-05 Ville Vainio <vivainio@gmail.com>
93
99
94 * external/mglob.py: expand('dirname') => ['dirname'], instead
100 * external/mglob.py: expand('dirname') => ['dirname'], instead
95 of ['dirname/foo','dirname/bar', ...].
101 of ['dirname/foo','dirname/bar', ...].
96
102
97 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
103 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
98 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
104 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
99 is useful for others as well).
105 is useful for others as well).
100
106
101 * iplib.py: on callable aliases (as opposed to old style aliases),
107 * iplib.py: on callable aliases (as opposed to old style aliases),
102 do var_expand() immediately, and use make_quoted_expr instead
108 do var_expand() immediately, and use make_quoted_expr instead
103 of hardcoded r"""
109 of hardcoded r"""
104
110
105 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
111 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
106 if not available load ipy_fsops.py for cp, mv, etc. replacements
112 if not available load ipy_fsops.py for cp, mv, etc. replacements
107
113
108 * OInspect.py, ipy_which.py: improve %which and obj? for callable
114 * OInspect.py, ipy_which.py: improve %which and obj? for callable
109 aliases
115 aliases
110
116
111 2007-09-04 Ville Vainio <vivainio@gmail.com>
117 2007-09-04 Ville Vainio <vivainio@gmail.com>
112
118
113 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
119 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
114 Relicensed under BSD with the authors approval.
120 Relicensed under BSD with the authors approval.
115
121
116 * ipmaker.py, usage.py: Remove %magic from default banner, improve
122 * ipmaker.py, usage.py: Remove %magic from default banner, improve
117 %quickref
123 %quickref
118
124
119 2007-09-03 Ville Vainio <vivainio@gmail.com>
125 2007-09-03 Ville Vainio <vivainio@gmail.com>
120
126
121 * Magic.py: %time now passes expression through prefilter,
127 * Magic.py: %time now passes expression through prefilter,
122 allowing IPython syntax.
128 allowing IPython syntax.
123
129
124 2007-09-01 Ville Vainio <vivainio@gmail.com>
130 2007-09-01 Ville Vainio <vivainio@gmail.com>
125
131
126 * ipmaker.py: Always show full traceback when newstyle config fails
132 * ipmaker.py: Always show full traceback when newstyle config fails
127
133
128 2007-08-27 Ville Vainio <vivainio@gmail.com>
134 2007-08-27 Ville Vainio <vivainio@gmail.com>
129
135
130 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
136 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
131
137
132 2007-08-26 Ville Vainio <vivainio@gmail.com>
138 2007-08-26 Ville Vainio <vivainio@gmail.com>
133
139
134 * ipmaker.py: Command line args have the highest priority again
140 * ipmaker.py: Command line args have the highest priority again
135
141
136 * iplib.py, ipmaker.py: -i command line argument now behaves as in
142 * iplib.py, ipmaker.py: -i command line argument now behaves as in
137 normal python, i.e. leaves the IPython session running after -c
143 normal python, i.e. leaves the IPython session running after -c
138 command or running a batch file from command line.
144 command or running a batch file from command line.
139
145
140 2007-08-22 Ville Vainio <vivainio@gmail.com>
146 2007-08-22 Ville Vainio <vivainio@gmail.com>
141
147
142 * iplib.py: no extra empty (last) line in raw hist w/ multiline
148 * iplib.py: no extra empty (last) line in raw hist w/ multiline
143 statements
149 statements
144
150
145 * logger.py: Fix bug where blank lines in history were not
151 * logger.py: Fix bug where blank lines in history were not
146 added until AFTER adding the current line; translated and raw
152 added until AFTER adding the current line; translated and raw
147 history should finally be in sync with prompt now.
153 history should finally be in sync with prompt now.
148
154
149 * ipy_completers.py: quick_completer now makes it easy to create
155 * ipy_completers.py: quick_completer now makes it easy to create
150 trivial custom completers
156 trivial custom completers
151
157
152 * clearcmd.py: shadow history compression & erasing, fixed input hist
158 * clearcmd.py: shadow history compression & erasing, fixed input hist
153 clearing.
159 clearing.
154
160
155 * envpersist.py, history.py: %env (sh profile only), %hist completers
161 * envpersist.py, history.py: %env (sh profile only), %hist completers
156
162
157 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
163 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
158 term title now include the drive letter, and always use / instead of
164 term title now include the drive letter, and always use / instead of
159 os.sep (as per recommended approach for win32 ipython in general).
165 os.sep (as per recommended approach for win32 ipython in general).
160
166
161 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
167 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
162 plain python scripts from ipykit command line by running
168 plain python scripts from ipykit command line by running
163 "py myscript.py", even w/o installed python.
169 "py myscript.py", even w/o installed python.
164
170
165 2007-08-21 Ville Vainio <vivainio@gmail.com>
171 2007-08-21 Ville Vainio <vivainio@gmail.com>
166
172
167 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
173 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
168 (for backwards compatibility)
174 (for backwards compatibility)
169
175
170 * history.py: switch back to %hist -t from %hist -r as default.
176 * history.py: switch back to %hist -t from %hist -r as default.
171 At least until raw history is fixed for good.
177 At least until raw history is fixed for good.
172
178
173 2007-08-20 Ville Vainio <vivainio@gmail.com>
179 2007-08-20 Ville Vainio <vivainio@gmail.com>
174
180
175 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
181 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
176 locate alias redeclarations etc. Also, avoid handling
182 locate alias redeclarations etc. Also, avoid handling
177 _ip.IP.alias_table directly, prefer using _ip.defalias.
183 _ip.IP.alias_table directly, prefer using _ip.defalias.
178
184
179
185
180 2007-08-15 Ville Vainio <vivainio@gmail.com>
186 2007-08-15 Ville Vainio <vivainio@gmail.com>
181
187
182 * prefilter.py: ! is now always served first
188 * prefilter.py: ! is now always served first
183
189
184 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
190 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
185
191
186 * IPython/iplib.py (safe_execfile): fix the SystemExit
192 * IPython/iplib.py (safe_execfile): fix the SystemExit
187 auto-suppression code to work in Python2.4 (the internal structure
193 auto-suppression code to work in Python2.4 (the internal structure
188 of that exception changed and I'd only tested the code with 2.5).
194 of that exception changed and I'd only tested the code with 2.5).
189 Bug reported by a SciPy attendee.
195 Bug reported by a SciPy attendee.
190
196
191 2007-08-13 Ville Vainio <vivainio@gmail.com>
197 2007-08-13 Ville Vainio <vivainio@gmail.com>
192
198
193 * prefilter.py: reverted !c:/bin/foo fix, made % in
199 * prefilter.py: reverted !c:/bin/foo fix, made % in
194 multiline specials work again
200 multiline specials work again
195
201
196 2007-08-13 Ville Vainio <vivainio@gmail.com>
202 2007-08-13 Ville Vainio <vivainio@gmail.com>
197
203
198 * prefilter.py: Take more care to special-case !, so that
204 * prefilter.py: Take more care to special-case !, so that
199 !c:/bin/foo.exe works.
205 !c:/bin/foo.exe works.
200
206
201 * setup.py: if we are building eggs, strip all docs and
207 * setup.py: if we are building eggs, strip all docs and
202 examples (it doesn't make sense to bytecompile examples,
208 examples (it doesn't make sense to bytecompile examples,
203 and docs would be in an awkward place anyway).
209 and docs would be in an awkward place anyway).
204
210
205 * Ryan Krauss' patch fixes start menu shortcuts when IPython
211 * Ryan Krauss' patch fixes start menu shortcuts when IPython
206 is installed into a directory that has spaces in the name.
212 is installed into a directory that has spaces in the name.
207
213
208 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
214 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
209
215
210 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
216 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
211 doctest profile and %doctest_mode, so they actually generate the
217 doctest profile and %doctest_mode, so they actually generate the
212 blank lines needed by doctest to separate individual tests.
218 blank lines needed by doctest to separate individual tests.
213
219
214 * IPython/iplib.py (safe_execfile): modify so that running code
220 * IPython/iplib.py (safe_execfile): modify so that running code
215 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
221 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
216 doesn't get a printed traceback. Any other value in sys.exit(),
222 doesn't get a printed traceback. Any other value in sys.exit(),
217 including the empty call, still generates a traceback. This
223 including the empty call, still generates a traceback. This
218 enables use of %run without having to pass '-e' for codes that
224 enables use of %run without having to pass '-e' for codes that
219 correctly set the exit status flag.
225 correctly set the exit status flag.
220
226
221 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
227 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
222
228
223 * IPython/iplib.py (InteractiveShell.post_config_initialization):
229 * IPython/iplib.py (InteractiveShell.post_config_initialization):
224 fix problems with doctests failing when run inside IPython due to
230 fix problems with doctests failing when run inside IPython due to
225 IPython's modifications of sys.displayhook.
231 IPython's modifications of sys.displayhook.
226
232
227 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
233 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
228
234
229 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
235 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
230 a string with names.
236 a string with names.
231
237
232 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
238 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
233
239
234 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
240 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
235 magic to toggle on/off the doctest pasting support without having
241 magic to toggle on/off the doctest pasting support without having
236 to leave a session to switch to a separate profile.
242 to leave a session to switch to a separate profile.
237
243
238 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
244 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
239
245
240 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
246 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
241 introduce a blank line between inputs, to conform to doctest
247 introduce a blank line between inputs, to conform to doctest
242 requirements.
248 requirements.
243
249
244 * IPython/OInspect.py (Inspector.pinfo): fix another part where
250 * IPython/OInspect.py (Inspector.pinfo): fix another part where
245 auto-generated docstrings for new-style classes were showing up.
251 auto-generated docstrings for new-style classes were showing up.
246
252
247 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
253 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
248
254
249 * api_changes: Add new file to track backward-incompatible
255 * api_changes: Add new file to track backward-incompatible
250 user-visible changes.
256 user-visible changes.
251
257
252 2007-08-06 Ville Vainio <vivainio@gmail.com>
258 2007-08-06 Ville Vainio <vivainio@gmail.com>
253
259
254 * ipmaker.py: fix bug where user_config_ns didn't exist at all
260 * ipmaker.py: fix bug where user_config_ns didn't exist at all
255 before all the config files were handled.
261 before all the config files were handled.
256
262
257 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
263 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
258
264
259 * IPython/irunner.py (RunnerFactory): Add new factory class for
265 * IPython/irunner.py (RunnerFactory): Add new factory class for
260 creating reusable runners based on filenames.
266 creating reusable runners based on filenames.
261
267
262 * IPython/Extensions/ipy_profile_doctest.py: New profile for
268 * IPython/Extensions/ipy_profile_doctest.py: New profile for
263 doctest support. It sets prompts/exceptions as similar to
269 doctest support. It sets prompts/exceptions as similar to
264 standard Python as possible, so that ipython sessions in this
270 standard Python as possible, so that ipython sessions in this
265 profile can be easily pasted as doctests with minimal
271 profile can be easily pasted as doctests with minimal
266 modifications. It also enables pasting of doctests from external
272 modifications. It also enables pasting of doctests from external
267 sources (even if they have leading whitespace), so that you can
273 sources (even if they have leading whitespace), so that you can
268 rerun doctests from existing sources.
274 rerun doctests from existing sources.
269
275
270 * IPython/iplib.py (_prefilter): fix a buglet where after entering
276 * IPython/iplib.py (_prefilter): fix a buglet where after entering
271 some whitespace, the prompt would become a continuation prompt
277 some whitespace, the prompt would become a continuation prompt
272 with no way of exiting it other than Ctrl-C. This fix brings us
278 with no way of exiting it other than Ctrl-C. This fix brings us
273 into conformity with how the default python prompt works.
279 into conformity with how the default python prompt works.
274
280
275 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
281 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
276 Add support for pasting not only lines that start with '>>>', but
282 Add support for pasting not only lines that start with '>>>', but
277 also with ' >>>'. That is, arbitrary whitespace can now precede
283 also with ' >>>'. That is, arbitrary whitespace can now precede
278 the prompts. This makes the system useful for pasting doctests
284 the prompts. This makes the system useful for pasting doctests
279 from docstrings back into a normal session.
285 from docstrings back into a normal session.
280
286
281 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
287 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
282
288
283 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
289 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
284 r1357, which had killed multiple invocations of an embedded
290 r1357, which had killed multiple invocations of an embedded
285 ipython (this means that example-embed has been broken for over 1
291 ipython (this means that example-embed has been broken for over 1
286 year!!!). Rather than possibly breaking the batch stuff for which
292 year!!!). Rather than possibly breaking the batch stuff for which
287 the code in iplib.py/interact was introduced, I worked around the
293 the code in iplib.py/interact was introduced, I worked around the
288 problem in the embedding class in Shell.py. We really need a
294 problem in the embedding class in Shell.py. We really need a
289 bloody test suite for this code, I'm sick of finding stuff that
295 bloody test suite for this code, I'm sick of finding stuff that
290 used to work breaking left and right every time I use an old
296 used to work breaking left and right every time I use an old
291 feature I hadn't touched in a few months.
297 feature I hadn't touched in a few months.
292 (kill_embedded): Add a new magic that only shows up in embedded
298 (kill_embedded): Add a new magic that only shows up in embedded
293 mode, to allow users to permanently deactivate an embedded instance.
299 mode, to allow users to permanently deactivate an embedded instance.
294
300
295 2007-08-01 Ville Vainio <vivainio@gmail.com>
301 2007-08-01 Ville Vainio <vivainio@gmail.com>
296
302
297 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
303 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
298 history gets out of sync on runlines (e.g. when running macros).
304 history gets out of sync on runlines (e.g. when running macros).
299
305
300 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
306 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
301
307
302 * IPython/Magic.py (magic_colors): fix win32-related error message
308 * IPython/Magic.py (magic_colors): fix win32-related error message
303 that could appear under *nix when readline was missing. Patch by
309 that could appear under *nix when readline was missing. Patch by
304 Scott Jackson, closes #175.
310 Scott Jackson, closes #175.
305
311
306 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
312 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
307
313
308 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
314 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
309 completer that it traits-aware, so that traits objects don't show
315 completer that it traits-aware, so that traits objects don't show
310 all of their internal attributes all the time.
316 all of their internal attributes all the time.
311
317
312 * IPython/genutils.py (dir2): moved this code from inside
318 * IPython/genutils.py (dir2): moved this code from inside
313 completer.py to expose it publicly, so I could use it in the
319 completer.py to expose it publicly, so I could use it in the
314 wildcards bugfix.
320 wildcards bugfix.
315
321
316 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
322 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
317 Stefan with Traits.
323 Stefan with Traits.
318
324
319 * IPython/completer.py (Completer.attr_matches): change internal
325 * IPython/completer.py (Completer.attr_matches): change internal
320 var name from 'object' to 'obj', since 'object' is now a builtin
326 var name from 'object' to 'obj', since 'object' is now a builtin
321 and this can lead to weird bugs if reusing this code elsewhere.
327 and this can lead to weird bugs if reusing this code elsewhere.
322
328
323 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
329 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
324
330
325 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
331 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
326 'foo?' and update the code to prevent printing of default
332 'foo?' and update the code to prevent printing of default
327 docstrings that started appearing after I added support for
333 docstrings that started appearing after I added support for
328 new-style classes. The approach I'm using isn't ideal (I just
334 new-style classes. The approach I'm using isn't ideal (I just
329 special-case those strings) but I'm not sure how to more robustly
335 special-case those strings) but I'm not sure how to more robustly
330 differentiate between truly user-written strings and Python's
336 differentiate between truly user-written strings and Python's
331 automatic ones.
337 automatic ones.
332
338
333 2007-07-09 Ville Vainio <vivainio@gmail.com>
339 2007-07-09 Ville Vainio <vivainio@gmail.com>
334
340
335 * completer.py: Applied Matthew Neeley's patch:
341 * completer.py: Applied Matthew Neeley's patch:
336 Dynamic attributes from trait_names and _getAttributeNames are added
342 Dynamic attributes from trait_names and _getAttributeNames are added
337 to the list of tab completions, but when this happens, the attribute
343 to the list of tab completions, but when this happens, the attribute
338 list is turned into a set, so the attributes are unordered when
344 list is turned into a set, so the attributes are unordered when
339 printed, which makes it hard to find the right completion. This patch
345 printed, which makes it hard to find the right completion. This patch
340 turns this set back into a list and sort it.
346 turns this set back into a list and sort it.
341
347
342 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
348 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
343
349
344 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
350 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
345 classes in various inspector functions.
351 classes in various inspector functions.
346
352
347 2007-06-28 Ville Vainio <vivainio@gmail.com>
353 2007-06-28 Ville Vainio <vivainio@gmail.com>
348
354
349 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
355 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
350 Implement "shadow" namespace, and callable aliases that reside there.
356 Implement "shadow" namespace, and callable aliases that reside there.
351 Use them by:
357 Use them by:
352
358
353 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
359 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
354
360
355 foo hello world
361 foo hello world
356 (gets translated to:)
362 (gets translated to:)
357 _sh.foo(r"""hello world""")
363 _sh.foo(r"""hello world""")
358
364
359 In practice, this kind of alias can take the role of a magic function
365 In practice, this kind of alias can take the role of a magic function
360
366
361 * New generic inspect_object, called on obj? and obj??
367 * New generic inspect_object, called on obj? and obj??
362
368
363 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
369 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
364
370
365 * IPython/ultraTB.py (findsource): fix a problem with
371 * IPython/ultraTB.py (findsource): fix a problem with
366 inspect.getfile that can cause crashes during traceback construction.
372 inspect.getfile that can cause crashes during traceback construction.
367
373
368 2007-06-14 Ville Vainio <vivainio@gmail.com>
374 2007-06-14 Ville Vainio <vivainio@gmail.com>
369
375
370 * iplib.py (handle_auto): Try to use ascii for printing "--->"
376 * iplib.py (handle_auto): Try to use ascii for printing "--->"
371 autocall rewrite indication, becausesometimes unicode fails to print
377 autocall rewrite indication, becausesometimes unicode fails to print
372 properly (and you get ' - - - '). Use plain uncoloured ---> for
378 properly (and you get ' - - - '). Use plain uncoloured ---> for
373 unicode.
379 unicode.
374
380
375 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
381 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
376
382
377 . pickleshare 'hash' commands (hget, hset, hcompress,
383 . pickleshare 'hash' commands (hget, hset, hcompress,
378 hdict) for efficient shadow history storage.
384 hdict) for efficient shadow history storage.
379
385
380 2007-06-13 Ville Vainio <vivainio@gmail.com>
386 2007-06-13 Ville Vainio <vivainio@gmail.com>
381
387
382 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
388 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
383 Added kw arg 'interactive', tell whether vars should be visible
389 Added kw arg 'interactive', tell whether vars should be visible
384 with %whos.
390 with %whos.
385
391
386 2007-06-11 Ville Vainio <vivainio@gmail.com>
392 2007-06-11 Ville Vainio <vivainio@gmail.com>
387
393
388 * pspersistence.py, Magic.py, iplib.py: directory history now saved
394 * pspersistence.py, Magic.py, iplib.py: directory history now saved
389 to db
395 to db
390
396
391 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
397 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
392 Also, it exits IPython immediately after evaluating the command (just like
398 Also, it exits IPython immediately after evaluating the command (just like
393 std python)
399 std python)
394
400
395 2007-06-05 Walter Doerwald <walter@livinglogic.de>
401 2007-06-05 Walter Doerwald <walter@livinglogic.de>
396
402
397 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
403 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
398 Python string and captures the output. (Idea and original patch by
404 Python string and captures the output. (Idea and original patch by
399 Stefan van der Walt)
405 Stefan van der Walt)
400
406
401 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
407 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
402
408
403 * IPython/ultraTB.py (VerboseTB.text): update printing of
409 * IPython/ultraTB.py (VerboseTB.text): update printing of
404 exception types for Python 2.5 (now all exceptions in the stdlib
410 exception types for Python 2.5 (now all exceptions in the stdlib
405 are new-style classes).
411 are new-style classes).
406
412
407 2007-05-31 Walter Doerwald <walter@livinglogic.de>
413 2007-05-31 Walter Doerwald <walter@livinglogic.de>
408
414
409 * IPython/Extensions/igrid.py: Add new commands refresh and
415 * IPython/Extensions/igrid.py: Add new commands refresh and
410 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
416 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
411 the iterator once (refresh) or after every x seconds (refresh_timer).
417 the iterator once (refresh) or after every x seconds (refresh_timer).
412 Add a working implementation of "searchexpression", where the text
418 Add a working implementation of "searchexpression", where the text
413 entered is not the text to search for, but an expression that must
419 entered is not the text to search for, but an expression that must
414 be true. Added display of shortcuts to the menu. Added commands "pickinput"
420 be true. Added display of shortcuts to the menu. Added commands "pickinput"
415 and "pickinputattr" that put the object or attribute under the cursor
421 and "pickinputattr" that put the object or attribute under the cursor
416 in the input line. Split the statusbar to be able to display the currently
422 in the input line. Split the statusbar to be able to display the currently
417 active refresh interval. (Patch by Nik Tautenhahn)
423 active refresh interval. (Patch by Nik Tautenhahn)
418
424
419 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
425 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
420
426
421 * fixing set_term_title to use ctypes as default
427 * fixing set_term_title to use ctypes as default
422
428
423 * fixing set_term_title fallback to work when curent dir
429 * fixing set_term_title fallback to work when curent dir
424 is on a windows network share
430 is on a windows network share
425
431
426 2007-05-28 Ville Vainio <vivainio@gmail.com>
432 2007-05-28 Ville Vainio <vivainio@gmail.com>
427
433
428 * %cpaste: strip + with > from left (diffs).
434 * %cpaste: strip + with > from left (diffs).
429
435
430 * iplib.py: Fix crash when readline not installed
436 * iplib.py: Fix crash when readline not installed
431
437
432 2007-05-26 Ville Vainio <vivainio@gmail.com>
438 2007-05-26 Ville Vainio <vivainio@gmail.com>
433
439
434 * generics.py: intruduce easy to extend result_display generic
440 * generics.py: intruduce easy to extend result_display generic
435 function (using simplegeneric.py).
441 function (using simplegeneric.py).
436
442
437 * Fixed the append functionality of %set.
443 * Fixed the append functionality of %set.
438
444
439 2007-05-25 Ville Vainio <vivainio@gmail.com>
445 2007-05-25 Ville Vainio <vivainio@gmail.com>
440
446
441 * New magic: %rep (fetch / run old commands from history)
447 * New magic: %rep (fetch / run old commands from history)
442
448
443 * New extension: mglob (%mglob magic), for powerful glob / find /filter
449 * New extension: mglob (%mglob magic), for powerful glob / find /filter
444 like functionality
450 like functionality
445
451
446 % maghistory.py: %hist -g PATTERM greps the history for pattern
452 % maghistory.py: %hist -g PATTERM greps the history for pattern
447
453
448 2007-05-24 Walter Doerwald <walter@livinglogic.de>
454 2007-05-24 Walter Doerwald <walter@livinglogic.de>
449
455
450 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
456 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
451 browse the IPython input history
457 browse the IPython input history
452
458
453 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
459 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
454 (mapped to "i") can be used to put the object under the curser in the input
460 (mapped to "i") can be used to put the object under the curser in the input
455 line. pickinputattr (mapped to "I") does the same for the attribute under
461 line. pickinputattr (mapped to "I") does the same for the attribute under
456 the cursor.
462 the cursor.
457
463
458 2007-05-24 Ville Vainio <vivainio@gmail.com>
464 2007-05-24 Ville Vainio <vivainio@gmail.com>
459
465
460 * Grand magic cleansing (changeset [2380]):
466 * Grand magic cleansing (changeset [2380]):
461
467
462 * Introduce ipy_legacy.py where the following magics were
468 * Introduce ipy_legacy.py where the following magics were
463 moved:
469 moved:
464
470
465 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
471 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
466
472
467 If you need them, either use default profile or "import ipy_legacy"
473 If you need them, either use default profile or "import ipy_legacy"
468 in your ipy_user_conf.py
474 in your ipy_user_conf.py
469
475
470 * Move sh and scipy profile to Extensions from UserConfig. this implies
476 * Move sh and scipy profile to Extensions from UserConfig. this implies
471 you should not edit them, but you don't need to run %upgrade when
477 you should not edit them, but you don't need to run %upgrade when
472 upgrading IPython anymore.
478 upgrading IPython anymore.
473
479
474 * %hist/%history now operates in "raw" mode by default. To get the old
480 * %hist/%history now operates in "raw" mode by default. To get the old
475 behaviour, run '%hist -n' (native mode).
481 behaviour, run '%hist -n' (native mode).
476
482
477 * split ipy_stock_completers.py to ipy_stock_completers.py and
483 * split ipy_stock_completers.py to ipy_stock_completers.py and
478 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
484 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
479 installed as default.
485 installed as default.
480
486
481 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
487 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
482 handling.
488 handling.
483
489
484 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
490 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
485 input if readline is available.
491 input if readline is available.
486
492
487 2007-05-23 Ville Vainio <vivainio@gmail.com>
493 2007-05-23 Ville Vainio <vivainio@gmail.com>
488
494
489 * macro.py: %store uses __getstate__ properly
495 * macro.py: %store uses __getstate__ properly
490
496
491 * exesetup.py: added new setup script for creating
497 * exesetup.py: added new setup script for creating
492 standalone IPython executables with py2exe (i.e.
498 standalone IPython executables with py2exe (i.e.
493 no python installation required).
499 no python installation required).
494
500
495 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
501 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
496 its place.
502 its place.
497
503
498 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
504 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
499
505
500 2007-05-21 Ville Vainio <vivainio@gmail.com>
506 2007-05-21 Ville Vainio <vivainio@gmail.com>
501
507
502 * platutil_win32.py (set_term_title): handle
508 * platutil_win32.py (set_term_title): handle
503 failure of 'title' system call properly.
509 failure of 'title' system call properly.
504
510
505 2007-05-17 Walter Doerwald <walter@livinglogic.de>
511 2007-05-17 Walter Doerwald <walter@livinglogic.de>
506
512
507 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
513 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
508 (Bug detected by Paul Mueller).
514 (Bug detected by Paul Mueller).
509
515
510 2007-05-16 Ville Vainio <vivainio@gmail.com>
516 2007-05-16 Ville Vainio <vivainio@gmail.com>
511
517
512 * ipy_profile_sci.py, ipython_win_post_install.py: Create
518 * ipy_profile_sci.py, ipython_win_post_install.py: Create
513 new "sci" profile, effectively a modern version of the old
519 new "sci" profile, effectively a modern version of the old
514 "scipy" profile (which is now slated for deprecation).
520 "scipy" profile (which is now slated for deprecation).
515
521
516 2007-05-15 Ville Vainio <vivainio@gmail.com>
522 2007-05-15 Ville Vainio <vivainio@gmail.com>
517
523
518 * pycolorize.py, pycolor.1: Paul Mueller's patches that
524 * pycolorize.py, pycolor.1: Paul Mueller's patches that
519 make pycolorize read input from stdin when run without arguments.
525 make pycolorize read input from stdin when run without arguments.
520
526
521 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
527 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
522
528
523 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
529 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
524 it in sh profile (instead of ipy_system_conf.py).
530 it in sh profile (instead of ipy_system_conf.py).
525
531
526 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
532 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
527 aliases are now lower case on windows (MyCommand.exe => mycommand).
533 aliases are now lower case on windows (MyCommand.exe => mycommand).
528
534
529 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
535 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
530 Macros are now callable objects that inherit from ipapi.IPyAutocall,
536 Macros are now callable objects that inherit from ipapi.IPyAutocall,
531 i.e. get autocalled regardless of system autocall setting.
537 i.e. get autocalled regardless of system autocall setting.
532
538
533 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
539 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
534
540
535 * IPython/rlineimpl.py: check for clear_history in readline and
541 * IPython/rlineimpl.py: check for clear_history in readline and
536 make it a dummy no-op if not available. This function isn't
542 make it a dummy no-op if not available. This function isn't
537 guaranteed to be in the API and appeared in Python 2.4, so we need
543 guaranteed to be in the API and appeared in Python 2.4, so we need
538 to check it ourselves. Also, clean up this file quite a bit.
544 to check it ourselves. Also, clean up this file quite a bit.
539
545
540 * ipython.1: update man page and full manual with information
546 * ipython.1: update man page and full manual with information
541 about threads (remove outdated warning). Closes #151.
547 about threads (remove outdated warning). Closes #151.
542
548
543 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
549 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
544
550
545 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
551 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
546 in trunk (note that this made it into the 0.8.1 release already,
552 in trunk (note that this made it into the 0.8.1 release already,
547 but the changelogs didn't get coordinated). Many thanks to Gael
553 but the changelogs didn't get coordinated). Many thanks to Gael
548 Varoquaux <gael.varoquaux-AT-normalesup.org>
554 Varoquaux <gael.varoquaux-AT-normalesup.org>
549
555
550 2007-05-09 *** Released version 0.8.1
556 2007-05-09 *** Released version 0.8.1
551
557
552 2007-05-10 Walter Doerwald <walter@livinglogic.de>
558 2007-05-10 Walter Doerwald <walter@livinglogic.de>
553
559
554 * IPython/Extensions/igrid.py: Incorporate html help into
560 * IPython/Extensions/igrid.py: Incorporate html help into
555 the module, so we don't have to search for the file.
561 the module, so we don't have to search for the file.
556
562
557 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
563 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
558
564
559 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
565 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
560
566
561 2007-04-30 Ville Vainio <vivainio@gmail.com>
567 2007-04-30 Ville Vainio <vivainio@gmail.com>
562
568
563 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
569 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
564 user has illegal (non-ascii) home directory name
570 user has illegal (non-ascii) home directory name
565
571
566 2007-04-27 Ville Vainio <vivainio@gmail.com>
572 2007-04-27 Ville Vainio <vivainio@gmail.com>
567
573
568 * platutils_win32.py: implement set_term_title for windows
574 * platutils_win32.py: implement set_term_title for windows
569
575
570 * Update version number
576 * Update version number
571
577
572 * ipy_profile_sh.py: more informative prompt (2 dir levels)
578 * ipy_profile_sh.py: more informative prompt (2 dir levels)
573
579
574 2007-04-26 Walter Doerwald <walter@livinglogic.de>
580 2007-04-26 Walter Doerwald <walter@livinglogic.de>
575
581
576 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
582 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
577 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
583 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
578 bug discovered by Ville).
584 bug discovered by Ville).
579
585
580 2007-04-26 Ville Vainio <vivainio@gmail.com>
586 2007-04-26 Ville Vainio <vivainio@gmail.com>
581
587
582 * Extensions/ipy_completers.py: Olivier's module completer now
588 * Extensions/ipy_completers.py: Olivier's module completer now
583 saves the list of root modules if it takes > 4 secs on the first run.
589 saves the list of root modules if it takes > 4 secs on the first run.
584
590
585 * Magic.py (%rehashx): %rehashx now clears the completer cache
591 * Magic.py (%rehashx): %rehashx now clears the completer cache
586
592
587
593
588 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
594 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
589
595
590 * ipython.el: fix incorrect color scheme, reported by Stefan.
596 * ipython.el: fix incorrect color scheme, reported by Stefan.
591 Closes #149.
597 Closes #149.
592
598
593 * IPython/PyColorize.py (Parser.format2): fix state-handling
599 * IPython/PyColorize.py (Parser.format2): fix state-handling
594 logic. I still don't like how that code handles state, but at
600 logic. I still don't like how that code handles state, but at
595 least now it should be correct, if inelegant. Closes #146.
601 least now it should be correct, if inelegant. Closes #146.
596
602
597 2007-04-25 Ville Vainio <vivainio@gmail.com>
603 2007-04-25 Ville Vainio <vivainio@gmail.com>
598
604
599 * Extensions/ipy_which.py: added extension for %which magic, works
605 * Extensions/ipy_which.py: added extension for %which magic, works
600 a lot like unix 'which' but also finds and expands aliases, and
606 a lot like unix 'which' but also finds and expands aliases, and
601 allows wildcards.
607 allows wildcards.
602
608
603 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
609 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
604 as opposed to returning nothing.
610 as opposed to returning nothing.
605
611
606 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
612 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
607 ipy_stock_completers on default profile, do import on sh profile.
613 ipy_stock_completers on default profile, do import on sh profile.
608
614
609 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
615 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
610
616
611 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
617 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
612 like ipython.py foo.py which raised a IndexError.
618 like ipython.py foo.py which raised a IndexError.
613
619
614 2007-04-21 Ville Vainio <vivainio@gmail.com>
620 2007-04-21 Ville Vainio <vivainio@gmail.com>
615
621
616 * Extensions/ipy_extutil.py: added extension to manage other ipython
622 * Extensions/ipy_extutil.py: added extension to manage other ipython
617 extensions. Now only supports 'ls' == list extensions.
623 extensions. Now only supports 'ls' == list extensions.
618
624
619 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
625 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
620
626
621 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
627 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
622 would prevent use of the exception system outside of a running
628 would prevent use of the exception system outside of a running
623 IPython instance.
629 IPython instance.
624
630
625 2007-04-20 Ville Vainio <vivainio@gmail.com>
631 2007-04-20 Ville Vainio <vivainio@gmail.com>
626
632
627 * Extensions/ipy_render.py: added extension for easy
633 * Extensions/ipy_render.py: added extension for easy
628 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
634 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
629 'Iptl' template notation,
635 'Iptl' template notation,
630
636
631 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
637 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
632 safer & faster 'import' completer.
638 safer & faster 'import' completer.
633
639
634 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
640 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
635 and _ip.defalias(name, command).
641 and _ip.defalias(name, command).
636
642
637 * Extensions/ipy_exportdb.py: New extension for exporting all the
643 * Extensions/ipy_exportdb.py: New extension for exporting all the
638 %store'd data in a portable format (normal ipapi calls like
644 %store'd data in a portable format (normal ipapi calls like
639 defmacro() etc.)
645 defmacro() etc.)
640
646
641 2007-04-19 Ville Vainio <vivainio@gmail.com>
647 2007-04-19 Ville Vainio <vivainio@gmail.com>
642
648
643 * upgrade_dir.py: skip junk files like *.pyc
649 * upgrade_dir.py: skip junk files like *.pyc
644
650
645 * Release.py: version number to 0.8.1
651 * Release.py: version number to 0.8.1
646
652
647 2007-04-18 Ville Vainio <vivainio@gmail.com>
653 2007-04-18 Ville Vainio <vivainio@gmail.com>
648
654
649 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
655 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
650 and later on win32.
656 and later on win32.
651
657
652 2007-04-16 Ville Vainio <vivainio@gmail.com>
658 2007-04-16 Ville Vainio <vivainio@gmail.com>
653
659
654 * iplib.py (showtraceback): Do not crash when running w/o readline.
660 * iplib.py (showtraceback): Do not crash when running w/o readline.
655
661
656 2007-04-12 Walter Doerwald <walter@livinglogic.de>
662 2007-04-12 Walter Doerwald <walter@livinglogic.de>
657
663
658 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
664 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
659 sorted (case sensitive with files and dirs mixed).
665 sorted (case sensitive with files and dirs mixed).
660
666
661 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
667 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
662
668
663 * IPython/Release.py (version): Open trunk for 0.8.1 development.
669 * IPython/Release.py (version): Open trunk for 0.8.1 development.
664
670
665 2007-04-10 *** Released version 0.8.0
671 2007-04-10 *** Released version 0.8.0
666
672
667 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
673 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
668
674
669 * Tag 0.8.0 for release.
675 * Tag 0.8.0 for release.
670
676
671 * IPython/iplib.py (reloadhist): add API function to cleanly
677 * IPython/iplib.py (reloadhist): add API function to cleanly
672 reload the readline history, which was growing inappropriately on
678 reload the readline history, which was growing inappropriately on
673 every %run call.
679 every %run call.
674
680
675 * win32_manual_post_install.py (run): apply last part of Nicolas
681 * win32_manual_post_install.py (run): apply last part of Nicolas
676 Pernetty's patch (I'd accidentally applied it in a different
682 Pernetty's patch (I'd accidentally applied it in a different
677 directory and this particular file didn't get patched).
683 directory and this particular file didn't get patched).
678
684
679 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
685 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
680
686
681 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
687 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
682 find the main thread id and use the proper API call. Thanks to
688 find the main thread id and use the proper API call. Thanks to
683 Stefan for the fix.
689 Stefan for the fix.
684
690
685 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
691 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
686 unit tests to reflect fixed ticket #52, and add more tests sent by
692 unit tests to reflect fixed ticket #52, and add more tests sent by
687 him.
693 him.
688
694
689 * IPython/iplib.py (raw_input): restore the readline completer
695 * IPython/iplib.py (raw_input): restore the readline completer
690 state on every input, in case third-party code messed it up.
696 state on every input, in case third-party code messed it up.
691 (_prefilter): revert recent addition of early-escape checks which
697 (_prefilter): revert recent addition of early-escape checks which
692 prevent many valid alias calls from working.
698 prevent many valid alias calls from working.
693
699
694 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
700 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
695 flag for sigint handler so we don't run a full signal() call on
701 flag for sigint handler so we don't run a full signal() call on
696 each runcode access.
702 each runcode access.
697
703
698 * IPython/Magic.py (magic_whos): small improvement to diagnostic
704 * IPython/Magic.py (magic_whos): small improvement to diagnostic
699 message.
705 message.
700
706
701 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
707 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
702
708
703 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
709 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
704 asynchronous exceptions working, i.e., Ctrl-C can actually
710 asynchronous exceptions working, i.e., Ctrl-C can actually
705 interrupt long-running code in the multithreaded shells.
711 interrupt long-running code in the multithreaded shells.
706
712
707 This is using Tomer Filiba's great ctypes-based trick:
713 This is using Tomer Filiba's great ctypes-based trick:
708 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
714 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
709 this in the past, but hadn't been able to make it work before. So
715 this in the past, but hadn't been able to make it work before. So
710 far it looks like it's actually running, but this needs more
716 far it looks like it's actually running, but this needs more
711 testing. If it really works, I'll be *very* happy, and we'll owe
717 testing. If it really works, I'll be *very* happy, and we'll owe
712 a huge thank you to Tomer. My current implementation is ugly,
718 a huge thank you to Tomer. My current implementation is ugly,
713 hackish and uses nasty globals, but I don't want to try and clean
719 hackish and uses nasty globals, but I don't want to try and clean
714 anything up until we know if it actually works.
720 anything up until we know if it actually works.
715
721
716 NOTE: this feature needs ctypes to work. ctypes is included in
722 NOTE: this feature needs ctypes to work. ctypes is included in
717 Python2.5, but 2.4 users will need to manually install it. This
723 Python2.5, but 2.4 users will need to manually install it. This
718 feature makes multi-threaded shells so much more usable that it's
724 feature makes multi-threaded shells so much more usable that it's
719 a minor price to pay (ctypes is very easy to install, already a
725 a minor price to pay (ctypes is very easy to install, already a
720 requirement for win32 and available in major linux distros).
726 requirement for win32 and available in major linux distros).
721
727
722 2007-04-04 Ville Vainio <vivainio@gmail.com>
728 2007-04-04 Ville Vainio <vivainio@gmail.com>
723
729
724 * Extensions/ipy_completers.py, ipy_stock_completers.py:
730 * Extensions/ipy_completers.py, ipy_stock_completers.py:
725 Moved implementations of 'bundled' completers to ipy_completers.py,
731 Moved implementations of 'bundled' completers to ipy_completers.py,
726 they are only enabled in ipy_stock_completers.py.
732 they are only enabled in ipy_stock_completers.py.
727
733
728 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
734 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
729
735
730 * IPython/PyColorize.py (Parser.format2): Fix identation of
736 * IPython/PyColorize.py (Parser.format2): Fix identation of
731 colorzied output and return early if color scheme is NoColor, to
737 colorzied output and return early if color scheme is NoColor, to
732 avoid unnecessary and expensive tokenization. Closes #131.
738 avoid unnecessary and expensive tokenization. Closes #131.
733
739
734 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
740 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
735
741
736 * IPython/Debugger.py: disable the use of pydb version 1.17. It
742 * IPython/Debugger.py: disable the use of pydb version 1.17. It
737 has a critical bug (a missing import that makes post-mortem not
743 has a critical bug (a missing import that makes post-mortem not
738 work at all). Unfortunately as of this time, this is the version
744 work at all). Unfortunately as of this time, this is the version
739 shipped with Ubuntu Edgy, so quite a few people have this one. I
745 shipped with Ubuntu Edgy, so quite a few people have this one. I
740 hope Edgy will update to a more recent package.
746 hope Edgy will update to a more recent package.
741
747
742 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
748 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
743
749
744 * IPython/iplib.py (_prefilter): close #52, second part of a patch
750 * IPython/iplib.py (_prefilter): close #52, second part of a patch
745 set by Stefan (only the first part had been applied before).
751 set by Stefan (only the first part had been applied before).
746
752
747 * IPython/Extensions/ipy_stock_completers.py (module_completer):
753 * IPython/Extensions/ipy_stock_completers.py (module_completer):
748 remove usage of the dangerous pkgutil.walk_packages(). See
754 remove usage of the dangerous pkgutil.walk_packages(). See
749 details in comments left in the code.
755 details in comments left in the code.
750
756
751 * IPython/Magic.py (magic_whos): add support for numpy arrays
757 * IPython/Magic.py (magic_whos): add support for numpy arrays
752 similar to what we had for Numeric.
758 similar to what we had for Numeric.
753
759
754 * IPython/completer.py (IPCompleter.complete): extend the
760 * IPython/completer.py (IPCompleter.complete): extend the
755 complete() call API to support completions by other mechanisms
761 complete() call API to support completions by other mechanisms
756 than readline. Closes #109.
762 than readline. Closes #109.
757
763
758 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
764 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
759 protect against a bug in Python's execfile(). Closes #123.
765 protect against a bug in Python's execfile(). Closes #123.
760
766
761 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
767 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
762
768
763 * IPython/iplib.py (split_user_input): ensure that when splitting
769 * IPython/iplib.py (split_user_input): ensure that when splitting
764 user input, the part that can be treated as a python name is pure
770 user input, the part that can be treated as a python name is pure
765 ascii (Python identifiers MUST be pure ascii). Part of the
771 ascii (Python identifiers MUST be pure ascii). Part of the
766 ongoing Unicode support work.
772 ongoing Unicode support work.
767
773
768 * IPython/Prompts.py (prompt_specials_color): Add \N for the
774 * IPython/Prompts.py (prompt_specials_color): Add \N for the
769 actual prompt number, without any coloring. This allows users to
775 actual prompt number, without any coloring. This allows users to
770 produce numbered prompts with their own colors. Added after a
776 produce numbered prompts with their own colors. Added after a
771 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
777 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
772
778
773 2007-03-31 Walter Doerwald <walter@livinglogic.de>
779 2007-03-31 Walter Doerwald <walter@livinglogic.de>
774
780
775 * IPython/Extensions/igrid.py: Map the return key
781 * IPython/Extensions/igrid.py: Map the return key
776 to enter() and shift-return to enterattr().
782 to enter() and shift-return to enterattr().
777
783
778 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
784 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
779
785
780 * IPython/Magic.py (magic_psearch): add unicode support by
786 * IPython/Magic.py (magic_psearch): add unicode support by
781 encoding to ascii the input, since this routine also only deals
787 encoding to ascii the input, since this routine also only deals
782 with valid Python names. Fixes a bug reported by Stefan.
788 with valid Python names. Fixes a bug reported by Stefan.
783
789
784 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
790 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
785
791
786 * IPython/Magic.py (_inspect): convert unicode input into ascii
792 * IPython/Magic.py (_inspect): convert unicode input into ascii
787 before trying to evaluate it as a Python identifier. This fixes a
793 before trying to evaluate it as a Python identifier. This fixes a
788 problem that the new unicode support had introduced when analyzing
794 problem that the new unicode support had introduced when analyzing
789 long definition lines for functions.
795 long definition lines for functions.
790
796
791 2007-03-24 Walter Doerwald <walter@livinglogic.de>
797 2007-03-24 Walter Doerwald <walter@livinglogic.de>
792
798
793 * IPython/Extensions/igrid.py: Fix picking. Using
799 * IPython/Extensions/igrid.py: Fix picking. Using
794 igrid with wxPython 2.6 and -wthread should work now.
800 igrid with wxPython 2.6 and -wthread should work now.
795 igrid.display() simply tries to create a frame without
801 igrid.display() simply tries to create a frame without
796 an application. Only if this fails an application is created.
802 an application. Only if this fails an application is created.
797
803
798 2007-03-23 Walter Doerwald <walter@livinglogic.de>
804 2007-03-23 Walter Doerwald <walter@livinglogic.de>
799
805
800 * IPython/Extensions/path.py: Updated to version 2.2.
806 * IPython/Extensions/path.py: Updated to version 2.2.
801
807
802 2007-03-23 Ville Vainio <vivainio@gmail.com>
808 2007-03-23 Ville Vainio <vivainio@gmail.com>
803
809
804 * iplib.py: recursive alias expansion now works better, so that
810 * iplib.py: recursive alias expansion now works better, so that
805 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
811 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
806 doesn't trip up the process, if 'd' has been aliased to 'ls'.
812 doesn't trip up the process, if 'd' has been aliased to 'ls'.
807
813
808 * Extensions/ipy_gnuglobal.py added, provides %global magic
814 * Extensions/ipy_gnuglobal.py added, provides %global magic
809 for users of http://www.gnu.org/software/global
815 for users of http://www.gnu.org/software/global
810
816
811 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
817 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
812 Closes #52. Patch by Stefan van der Walt.
818 Closes #52. Patch by Stefan van der Walt.
813
819
814 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
820 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
815
821
816 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
822 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
817 respect the __file__ attribute when using %run. Thanks to a bug
823 respect the __file__ attribute when using %run. Thanks to a bug
818 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
824 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
819
825
820 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
826 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
821
827
822 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
828 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
823 input. Patch sent by Stefan.
829 input. Patch sent by Stefan.
824
830
825 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
831 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
826 * IPython/Extensions/ipy_stock_completer.py
832 * IPython/Extensions/ipy_stock_completer.py
827 shlex_split, fix bug in shlex_split. len function
833 shlex_split, fix bug in shlex_split. len function
828 call was missing an if statement. Caused shlex_split to
834 call was missing an if statement. Caused shlex_split to
829 sometimes return "" as last element.
835 sometimes return "" as last element.
830
836
831 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
837 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
832
838
833 * IPython/completer.py
839 * IPython/completer.py
834 (IPCompleter.file_matches.single_dir_expand): fix a problem
840 (IPCompleter.file_matches.single_dir_expand): fix a problem
835 reported by Stefan, where directories containign a single subdir
841 reported by Stefan, where directories containign a single subdir
836 would be completed too early.
842 would be completed too early.
837
843
838 * IPython/Shell.py (_load_pylab): Make the execution of 'from
844 * IPython/Shell.py (_load_pylab): Make the execution of 'from
839 pylab import *' when -pylab is given be optional. A new flag,
845 pylab import *' when -pylab is given be optional. A new flag,
840 pylab_import_all controls this behavior, the default is True for
846 pylab_import_all controls this behavior, the default is True for
841 backwards compatibility.
847 backwards compatibility.
842
848
843 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
849 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
844 modified) R. Bernstein's patch for fully syntax highlighted
850 modified) R. Bernstein's patch for fully syntax highlighted
845 tracebacks. The functionality is also available under ultraTB for
851 tracebacks. The functionality is also available under ultraTB for
846 non-ipython users (someone using ultraTB but outside an ipython
852 non-ipython users (someone using ultraTB but outside an ipython
847 session). They can select the color scheme by setting the
853 session). They can select the color scheme by setting the
848 module-level global DEFAULT_SCHEME. The highlight functionality
854 module-level global DEFAULT_SCHEME. The highlight functionality
849 also works when debugging.
855 also works when debugging.
850
856
851 * IPython/genutils.py (IOStream.close): small patch by
857 * IPython/genutils.py (IOStream.close): small patch by
852 R. Bernstein for improved pydb support.
858 R. Bernstein for improved pydb support.
853
859
854 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
860 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
855 DaveS <davls@telus.net> to improve support of debugging under
861 DaveS <davls@telus.net> to improve support of debugging under
856 NTEmacs, including improved pydb behavior.
862 NTEmacs, including improved pydb behavior.
857
863
858 * IPython/Magic.py (magic_prun): Fix saving of profile info for
864 * IPython/Magic.py (magic_prun): Fix saving of profile info for
859 Python 2.5, where the stats object API changed a little. Thanks
865 Python 2.5, where the stats object API changed a little. Thanks
860 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
866 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
861
867
862 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
868 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
863 Pernetty's patch to improve support for (X)Emacs under Win32.
869 Pernetty's patch to improve support for (X)Emacs under Win32.
864
870
865 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
871 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
866
872
867 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
873 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
868 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
874 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
869 a report by Nik Tautenhahn.
875 a report by Nik Tautenhahn.
870
876
871 2007-03-16 Walter Doerwald <walter@livinglogic.de>
877 2007-03-16 Walter Doerwald <walter@livinglogic.de>
872
878
873 * setup.py: Add the igrid help files to the list of data files
879 * setup.py: Add the igrid help files to the list of data files
874 to be installed alongside igrid.
880 to be installed alongside igrid.
875 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
881 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
876 Show the input object of the igrid browser as the window tile.
882 Show the input object of the igrid browser as the window tile.
877 Show the object the cursor is on in the statusbar.
883 Show the object the cursor is on in the statusbar.
878
884
879 2007-03-15 Ville Vainio <vivainio@gmail.com>
885 2007-03-15 Ville Vainio <vivainio@gmail.com>
880
886
881 * Extensions/ipy_stock_completers.py: Fixed exception
887 * Extensions/ipy_stock_completers.py: Fixed exception
882 on mismatching quotes in %run completer. Patch by
888 on mismatching quotes in %run completer. Patch by
883 Jorgen Stenarson. Closes #127.
889 Jorgen Stenarson. Closes #127.
884
890
885 2007-03-14 Ville Vainio <vivainio@gmail.com>
891 2007-03-14 Ville Vainio <vivainio@gmail.com>
886
892
887 * Extensions/ext_rehashdir.py: Do not do auto_alias
893 * Extensions/ext_rehashdir.py: Do not do auto_alias
888 in %rehashdir, it clobbers %store'd aliases.
894 in %rehashdir, it clobbers %store'd aliases.
889
895
890 * UserConfig/ipy_profile_sh.py: envpersist.py extension
896 * UserConfig/ipy_profile_sh.py: envpersist.py extension
891 (beefed up %env) imported for sh profile.
897 (beefed up %env) imported for sh profile.
892
898
893 2007-03-10 Walter Doerwald <walter@livinglogic.de>
899 2007-03-10 Walter Doerwald <walter@livinglogic.de>
894
900
895 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
901 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
896 as the default browser.
902 as the default browser.
897 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
903 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
898 As igrid displays all attributes it ever encounters, fetch() (which has
904 As igrid displays all attributes it ever encounters, fetch() (which has
899 been renamed to _fetch()) doesn't have to recalculate the display attributes
905 been renamed to _fetch()) doesn't have to recalculate the display attributes
900 every time a new item is fetched. This should speed up scrolling.
906 every time a new item is fetched. This should speed up scrolling.
901
907
902 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
908 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
903
909
904 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
910 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
905 Schmolck's recently reported tab-completion bug (my previous one
911 Schmolck's recently reported tab-completion bug (my previous one
906 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
912 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
907
913
908 2007-03-09 Walter Doerwald <walter@livinglogic.de>
914 2007-03-09 Walter Doerwald <walter@livinglogic.de>
909
915
910 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
916 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
911 Close help window if exiting igrid.
917 Close help window if exiting igrid.
912
918
913 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
919 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
914
920
915 * IPython/Extensions/ipy_defaults.py: Check if readline is available
921 * IPython/Extensions/ipy_defaults.py: Check if readline is available
916 before calling functions from readline.
922 before calling functions from readline.
917
923
918 2007-03-02 Walter Doerwald <walter@livinglogic.de>
924 2007-03-02 Walter Doerwald <walter@livinglogic.de>
919
925
920 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
926 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
921 igrid is a wxPython-based display object for ipipe. If your system has
927 igrid is a wxPython-based display object for ipipe. If your system has
922 wx installed igrid will be the default display. Without wx ipipe falls
928 wx installed igrid will be the default display. Without wx ipipe falls
923 back to ibrowse (which needs curses). If no curses is installed ipipe
929 back to ibrowse (which needs curses). If no curses is installed ipipe
924 falls back to idump.
930 falls back to idump.
925
931
926 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
932 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
927
933
928 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
934 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
929 my changes from yesterday, they introduced bugs. Will reactivate
935 my changes from yesterday, they introduced bugs. Will reactivate
930 once I get a correct solution, which will be much easier thanks to
936 once I get a correct solution, which will be much easier thanks to
931 Dan Milstein's new prefilter test suite.
937 Dan Milstein's new prefilter test suite.
932
938
933 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
939 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
934
940
935 * IPython/iplib.py (split_user_input): fix input splitting so we
941 * IPython/iplib.py (split_user_input): fix input splitting so we
936 don't attempt attribute accesses on things that can't possibly be
942 don't attempt attribute accesses on things that can't possibly be
937 valid Python attributes. After a bug report by Alex Schmolck.
943 valid Python attributes. After a bug report by Alex Schmolck.
938 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
944 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
939 %magic with explicit % prefix.
945 %magic with explicit % prefix.
940
946
941 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
947 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
942
948
943 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
949 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
944 avoid a DeprecationWarning from GTK.
950 avoid a DeprecationWarning from GTK.
945
951
946 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
952 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
947
953
948 * IPython/genutils.py (clock): I modified clock() to return total
954 * IPython/genutils.py (clock): I modified clock() to return total
949 time, user+system. This is a more commonly needed metric. I also
955 time, user+system. This is a more commonly needed metric. I also
950 introduced the new clocku/clocks to get only user/system time if
956 introduced the new clocku/clocks to get only user/system time if
951 one wants those instead.
957 one wants those instead.
952
958
953 ***WARNING: API CHANGE*** clock() used to return only user time,
959 ***WARNING: API CHANGE*** clock() used to return only user time,
954 so if you want exactly the same results as before, use clocku
960 so if you want exactly the same results as before, use clocku
955 instead.
961 instead.
956
962
957 2007-02-22 Ville Vainio <vivainio@gmail.com>
963 2007-02-22 Ville Vainio <vivainio@gmail.com>
958
964
959 * IPython/Extensions/ipy_p4.py: Extension for improved
965 * IPython/Extensions/ipy_p4.py: Extension for improved
960 p4 (perforce version control system) experience.
966 p4 (perforce version control system) experience.
961 Adds %p4 magic with p4 command completion and
967 Adds %p4 magic with p4 command completion and
962 automatic -G argument (marshall output as python dict)
968 automatic -G argument (marshall output as python dict)
963
969
964 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
970 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
965
971
966 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
972 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
967 stop marks.
973 stop marks.
968 (ClearingMixin): a simple mixin to easily make a Demo class clear
974 (ClearingMixin): a simple mixin to easily make a Demo class clear
969 the screen in between blocks and have empty marquees. The
975 the screen in between blocks and have empty marquees. The
970 ClearDemo and ClearIPDemo classes that use it are included.
976 ClearDemo and ClearIPDemo classes that use it are included.
971
977
972 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
978 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
973
979
974 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
980 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
975 protect against exceptions at Python shutdown time. Patch
981 protect against exceptions at Python shutdown time. Patch
976 sumbmitted to upstream.
982 sumbmitted to upstream.
977
983
978 2007-02-14 Walter Doerwald <walter@livinglogic.de>
984 2007-02-14 Walter Doerwald <walter@livinglogic.de>
979
985
980 * IPython/Extensions/ibrowse.py: If entering the first object level
986 * IPython/Extensions/ibrowse.py: If entering the first object level
981 (i.e. the object for which the browser has been started) fails,
987 (i.e. the object for which the browser has been started) fails,
982 now the error is raised directly (aborting the browser) instead of
988 now the error is raised directly (aborting the browser) instead of
983 running into an empty levels list later.
989 running into an empty levels list later.
984
990
985 2007-02-03 Walter Doerwald <walter@livinglogic.de>
991 2007-02-03 Walter Doerwald <walter@livinglogic.de>
986
992
987 * IPython/Extensions/ipipe.py: Add an xrepr implementation
993 * IPython/Extensions/ipipe.py: Add an xrepr implementation
988 for the noitem object.
994 for the noitem object.
989
995
990 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
996 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
991
997
992 * IPython/completer.py (Completer.attr_matches): Fix small
998 * IPython/completer.py (Completer.attr_matches): Fix small
993 tab-completion bug with Enthought Traits objects with units.
999 tab-completion bug with Enthought Traits objects with units.
994 Thanks to a bug report by Tom Denniston
1000 Thanks to a bug report by Tom Denniston
995 <tom.denniston-AT-alum.dartmouth.org>.
1001 <tom.denniston-AT-alum.dartmouth.org>.
996
1002
997 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1003 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
998
1004
999 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1005 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1000 bug where only .ipy or .py would be completed. Once the first
1006 bug where only .ipy or .py would be completed. Once the first
1001 argument to %run has been given, all completions are valid because
1007 argument to %run has been given, all completions are valid because
1002 they are the arguments to the script, which may well be non-python
1008 they are the arguments to the script, which may well be non-python
1003 filenames.
1009 filenames.
1004
1010
1005 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1011 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1006 to irunner to allow it to correctly support real doctesting of
1012 to irunner to allow it to correctly support real doctesting of
1007 out-of-process ipython code.
1013 out-of-process ipython code.
1008
1014
1009 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1015 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1010 title an option (-noterm_title) because it completely breaks
1016 title an option (-noterm_title) because it completely breaks
1011 doctesting.
1017 doctesting.
1012
1018
1013 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1019 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1014
1020
1015 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1021 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1016
1022
1017 * IPython/irunner.py (main): fix small bug where extensions were
1023 * IPython/irunner.py (main): fix small bug where extensions were
1018 not being correctly recognized.
1024 not being correctly recognized.
1019
1025
1020 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1026 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1021
1027
1022 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1028 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1023 a string containing a single line yields the string itself as the
1029 a string containing a single line yields the string itself as the
1024 only item.
1030 only item.
1025
1031
1026 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1032 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1027 object if it's the same as the one on the last level (This avoids
1033 object if it's the same as the one on the last level (This avoids
1028 infinite recursion for one line strings).
1034 infinite recursion for one line strings).
1029
1035
1030 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1036 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1031
1037
1032 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1038 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1033 all output streams before printing tracebacks. This ensures that
1039 all output streams before printing tracebacks. This ensures that
1034 user output doesn't end up interleaved with traceback output.
1040 user output doesn't end up interleaved with traceback output.
1035
1041
1036 2007-01-10 Ville Vainio <vivainio@gmail.com>
1042 2007-01-10 Ville Vainio <vivainio@gmail.com>
1037
1043
1038 * Extensions/envpersist.py: Turbocharged %env that remembers
1044 * Extensions/envpersist.py: Turbocharged %env that remembers
1039 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1045 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1040 "%env VISUAL=jed".
1046 "%env VISUAL=jed".
1041
1047
1042 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1048 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1043
1049
1044 * IPython/iplib.py (showtraceback): ensure that we correctly call
1050 * IPython/iplib.py (showtraceback): ensure that we correctly call
1045 custom handlers in all cases (some with pdb were slipping through,
1051 custom handlers in all cases (some with pdb were slipping through,
1046 but I'm not exactly sure why).
1052 but I'm not exactly sure why).
1047
1053
1048 * IPython/Debugger.py (Tracer.__init__): added new class to
1054 * IPython/Debugger.py (Tracer.__init__): added new class to
1049 support set_trace-like usage of IPython's enhanced debugger.
1055 support set_trace-like usage of IPython's enhanced debugger.
1050
1056
1051 2006-12-24 Ville Vainio <vivainio@gmail.com>
1057 2006-12-24 Ville Vainio <vivainio@gmail.com>
1052
1058
1053 * ipmaker.py: more informative message when ipy_user_conf
1059 * ipmaker.py: more informative message when ipy_user_conf
1054 import fails (suggest running %upgrade).
1060 import fails (suggest running %upgrade).
1055
1061
1056 * tools/run_ipy_in_profiler.py: Utility to see where
1062 * tools/run_ipy_in_profiler.py: Utility to see where
1057 the time during IPython startup is spent.
1063 the time during IPython startup is spent.
1058
1064
1059 2006-12-20 Ville Vainio <vivainio@gmail.com>
1065 2006-12-20 Ville Vainio <vivainio@gmail.com>
1060
1066
1061 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1067 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1062
1068
1063 * ipapi.py: Add new ipapi method, expand_alias.
1069 * ipapi.py: Add new ipapi method, expand_alias.
1064
1070
1065 * Release.py: Bump up version to 0.7.4.svn
1071 * Release.py: Bump up version to 0.7.4.svn
1066
1072
1067 2006-12-17 Ville Vainio <vivainio@gmail.com>
1073 2006-12-17 Ville Vainio <vivainio@gmail.com>
1068
1074
1069 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1075 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1070 to work properly on posix too
1076 to work properly on posix too
1071
1077
1072 * Release.py: Update revnum (version is still just 0.7.3).
1078 * Release.py: Update revnum (version is still just 0.7.3).
1073
1079
1074 2006-12-15 Ville Vainio <vivainio@gmail.com>
1080 2006-12-15 Ville Vainio <vivainio@gmail.com>
1075
1081
1076 * scripts/ipython_win_post_install: create ipython.py in
1082 * scripts/ipython_win_post_install: create ipython.py in
1077 prefix + "/scripts".
1083 prefix + "/scripts".
1078
1084
1079 * Release.py: Update version to 0.7.3.
1085 * Release.py: Update version to 0.7.3.
1080
1086
1081 2006-12-14 Ville Vainio <vivainio@gmail.com>
1087 2006-12-14 Ville Vainio <vivainio@gmail.com>
1082
1088
1083 * scripts/ipython_win_post_install: Overwrite old shortcuts
1089 * scripts/ipython_win_post_install: Overwrite old shortcuts
1084 if they already exist
1090 if they already exist
1085
1091
1086 * Release.py: release 0.7.3rc2
1092 * Release.py: release 0.7.3rc2
1087
1093
1088 2006-12-13 Ville Vainio <vivainio@gmail.com>
1094 2006-12-13 Ville Vainio <vivainio@gmail.com>
1089
1095
1090 * Branch and update Release.py for 0.7.3rc1
1096 * Branch and update Release.py for 0.7.3rc1
1091
1097
1092 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1098 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1093
1099
1094 * IPython/Shell.py (IPShellWX): update for current WX naming
1100 * IPython/Shell.py (IPShellWX): update for current WX naming
1095 conventions, to avoid a deprecation warning with current WX
1101 conventions, to avoid a deprecation warning with current WX
1096 versions. Thanks to a report by Danny Shevitz.
1102 versions. Thanks to a report by Danny Shevitz.
1097
1103
1098 2006-12-12 Ville Vainio <vivainio@gmail.com>
1104 2006-12-12 Ville Vainio <vivainio@gmail.com>
1099
1105
1100 * ipmaker.py: apply david cournapeau's patch to make
1106 * ipmaker.py: apply david cournapeau's patch to make
1101 import_some work properly even when ipythonrc does
1107 import_some work properly even when ipythonrc does
1102 import_some on empty list (it was an old bug!).
1108 import_some on empty list (it was an old bug!).
1103
1109
1104 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1110 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1105 Add deprecation note to ipythonrc and a url to wiki
1111 Add deprecation note to ipythonrc and a url to wiki
1106 in ipy_user_conf.py
1112 in ipy_user_conf.py
1107
1113
1108
1114
1109 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1115 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1110 as if it was typed on IPython command prompt, i.e.
1116 as if it was typed on IPython command prompt, i.e.
1111 as IPython script.
1117 as IPython script.
1112
1118
1113 * example-magic.py, magic_grepl.py: remove outdated examples
1119 * example-magic.py, magic_grepl.py: remove outdated examples
1114
1120
1115 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1121 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1116
1122
1117 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1123 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1118 is called before any exception has occurred.
1124 is called before any exception has occurred.
1119
1125
1120 2006-12-08 Ville Vainio <vivainio@gmail.com>
1126 2006-12-08 Ville Vainio <vivainio@gmail.com>
1121
1127
1122 * Extensions/ipy_stock_completers.py: fix cd completer
1128 * Extensions/ipy_stock_completers.py: fix cd completer
1123 to translate /'s to \'s again.
1129 to translate /'s to \'s again.
1124
1130
1125 * completer.py: prevent traceback on file completions w/
1131 * completer.py: prevent traceback on file completions w/
1126 backslash.
1132 backslash.
1127
1133
1128 * Release.py: Update release number to 0.7.3b3 for release
1134 * Release.py: Update release number to 0.7.3b3 for release
1129
1135
1130 2006-12-07 Ville Vainio <vivainio@gmail.com>
1136 2006-12-07 Ville Vainio <vivainio@gmail.com>
1131
1137
1132 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1138 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1133 while executing external code. Provides more shell-like behaviour
1139 while executing external code. Provides more shell-like behaviour
1134 and overall better response to ctrl + C / ctrl + break.
1140 and overall better response to ctrl + C / ctrl + break.
1135
1141
1136 * tools/make_tarball.py: new script to create tarball straight from svn
1142 * tools/make_tarball.py: new script to create tarball straight from svn
1137 (setup.py sdist doesn't work on win32).
1143 (setup.py sdist doesn't work on win32).
1138
1144
1139 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1145 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1140 on dirnames with spaces and use the default completer instead.
1146 on dirnames with spaces and use the default completer instead.
1141
1147
1142 * Revision.py: Change version to 0.7.3b2 for release.
1148 * Revision.py: Change version to 0.7.3b2 for release.
1143
1149
1144 2006-12-05 Ville Vainio <vivainio@gmail.com>
1150 2006-12-05 Ville Vainio <vivainio@gmail.com>
1145
1151
1146 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1152 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1147 pydb patch 4 (rm debug printing, py 2.5 checking)
1153 pydb patch 4 (rm debug printing, py 2.5 checking)
1148
1154
1149 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1155 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1150 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1156 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1151 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1157 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1152 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1158 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1153 object the cursor was on before the refresh. The command "markrange" is
1159 object the cursor was on before the refresh. The command "markrange" is
1154 mapped to "%" now.
1160 mapped to "%" now.
1155 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1161 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1156
1162
1157 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1163 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1158
1164
1159 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1165 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1160 interactive debugger on the last traceback, without having to call
1166 interactive debugger on the last traceback, without having to call
1161 %pdb and rerun your code. Made minor changes in various modules,
1167 %pdb and rerun your code. Made minor changes in various modules,
1162 should automatically recognize pydb if available.
1168 should automatically recognize pydb if available.
1163
1169
1164 2006-11-28 Ville Vainio <vivainio@gmail.com>
1170 2006-11-28 Ville Vainio <vivainio@gmail.com>
1165
1171
1166 * completer.py: If the text start with !, show file completions
1172 * completer.py: If the text start with !, show file completions
1167 properly. This helps when trying to complete command name
1173 properly. This helps when trying to complete command name
1168 for shell escapes.
1174 for shell escapes.
1169
1175
1170 2006-11-27 Ville Vainio <vivainio@gmail.com>
1176 2006-11-27 Ville Vainio <vivainio@gmail.com>
1171
1177
1172 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1178 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1173 der Walt. Clean up svn and hg completers by using a common
1179 der Walt. Clean up svn and hg completers by using a common
1174 vcs_completer.
1180 vcs_completer.
1175
1181
1176 2006-11-26 Ville Vainio <vivainio@gmail.com>
1182 2006-11-26 Ville Vainio <vivainio@gmail.com>
1177
1183
1178 * Remove ipconfig and %config; you should use _ip.options structure
1184 * Remove ipconfig and %config; you should use _ip.options structure
1179 directly instead!
1185 directly instead!
1180
1186
1181 * genutils.py: add wrap_deprecated function for deprecating callables
1187 * genutils.py: add wrap_deprecated function for deprecating callables
1182
1188
1183 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1189 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1184 _ip.system instead. ipalias is redundant.
1190 _ip.system instead. ipalias is redundant.
1185
1191
1186 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1192 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1187 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1193 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1188 explicit.
1194 explicit.
1189
1195
1190 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1196 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1191 completer. Try it by entering 'hg ' and pressing tab.
1197 completer. Try it by entering 'hg ' and pressing tab.
1192
1198
1193 * macro.py: Give Macro a useful __repr__ method
1199 * macro.py: Give Macro a useful __repr__ method
1194
1200
1195 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1201 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1196
1202
1197 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1203 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1198 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1204 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1199 we don't get a duplicate ipipe module, where registration of the xrepr
1205 we don't get a duplicate ipipe module, where registration of the xrepr
1200 implementation for Text is useless.
1206 implementation for Text is useless.
1201
1207
1202 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1208 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1203
1209
1204 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1210 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1205
1211
1206 2006-11-24 Ville Vainio <vivainio@gmail.com>
1212 2006-11-24 Ville Vainio <vivainio@gmail.com>
1207
1213
1208 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1214 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1209 try to use "cProfile" instead of the slower pure python
1215 try to use "cProfile" instead of the slower pure python
1210 "profile"
1216 "profile"
1211
1217
1212 2006-11-23 Ville Vainio <vivainio@gmail.com>
1218 2006-11-23 Ville Vainio <vivainio@gmail.com>
1213
1219
1214 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1220 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1215 Qt+IPython+Designer link in documentation.
1221 Qt+IPython+Designer link in documentation.
1216
1222
1217 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1223 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1218 correct Pdb object to %pydb.
1224 correct Pdb object to %pydb.
1219
1225
1220
1226
1221 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1227 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1222 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1228 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1223 generic xrepr(), otherwise the list implementation would kick in.
1229 generic xrepr(), otherwise the list implementation would kick in.
1224
1230
1225 2006-11-21 Ville Vainio <vivainio@gmail.com>
1231 2006-11-21 Ville Vainio <vivainio@gmail.com>
1226
1232
1227 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1233 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1228 with one from UserConfig.
1234 with one from UserConfig.
1229
1235
1230 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1236 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1231 it was missing which broke the sh profile.
1237 it was missing which broke the sh profile.
1232
1238
1233 * completer.py: file completer now uses explicit '/' instead
1239 * completer.py: file completer now uses explicit '/' instead
1234 of os.path.join, expansion of 'foo' was broken on win32
1240 of os.path.join, expansion of 'foo' was broken on win32
1235 if there was one directory with name 'foobar'.
1241 if there was one directory with name 'foobar'.
1236
1242
1237 * A bunch of patches from Kirill Smelkov:
1243 * A bunch of patches from Kirill Smelkov:
1238
1244
1239 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1245 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1240
1246
1241 * [patch 7/9] Implement %page -r (page in raw mode) -
1247 * [patch 7/9] Implement %page -r (page in raw mode) -
1242
1248
1243 * [patch 5/9] ScientificPython webpage has moved
1249 * [patch 5/9] ScientificPython webpage has moved
1244
1250
1245 * [patch 4/9] The manual mentions %ds, should be %dhist
1251 * [patch 4/9] The manual mentions %ds, should be %dhist
1246
1252
1247 * [patch 3/9] Kill old bits from %prun doc.
1253 * [patch 3/9] Kill old bits from %prun doc.
1248
1254
1249 * [patch 1/9] Fix typos here and there.
1255 * [patch 1/9] Fix typos here and there.
1250
1256
1251 2006-11-08 Ville Vainio <vivainio@gmail.com>
1257 2006-11-08 Ville Vainio <vivainio@gmail.com>
1252
1258
1253 * completer.py (attr_matches): catch all exceptions raised
1259 * completer.py (attr_matches): catch all exceptions raised
1254 by eval of expr with dots.
1260 by eval of expr with dots.
1255
1261
1256 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1262 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1257
1263
1258 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1264 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1259 input if it starts with whitespace. This allows you to paste
1265 input if it starts with whitespace. This allows you to paste
1260 indented input from any editor without manually having to type in
1266 indented input from any editor without manually having to type in
1261 the 'if 1:', which is convenient when working interactively.
1267 the 'if 1:', which is convenient when working interactively.
1262 Slightly modifed version of a patch by Bo Peng
1268 Slightly modifed version of a patch by Bo Peng
1263 <bpeng-AT-rice.edu>.
1269 <bpeng-AT-rice.edu>.
1264
1270
1265 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1271 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1266
1272
1267 * IPython/irunner.py (main): modified irunner so it automatically
1273 * IPython/irunner.py (main): modified irunner so it automatically
1268 recognizes the right runner to use based on the extension (.py for
1274 recognizes the right runner to use based on the extension (.py for
1269 python, .ipy for ipython and .sage for sage).
1275 python, .ipy for ipython and .sage for sage).
1270
1276
1271 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1277 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1272 visible in ipapi as ip.config(), to programatically control the
1278 visible in ipapi as ip.config(), to programatically control the
1273 internal rc object. There's an accompanying %config magic for
1279 internal rc object. There's an accompanying %config magic for
1274 interactive use, which has been enhanced to match the
1280 interactive use, which has been enhanced to match the
1275 funtionality in ipconfig.
1281 funtionality in ipconfig.
1276
1282
1277 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1283 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1278 so it's not just a toggle, it now takes an argument. Add support
1284 so it's not just a toggle, it now takes an argument. Add support
1279 for a customizable header when making system calls, as the new
1285 for a customizable header when making system calls, as the new
1280 system_header variable in the ipythonrc file.
1286 system_header variable in the ipythonrc file.
1281
1287
1282 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1288 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1283
1289
1284 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1290 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1285 generic functions (using Philip J. Eby's simplegeneric package).
1291 generic functions (using Philip J. Eby's simplegeneric package).
1286 This makes it possible to customize the display of third-party classes
1292 This makes it possible to customize the display of third-party classes
1287 without having to monkeypatch them. xiter() no longer supports a mode
1293 without having to monkeypatch them. xiter() no longer supports a mode
1288 argument and the XMode class has been removed. The same functionality can
1294 argument and the XMode class has been removed. The same functionality can
1289 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1295 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1290 One consequence of the switch to generic functions is that xrepr() and
1296 One consequence of the switch to generic functions is that xrepr() and
1291 xattrs() implementation must define the default value for the mode
1297 xattrs() implementation must define the default value for the mode
1292 argument themselves and xattrs() implementations must return real
1298 argument themselves and xattrs() implementations must return real
1293 descriptors.
1299 descriptors.
1294
1300
1295 * IPython/external: This new subpackage will contain all third-party
1301 * IPython/external: This new subpackage will contain all third-party
1296 packages that are bundled with IPython. (The first one is simplegeneric).
1302 packages that are bundled with IPython. (The first one is simplegeneric).
1297
1303
1298 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1304 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1299 directory which as been dropped in r1703.
1305 directory which as been dropped in r1703.
1300
1306
1301 * IPython/Extensions/ipipe.py (iless): Fixed.
1307 * IPython/Extensions/ipipe.py (iless): Fixed.
1302
1308
1303 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1309 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1304
1310
1305 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1311 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1306
1312
1307 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1313 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1308 handling in variable expansion so that shells and magics recognize
1314 handling in variable expansion so that shells and magics recognize
1309 function local scopes correctly. Bug reported by Brian.
1315 function local scopes correctly. Bug reported by Brian.
1310
1316
1311 * scripts/ipython: remove the very first entry in sys.path which
1317 * scripts/ipython: remove the very first entry in sys.path which
1312 Python auto-inserts for scripts, so that sys.path under IPython is
1318 Python auto-inserts for scripts, so that sys.path under IPython is
1313 as similar as possible to that under plain Python.
1319 as similar as possible to that under plain Python.
1314
1320
1315 * IPython/completer.py (IPCompleter.file_matches): Fix
1321 * IPython/completer.py (IPCompleter.file_matches): Fix
1316 tab-completion so that quotes are not closed unless the completion
1322 tab-completion so that quotes are not closed unless the completion
1317 is unambiguous. After a request by Stefan. Minor cleanups in
1323 is unambiguous. After a request by Stefan. Minor cleanups in
1318 ipy_stock_completers.
1324 ipy_stock_completers.
1319
1325
1320 2006-11-02 Ville Vainio <vivainio@gmail.com>
1326 2006-11-02 Ville Vainio <vivainio@gmail.com>
1321
1327
1322 * ipy_stock_completers.py: Add %run and %cd completers.
1328 * ipy_stock_completers.py: Add %run and %cd completers.
1323
1329
1324 * completer.py: Try running custom completer for both
1330 * completer.py: Try running custom completer for both
1325 "foo" and "%foo" if the command is just "foo". Ignore case
1331 "foo" and "%foo" if the command is just "foo". Ignore case
1326 when filtering possible completions.
1332 when filtering possible completions.
1327
1333
1328 * UserConfig/ipy_user_conf.py: install stock completers as default
1334 * UserConfig/ipy_user_conf.py: install stock completers as default
1329
1335
1330 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1336 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1331 simplified readline history save / restore through a wrapper
1337 simplified readline history save / restore through a wrapper
1332 function
1338 function
1333
1339
1334
1340
1335 2006-10-31 Ville Vainio <vivainio@gmail.com>
1341 2006-10-31 Ville Vainio <vivainio@gmail.com>
1336
1342
1337 * strdispatch.py, completer.py, ipy_stock_completers.py:
1343 * strdispatch.py, completer.py, ipy_stock_completers.py:
1338 Allow str_key ("command") in completer hooks. Implement
1344 Allow str_key ("command") in completer hooks. Implement
1339 trivial completer for 'import' (stdlib modules only). Rename
1345 trivial completer for 'import' (stdlib modules only). Rename
1340 ipy_linux_package_managers.py to ipy_stock_completers.py.
1346 ipy_linux_package_managers.py to ipy_stock_completers.py.
1341 SVN completer.
1347 SVN completer.
1342
1348
1343 * Extensions/ledit.py: %magic line editor for easily and
1349 * Extensions/ledit.py: %magic line editor for easily and
1344 incrementally manipulating lists of strings. The magic command
1350 incrementally manipulating lists of strings. The magic command
1345 name is %led.
1351 name is %led.
1346
1352
1347 2006-10-30 Ville Vainio <vivainio@gmail.com>
1353 2006-10-30 Ville Vainio <vivainio@gmail.com>
1348
1354
1349 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1355 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1350 Bernsteins's patches for pydb integration.
1356 Bernsteins's patches for pydb integration.
1351 http://bashdb.sourceforge.net/pydb/
1357 http://bashdb.sourceforge.net/pydb/
1352
1358
1353 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1359 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1354 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1360 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1355 custom completer hook to allow the users to implement their own
1361 custom completer hook to allow the users to implement their own
1356 completers. See ipy_linux_package_managers.py for example. The
1362 completers. See ipy_linux_package_managers.py for example. The
1357 hook name is 'complete_command'.
1363 hook name is 'complete_command'.
1358
1364
1359 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1365 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1360
1366
1361 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1367 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1362 Numeric leftovers.
1368 Numeric leftovers.
1363
1369
1364 * ipython.el (py-execute-region): apply Stefan's patch to fix
1370 * ipython.el (py-execute-region): apply Stefan's patch to fix
1365 garbled results if the python shell hasn't been previously started.
1371 garbled results if the python shell hasn't been previously started.
1366
1372
1367 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1373 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1368 pretty generic function and useful for other things.
1374 pretty generic function and useful for other things.
1369
1375
1370 * IPython/OInspect.py (getsource): Add customizable source
1376 * IPython/OInspect.py (getsource): Add customizable source
1371 extractor. After a request/patch form W. Stein (SAGE).
1377 extractor. After a request/patch form W. Stein (SAGE).
1372
1378
1373 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1379 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1374 window size to a more reasonable value from what pexpect does,
1380 window size to a more reasonable value from what pexpect does,
1375 since their choice causes wrapping bugs with long input lines.
1381 since their choice causes wrapping bugs with long input lines.
1376
1382
1377 2006-10-28 Ville Vainio <vivainio@gmail.com>
1383 2006-10-28 Ville Vainio <vivainio@gmail.com>
1378
1384
1379 * Magic.py (%run): Save and restore the readline history from
1385 * Magic.py (%run): Save and restore the readline history from
1380 file around %run commands to prevent side effects from
1386 file around %run commands to prevent side effects from
1381 %runned programs that might use readline (e.g. pydb).
1387 %runned programs that might use readline (e.g. pydb).
1382
1388
1383 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1389 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1384 invoking the pydb enhanced debugger.
1390 invoking the pydb enhanced debugger.
1385
1391
1386 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1392 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1387
1393
1388 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1394 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1389 call the base class method and propagate the return value to
1395 call the base class method and propagate the return value to
1390 ifile. This is now done by path itself.
1396 ifile. This is now done by path itself.
1391
1397
1392 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1398 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1393
1399
1394 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1400 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1395 api: set_crash_handler(), to expose the ability to change the
1401 api: set_crash_handler(), to expose the ability to change the
1396 internal crash handler.
1402 internal crash handler.
1397
1403
1398 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1404 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1399 the various parameters of the crash handler so that apps using
1405 the various parameters of the crash handler so that apps using
1400 IPython as their engine can customize crash handling. Ipmlemented
1406 IPython as their engine can customize crash handling. Ipmlemented
1401 at the request of SAGE.
1407 at the request of SAGE.
1402
1408
1403 2006-10-14 Ville Vainio <vivainio@gmail.com>
1409 2006-10-14 Ville Vainio <vivainio@gmail.com>
1404
1410
1405 * Magic.py, ipython.el: applied first "safe" part of Rocky
1411 * Magic.py, ipython.el: applied first "safe" part of Rocky
1406 Bernstein's patch set for pydb integration.
1412 Bernstein's patch set for pydb integration.
1407
1413
1408 * Magic.py (%unalias, %alias): %store'd aliases can now be
1414 * Magic.py (%unalias, %alias): %store'd aliases can now be
1409 removed with '%unalias'. %alias w/o args now shows most
1415 removed with '%unalias'. %alias w/o args now shows most
1410 interesting (stored / manually defined) aliases last
1416 interesting (stored / manually defined) aliases last
1411 where they catch the eye w/o scrolling.
1417 where they catch the eye w/o scrolling.
1412
1418
1413 * Magic.py (%rehashx), ext_rehashdir.py: files with
1419 * Magic.py (%rehashx), ext_rehashdir.py: files with
1414 'py' extension are always considered executable, even
1420 'py' extension are always considered executable, even
1415 when not in PATHEXT environment variable.
1421 when not in PATHEXT environment variable.
1416
1422
1417 2006-10-12 Ville Vainio <vivainio@gmail.com>
1423 2006-10-12 Ville Vainio <vivainio@gmail.com>
1418
1424
1419 * jobctrl.py: Add new "jobctrl" extension for spawning background
1425 * jobctrl.py: Add new "jobctrl" extension for spawning background
1420 processes with "&find /". 'import jobctrl' to try it out. Requires
1426 processes with "&find /". 'import jobctrl' to try it out. Requires
1421 'subprocess' module, standard in python 2.4+.
1427 'subprocess' module, standard in python 2.4+.
1422
1428
1423 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1429 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1424 so if foo -> bar and bar -> baz, then foo -> baz.
1430 so if foo -> bar and bar -> baz, then foo -> baz.
1425
1431
1426 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1432 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1427
1433
1428 * IPython/Magic.py (Magic.parse_options): add a new posix option
1434 * IPython/Magic.py (Magic.parse_options): add a new posix option
1429 to allow parsing of input args in magics that doesn't strip quotes
1435 to allow parsing of input args in magics that doesn't strip quotes
1430 (if posix=False). This also closes %timeit bug reported by
1436 (if posix=False). This also closes %timeit bug reported by
1431 Stefan.
1437 Stefan.
1432
1438
1433 2006-10-03 Ville Vainio <vivainio@gmail.com>
1439 2006-10-03 Ville Vainio <vivainio@gmail.com>
1434
1440
1435 * iplib.py (raw_input, interact): Return ValueError catching for
1441 * iplib.py (raw_input, interact): Return ValueError catching for
1436 raw_input. Fixes infinite loop for sys.stdin.close() or
1442 raw_input. Fixes infinite loop for sys.stdin.close() or
1437 sys.stdout.close().
1443 sys.stdout.close().
1438
1444
1439 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1445 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1440
1446
1441 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1447 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1442 to help in handling doctests. irunner is now pretty useful for
1448 to help in handling doctests. irunner is now pretty useful for
1443 running standalone scripts and simulate a full interactive session
1449 running standalone scripts and simulate a full interactive session
1444 in a format that can be then pasted as a doctest.
1450 in a format that can be then pasted as a doctest.
1445
1451
1446 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1452 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1447 on top of the default (useless) ones. This also fixes the nasty
1453 on top of the default (useless) ones. This also fixes the nasty
1448 way in which 2.5's Quitter() exits (reverted [1785]).
1454 way in which 2.5's Quitter() exits (reverted [1785]).
1449
1455
1450 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1456 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1451 2.5.
1457 2.5.
1452
1458
1453 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1459 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1454 color scheme is updated as well when color scheme is changed
1460 color scheme is updated as well when color scheme is changed
1455 interactively.
1461 interactively.
1456
1462
1457 2006-09-27 Ville Vainio <vivainio@gmail.com>
1463 2006-09-27 Ville Vainio <vivainio@gmail.com>
1458
1464
1459 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1465 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1460 infinite loop and just exit. It's a hack, but will do for a while.
1466 infinite loop and just exit. It's a hack, but will do for a while.
1461
1467
1462 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1468 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1463
1469
1464 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1470 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1465 the constructor, this makes it possible to get a list of only directories
1471 the constructor, this makes it possible to get a list of only directories
1466 or only files.
1472 or only files.
1467
1473
1468 2006-08-12 Ville Vainio <vivainio@gmail.com>
1474 2006-08-12 Ville Vainio <vivainio@gmail.com>
1469
1475
1470 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1476 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1471 they broke unittest
1477 they broke unittest
1472
1478
1473 2006-08-11 Ville Vainio <vivainio@gmail.com>
1479 2006-08-11 Ville Vainio <vivainio@gmail.com>
1474
1480
1475 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1481 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1476 by resolving issue properly, i.e. by inheriting FakeModule
1482 by resolving issue properly, i.e. by inheriting FakeModule
1477 from types.ModuleType. Pickling ipython interactive data
1483 from types.ModuleType. Pickling ipython interactive data
1478 should still work as usual (testing appreciated).
1484 should still work as usual (testing appreciated).
1479
1485
1480 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1486 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1481
1487
1482 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1488 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1483 running under python 2.3 with code from 2.4 to fix a bug with
1489 running under python 2.3 with code from 2.4 to fix a bug with
1484 help(). Reported by the Debian maintainers, Norbert Tretkowski
1490 help(). Reported by the Debian maintainers, Norbert Tretkowski
1485 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1491 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1486 <afayolle-AT-debian.org>.
1492 <afayolle-AT-debian.org>.
1487
1493
1488 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1494 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1489
1495
1490 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1496 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1491 (which was displaying "quit" twice).
1497 (which was displaying "quit" twice).
1492
1498
1493 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1499 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1494
1500
1495 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1501 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1496 the mode argument).
1502 the mode argument).
1497
1503
1498 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1504 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1499
1505
1500 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1506 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1501 not running under IPython.
1507 not running under IPython.
1502
1508
1503 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1509 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1504 and make it iterable (iterating over the attribute itself). Add two new
1510 and make it iterable (iterating over the attribute itself). Add two new
1505 magic strings for __xattrs__(): If the string starts with "-", the attribute
1511 magic strings for __xattrs__(): If the string starts with "-", the attribute
1506 will not be displayed in ibrowse's detail view (but it can still be
1512 will not be displayed in ibrowse's detail view (but it can still be
1507 iterated over). This makes it possible to add attributes that are large
1513 iterated over). This makes it possible to add attributes that are large
1508 lists or generator methods to the detail view. Replace magic attribute names
1514 lists or generator methods to the detail view. Replace magic attribute names
1509 and _attrname() and _getattr() with "descriptors": For each type of magic
1515 and _attrname() and _getattr() with "descriptors": For each type of magic
1510 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1516 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1511 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1517 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1512 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1518 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1513 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1519 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1514 are still supported.
1520 are still supported.
1515
1521
1516 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1522 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1517 fails in ibrowse.fetch(), the exception object is added as the last item
1523 fails in ibrowse.fetch(), the exception object is added as the last item
1518 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1524 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1519 a generator throws an exception midway through execution.
1525 a generator throws an exception midway through execution.
1520
1526
1521 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1527 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1522 encoding into methods.
1528 encoding into methods.
1523
1529
1524 2006-07-26 Ville Vainio <vivainio@gmail.com>
1530 2006-07-26 Ville Vainio <vivainio@gmail.com>
1525
1531
1526 * iplib.py: history now stores multiline input as single
1532 * iplib.py: history now stores multiline input as single
1527 history entries. Patch by Jorgen Cederlof.
1533 history entries. Patch by Jorgen Cederlof.
1528
1534
1529 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1535 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1530
1536
1531 * IPython/Extensions/ibrowse.py: Make cursor visible over
1537 * IPython/Extensions/ibrowse.py: Make cursor visible over
1532 non existing attributes.
1538 non existing attributes.
1533
1539
1534 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1540 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1535
1541
1536 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1542 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1537 error output of the running command doesn't mess up the screen.
1543 error output of the running command doesn't mess up the screen.
1538
1544
1539 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1545 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1540
1546
1541 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1547 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1542 argument. This sorts the items themselves.
1548 argument. This sorts the items themselves.
1543
1549
1544 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1550 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1545
1551
1546 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1552 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1547 Compile expression strings into code objects. This should speed
1553 Compile expression strings into code objects. This should speed
1548 up ifilter and friends somewhat.
1554 up ifilter and friends somewhat.
1549
1555
1550 2006-07-08 Ville Vainio <vivainio@gmail.com>
1556 2006-07-08 Ville Vainio <vivainio@gmail.com>
1551
1557
1552 * Magic.py: %cpaste now strips > from the beginning of lines
1558 * Magic.py: %cpaste now strips > from the beginning of lines
1553 to ease pasting quoted code from emails. Contributed by
1559 to ease pasting quoted code from emails. Contributed by
1554 Stefan van der Walt.
1560 Stefan van der Walt.
1555
1561
1556 2006-06-29 Ville Vainio <vivainio@gmail.com>
1562 2006-06-29 Ville Vainio <vivainio@gmail.com>
1557
1563
1558 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1564 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1559 mode, patch contributed by Darren Dale. NEEDS TESTING!
1565 mode, patch contributed by Darren Dale. NEEDS TESTING!
1560
1566
1561 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1567 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1562
1568
1563 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1569 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1564 a blue background. Fix fetching new display rows when the browser
1570 a blue background. Fix fetching new display rows when the browser
1565 scrolls more than a screenful (e.g. by using the goto command).
1571 scrolls more than a screenful (e.g. by using the goto command).
1566
1572
1567 2006-06-27 Ville Vainio <vivainio@gmail.com>
1573 2006-06-27 Ville Vainio <vivainio@gmail.com>
1568
1574
1569 * Magic.py (_inspect, _ofind) Apply David Huard's
1575 * Magic.py (_inspect, _ofind) Apply David Huard's
1570 patch for displaying the correct docstring for 'property'
1576 patch for displaying the correct docstring for 'property'
1571 attributes.
1577 attributes.
1572
1578
1573 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1579 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1574
1580
1575 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1581 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1576 commands into the methods implementing them.
1582 commands into the methods implementing them.
1577
1583
1578 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1584 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1579
1585
1580 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1586 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1581 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1587 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1582 autoindent support was authored by Jin Liu.
1588 autoindent support was authored by Jin Liu.
1583
1589
1584 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1590 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1585
1591
1586 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1592 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1587 for keymaps with a custom class that simplifies handling.
1593 for keymaps with a custom class that simplifies handling.
1588
1594
1589 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1595 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1590
1596
1591 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1597 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1592 resizing. This requires Python 2.5 to work.
1598 resizing. This requires Python 2.5 to work.
1593
1599
1594 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1600 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1595
1601
1596 * IPython/Extensions/ibrowse.py: Add two new commands to
1602 * IPython/Extensions/ibrowse.py: Add two new commands to
1597 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1603 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1598 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1604 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1599 attributes again. Remapped the help command to "?". Display
1605 attributes again. Remapped the help command to "?". Display
1600 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1606 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1601 as keys for the "home" and "end" commands. Add three new commands
1607 as keys for the "home" and "end" commands. Add three new commands
1602 to the input mode for "find" and friends: "delend" (CTRL-K)
1608 to the input mode for "find" and friends: "delend" (CTRL-K)
1603 deletes to the end of line. "incsearchup" searches upwards in the
1609 deletes to the end of line. "incsearchup" searches upwards in the
1604 command history for an input that starts with the text before the cursor.
1610 command history for an input that starts with the text before the cursor.
1605 "incsearchdown" does the same downwards. Removed a bogus mapping of
1611 "incsearchdown" does the same downwards. Removed a bogus mapping of
1606 the x key to "delete".
1612 the x key to "delete".
1607
1613
1608 2006-06-15 Ville Vainio <vivainio@gmail.com>
1614 2006-06-15 Ville Vainio <vivainio@gmail.com>
1609
1615
1610 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1616 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1611 used to create prompts dynamically, instead of the "old" way of
1617 used to create prompts dynamically, instead of the "old" way of
1612 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1618 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1613 way still works (it's invoked by the default hook), of course.
1619 way still works (it's invoked by the default hook), of course.
1614
1620
1615 * Prompts.py: added generate_output_prompt hook for altering output
1621 * Prompts.py: added generate_output_prompt hook for altering output
1616 prompt
1622 prompt
1617
1623
1618 * Release.py: Changed version string to 0.7.3.svn.
1624 * Release.py: Changed version string to 0.7.3.svn.
1619
1625
1620 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1626 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1621
1627
1622 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1628 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1623 the call to fetch() always tries to fetch enough data for at least one
1629 the call to fetch() always tries to fetch enough data for at least one
1624 full screen. This makes it possible to simply call moveto(0,0,True) in
1630 full screen. This makes it possible to simply call moveto(0,0,True) in
1625 the constructor. Fix typos and removed the obsolete goto attribute.
1631 the constructor. Fix typos and removed the obsolete goto attribute.
1626
1632
1627 2006-06-12 Ville Vainio <vivainio@gmail.com>
1633 2006-06-12 Ville Vainio <vivainio@gmail.com>
1628
1634
1629 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1635 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1630 allowing $variable interpolation within multiline statements,
1636 allowing $variable interpolation within multiline statements,
1631 though so far only with "sh" profile for a testing period.
1637 though so far only with "sh" profile for a testing period.
1632 The patch also enables splitting long commands with \ but it
1638 The patch also enables splitting long commands with \ but it
1633 doesn't work properly yet.
1639 doesn't work properly yet.
1634
1640
1635 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1641 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1636
1642
1637 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1643 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1638 input history and the position of the cursor in the input history for
1644 input history and the position of the cursor in the input history for
1639 the find, findbackwards and goto command.
1645 the find, findbackwards and goto command.
1640
1646
1641 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1647 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1642
1648
1643 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1649 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1644 implements the basic functionality of browser commands that require
1650 implements the basic functionality of browser commands that require
1645 input. Reimplement the goto, find and findbackwards commands as
1651 input. Reimplement the goto, find and findbackwards commands as
1646 subclasses of _CommandInput. Add an input history and keymaps to those
1652 subclasses of _CommandInput. Add an input history and keymaps to those
1647 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1653 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1648 execute commands.
1654 execute commands.
1649
1655
1650 2006-06-07 Ville Vainio <vivainio@gmail.com>
1656 2006-06-07 Ville Vainio <vivainio@gmail.com>
1651
1657
1652 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1658 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1653 running the batch files instead of leaving the session open.
1659 running the batch files instead of leaving the session open.
1654
1660
1655 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1661 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1656
1662
1657 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1663 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1658 the original fix was incomplete. Patch submitted by W. Maier.
1664 the original fix was incomplete. Patch submitted by W. Maier.
1659
1665
1660 2006-06-07 Ville Vainio <vivainio@gmail.com>
1666 2006-06-07 Ville Vainio <vivainio@gmail.com>
1661
1667
1662 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1668 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1663 Confirmation prompts can be supressed by 'quiet' option.
1669 Confirmation prompts can be supressed by 'quiet' option.
1664 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1670 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1665
1671
1666 2006-06-06 *** Released version 0.7.2
1672 2006-06-06 *** Released version 0.7.2
1667
1673
1668 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1674 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1669
1675
1670 * IPython/Release.py (version): Made 0.7.2 final for release.
1676 * IPython/Release.py (version): Made 0.7.2 final for release.
1671 Repo tagged and release cut.
1677 Repo tagged and release cut.
1672
1678
1673 2006-06-05 Ville Vainio <vivainio@gmail.com>
1679 2006-06-05 Ville Vainio <vivainio@gmail.com>
1674
1680
1675 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1681 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1676 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1682 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1677
1683
1678 * upgrade_dir.py: try import 'path' module a bit harder
1684 * upgrade_dir.py: try import 'path' module a bit harder
1679 (for %upgrade)
1685 (for %upgrade)
1680
1686
1681 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1687 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1682
1688
1683 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1689 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1684 instead of looping 20 times.
1690 instead of looping 20 times.
1685
1691
1686 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1692 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1687 correctly at initialization time. Bug reported by Krishna Mohan
1693 correctly at initialization time. Bug reported by Krishna Mohan
1688 Gundu <gkmohan-AT-gmail.com> on the user list.
1694 Gundu <gkmohan-AT-gmail.com> on the user list.
1689
1695
1690 * IPython/Release.py (version): Mark 0.7.2 version to start
1696 * IPython/Release.py (version): Mark 0.7.2 version to start
1691 testing for release on 06/06.
1697 testing for release on 06/06.
1692
1698
1693 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1699 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1694
1700
1695 * scripts/irunner: thin script interface so users don't have to
1701 * scripts/irunner: thin script interface so users don't have to
1696 find the module and call it as an executable, since modules rarely
1702 find the module and call it as an executable, since modules rarely
1697 live in people's PATH.
1703 live in people's PATH.
1698
1704
1699 * IPython/irunner.py (InteractiveRunner.__init__): added
1705 * IPython/irunner.py (InteractiveRunner.__init__): added
1700 delaybeforesend attribute to control delays with newer versions of
1706 delaybeforesend attribute to control delays with newer versions of
1701 pexpect. Thanks to detailed help from pexpect's author, Noah
1707 pexpect. Thanks to detailed help from pexpect's author, Noah
1702 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1708 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1703 correctly (it works in NoColor mode).
1709 correctly (it works in NoColor mode).
1704
1710
1705 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1711 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1706 SAGE list, from improper log() calls.
1712 SAGE list, from improper log() calls.
1707
1713
1708 2006-05-31 Ville Vainio <vivainio@gmail.com>
1714 2006-05-31 Ville Vainio <vivainio@gmail.com>
1709
1715
1710 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1716 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1711 with args in parens to work correctly with dirs that have spaces.
1717 with args in parens to work correctly with dirs that have spaces.
1712
1718
1713 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1719 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1714
1720
1715 * IPython/Logger.py (Logger.logstart): add option to log raw input
1721 * IPython/Logger.py (Logger.logstart): add option to log raw input
1716 instead of the processed one. A -r flag was added to the
1722 instead of the processed one. A -r flag was added to the
1717 %logstart magic used for controlling logging.
1723 %logstart magic used for controlling logging.
1718
1724
1719 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1725 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1720
1726
1721 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1727 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1722 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1728 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1723 recognize the option. After a bug report by Will Maier. This
1729 recognize the option. After a bug report by Will Maier. This
1724 closes #64 (will do it after confirmation from W. Maier).
1730 closes #64 (will do it after confirmation from W. Maier).
1725
1731
1726 * IPython/irunner.py: New module to run scripts as if manually
1732 * IPython/irunner.py: New module to run scripts as if manually
1727 typed into an interactive environment, based on pexpect. After a
1733 typed into an interactive environment, based on pexpect. After a
1728 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1734 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1729 ipython-user list. Simple unittests in the tests/ directory.
1735 ipython-user list. Simple unittests in the tests/ directory.
1730
1736
1731 * tools/release: add Will Maier, OpenBSD port maintainer, to
1737 * tools/release: add Will Maier, OpenBSD port maintainer, to
1732 recepients list. We are now officially part of the OpenBSD ports:
1738 recepients list. We are now officially part of the OpenBSD ports:
1733 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1739 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1734 work.
1740 work.
1735
1741
1736 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1742 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1737
1743
1738 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1744 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1739 so that it doesn't break tkinter apps.
1745 so that it doesn't break tkinter apps.
1740
1746
1741 * IPython/iplib.py (_prefilter): fix bug where aliases would
1747 * IPython/iplib.py (_prefilter): fix bug where aliases would
1742 shadow variables when autocall was fully off. Reported by SAGE
1748 shadow variables when autocall was fully off. Reported by SAGE
1743 author William Stein.
1749 author William Stein.
1744
1750
1745 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1751 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1746 at what detail level strings are computed when foo? is requested.
1752 at what detail level strings are computed when foo? is requested.
1747 This allows users to ask for example that the string form of an
1753 This allows users to ask for example that the string form of an
1748 object is only computed when foo?? is called, or even never, by
1754 object is only computed when foo?? is called, or even never, by
1749 setting the object_info_string_level >= 2 in the configuration
1755 setting the object_info_string_level >= 2 in the configuration
1750 file. This new option has been added and documented. After a
1756 file. This new option has been added and documented. After a
1751 request by SAGE to be able to control the printing of very large
1757 request by SAGE to be able to control the printing of very large
1752 objects more easily.
1758 objects more easily.
1753
1759
1754 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1760 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1755
1761
1756 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1762 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1757 from sys.argv, to be 100% consistent with how Python itself works
1763 from sys.argv, to be 100% consistent with how Python itself works
1758 (as seen for example with python -i file.py). After a bug report
1764 (as seen for example with python -i file.py). After a bug report
1759 by Jeffrey Collins.
1765 by Jeffrey Collins.
1760
1766
1761 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1767 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1762 nasty bug which was preventing custom namespaces with -pylab,
1768 nasty bug which was preventing custom namespaces with -pylab,
1763 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1769 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1764 compatibility (long gone from mpl).
1770 compatibility (long gone from mpl).
1765
1771
1766 * IPython/ipapi.py (make_session): name change: create->make. We
1772 * IPython/ipapi.py (make_session): name change: create->make. We
1767 use make in other places (ipmaker,...), it's shorter and easier to
1773 use make in other places (ipmaker,...), it's shorter and easier to
1768 type and say, etc. I'm trying to clean things before 0.7.2 so
1774 type and say, etc. I'm trying to clean things before 0.7.2 so
1769 that I can keep things stable wrt to ipapi in the chainsaw branch.
1775 that I can keep things stable wrt to ipapi in the chainsaw branch.
1770
1776
1771 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1777 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1772 python-mode recognizes our debugger mode. Add support for
1778 python-mode recognizes our debugger mode. Add support for
1773 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1779 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1774 <m.liu.jin-AT-gmail.com> originally written by
1780 <m.liu.jin-AT-gmail.com> originally written by
1775 doxgen-AT-newsmth.net (with minor modifications for xemacs
1781 doxgen-AT-newsmth.net (with minor modifications for xemacs
1776 compatibility)
1782 compatibility)
1777
1783
1778 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1784 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1779 tracebacks when walking the stack so that the stack tracking system
1785 tracebacks when walking the stack so that the stack tracking system
1780 in emacs' python-mode can identify the frames correctly.
1786 in emacs' python-mode can identify the frames correctly.
1781
1787
1782 * IPython/ipmaker.py (make_IPython): make the internal (and
1788 * IPython/ipmaker.py (make_IPython): make the internal (and
1783 default config) autoedit_syntax value false by default. Too many
1789 default config) autoedit_syntax value false by default. Too many
1784 users have complained to me (both on and off-list) about problems
1790 users have complained to me (both on and off-list) about problems
1785 with this option being on by default, so I'm making it default to
1791 with this option being on by default, so I'm making it default to
1786 off. It can still be enabled by anyone via the usual mechanisms.
1792 off. It can still be enabled by anyone via the usual mechanisms.
1787
1793
1788 * IPython/completer.py (Completer.attr_matches): add support for
1794 * IPython/completer.py (Completer.attr_matches): add support for
1789 PyCrust-style _getAttributeNames magic method. Patch contributed
1795 PyCrust-style _getAttributeNames magic method. Patch contributed
1790 by <mscott-AT-goldenspud.com>. Closes #50.
1796 by <mscott-AT-goldenspud.com>. Closes #50.
1791
1797
1792 * IPython/iplib.py (InteractiveShell.__init__): remove the
1798 * IPython/iplib.py (InteractiveShell.__init__): remove the
1793 deletion of exit/quit from __builtin__, which can break
1799 deletion of exit/quit from __builtin__, which can break
1794 third-party tools like the Zope debugging console. The
1800 third-party tools like the Zope debugging console. The
1795 %exit/%quit magics remain. In general, it's probably a good idea
1801 %exit/%quit magics remain. In general, it's probably a good idea
1796 not to delete anything from __builtin__, since we never know what
1802 not to delete anything from __builtin__, since we never know what
1797 that will break. In any case, python now (for 2.5) will support
1803 that will break. In any case, python now (for 2.5) will support
1798 'real' exit/quit, so this issue is moot. Closes #55.
1804 'real' exit/quit, so this issue is moot. Closes #55.
1799
1805
1800 * IPython/genutils.py (with_obj): rename the 'with' function to
1806 * IPython/genutils.py (with_obj): rename the 'with' function to
1801 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1807 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1802 becomes a language keyword. Closes #53.
1808 becomes a language keyword. Closes #53.
1803
1809
1804 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1810 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1805 __file__ attribute to this so it fools more things into thinking
1811 __file__ attribute to this so it fools more things into thinking
1806 it is a real module. Closes #59.
1812 it is a real module. Closes #59.
1807
1813
1808 * IPython/Magic.py (magic_edit): add -n option to open the editor
1814 * IPython/Magic.py (magic_edit): add -n option to open the editor
1809 at a specific line number. After a patch by Stefan van der Walt.
1815 at a specific line number. After a patch by Stefan van der Walt.
1810
1816
1811 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1817 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1812
1818
1813 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1819 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1814 reason the file could not be opened. After automatic crash
1820 reason the file could not be opened. After automatic crash
1815 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1821 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1816 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1822 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1817 (_should_recompile): Don't fire editor if using %bg, since there
1823 (_should_recompile): Don't fire editor if using %bg, since there
1818 is no file in the first place. From the same report as above.
1824 is no file in the first place. From the same report as above.
1819 (raw_input): protect against faulty third-party prefilters. After
1825 (raw_input): protect against faulty third-party prefilters. After
1820 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1826 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1821 while running under SAGE.
1827 while running under SAGE.
1822
1828
1823 2006-05-23 Ville Vainio <vivainio@gmail.com>
1829 2006-05-23 Ville Vainio <vivainio@gmail.com>
1824
1830
1825 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1831 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1826 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1832 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1827 now returns None (again), unless dummy is specifically allowed by
1833 now returns None (again), unless dummy is specifically allowed by
1828 ipapi.get(allow_dummy=True).
1834 ipapi.get(allow_dummy=True).
1829
1835
1830 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1836 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1831
1837
1832 * IPython: remove all 2.2-compatibility objects and hacks from
1838 * IPython: remove all 2.2-compatibility objects and hacks from
1833 everywhere, since we only support 2.3 at this point. Docs
1839 everywhere, since we only support 2.3 at this point. Docs
1834 updated.
1840 updated.
1835
1841
1836 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1842 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1837 Anything requiring extra validation can be turned into a Python
1843 Anything requiring extra validation can be turned into a Python
1838 property in the future. I used a property for the db one b/c
1844 property in the future. I used a property for the db one b/c
1839 there was a nasty circularity problem with the initialization
1845 there was a nasty circularity problem with the initialization
1840 order, which right now I don't have time to clean up.
1846 order, which right now I don't have time to clean up.
1841
1847
1842 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1848 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1843 another locking bug reported by Jorgen. I'm not 100% sure though,
1849 another locking bug reported by Jorgen. I'm not 100% sure though,
1844 so more testing is needed...
1850 so more testing is needed...
1845
1851
1846 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1852 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1847
1853
1848 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1854 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1849 local variables from any routine in user code (typically executed
1855 local variables from any routine in user code (typically executed
1850 with %run) directly into the interactive namespace. Very useful
1856 with %run) directly into the interactive namespace. Very useful
1851 when doing complex debugging.
1857 when doing complex debugging.
1852 (IPythonNotRunning): Changed the default None object to a dummy
1858 (IPythonNotRunning): Changed the default None object to a dummy
1853 whose attributes can be queried as well as called without
1859 whose attributes can be queried as well as called without
1854 exploding, to ease writing code which works transparently both in
1860 exploding, to ease writing code which works transparently both in
1855 and out of ipython and uses some of this API.
1861 and out of ipython and uses some of this API.
1856
1862
1857 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1863 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1858
1864
1859 * IPython/hooks.py (result_display): Fix the fact that our display
1865 * IPython/hooks.py (result_display): Fix the fact that our display
1860 hook was using str() instead of repr(), as the default python
1866 hook was using str() instead of repr(), as the default python
1861 console does. This had gone unnoticed b/c it only happened if
1867 console does. This had gone unnoticed b/c it only happened if
1862 %Pprint was off, but the inconsistency was there.
1868 %Pprint was off, but the inconsistency was there.
1863
1869
1864 2006-05-15 Ville Vainio <vivainio@gmail.com>
1870 2006-05-15 Ville Vainio <vivainio@gmail.com>
1865
1871
1866 * Oinspect.py: Only show docstring for nonexisting/binary files
1872 * Oinspect.py: Only show docstring for nonexisting/binary files
1867 when doing object??, closing ticket #62
1873 when doing object??, closing ticket #62
1868
1874
1869 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1875 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1870
1876
1871 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1877 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1872 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1878 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1873 was being released in a routine which hadn't checked if it had
1879 was being released in a routine which hadn't checked if it had
1874 been the one to acquire it.
1880 been the one to acquire it.
1875
1881
1876 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1882 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1877
1883
1878 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1884 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1879
1885
1880 2006-04-11 Ville Vainio <vivainio@gmail.com>
1886 2006-04-11 Ville Vainio <vivainio@gmail.com>
1881
1887
1882 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1888 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1883 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1889 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1884 prefilters, allowing stuff like magics and aliases in the file.
1890 prefilters, allowing stuff like magics and aliases in the file.
1885
1891
1886 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1892 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1887 added. Supported now are "%clear in" and "%clear out" (clear input and
1893 added. Supported now are "%clear in" and "%clear out" (clear input and
1888 output history, respectively). Also fixed CachedOutput.flush to
1894 output history, respectively). Also fixed CachedOutput.flush to
1889 properly flush the output cache.
1895 properly flush the output cache.
1890
1896
1891 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1897 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1892 half-success (and fail explicitly).
1898 half-success (and fail explicitly).
1893
1899
1894 2006-03-28 Ville Vainio <vivainio@gmail.com>
1900 2006-03-28 Ville Vainio <vivainio@gmail.com>
1895
1901
1896 * iplib.py: Fix quoting of aliases so that only argless ones
1902 * iplib.py: Fix quoting of aliases so that only argless ones
1897 are quoted
1903 are quoted
1898
1904
1899 2006-03-28 Ville Vainio <vivainio@gmail.com>
1905 2006-03-28 Ville Vainio <vivainio@gmail.com>
1900
1906
1901 * iplib.py: Quote aliases with spaces in the name.
1907 * iplib.py: Quote aliases with spaces in the name.
1902 "c:\program files\blah\bin" is now legal alias target.
1908 "c:\program files\blah\bin" is now legal alias target.
1903
1909
1904 * ext_rehashdir.py: Space no longer allowed as arg
1910 * ext_rehashdir.py: Space no longer allowed as arg
1905 separator, since space is legal in path names.
1911 separator, since space is legal in path names.
1906
1912
1907 2006-03-16 Ville Vainio <vivainio@gmail.com>
1913 2006-03-16 Ville Vainio <vivainio@gmail.com>
1908
1914
1909 * upgrade_dir.py: Take path.py from Extensions, correcting
1915 * upgrade_dir.py: Take path.py from Extensions, correcting
1910 %upgrade magic
1916 %upgrade magic
1911
1917
1912 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1918 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1913
1919
1914 * hooks.py: Only enclose editor binary in quotes if legal and
1920 * hooks.py: Only enclose editor binary in quotes if legal and
1915 necessary (space in the name, and is an existing file). Fixes a bug
1921 necessary (space in the name, and is an existing file). Fixes a bug
1916 reported by Zachary Pincus.
1922 reported by Zachary Pincus.
1917
1923
1918 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1924 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1919
1925
1920 * Manual: thanks to a tip on proper color handling for Emacs, by
1926 * Manual: thanks to a tip on proper color handling for Emacs, by
1921 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1927 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1922
1928
1923 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1929 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1924 by applying the provided patch. Thanks to Liu Jin
1930 by applying the provided patch. Thanks to Liu Jin
1925 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1931 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1926 XEmacs/Linux, I'm trusting the submitter that it actually helps
1932 XEmacs/Linux, I'm trusting the submitter that it actually helps
1927 under win32/GNU Emacs. Will revisit if any problems are reported.
1933 under win32/GNU Emacs. Will revisit if any problems are reported.
1928
1934
1929 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1935 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1930
1936
1931 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1937 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1932 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1938 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1933
1939
1934 2006-03-12 Ville Vainio <vivainio@gmail.com>
1940 2006-03-12 Ville Vainio <vivainio@gmail.com>
1935
1941
1936 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1942 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1937 Torsten Marek.
1943 Torsten Marek.
1938
1944
1939 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1945 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1940
1946
1941 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1947 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1942 line ranges works again.
1948 line ranges works again.
1943
1949
1944 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1950 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1945
1951
1946 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1952 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1947 and friends, after a discussion with Zach Pincus on ipython-user.
1953 and friends, after a discussion with Zach Pincus on ipython-user.
1948 I'm not 100% sure, but after thinking about it quite a bit, it may
1954 I'm not 100% sure, but after thinking about it quite a bit, it may
1949 be OK. Testing with the multithreaded shells didn't reveal any
1955 be OK. Testing with the multithreaded shells didn't reveal any
1950 problems, but let's keep an eye out.
1956 problems, but let's keep an eye out.
1951
1957
1952 In the process, I fixed a few things which were calling
1958 In the process, I fixed a few things which were calling
1953 self.InteractiveTB() directly (like safe_execfile), which is a
1959 self.InteractiveTB() directly (like safe_execfile), which is a
1954 mistake: ALL exception reporting should be done by calling
1960 mistake: ALL exception reporting should be done by calling
1955 self.showtraceback(), which handles state and tab-completion and
1961 self.showtraceback(), which handles state and tab-completion and
1956 more.
1962 more.
1957
1963
1958 2006-03-01 Ville Vainio <vivainio@gmail.com>
1964 2006-03-01 Ville Vainio <vivainio@gmail.com>
1959
1965
1960 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1966 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1961 To use, do "from ipipe import *".
1967 To use, do "from ipipe import *".
1962
1968
1963 2006-02-24 Ville Vainio <vivainio@gmail.com>
1969 2006-02-24 Ville Vainio <vivainio@gmail.com>
1964
1970
1965 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1971 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1966 "cleanly" and safely than the older upgrade mechanism.
1972 "cleanly" and safely than the older upgrade mechanism.
1967
1973
1968 2006-02-21 Ville Vainio <vivainio@gmail.com>
1974 2006-02-21 Ville Vainio <vivainio@gmail.com>
1969
1975
1970 * Magic.py: %save works again.
1976 * Magic.py: %save works again.
1971
1977
1972 2006-02-15 Ville Vainio <vivainio@gmail.com>
1978 2006-02-15 Ville Vainio <vivainio@gmail.com>
1973
1979
1974 * Magic.py: %Pprint works again
1980 * Magic.py: %Pprint works again
1975
1981
1976 * Extensions/ipy_sane_defaults.py: Provide everything provided
1982 * Extensions/ipy_sane_defaults.py: Provide everything provided
1977 in default ipythonrc, to make it possible to have a completely empty
1983 in default ipythonrc, to make it possible to have a completely empty
1978 ipythonrc (and thus completely rc-file free configuration)
1984 ipythonrc (and thus completely rc-file free configuration)
1979
1985
1980 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1986 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1981
1987
1982 * IPython/hooks.py (editor): quote the call to the editor command,
1988 * IPython/hooks.py (editor): quote the call to the editor command,
1983 to allow commands with spaces in them. Problem noted by watching
1989 to allow commands with spaces in them. Problem noted by watching
1984 Ian Oswald's video about textpad under win32 at
1990 Ian Oswald's video about textpad under win32 at
1985 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1991 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1986
1992
1987 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1993 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1988 describing magics (we haven't used @ for a loong time).
1994 describing magics (we haven't used @ for a loong time).
1989
1995
1990 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1996 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1991 contributed by marienz to close
1997 contributed by marienz to close
1992 http://www.scipy.net/roundup/ipython/issue53.
1998 http://www.scipy.net/roundup/ipython/issue53.
1993
1999
1994 2006-02-10 Ville Vainio <vivainio@gmail.com>
2000 2006-02-10 Ville Vainio <vivainio@gmail.com>
1995
2001
1996 * genutils.py: getoutput now works in win32 too
2002 * genutils.py: getoutput now works in win32 too
1997
2003
1998 * completer.py: alias and magic completion only invoked
2004 * completer.py: alias and magic completion only invoked
1999 at the first "item" in the line, to avoid "cd %store"
2005 at the first "item" in the line, to avoid "cd %store"
2000 nonsense.
2006 nonsense.
2001
2007
2002 2006-02-09 Ville Vainio <vivainio@gmail.com>
2008 2006-02-09 Ville Vainio <vivainio@gmail.com>
2003
2009
2004 * test/*: Added a unit testing framework (finally).
2010 * test/*: Added a unit testing framework (finally).
2005 '%run runtests.py' to run test_*.
2011 '%run runtests.py' to run test_*.
2006
2012
2007 * ipapi.py: Exposed runlines and set_custom_exc
2013 * ipapi.py: Exposed runlines and set_custom_exc
2008
2014
2009 2006-02-07 Ville Vainio <vivainio@gmail.com>
2015 2006-02-07 Ville Vainio <vivainio@gmail.com>
2010
2016
2011 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2017 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2012 instead use "f(1 2)" as before.
2018 instead use "f(1 2)" as before.
2013
2019
2014 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2020 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2015
2021
2016 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2022 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2017 facilities, for demos processed by the IPython input filter
2023 facilities, for demos processed by the IPython input filter
2018 (IPythonDemo), and for running a script one-line-at-a-time as a
2024 (IPythonDemo), and for running a script one-line-at-a-time as a
2019 demo, both for pure Python (LineDemo) and for IPython-processed
2025 demo, both for pure Python (LineDemo) and for IPython-processed
2020 input (IPythonLineDemo). After a request by Dave Kohel, from the
2026 input (IPythonLineDemo). After a request by Dave Kohel, from the
2021 SAGE team.
2027 SAGE team.
2022 (Demo.edit): added an edit() method to the demo objects, to edit
2028 (Demo.edit): added an edit() method to the demo objects, to edit
2023 the in-memory copy of the last executed block.
2029 the in-memory copy of the last executed block.
2024
2030
2025 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2031 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2026 processing to %edit, %macro and %save. These commands can now be
2032 processing to %edit, %macro and %save. These commands can now be
2027 invoked on the unprocessed input as it was typed by the user
2033 invoked on the unprocessed input as it was typed by the user
2028 (without any prefilters applied). After requests by the SAGE team
2034 (without any prefilters applied). After requests by the SAGE team
2029 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2035 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2030
2036
2031 2006-02-01 Ville Vainio <vivainio@gmail.com>
2037 2006-02-01 Ville Vainio <vivainio@gmail.com>
2032
2038
2033 * setup.py, eggsetup.py: easy_install ipython==dev works
2039 * setup.py, eggsetup.py: easy_install ipython==dev works
2034 correctly now (on Linux)
2040 correctly now (on Linux)
2035
2041
2036 * ipy_user_conf,ipmaker: user config changes, removed spurious
2042 * ipy_user_conf,ipmaker: user config changes, removed spurious
2037 warnings
2043 warnings
2038
2044
2039 * iplib: if rc.banner is string, use it as is.
2045 * iplib: if rc.banner is string, use it as is.
2040
2046
2041 * Magic: %pycat accepts a string argument and pages it's contents.
2047 * Magic: %pycat accepts a string argument and pages it's contents.
2042
2048
2043
2049
2044 2006-01-30 Ville Vainio <vivainio@gmail.com>
2050 2006-01-30 Ville Vainio <vivainio@gmail.com>
2045
2051
2046 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2052 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2047 Now %store and bookmarks work through PickleShare, meaning that
2053 Now %store and bookmarks work through PickleShare, meaning that
2048 concurrent access is possible and all ipython sessions see the
2054 concurrent access is possible and all ipython sessions see the
2049 same database situation all the time, instead of snapshot of
2055 same database situation all the time, instead of snapshot of
2050 the situation when the session was started. Hence, %bookmark
2056 the situation when the session was started. Hence, %bookmark
2051 results are immediately accessible from othes sessions. The database
2057 results are immediately accessible from othes sessions. The database
2052 is also available for use by user extensions. See:
2058 is also available for use by user extensions. See:
2053 http://www.python.org/pypi/pickleshare
2059 http://www.python.org/pypi/pickleshare
2054
2060
2055 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2061 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2056
2062
2057 * aliases can now be %store'd
2063 * aliases can now be %store'd
2058
2064
2059 * path.py moved to Extensions so that pickleshare does not need
2065 * path.py moved to Extensions so that pickleshare does not need
2060 IPython-specific import. Extensions added to pythonpath right
2066 IPython-specific import. Extensions added to pythonpath right
2061 at __init__.
2067 at __init__.
2062
2068
2063 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2069 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2064 called with _ip.system and the pre-transformed command string.
2070 called with _ip.system and the pre-transformed command string.
2065
2071
2066 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2072 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2067
2073
2068 * IPython/iplib.py (interact): Fix that we were not catching
2074 * IPython/iplib.py (interact): Fix that we were not catching
2069 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2075 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2070 logic here had to change, but it's fixed now.
2076 logic here had to change, but it's fixed now.
2071
2077
2072 2006-01-29 Ville Vainio <vivainio@gmail.com>
2078 2006-01-29 Ville Vainio <vivainio@gmail.com>
2073
2079
2074 * iplib.py: Try to import pyreadline on Windows.
2080 * iplib.py: Try to import pyreadline on Windows.
2075
2081
2076 2006-01-27 Ville Vainio <vivainio@gmail.com>
2082 2006-01-27 Ville Vainio <vivainio@gmail.com>
2077
2083
2078 * iplib.py: Expose ipapi as _ip in builtin namespace.
2084 * iplib.py: Expose ipapi as _ip in builtin namespace.
2079 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2085 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2080 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2086 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2081 syntax now produce _ip.* variant of the commands.
2087 syntax now produce _ip.* variant of the commands.
2082
2088
2083 * "_ip.options().autoedit_syntax = 2" automatically throws
2089 * "_ip.options().autoedit_syntax = 2" automatically throws
2084 user to editor for syntax error correction without prompting.
2090 user to editor for syntax error correction without prompting.
2085
2091
2086 2006-01-27 Ville Vainio <vivainio@gmail.com>
2092 2006-01-27 Ville Vainio <vivainio@gmail.com>
2087
2093
2088 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2094 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2089 'ipython' at argv[0]) executed through command line.
2095 'ipython' at argv[0]) executed through command line.
2090 NOTE: this DEPRECATES calling ipython with multiple scripts
2096 NOTE: this DEPRECATES calling ipython with multiple scripts
2091 ("ipython a.py b.py c.py")
2097 ("ipython a.py b.py c.py")
2092
2098
2093 * iplib.py, hooks.py: Added configurable input prefilter,
2099 * iplib.py, hooks.py: Added configurable input prefilter,
2094 named 'input_prefilter'. See ext_rescapture.py for example
2100 named 'input_prefilter'. See ext_rescapture.py for example
2095 usage.
2101 usage.
2096
2102
2097 * ext_rescapture.py, Magic.py: Better system command output capture
2103 * ext_rescapture.py, Magic.py: Better system command output capture
2098 through 'var = !ls' (deprecates user-visible %sc). Same notation
2104 through 'var = !ls' (deprecates user-visible %sc). Same notation
2099 applies for magics, 'var = %alias' assigns alias list to var.
2105 applies for magics, 'var = %alias' assigns alias list to var.
2100
2106
2101 * ipapi.py: added meta() for accessing extension-usable data store.
2107 * ipapi.py: added meta() for accessing extension-usable data store.
2102
2108
2103 * iplib.py: added InteractiveShell.getapi(). New magics should be
2109 * iplib.py: added InteractiveShell.getapi(). New magics should be
2104 written doing self.getapi() instead of using the shell directly.
2110 written doing self.getapi() instead of using the shell directly.
2105
2111
2106 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2112 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2107 %store foo >> ~/myfoo.txt to store variables to files (in clean
2113 %store foo >> ~/myfoo.txt to store variables to files (in clean
2108 textual form, not a restorable pickle).
2114 textual form, not a restorable pickle).
2109
2115
2110 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2116 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2111
2117
2112 * usage.py, Magic.py: added %quickref
2118 * usage.py, Magic.py: added %quickref
2113
2119
2114 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2120 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2115
2121
2116 * GetoptErrors when invoking magics etc. with wrong args
2122 * GetoptErrors when invoking magics etc. with wrong args
2117 are now more helpful:
2123 are now more helpful:
2118 GetoptError: option -l not recognized (allowed: "qb" )
2124 GetoptError: option -l not recognized (allowed: "qb" )
2119
2125
2120 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2126 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2121
2127
2122 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2128 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2123 computationally intensive blocks don't appear to stall the demo.
2129 computationally intensive blocks don't appear to stall the demo.
2124
2130
2125 2006-01-24 Ville Vainio <vivainio@gmail.com>
2131 2006-01-24 Ville Vainio <vivainio@gmail.com>
2126
2132
2127 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2133 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2128 value to manipulate resulting history entry.
2134 value to manipulate resulting history entry.
2129
2135
2130 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2136 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2131 to instance methods of IPApi class, to make extending an embedded
2137 to instance methods of IPApi class, to make extending an embedded
2132 IPython feasible. See ext_rehashdir.py for example usage.
2138 IPython feasible. See ext_rehashdir.py for example usage.
2133
2139
2134 * Merged 1071-1076 from branches/0.7.1
2140 * Merged 1071-1076 from branches/0.7.1
2135
2141
2136
2142
2137 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2143 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2138
2144
2139 * tools/release (daystamp): Fix build tools to use the new
2145 * tools/release (daystamp): Fix build tools to use the new
2140 eggsetup.py script to build lightweight eggs.
2146 eggsetup.py script to build lightweight eggs.
2141
2147
2142 * Applied changesets 1062 and 1064 before 0.7.1 release.
2148 * Applied changesets 1062 and 1064 before 0.7.1 release.
2143
2149
2144 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2150 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2145 see the raw input history (without conversions like %ls ->
2151 see the raw input history (without conversions like %ls ->
2146 ipmagic("ls")). After a request from W. Stein, SAGE
2152 ipmagic("ls")). After a request from W. Stein, SAGE
2147 (http://modular.ucsd.edu/sage) developer. This information is
2153 (http://modular.ucsd.edu/sage) developer. This information is
2148 stored in the input_hist_raw attribute of the IPython instance, so
2154 stored in the input_hist_raw attribute of the IPython instance, so
2149 developers can access it if needed (it's an InputList instance).
2155 developers can access it if needed (it's an InputList instance).
2150
2156
2151 * Versionstring = 0.7.2.svn
2157 * Versionstring = 0.7.2.svn
2152
2158
2153 * eggsetup.py: A separate script for constructing eggs, creates
2159 * eggsetup.py: A separate script for constructing eggs, creates
2154 proper launch scripts even on Windows (an .exe file in
2160 proper launch scripts even on Windows (an .exe file in
2155 \python24\scripts).
2161 \python24\scripts).
2156
2162
2157 * ipapi.py: launch_new_instance, launch entry point needed for the
2163 * ipapi.py: launch_new_instance, launch entry point needed for the
2158 egg.
2164 egg.
2159
2165
2160 2006-01-23 Ville Vainio <vivainio@gmail.com>
2166 2006-01-23 Ville Vainio <vivainio@gmail.com>
2161
2167
2162 * Added %cpaste magic for pasting python code
2168 * Added %cpaste magic for pasting python code
2163
2169
2164 2006-01-22 Ville Vainio <vivainio@gmail.com>
2170 2006-01-22 Ville Vainio <vivainio@gmail.com>
2165
2171
2166 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2172 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2167
2173
2168 * Versionstring = 0.7.2.svn
2174 * Versionstring = 0.7.2.svn
2169
2175
2170 * eggsetup.py: A separate script for constructing eggs, creates
2176 * eggsetup.py: A separate script for constructing eggs, creates
2171 proper launch scripts even on Windows (an .exe file in
2177 proper launch scripts even on Windows (an .exe file in
2172 \python24\scripts).
2178 \python24\scripts).
2173
2179
2174 * ipapi.py: launch_new_instance, launch entry point needed for the
2180 * ipapi.py: launch_new_instance, launch entry point needed for the
2175 egg.
2181 egg.
2176
2182
2177 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2183 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2178
2184
2179 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2185 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2180 %pfile foo would print the file for foo even if it was a binary.
2186 %pfile foo would print the file for foo even if it was a binary.
2181 Now, extensions '.so' and '.dll' are skipped.
2187 Now, extensions '.so' and '.dll' are skipped.
2182
2188
2183 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2189 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2184 bug, where macros would fail in all threaded modes. I'm not 100%
2190 bug, where macros would fail in all threaded modes. I'm not 100%
2185 sure, so I'm going to put out an rc instead of making a release
2191 sure, so I'm going to put out an rc instead of making a release
2186 today, and wait for feedback for at least a few days.
2192 today, and wait for feedback for at least a few days.
2187
2193
2188 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2194 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2189 it...) the handling of pasting external code with autoindent on.
2195 it...) the handling of pasting external code with autoindent on.
2190 To get out of a multiline input, the rule will appear for most
2196 To get out of a multiline input, the rule will appear for most
2191 users unchanged: two blank lines or change the indent level
2197 users unchanged: two blank lines or change the indent level
2192 proposed by IPython. But there is a twist now: you can
2198 proposed by IPython. But there is a twist now: you can
2193 add/subtract only *one or two spaces*. If you add/subtract three
2199 add/subtract only *one or two spaces*. If you add/subtract three
2194 or more (unless you completely delete the line), IPython will
2200 or more (unless you completely delete the line), IPython will
2195 accept that line, and you'll need to enter a second one of pure
2201 accept that line, and you'll need to enter a second one of pure
2196 whitespace. I know it sounds complicated, but I can't find a
2202 whitespace. I know it sounds complicated, but I can't find a
2197 different solution that covers all the cases, with the right
2203 different solution that covers all the cases, with the right
2198 heuristics. Hopefully in actual use, nobody will really notice
2204 heuristics. Hopefully in actual use, nobody will really notice
2199 all these strange rules and things will 'just work'.
2205 all these strange rules and things will 'just work'.
2200
2206
2201 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2207 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2202
2208
2203 * IPython/iplib.py (interact): catch exceptions which can be
2209 * IPython/iplib.py (interact): catch exceptions which can be
2204 triggered asynchronously by signal handlers. Thanks to an
2210 triggered asynchronously by signal handlers. Thanks to an
2205 automatic crash report, submitted by Colin Kingsley
2211 automatic crash report, submitted by Colin Kingsley
2206 <tercel-AT-gentoo.org>.
2212 <tercel-AT-gentoo.org>.
2207
2213
2208 2006-01-20 Ville Vainio <vivainio@gmail.com>
2214 2006-01-20 Ville Vainio <vivainio@gmail.com>
2209
2215
2210 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2216 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2211 (%rehashdir, very useful, try it out) of how to extend ipython
2217 (%rehashdir, very useful, try it out) of how to extend ipython
2212 with new magics. Also added Extensions dir to pythonpath to make
2218 with new magics. Also added Extensions dir to pythonpath to make
2213 importing extensions easy.
2219 importing extensions easy.
2214
2220
2215 * %store now complains when trying to store interactively declared
2221 * %store now complains when trying to store interactively declared
2216 classes / instances of those classes.
2222 classes / instances of those classes.
2217
2223
2218 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2224 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2219 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2225 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2220 if they exist, and ipy_user_conf.py with some defaults is created for
2226 if they exist, and ipy_user_conf.py with some defaults is created for
2221 the user.
2227 the user.
2222
2228
2223 * Startup rehashing done by the config file, not InterpreterExec.
2229 * Startup rehashing done by the config file, not InterpreterExec.
2224 This means system commands are available even without selecting the
2230 This means system commands are available even without selecting the
2225 pysh profile. It's the sensible default after all.
2231 pysh profile. It's the sensible default after all.
2226
2232
2227 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2233 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2228
2234
2229 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2235 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2230 multiline code with autoindent on working. But I am really not
2236 multiline code with autoindent on working. But I am really not
2231 sure, so this needs more testing. Will commit a debug-enabled
2237 sure, so this needs more testing. Will commit a debug-enabled
2232 version for now, while I test it some more, so that Ville and
2238 version for now, while I test it some more, so that Ville and
2233 others may also catch any problems. Also made
2239 others may also catch any problems. Also made
2234 self.indent_current_str() a method, to ensure that there's no
2240 self.indent_current_str() a method, to ensure that there's no
2235 chance of the indent space count and the corresponding string
2241 chance of the indent space count and the corresponding string
2236 falling out of sync. All code needing the string should just call
2242 falling out of sync. All code needing the string should just call
2237 the method.
2243 the method.
2238
2244
2239 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2245 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2240
2246
2241 * IPython/Magic.py (magic_edit): fix check for when users don't
2247 * IPython/Magic.py (magic_edit): fix check for when users don't
2242 save their output files, the try/except was in the wrong section.
2248 save their output files, the try/except was in the wrong section.
2243
2249
2244 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2250 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2245
2251
2246 * IPython/Magic.py (magic_run): fix __file__ global missing from
2252 * IPython/Magic.py (magic_run): fix __file__ global missing from
2247 script's namespace when executed via %run. After a report by
2253 script's namespace when executed via %run. After a report by
2248 Vivian.
2254 Vivian.
2249
2255
2250 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2256 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2251 when using python 2.4. The parent constructor changed in 2.4, and
2257 when using python 2.4. The parent constructor changed in 2.4, and
2252 we need to track it directly (we can't call it, as it messes up
2258 we need to track it directly (we can't call it, as it messes up
2253 readline and tab-completion inside our pdb would stop working).
2259 readline and tab-completion inside our pdb would stop working).
2254 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2260 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2255
2261
2256 2006-01-16 Ville Vainio <vivainio@gmail.com>
2262 2006-01-16 Ville Vainio <vivainio@gmail.com>
2257
2263
2258 * Ipython/magic.py: Reverted back to old %edit functionality
2264 * Ipython/magic.py: Reverted back to old %edit functionality
2259 that returns file contents on exit.
2265 that returns file contents on exit.
2260
2266
2261 * IPython/path.py: Added Jason Orendorff's "path" module to
2267 * IPython/path.py: Added Jason Orendorff's "path" module to
2262 IPython tree, http://www.jorendorff.com/articles/python/path/.
2268 IPython tree, http://www.jorendorff.com/articles/python/path/.
2263 You can get path objects conveniently through %sc, and !!, e.g.:
2269 You can get path objects conveniently through %sc, and !!, e.g.:
2264 sc files=ls
2270 sc files=ls
2265 for p in files.paths: # or files.p
2271 for p in files.paths: # or files.p
2266 print p,p.mtime
2272 print p,p.mtime
2267
2273
2268 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2274 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2269 now work again without considering the exclusion regexp -
2275 now work again without considering the exclusion regexp -
2270 hence, things like ',foo my/path' turn to 'foo("my/path")'
2276 hence, things like ',foo my/path' turn to 'foo("my/path")'
2271 instead of syntax error.
2277 instead of syntax error.
2272
2278
2273
2279
2274 2006-01-14 Ville Vainio <vivainio@gmail.com>
2280 2006-01-14 Ville Vainio <vivainio@gmail.com>
2275
2281
2276 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2282 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2277 ipapi decorators for python 2.4 users, options() provides access to rc
2283 ipapi decorators for python 2.4 users, options() provides access to rc
2278 data.
2284 data.
2279
2285
2280 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2286 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2281 as path separators (even on Linux ;-). Space character after
2287 as path separators (even on Linux ;-). Space character after
2282 backslash (as yielded by tab completer) is still space;
2288 backslash (as yielded by tab completer) is still space;
2283 "%cd long\ name" works as expected.
2289 "%cd long\ name" works as expected.
2284
2290
2285 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2291 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2286 as "chain of command", with priority. API stays the same,
2292 as "chain of command", with priority. API stays the same,
2287 TryNext exception raised by a hook function signals that
2293 TryNext exception raised by a hook function signals that
2288 current hook failed and next hook should try handling it, as
2294 current hook failed and next hook should try handling it, as
2289 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2295 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2290 requested configurable display hook, which is now implemented.
2296 requested configurable display hook, which is now implemented.
2291
2297
2292 2006-01-13 Ville Vainio <vivainio@gmail.com>
2298 2006-01-13 Ville Vainio <vivainio@gmail.com>
2293
2299
2294 * IPython/platutils*.py: platform specific utility functions,
2300 * IPython/platutils*.py: platform specific utility functions,
2295 so far only set_term_title is implemented (change terminal
2301 so far only set_term_title is implemented (change terminal
2296 label in windowing systems). %cd now changes the title to
2302 label in windowing systems). %cd now changes the title to
2297 current dir.
2303 current dir.
2298
2304
2299 * IPython/Release.py: Added myself to "authors" list,
2305 * IPython/Release.py: Added myself to "authors" list,
2300 had to create new files.
2306 had to create new files.
2301
2307
2302 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2308 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2303 shell escape; not a known bug but had potential to be one in the
2309 shell escape; not a known bug but had potential to be one in the
2304 future.
2310 future.
2305
2311
2306 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2312 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2307 extension API for IPython! See the module for usage example. Fix
2313 extension API for IPython! See the module for usage example. Fix
2308 OInspect for docstring-less magic functions.
2314 OInspect for docstring-less magic functions.
2309
2315
2310
2316
2311 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2317 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2312
2318
2313 * IPython/iplib.py (raw_input): temporarily deactivate all
2319 * IPython/iplib.py (raw_input): temporarily deactivate all
2314 attempts at allowing pasting of code with autoindent on. It
2320 attempts at allowing pasting of code with autoindent on. It
2315 introduced bugs (reported by Prabhu) and I can't seem to find a
2321 introduced bugs (reported by Prabhu) and I can't seem to find a
2316 robust combination which works in all cases. Will have to revisit
2322 robust combination which works in all cases. Will have to revisit
2317 later.
2323 later.
2318
2324
2319 * IPython/genutils.py: remove isspace() function. We've dropped
2325 * IPython/genutils.py: remove isspace() function. We've dropped
2320 2.2 compatibility, so it's OK to use the string method.
2326 2.2 compatibility, so it's OK to use the string method.
2321
2327
2322 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2328 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2323
2329
2324 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2330 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2325 matching what NOT to autocall on, to include all python binary
2331 matching what NOT to autocall on, to include all python binary
2326 operators (including things like 'and', 'or', 'is' and 'in').
2332 operators (including things like 'and', 'or', 'is' and 'in').
2327 Prompted by a bug report on 'foo & bar', but I realized we had
2333 Prompted by a bug report on 'foo & bar', but I realized we had
2328 many more potential bug cases with other operators. The regexp is
2334 many more potential bug cases with other operators. The regexp is
2329 self.re_exclude_auto, it's fairly commented.
2335 self.re_exclude_auto, it's fairly commented.
2330
2336
2331 2006-01-12 Ville Vainio <vivainio@gmail.com>
2337 2006-01-12 Ville Vainio <vivainio@gmail.com>
2332
2338
2333 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2339 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2334 Prettified and hardened string/backslash quoting with ipsystem(),
2340 Prettified and hardened string/backslash quoting with ipsystem(),
2335 ipalias() and ipmagic(). Now even \ characters are passed to
2341 ipalias() and ipmagic(). Now even \ characters are passed to
2336 %magics, !shell escapes and aliases exactly as they are in the
2342 %magics, !shell escapes and aliases exactly as they are in the
2337 ipython command line. Should improve backslash experience,
2343 ipython command line. Should improve backslash experience,
2338 particularly in Windows (path delimiter for some commands that
2344 particularly in Windows (path delimiter for some commands that
2339 won't understand '/'), but Unix benefits as well (regexps). %cd
2345 won't understand '/'), but Unix benefits as well (regexps). %cd
2340 magic still doesn't support backslash path delimiters, though. Also
2346 magic still doesn't support backslash path delimiters, though. Also
2341 deleted all pretense of supporting multiline command strings in
2347 deleted all pretense of supporting multiline command strings in
2342 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2348 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2343
2349
2344 * doc/build_doc_instructions.txt added. Documentation on how to
2350 * doc/build_doc_instructions.txt added. Documentation on how to
2345 use doc/update_manual.py, added yesterday. Both files contributed
2351 use doc/update_manual.py, added yesterday. Both files contributed
2346 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2352 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2347 doc/*.sh for deprecation at a later date.
2353 doc/*.sh for deprecation at a later date.
2348
2354
2349 * /ipython.py Added ipython.py to root directory for
2355 * /ipython.py Added ipython.py to root directory for
2350 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2356 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2351 ipython.py) and development convenience (no need to keep doing
2357 ipython.py) and development convenience (no need to keep doing
2352 "setup.py install" between changes).
2358 "setup.py install" between changes).
2353
2359
2354 * Made ! and !! shell escapes work (again) in multiline expressions:
2360 * Made ! and !! shell escapes work (again) in multiline expressions:
2355 if 1:
2361 if 1:
2356 !ls
2362 !ls
2357 !!ls
2363 !!ls
2358
2364
2359 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2365 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2360
2366
2361 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2367 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2362 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2368 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2363 module in case-insensitive installation. Was causing crashes
2369 module in case-insensitive installation. Was causing crashes
2364 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2370 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2365
2371
2366 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2372 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2367 <marienz-AT-gentoo.org>, closes
2373 <marienz-AT-gentoo.org>, closes
2368 http://www.scipy.net/roundup/ipython/issue51.
2374 http://www.scipy.net/roundup/ipython/issue51.
2369
2375
2370 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2376 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2371
2377
2372 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2378 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2373 problem of excessive CPU usage under *nix and keyboard lag under
2379 problem of excessive CPU usage under *nix and keyboard lag under
2374 win32.
2380 win32.
2375
2381
2376 2006-01-10 *** Released version 0.7.0
2382 2006-01-10 *** Released version 0.7.0
2377
2383
2378 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2384 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2379
2385
2380 * IPython/Release.py (revision): tag version number to 0.7.0,
2386 * IPython/Release.py (revision): tag version number to 0.7.0,
2381 ready for release.
2387 ready for release.
2382
2388
2383 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2389 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2384 it informs the user of the name of the temp. file used. This can
2390 it informs the user of the name of the temp. file used. This can
2385 help if you decide later to reuse that same file, so you know
2391 help if you decide later to reuse that same file, so you know
2386 where to copy the info from.
2392 where to copy the info from.
2387
2393
2388 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2394 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2389
2395
2390 * setup_bdist_egg.py: little script to build an egg. Added
2396 * setup_bdist_egg.py: little script to build an egg. Added
2391 support in the release tools as well.
2397 support in the release tools as well.
2392
2398
2393 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2399 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2394
2400
2395 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2401 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2396 version selection (new -wxversion command line and ipythonrc
2402 version selection (new -wxversion command line and ipythonrc
2397 parameter). Patch contributed by Arnd Baecker
2403 parameter). Patch contributed by Arnd Baecker
2398 <arnd.baecker-AT-web.de>.
2404 <arnd.baecker-AT-web.de>.
2399
2405
2400 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2406 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2401 embedded instances, for variables defined at the interactive
2407 embedded instances, for variables defined at the interactive
2402 prompt of the embedded ipython. Reported by Arnd.
2408 prompt of the embedded ipython. Reported by Arnd.
2403
2409
2404 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2410 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2405 it can be used as a (stateful) toggle, or with a direct parameter.
2411 it can be used as a (stateful) toggle, or with a direct parameter.
2406
2412
2407 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2413 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2408 could be triggered in certain cases and cause the traceback
2414 could be triggered in certain cases and cause the traceback
2409 printer not to work.
2415 printer not to work.
2410
2416
2411 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2417 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2412
2418
2413 * IPython/iplib.py (_should_recompile): Small fix, closes
2419 * IPython/iplib.py (_should_recompile): Small fix, closes
2414 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2420 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2415
2421
2416 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2422 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2417
2423
2418 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2424 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2419 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2425 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2420 Moad for help with tracking it down.
2426 Moad for help with tracking it down.
2421
2427
2422 * IPython/iplib.py (handle_auto): fix autocall handling for
2428 * IPython/iplib.py (handle_auto): fix autocall handling for
2423 objects which support BOTH __getitem__ and __call__ (so that f [x]
2429 objects which support BOTH __getitem__ and __call__ (so that f [x]
2424 is left alone, instead of becoming f([x]) automatically).
2430 is left alone, instead of becoming f([x]) automatically).
2425
2431
2426 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2432 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2427 Ville's patch.
2433 Ville's patch.
2428
2434
2429 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2435 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2430
2436
2431 * IPython/iplib.py (handle_auto): changed autocall semantics to
2437 * IPython/iplib.py (handle_auto): changed autocall semantics to
2432 include 'smart' mode, where the autocall transformation is NOT
2438 include 'smart' mode, where the autocall transformation is NOT
2433 applied if there are no arguments on the line. This allows you to
2439 applied if there are no arguments on the line. This allows you to
2434 just type 'foo' if foo is a callable to see its internal form,
2440 just type 'foo' if foo is a callable to see its internal form,
2435 instead of having it called with no arguments (typically a
2441 instead of having it called with no arguments (typically a
2436 mistake). The old 'full' autocall still exists: for that, you
2442 mistake). The old 'full' autocall still exists: for that, you
2437 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2443 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2438
2444
2439 * IPython/completer.py (Completer.attr_matches): add
2445 * IPython/completer.py (Completer.attr_matches): add
2440 tab-completion support for Enthoughts' traits. After a report by
2446 tab-completion support for Enthoughts' traits. After a report by
2441 Arnd and a patch by Prabhu.
2447 Arnd and a patch by Prabhu.
2442
2448
2443 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2449 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2444
2450
2445 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2451 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2446 Schmolck's patch to fix inspect.getinnerframes().
2452 Schmolck's patch to fix inspect.getinnerframes().
2447
2453
2448 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2454 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2449 for embedded instances, regarding handling of namespaces and items
2455 for embedded instances, regarding handling of namespaces and items
2450 added to the __builtin__ one. Multiple embedded instances and
2456 added to the __builtin__ one. Multiple embedded instances and
2451 recursive embeddings should work better now (though I'm not sure
2457 recursive embeddings should work better now (though I'm not sure
2452 I've got all the corner cases fixed, that code is a bit of a brain
2458 I've got all the corner cases fixed, that code is a bit of a brain
2453 twister).
2459 twister).
2454
2460
2455 * IPython/Magic.py (magic_edit): added support to edit in-memory
2461 * IPython/Magic.py (magic_edit): added support to edit in-memory
2456 macros (automatically creates the necessary temp files). %edit
2462 macros (automatically creates the necessary temp files). %edit
2457 also doesn't return the file contents anymore, it's just noise.
2463 also doesn't return the file contents anymore, it's just noise.
2458
2464
2459 * IPython/completer.py (Completer.attr_matches): revert change to
2465 * IPython/completer.py (Completer.attr_matches): revert change to
2460 complete only on attributes listed in __all__. I realized it
2466 complete only on attributes listed in __all__. I realized it
2461 cripples the tab-completion system as a tool for exploring the
2467 cripples the tab-completion system as a tool for exploring the
2462 internals of unknown libraries (it renders any non-__all__
2468 internals of unknown libraries (it renders any non-__all__
2463 attribute off-limits). I got bit by this when trying to see
2469 attribute off-limits). I got bit by this when trying to see
2464 something inside the dis module.
2470 something inside the dis module.
2465
2471
2466 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2472 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2467
2473
2468 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2474 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2469 namespace for users and extension writers to hold data in. This
2475 namespace for users and extension writers to hold data in. This
2470 follows the discussion in
2476 follows the discussion in
2471 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2477 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2472
2478
2473 * IPython/completer.py (IPCompleter.complete): small patch to help
2479 * IPython/completer.py (IPCompleter.complete): small patch to help
2474 tab-completion under Emacs, after a suggestion by John Barnard
2480 tab-completion under Emacs, after a suggestion by John Barnard
2475 <barnarj-AT-ccf.org>.
2481 <barnarj-AT-ccf.org>.
2476
2482
2477 * IPython/Magic.py (Magic.extract_input_slices): added support for
2483 * IPython/Magic.py (Magic.extract_input_slices): added support for
2478 the slice notation in magics to use N-M to represent numbers N...M
2484 the slice notation in magics to use N-M to represent numbers N...M
2479 (closed endpoints). This is used by %macro and %save.
2485 (closed endpoints). This is used by %macro and %save.
2480
2486
2481 * IPython/completer.py (Completer.attr_matches): for modules which
2487 * IPython/completer.py (Completer.attr_matches): for modules which
2482 define __all__, complete only on those. After a patch by Jeffrey
2488 define __all__, complete only on those. After a patch by Jeffrey
2483 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2489 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2484 speed up this routine.
2490 speed up this routine.
2485
2491
2486 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2492 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2487 don't know if this is the end of it, but the behavior now is
2493 don't know if this is the end of it, but the behavior now is
2488 certainly much more correct. Note that coupled with macros,
2494 certainly much more correct. Note that coupled with macros,
2489 slightly surprising (at first) behavior may occur: a macro will in
2495 slightly surprising (at first) behavior may occur: a macro will in
2490 general expand to multiple lines of input, so upon exiting, the
2496 general expand to multiple lines of input, so upon exiting, the
2491 in/out counters will both be bumped by the corresponding amount
2497 in/out counters will both be bumped by the corresponding amount
2492 (as if the macro's contents had been typed interactively). Typing
2498 (as if the macro's contents had been typed interactively). Typing
2493 %hist will reveal the intermediate (silently processed) lines.
2499 %hist will reveal the intermediate (silently processed) lines.
2494
2500
2495 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2501 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2496 pickle to fail (%run was overwriting __main__ and not restoring
2502 pickle to fail (%run was overwriting __main__ and not restoring
2497 it, but pickle relies on __main__ to operate).
2503 it, but pickle relies on __main__ to operate).
2498
2504
2499 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2505 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2500 using properties, but forgot to make the main InteractiveShell
2506 using properties, but forgot to make the main InteractiveShell
2501 class a new-style class. Properties fail silently, and
2507 class a new-style class. Properties fail silently, and
2502 mysteriously, with old-style class (getters work, but
2508 mysteriously, with old-style class (getters work, but
2503 setters don't do anything).
2509 setters don't do anything).
2504
2510
2505 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2511 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2506
2512
2507 * IPython/Magic.py (magic_history): fix history reporting bug (I
2513 * IPython/Magic.py (magic_history): fix history reporting bug (I
2508 know some nasties are still there, I just can't seem to find a
2514 know some nasties are still there, I just can't seem to find a
2509 reproducible test case to track them down; the input history is
2515 reproducible test case to track them down; the input history is
2510 falling out of sync...)
2516 falling out of sync...)
2511
2517
2512 * IPython/iplib.py (handle_shell_escape): fix bug where both
2518 * IPython/iplib.py (handle_shell_escape): fix bug where both
2513 aliases and system accesses where broken for indented code (such
2519 aliases and system accesses where broken for indented code (such
2514 as loops).
2520 as loops).
2515
2521
2516 * IPython/genutils.py (shell): fix small but critical bug for
2522 * IPython/genutils.py (shell): fix small but critical bug for
2517 win32 system access.
2523 win32 system access.
2518
2524
2519 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2525 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2520
2526
2521 * IPython/iplib.py (showtraceback): remove use of the
2527 * IPython/iplib.py (showtraceback): remove use of the
2522 sys.last_{type/value/traceback} structures, which are non
2528 sys.last_{type/value/traceback} structures, which are non
2523 thread-safe.
2529 thread-safe.
2524 (_prefilter): change control flow to ensure that we NEVER
2530 (_prefilter): change control flow to ensure that we NEVER
2525 introspect objects when autocall is off. This will guarantee that
2531 introspect objects when autocall is off. This will guarantee that
2526 having an input line of the form 'x.y', where access to attribute
2532 having an input line of the form 'x.y', where access to attribute
2527 'y' has side effects, doesn't trigger the side effect TWICE. It
2533 'y' has side effects, doesn't trigger the side effect TWICE. It
2528 is important to note that, with autocall on, these side effects
2534 is important to note that, with autocall on, these side effects
2529 can still happen.
2535 can still happen.
2530 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2536 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2531 trio. IPython offers these three kinds of special calls which are
2537 trio. IPython offers these three kinds of special calls which are
2532 not python code, and it's a good thing to have their call method
2538 not python code, and it's a good thing to have their call method
2533 be accessible as pure python functions (not just special syntax at
2539 be accessible as pure python functions (not just special syntax at
2534 the command line). It gives us a better internal implementation
2540 the command line). It gives us a better internal implementation
2535 structure, as well as exposing these for user scripting more
2541 structure, as well as exposing these for user scripting more
2536 cleanly.
2542 cleanly.
2537
2543
2538 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2544 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2539 file. Now that they'll be more likely to be used with the
2545 file. Now that they'll be more likely to be used with the
2540 persistance system (%store), I want to make sure their module path
2546 persistance system (%store), I want to make sure their module path
2541 doesn't change in the future, so that we don't break things for
2547 doesn't change in the future, so that we don't break things for
2542 users' persisted data.
2548 users' persisted data.
2543
2549
2544 * IPython/iplib.py (autoindent_update): move indentation
2550 * IPython/iplib.py (autoindent_update): move indentation
2545 management into the _text_ processing loop, not the keyboard
2551 management into the _text_ processing loop, not the keyboard
2546 interactive one. This is necessary to correctly process non-typed
2552 interactive one. This is necessary to correctly process non-typed
2547 multiline input (such as macros).
2553 multiline input (such as macros).
2548
2554
2549 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2555 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2550 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2556 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2551 which was producing problems in the resulting manual.
2557 which was producing problems in the resulting manual.
2552 (magic_whos): improve reporting of instances (show their class,
2558 (magic_whos): improve reporting of instances (show their class,
2553 instead of simply printing 'instance' which isn't terribly
2559 instead of simply printing 'instance' which isn't terribly
2554 informative).
2560 informative).
2555
2561
2556 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2562 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2557 (minor mods) to support network shares under win32.
2563 (minor mods) to support network shares under win32.
2558
2564
2559 * IPython/winconsole.py (get_console_size): add new winconsole
2565 * IPython/winconsole.py (get_console_size): add new winconsole
2560 module and fixes to page_dumb() to improve its behavior under
2566 module and fixes to page_dumb() to improve its behavior under
2561 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2567 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2562
2568
2563 * IPython/Magic.py (Macro): simplified Macro class to just
2569 * IPython/Magic.py (Macro): simplified Macro class to just
2564 subclass list. We've had only 2.2 compatibility for a very long
2570 subclass list. We've had only 2.2 compatibility for a very long
2565 time, yet I was still avoiding subclassing the builtin types. No
2571 time, yet I was still avoiding subclassing the builtin types. No
2566 more (I'm also starting to use properties, though I won't shift to
2572 more (I'm also starting to use properties, though I won't shift to
2567 2.3-specific features quite yet).
2573 2.3-specific features quite yet).
2568 (magic_store): added Ville's patch for lightweight variable
2574 (magic_store): added Ville's patch for lightweight variable
2569 persistence, after a request on the user list by Matt Wilkie
2575 persistence, after a request on the user list by Matt Wilkie
2570 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2576 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2571 details.
2577 details.
2572
2578
2573 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2579 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2574 changed the default logfile name from 'ipython.log' to
2580 changed the default logfile name from 'ipython.log' to
2575 'ipython_log.py'. These logs are real python files, and now that
2581 'ipython_log.py'. These logs are real python files, and now that
2576 we have much better multiline support, people are more likely to
2582 we have much better multiline support, people are more likely to
2577 want to use them as such. Might as well name them correctly.
2583 want to use them as such. Might as well name them correctly.
2578
2584
2579 * IPython/Magic.py: substantial cleanup. While we can't stop
2585 * IPython/Magic.py: substantial cleanup. While we can't stop
2580 using magics as mixins, due to the existing customizations 'out
2586 using magics as mixins, due to the existing customizations 'out
2581 there' which rely on the mixin naming conventions, at least I
2587 there' which rely on the mixin naming conventions, at least I
2582 cleaned out all cross-class name usage. So once we are OK with
2588 cleaned out all cross-class name usage. So once we are OK with
2583 breaking compatibility, the two systems can be separated.
2589 breaking compatibility, the two systems can be separated.
2584
2590
2585 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2591 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2586 anymore, and the class is a fair bit less hideous as well. New
2592 anymore, and the class is a fair bit less hideous as well. New
2587 features were also introduced: timestamping of input, and logging
2593 features were also introduced: timestamping of input, and logging
2588 of output results. These are user-visible with the -t and -o
2594 of output results. These are user-visible with the -t and -o
2589 options to %logstart. Closes
2595 options to %logstart. Closes
2590 http://www.scipy.net/roundup/ipython/issue11 and a request by
2596 http://www.scipy.net/roundup/ipython/issue11 and a request by
2591 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2597 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2592
2598
2593 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2599 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2594
2600
2595 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2601 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2596 better handle backslashes in paths. See the thread 'More Windows
2602 better handle backslashes in paths. See the thread 'More Windows
2597 questions part 2 - \/ characters revisited' on the iypthon user
2603 questions part 2 - \/ characters revisited' on the iypthon user
2598 list:
2604 list:
2599 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2605 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2600
2606
2601 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2607 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2602
2608
2603 (InteractiveShell.__init__): change threaded shells to not use the
2609 (InteractiveShell.__init__): change threaded shells to not use the
2604 ipython crash handler. This was causing more problems than not,
2610 ipython crash handler. This was causing more problems than not,
2605 as exceptions in the main thread (GUI code, typically) would
2611 as exceptions in the main thread (GUI code, typically) would
2606 always show up as a 'crash', when they really weren't.
2612 always show up as a 'crash', when they really weren't.
2607
2613
2608 The colors and exception mode commands (%colors/%xmode) have been
2614 The colors and exception mode commands (%colors/%xmode) have been
2609 synchronized to also take this into account, so users can get
2615 synchronized to also take this into account, so users can get
2610 verbose exceptions for their threaded code as well. I also added
2616 verbose exceptions for their threaded code as well. I also added
2611 support for activating pdb inside this exception handler as well,
2617 support for activating pdb inside this exception handler as well,
2612 so now GUI authors can use IPython's enhanced pdb at runtime.
2618 so now GUI authors can use IPython's enhanced pdb at runtime.
2613
2619
2614 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2620 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2615 true by default, and add it to the shipped ipythonrc file. Since
2621 true by default, and add it to the shipped ipythonrc file. Since
2616 this asks the user before proceeding, I think it's OK to make it
2622 this asks the user before proceeding, I think it's OK to make it
2617 true by default.
2623 true by default.
2618
2624
2619 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2625 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2620 of the previous special-casing of input in the eval loop. I think
2626 of the previous special-casing of input in the eval loop. I think
2621 this is cleaner, as they really are commands and shouldn't have
2627 this is cleaner, as they really are commands and shouldn't have
2622 a special role in the middle of the core code.
2628 a special role in the middle of the core code.
2623
2629
2624 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2630 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2625
2631
2626 * IPython/iplib.py (edit_syntax_error): added support for
2632 * IPython/iplib.py (edit_syntax_error): added support for
2627 automatically reopening the editor if the file had a syntax error
2633 automatically reopening the editor if the file had a syntax error
2628 in it. Thanks to scottt who provided the patch at:
2634 in it. Thanks to scottt who provided the patch at:
2629 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2635 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2630 version committed).
2636 version committed).
2631
2637
2632 * IPython/iplib.py (handle_normal): add suport for multi-line
2638 * IPython/iplib.py (handle_normal): add suport for multi-line
2633 input with emtpy lines. This fixes
2639 input with emtpy lines. This fixes
2634 http://www.scipy.net/roundup/ipython/issue43 and a similar
2640 http://www.scipy.net/roundup/ipython/issue43 and a similar
2635 discussion on the user list.
2641 discussion on the user list.
2636
2642
2637 WARNING: a behavior change is necessarily introduced to support
2643 WARNING: a behavior change is necessarily introduced to support
2638 blank lines: now a single blank line with whitespace does NOT
2644 blank lines: now a single blank line with whitespace does NOT
2639 break the input loop, which means that when autoindent is on, by
2645 break the input loop, which means that when autoindent is on, by
2640 default hitting return on the next (indented) line does NOT exit.
2646 default hitting return on the next (indented) line does NOT exit.
2641
2647
2642 Instead, to exit a multiline input you can either have:
2648 Instead, to exit a multiline input you can either have:
2643
2649
2644 - TWO whitespace lines (just hit return again), or
2650 - TWO whitespace lines (just hit return again), or
2645 - a single whitespace line of a different length than provided
2651 - a single whitespace line of a different length than provided
2646 by the autoindent (add or remove a space).
2652 by the autoindent (add or remove a space).
2647
2653
2648 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2654 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2649 module to better organize all readline-related functionality.
2655 module to better organize all readline-related functionality.
2650 I've deleted FlexCompleter and put all completion clases here.
2656 I've deleted FlexCompleter and put all completion clases here.
2651
2657
2652 * IPython/iplib.py (raw_input): improve indentation management.
2658 * IPython/iplib.py (raw_input): improve indentation management.
2653 It is now possible to paste indented code with autoindent on, and
2659 It is now possible to paste indented code with autoindent on, and
2654 the code is interpreted correctly (though it still looks bad on
2660 the code is interpreted correctly (though it still looks bad on
2655 screen, due to the line-oriented nature of ipython).
2661 screen, due to the line-oriented nature of ipython).
2656 (MagicCompleter.complete): change behavior so that a TAB key on an
2662 (MagicCompleter.complete): change behavior so that a TAB key on an
2657 otherwise empty line actually inserts a tab, instead of completing
2663 otherwise empty line actually inserts a tab, instead of completing
2658 on the entire global namespace. This makes it easier to use the
2664 on the entire global namespace. This makes it easier to use the
2659 TAB key for indentation. After a request by Hans Meine
2665 TAB key for indentation. After a request by Hans Meine
2660 <hans_meine-AT-gmx.net>
2666 <hans_meine-AT-gmx.net>
2661 (_prefilter): add support so that typing plain 'exit' or 'quit'
2667 (_prefilter): add support so that typing plain 'exit' or 'quit'
2662 does a sensible thing. Originally I tried to deviate as little as
2668 does a sensible thing. Originally I tried to deviate as little as
2663 possible from the default python behavior, but even that one may
2669 possible from the default python behavior, but even that one may
2664 change in this direction (thread on python-dev to that effect).
2670 change in this direction (thread on python-dev to that effect).
2665 Regardless, ipython should do the right thing even if CPython's
2671 Regardless, ipython should do the right thing even if CPython's
2666 '>>>' prompt doesn't.
2672 '>>>' prompt doesn't.
2667 (InteractiveShell): removed subclassing code.InteractiveConsole
2673 (InteractiveShell): removed subclassing code.InteractiveConsole
2668 class. By now we'd overridden just about all of its methods: I've
2674 class. By now we'd overridden just about all of its methods: I've
2669 copied the remaining two over, and now ipython is a standalone
2675 copied the remaining two over, and now ipython is a standalone
2670 class. This will provide a clearer picture for the chainsaw
2676 class. This will provide a clearer picture for the chainsaw
2671 branch refactoring.
2677 branch refactoring.
2672
2678
2673 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2679 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2674
2680
2675 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2681 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2676 failures for objects which break when dir() is called on them.
2682 failures for objects which break when dir() is called on them.
2677
2683
2678 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2684 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2679 distinct local and global namespaces in the completer API. This
2685 distinct local and global namespaces in the completer API. This
2680 change allows us to properly handle completion with distinct
2686 change allows us to properly handle completion with distinct
2681 scopes, including in embedded instances (this had never really
2687 scopes, including in embedded instances (this had never really
2682 worked correctly).
2688 worked correctly).
2683
2689
2684 Note: this introduces a change in the constructor for
2690 Note: this introduces a change in the constructor for
2685 MagicCompleter, as a new global_namespace parameter is now the
2691 MagicCompleter, as a new global_namespace parameter is now the
2686 second argument (the others were bumped one position).
2692 second argument (the others were bumped one position).
2687
2693
2688 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2694 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2689
2695
2690 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2696 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2691 embedded instances (which can be done now thanks to Vivian's
2697 embedded instances (which can be done now thanks to Vivian's
2692 frame-handling fixes for pdb).
2698 frame-handling fixes for pdb).
2693 (InteractiveShell.__init__): Fix namespace handling problem in
2699 (InteractiveShell.__init__): Fix namespace handling problem in
2694 embedded instances. We were overwriting __main__ unconditionally,
2700 embedded instances. We were overwriting __main__ unconditionally,
2695 and this should only be done for 'full' (non-embedded) IPython;
2701 and this should only be done for 'full' (non-embedded) IPython;
2696 embedded instances must respect the caller's __main__. Thanks to
2702 embedded instances must respect the caller's __main__. Thanks to
2697 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2703 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2698
2704
2699 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2705 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2700
2706
2701 * setup.py: added download_url to setup(). This registers the
2707 * setup.py: added download_url to setup(). This registers the
2702 download address at PyPI, which is not only useful to humans
2708 download address at PyPI, which is not only useful to humans
2703 browsing the site, but is also picked up by setuptools (the Eggs
2709 browsing the site, but is also picked up by setuptools (the Eggs
2704 machinery). Thanks to Ville and R. Kern for the info/discussion
2710 machinery). Thanks to Ville and R. Kern for the info/discussion
2705 on this.
2711 on this.
2706
2712
2707 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2713 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2708
2714
2709 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2715 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2710 This brings a lot of nice functionality to the pdb mode, which now
2716 This brings a lot of nice functionality to the pdb mode, which now
2711 has tab-completion, syntax highlighting, and better stack handling
2717 has tab-completion, syntax highlighting, and better stack handling
2712 than before. Many thanks to Vivian De Smedt
2718 than before. Many thanks to Vivian De Smedt
2713 <vivian-AT-vdesmedt.com> for the original patches.
2719 <vivian-AT-vdesmedt.com> for the original patches.
2714
2720
2715 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2721 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2716
2722
2717 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2723 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2718 sequence to consistently accept the banner argument. The
2724 sequence to consistently accept the banner argument. The
2719 inconsistency was tripping SAGE, thanks to Gary Zablackis
2725 inconsistency was tripping SAGE, thanks to Gary Zablackis
2720 <gzabl-AT-yahoo.com> for the report.
2726 <gzabl-AT-yahoo.com> for the report.
2721
2727
2722 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2728 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2723
2729
2724 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2730 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2725 Fix bug where a naked 'alias' call in the ipythonrc file would
2731 Fix bug where a naked 'alias' call in the ipythonrc file would
2726 cause a crash. Bug reported by Jorgen Stenarson.
2732 cause a crash. Bug reported by Jorgen Stenarson.
2727
2733
2728 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2734 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2729
2735
2730 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2736 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2731 startup time.
2737 startup time.
2732
2738
2733 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2739 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2734 instances had introduced a bug with globals in normal code. Now
2740 instances had introduced a bug with globals in normal code. Now
2735 it's working in all cases.
2741 it's working in all cases.
2736
2742
2737 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2743 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2738 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2744 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2739 has been introduced to set the default case sensitivity of the
2745 has been introduced to set the default case sensitivity of the
2740 searches. Users can still select either mode at runtime on a
2746 searches. Users can still select either mode at runtime on a
2741 per-search basis.
2747 per-search basis.
2742
2748
2743 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2749 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2744
2750
2745 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2751 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2746 attributes in wildcard searches for subclasses. Modified version
2752 attributes in wildcard searches for subclasses. Modified version
2747 of a patch by Jorgen.
2753 of a patch by Jorgen.
2748
2754
2749 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2755 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2750
2756
2751 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2757 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2752 embedded instances. I added a user_global_ns attribute to the
2758 embedded instances. I added a user_global_ns attribute to the
2753 InteractiveShell class to handle this.
2759 InteractiveShell class to handle this.
2754
2760
2755 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2761 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2756
2762
2757 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2763 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2758 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2764 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2759 (reported under win32, but may happen also in other platforms).
2765 (reported under win32, but may happen also in other platforms).
2760 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2766 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2761
2767
2762 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2768 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2763
2769
2764 * IPython/Magic.py (magic_psearch): new support for wildcard
2770 * IPython/Magic.py (magic_psearch): new support for wildcard
2765 patterns. Now, typing ?a*b will list all names which begin with a
2771 patterns. Now, typing ?a*b will list all names which begin with a
2766 and end in b, for example. The %psearch magic has full
2772 and end in b, for example. The %psearch magic has full
2767 docstrings. Many thanks to JΓΆrgen Stenarson
2773 docstrings. Many thanks to JΓΆrgen Stenarson
2768 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2774 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2769 implementing this functionality.
2775 implementing this functionality.
2770
2776
2771 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2777 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2772
2778
2773 * Manual: fixed long-standing annoyance of double-dashes (as in
2779 * Manual: fixed long-standing annoyance of double-dashes (as in
2774 --prefix=~, for example) being stripped in the HTML version. This
2780 --prefix=~, for example) being stripped in the HTML version. This
2775 is a latex2html bug, but a workaround was provided. Many thanks
2781 is a latex2html bug, but a workaround was provided. Many thanks
2776 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2782 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2777 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2783 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2778 rolling. This seemingly small issue had tripped a number of users
2784 rolling. This seemingly small issue had tripped a number of users
2779 when first installing, so I'm glad to see it gone.
2785 when first installing, so I'm glad to see it gone.
2780
2786
2781 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2787 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2782
2788
2783 * IPython/Extensions/numeric_formats.py: fix missing import,
2789 * IPython/Extensions/numeric_formats.py: fix missing import,
2784 reported by Stephen Walton.
2790 reported by Stephen Walton.
2785
2791
2786 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2792 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2787
2793
2788 * IPython/demo.py: finish demo module, fully documented now.
2794 * IPython/demo.py: finish demo module, fully documented now.
2789
2795
2790 * IPython/genutils.py (file_read): simple little utility to read a
2796 * IPython/genutils.py (file_read): simple little utility to read a
2791 file and ensure it's closed afterwards.
2797 file and ensure it's closed afterwards.
2792
2798
2793 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2799 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2794
2800
2795 * IPython/demo.py (Demo.__init__): added support for individually
2801 * IPython/demo.py (Demo.__init__): added support for individually
2796 tagging blocks for automatic execution.
2802 tagging blocks for automatic execution.
2797
2803
2798 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2804 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2799 syntax-highlighted python sources, requested by John.
2805 syntax-highlighted python sources, requested by John.
2800
2806
2801 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2807 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2802
2808
2803 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2809 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2804 finishing.
2810 finishing.
2805
2811
2806 * IPython/genutils.py (shlex_split): moved from Magic to here,
2812 * IPython/genutils.py (shlex_split): moved from Magic to here,
2807 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2813 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2808
2814
2809 * IPython/demo.py (Demo.__init__): added support for silent
2815 * IPython/demo.py (Demo.__init__): added support for silent
2810 blocks, improved marks as regexps, docstrings written.
2816 blocks, improved marks as regexps, docstrings written.
2811 (Demo.__init__): better docstring, added support for sys.argv.
2817 (Demo.__init__): better docstring, added support for sys.argv.
2812
2818
2813 * IPython/genutils.py (marquee): little utility used by the demo
2819 * IPython/genutils.py (marquee): little utility used by the demo
2814 code, handy in general.
2820 code, handy in general.
2815
2821
2816 * IPython/demo.py (Demo.__init__): new class for interactive
2822 * IPython/demo.py (Demo.__init__): new class for interactive
2817 demos. Not documented yet, I just wrote it in a hurry for
2823 demos. Not documented yet, I just wrote it in a hurry for
2818 scipy'05. Will docstring later.
2824 scipy'05. Will docstring later.
2819
2825
2820 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2826 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2821
2827
2822 * IPython/Shell.py (sigint_handler): Drastic simplification which
2828 * IPython/Shell.py (sigint_handler): Drastic simplification which
2823 also seems to make Ctrl-C work correctly across threads! This is
2829 also seems to make Ctrl-C work correctly across threads! This is
2824 so simple, that I can't beleive I'd missed it before. Needs more
2830 so simple, that I can't beleive I'd missed it before. Needs more
2825 testing, though.
2831 testing, though.
2826 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2832 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2827 like this before...
2833 like this before...
2828
2834
2829 * IPython/genutils.py (get_home_dir): add protection against
2835 * IPython/genutils.py (get_home_dir): add protection against
2830 non-dirs in win32 registry.
2836 non-dirs in win32 registry.
2831
2837
2832 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2838 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2833 bug where dict was mutated while iterating (pysh crash).
2839 bug where dict was mutated while iterating (pysh crash).
2834
2840
2835 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2841 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2836
2842
2837 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2843 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2838 spurious newlines added by this routine. After a report by
2844 spurious newlines added by this routine. After a report by
2839 F. Mantegazza.
2845 F. Mantegazza.
2840
2846
2841 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2847 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2842
2848
2843 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2849 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2844 calls. These were a leftover from the GTK 1.x days, and can cause
2850 calls. These were a leftover from the GTK 1.x days, and can cause
2845 problems in certain cases (after a report by John Hunter).
2851 problems in certain cases (after a report by John Hunter).
2846
2852
2847 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2853 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2848 os.getcwd() fails at init time. Thanks to patch from David Remahl
2854 os.getcwd() fails at init time. Thanks to patch from David Remahl
2849 <chmod007-AT-mac.com>.
2855 <chmod007-AT-mac.com>.
2850 (InteractiveShell.__init__): prevent certain special magics from
2856 (InteractiveShell.__init__): prevent certain special magics from
2851 being shadowed by aliases. Closes
2857 being shadowed by aliases. Closes
2852 http://www.scipy.net/roundup/ipython/issue41.
2858 http://www.scipy.net/roundup/ipython/issue41.
2853
2859
2854 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2860 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2855
2861
2856 * IPython/iplib.py (InteractiveShell.complete): Added new
2862 * IPython/iplib.py (InteractiveShell.complete): Added new
2857 top-level completion method to expose the completion mechanism
2863 top-level completion method to expose the completion mechanism
2858 beyond readline-based environments.
2864 beyond readline-based environments.
2859
2865
2860 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2866 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2861
2867
2862 * tools/ipsvnc (svnversion): fix svnversion capture.
2868 * tools/ipsvnc (svnversion): fix svnversion capture.
2863
2869
2864 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2870 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2865 attribute to self, which was missing. Before, it was set by a
2871 attribute to self, which was missing. Before, it was set by a
2866 routine which in certain cases wasn't being called, so the
2872 routine which in certain cases wasn't being called, so the
2867 instance could end up missing the attribute. This caused a crash.
2873 instance could end up missing the attribute. This caused a crash.
2868 Closes http://www.scipy.net/roundup/ipython/issue40.
2874 Closes http://www.scipy.net/roundup/ipython/issue40.
2869
2875
2870 2005-08-16 Fernando Perez <fperez@colorado.edu>
2876 2005-08-16 Fernando Perez <fperez@colorado.edu>
2871
2877
2872 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2878 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2873 contains non-string attribute. Closes
2879 contains non-string attribute. Closes
2874 http://www.scipy.net/roundup/ipython/issue38.
2880 http://www.scipy.net/roundup/ipython/issue38.
2875
2881
2876 2005-08-14 Fernando Perez <fperez@colorado.edu>
2882 2005-08-14 Fernando Perez <fperez@colorado.edu>
2877
2883
2878 * tools/ipsvnc: Minor improvements, to add changeset info.
2884 * tools/ipsvnc: Minor improvements, to add changeset info.
2879
2885
2880 2005-08-12 Fernando Perez <fperez@colorado.edu>
2886 2005-08-12 Fernando Perez <fperez@colorado.edu>
2881
2887
2882 * IPython/iplib.py (runsource): remove self.code_to_run_src
2888 * IPython/iplib.py (runsource): remove self.code_to_run_src
2883 attribute. I realized this is nothing more than
2889 attribute. I realized this is nothing more than
2884 '\n'.join(self.buffer), and having the same data in two different
2890 '\n'.join(self.buffer), and having the same data in two different
2885 places is just asking for synchronization bugs. This may impact
2891 places is just asking for synchronization bugs. This may impact
2886 people who have custom exception handlers, so I need to warn
2892 people who have custom exception handlers, so I need to warn
2887 ipython-dev about it (F. Mantegazza may use them).
2893 ipython-dev about it (F. Mantegazza may use them).
2888
2894
2889 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2895 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2890
2896
2891 * IPython/genutils.py: fix 2.2 compatibility (generators)
2897 * IPython/genutils.py: fix 2.2 compatibility (generators)
2892
2898
2893 2005-07-18 Fernando Perez <fperez@colorado.edu>
2899 2005-07-18 Fernando Perez <fperez@colorado.edu>
2894
2900
2895 * IPython/genutils.py (get_home_dir): fix to help users with
2901 * IPython/genutils.py (get_home_dir): fix to help users with
2896 invalid $HOME under win32.
2902 invalid $HOME under win32.
2897
2903
2898 2005-07-17 Fernando Perez <fperez@colorado.edu>
2904 2005-07-17 Fernando Perez <fperez@colorado.edu>
2899
2905
2900 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2906 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2901 some old hacks and clean up a bit other routines; code should be
2907 some old hacks and clean up a bit other routines; code should be
2902 simpler and a bit faster.
2908 simpler and a bit faster.
2903
2909
2904 * IPython/iplib.py (interact): removed some last-resort attempts
2910 * IPython/iplib.py (interact): removed some last-resort attempts
2905 to survive broken stdout/stderr. That code was only making it
2911 to survive broken stdout/stderr. That code was only making it
2906 harder to abstract out the i/o (necessary for gui integration),
2912 harder to abstract out the i/o (necessary for gui integration),
2907 and the crashes it could prevent were extremely rare in practice
2913 and the crashes it could prevent were extremely rare in practice
2908 (besides being fully user-induced in a pretty violent manner).
2914 (besides being fully user-induced in a pretty violent manner).
2909
2915
2910 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2916 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2911 Nothing major yet, but the code is simpler to read; this should
2917 Nothing major yet, but the code is simpler to read; this should
2912 make it easier to do more serious modifications in the future.
2918 make it easier to do more serious modifications in the future.
2913
2919
2914 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2920 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2915 which broke in .15 (thanks to a report by Ville).
2921 which broke in .15 (thanks to a report by Ville).
2916
2922
2917 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2923 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2918 be quite correct, I know next to nothing about unicode). This
2924 be quite correct, I know next to nothing about unicode). This
2919 will allow unicode strings to be used in prompts, amongst other
2925 will allow unicode strings to be used in prompts, amongst other
2920 cases. It also will prevent ipython from crashing when unicode
2926 cases. It also will prevent ipython from crashing when unicode
2921 shows up unexpectedly in many places. If ascii encoding fails, we
2927 shows up unexpectedly in many places. If ascii encoding fails, we
2922 assume utf_8. Currently the encoding is not a user-visible
2928 assume utf_8. Currently the encoding is not a user-visible
2923 setting, though it could be made so if there is demand for it.
2929 setting, though it could be made so if there is demand for it.
2924
2930
2925 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2931 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2926
2932
2927 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2933 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2928
2934
2929 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2935 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2930
2936
2931 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2937 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2932 code can work transparently for 2.2/2.3.
2938 code can work transparently for 2.2/2.3.
2933
2939
2934 2005-07-16 Fernando Perez <fperez@colorado.edu>
2940 2005-07-16 Fernando Perez <fperez@colorado.edu>
2935
2941
2936 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2942 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2937 out of the color scheme table used for coloring exception
2943 out of the color scheme table used for coloring exception
2938 tracebacks. This allows user code to add new schemes at runtime.
2944 tracebacks. This allows user code to add new schemes at runtime.
2939 This is a minimally modified version of the patch at
2945 This is a minimally modified version of the patch at
2940 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2946 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2941 for the contribution.
2947 for the contribution.
2942
2948
2943 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2949 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2944 slightly modified version of the patch in
2950 slightly modified version of the patch in
2945 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2951 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2946 to remove the previous try/except solution (which was costlier).
2952 to remove the previous try/except solution (which was costlier).
2947 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2953 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2948
2954
2949 2005-06-08 Fernando Perez <fperez@colorado.edu>
2955 2005-06-08 Fernando Perez <fperez@colorado.edu>
2950
2956
2951 * IPython/iplib.py (write/write_err): Add methods to abstract all
2957 * IPython/iplib.py (write/write_err): Add methods to abstract all
2952 I/O a bit more.
2958 I/O a bit more.
2953
2959
2954 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2960 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2955 warning, reported by Aric Hagberg, fix by JD Hunter.
2961 warning, reported by Aric Hagberg, fix by JD Hunter.
2956
2962
2957 2005-06-02 *** Released version 0.6.15
2963 2005-06-02 *** Released version 0.6.15
2958
2964
2959 2005-06-01 Fernando Perez <fperez@colorado.edu>
2965 2005-06-01 Fernando Perez <fperez@colorado.edu>
2960
2966
2961 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2967 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2962 tab-completion of filenames within open-quoted strings. Note that
2968 tab-completion of filenames within open-quoted strings. Note that
2963 this requires that in ~/.ipython/ipythonrc, users change the
2969 this requires that in ~/.ipython/ipythonrc, users change the
2964 readline delimiters configuration to read:
2970 readline delimiters configuration to read:
2965
2971
2966 readline_remove_delims -/~
2972 readline_remove_delims -/~
2967
2973
2968
2974
2969 2005-05-31 *** Released version 0.6.14
2975 2005-05-31 *** Released version 0.6.14
2970
2976
2971 2005-05-29 Fernando Perez <fperez@colorado.edu>
2977 2005-05-29 Fernando Perez <fperez@colorado.edu>
2972
2978
2973 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2979 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2974 with files not on the filesystem. Reported by Eliyahu Sandler
2980 with files not on the filesystem. Reported by Eliyahu Sandler
2975 <eli@gondolin.net>
2981 <eli@gondolin.net>
2976
2982
2977 2005-05-22 Fernando Perez <fperez@colorado.edu>
2983 2005-05-22 Fernando Perez <fperez@colorado.edu>
2978
2984
2979 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2985 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2980 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2986 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2981
2987
2982 2005-05-19 Fernando Perez <fperez@colorado.edu>
2988 2005-05-19 Fernando Perez <fperez@colorado.edu>
2983
2989
2984 * IPython/iplib.py (safe_execfile): close a file which could be
2990 * IPython/iplib.py (safe_execfile): close a file which could be
2985 left open (causing problems in win32, which locks open files).
2991 left open (causing problems in win32, which locks open files).
2986 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2992 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2987
2993
2988 2005-05-18 Fernando Perez <fperez@colorado.edu>
2994 2005-05-18 Fernando Perez <fperez@colorado.edu>
2989
2995
2990 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2996 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2991 keyword arguments correctly to safe_execfile().
2997 keyword arguments correctly to safe_execfile().
2992
2998
2993 2005-05-13 Fernando Perez <fperez@colorado.edu>
2999 2005-05-13 Fernando Perez <fperez@colorado.edu>
2994
3000
2995 * ipython.1: Added info about Qt to manpage, and threads warning
3001 * ipython.1: Added info about Qt to manpage, and threads warning
2996 to usage page (invoked with --help).
3002 to usage page (invoked with --help).
2997
3003
2998 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3004 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2999 new matcher (it goes at the end of the priority list) to do
3005 new matcher (it goes at the end of the priority list) to do
3000 tab-completion on named function arguments. Submitted by George
3006 tab-completion on named function arguments. Submitted by George
3001 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3007 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3002 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3008 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3003 for more details.
3009 for more details.
3004
3010
3005 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3011 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3006 SystemExit exceptions in the script being run. Thanks to a report
3012 SystemExit exceptions in the script being run. Thanks to a report
3007 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3013 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3008 producing very annoying behavior when running unit tests.
3014 producing very annoying behavior when running unit tests.
3009
3015
3010 2005-05-12 Fernando Perez <fperez@colorado.edu>
3016 2005-05-12 Fernando Perez <fperez@colorado.edu>
3011
3017
3012 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3018 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3013 which I'd broken (again) due to a changed regexp. In the process,
3019 which I'd broken (again) due to a changed regexp. In the process,
3014 added ';' as an escape to auto-quote the whole line without
3020 added ';' as an escape to auto-quote the whole line without
3015 splitting its arguments. Thanks to a report by Jerry McRae
3021 splitting its arguments. Thanks to a report by Jerry McRae
3016 <qrs0xyc02-AT-sneakemail.com>.
3022 <qrs0xyc02-AT-sneakemail.com>.
3017
3023
3018 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3024 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3019 possible crashes caused by a TokenError. Reported by Ed Schofield
3025 possible crashes caused by a TokenError. Reported by Ed Schofield
3020 <schofield-AT-ftw.at>.
3026 <schofield-AT-ftw.at>.
3021
3027
3022 2005-05-06 Fernando Perez <fperez@colorado.edu>
3028 2005-05-06 Fernando Perez <fperez@colorado.edu>
3023
3029
3024 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3030 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3025
3031
3026 2005-04-29 Fernando Perez <fperez@colorado.edu>
3032 2005-04-29 Fernando Perez <fperez@colorado.edu>
3027
3033
3028 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3034 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3029 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3035 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3030 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3036 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3031 which provides support for Qt interactive usage (similar to the
3037 which provides support for Qt interactive usage (similar to the
3032 existing one for WX and GTK). This had been often requested.
3038 existing one for WX and GTK). This had been often requested.
3033
3039
3034 2005-04-14 *** Released version 0.6.13
3040 2005-04-14 *** Released version 0.6.13
3035
3041
3036 2005-04-08 Fernando Perez <fperez@colorado.edu>
3042 2005-04-08 Fernando Perez <fperez@colorado.edu>
3037
3043
3038 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3044 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3039 from _ofind, which gets called on almost every input line. Now,
3045 from _ofind, which gets called on almost every input line. Now,
3040 we only try to get docstrings if they are actually going to be
3046 we only try to get docstrings if they are actually going to be
3041 used (the overhead of fetching unnecessary docstrings can be
3047 used (the overhead of fetching unnecessary docstrings can be
3042 noticeable for certain objects, such as Pyro proxies).
3048 noticeable for certain objects, such as Pyro proxies).
3043
3049
3044 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3050 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3045 for completers. For some reason I had been passing them the state
3051 for completers. For some reason I had been passing them the state
3046 variable, which completers never actually need, and was in
3052 variable, which completers never actually need, and was in
3047 conflict with the rlcompleter API. Custom completers ONLY need to
3053 conflict with the rlcompleter API. Custom completers ONLY need to
3048 take the text parameter.
3054 take the text parameter.
3049
3055
3050 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3056 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3051 work correctly in pysh. I've also moved all the logic which used
3057 work correctly in pysh. I've also moved all the logic which used
3052 to be in pysh.py here, which will prevent problems with future
3058 to be in pysh.py here, which will prevent problems with future
3053 upgrades. However, this time I must warn users to update their
3059 upgrades. However, this time I must warn users to update their
3054 pysh profile to include the line
3060 pysh profile to include the line
3055
3061
3056 import_all IPython.Extensions.InterpreterExec
3062 import_all IPython.Extensions.InterpreterExec
3057
3063
3058 because otherwise things won't work for them. They MUST also
3064 because otherwise things won't work for them. They MUST also
3059 delete pysh.py and the line
3065 delete pysh.py and the line
3060
3066
3061 execfile pysh.py
3067 execfile pysh.py
3062
3068
3063 from their ipythonrc-pysh.
3069 from their ipythonrc-pysh.
3064
3070
3065 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3071 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3066 robust in the face of objects whose dir() returns non-strings
3072 robust in the face of objects whose dir() returns non-strings
3067 (which it shouldn't, but some broken libs like ITK do). Thanks to
3073 (which it shouldn't, but some broken libs like ITK do). Thanks to
3068 a patch by John Hunter (implemented differently, though). Also
3074 a patch by John Hunter (implemented differently, though). Also
3069 minor improvements by using .extend instead of + on lists.
3075 minor improvements by using .extend instead of + on lists.
3070
3076
3071 * pysh.py:
3077 * pysh.py:
3072
3078
3073 2005-04-06 Fernando Perez <fperez@colorado.edu>
3079 2005-04-06 Fernando Perez <fperez@colorado.edu>
3074
3080
3075 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3081 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3076 by default, so that all users benefit from it. Those who don't
3082 by default, so that all users benefit from it. Those who don't
3077 want it can still turn it off.
3083 want it can still turn it off.
3078
3084
3079 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3085 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3080 config file, I'd forgotten about this, so users were getting it
3086 config file, I'd forgotten about this, so users were getting it
3081 off by default.
3087 off by default.
3082
3088
3083 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3089 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3084 consistency. Now magics can be called in multiline statements,
3090 consistency. Now magics can be called in multiline statements,
3085 and python variables can be expanded in magic calls via $var.
3091 and python variables can be expanded in magic calls via $var.
3086 This makes the magic system behave just like aliases or !system
3092 This makes the magic system behave just like aliases or !system
3087 calls.
3093 calls.
3088
3094
3089 2005-03-28 Fernando Perez <fperez@colorado.edu>
3095 2005-03-28 Fernando Perez <fperez@colorado.edu>
3090
3096
3091 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3097 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3092 expensive string additions for building command. Add support for
3098 expensive string additions for building command. Add support for
3093 trailing ';' when autocall is used.
3099 trailing ';' when autocall is used.
3094
3100
3095 2005-03-26 Fernando Perez <fperez@colorado.edu>
3101 2005-03-26 Fernando Perez <fperez@colorado.edu>
3096
3102
3097 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3103 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3098 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3104 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3099 ipython.el robust against prompts with any number of spaces
3105 ipython.el robust against prompts with any number of spaces
3100 (including 0) after the ':' character.
3106 (including 0) after the ':' character.
3101
3107
3102 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3108 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3103 continuation prompt, which misled users to think the line was
3109 continuation prompt, which misled users to think the line was
3104 already indented. Closes debian Bug#300847, reported to me by
3110 already indented. Closes debian Bug#300847, reported to me by
3105 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3111 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3106
3112
3107 2005-03-23 Fernando Perez <fperez@colorado.edu>
3113 2005-03-23 Fernando Perez <fperez@colorado.edu>
3108
3114
3109 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3115 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3110 properly aligned if they have embedded newlines.
3116 properly aligned if they have embedded newlines.
3111
3117
3112 * IPython/iplib.py (runlines): Add a public method to expose
3118 * IPython/iplib.py (runlines): Add a public method to expose
3113 IPython's code execution machinery, so that users can run strings
3119 IPython's code execution machinery, so that users can run strings
3114 as if they had been typed at the prompt interactively.
3120 as if they had been typed at the prompt interactively.
3115 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3121 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3116 methods which can call the system shell, but with python variable
3122 methods which can call the system shell, but with python variable
3117 expansion. The three such methods are: __IPYTHON__.system,
3123 expansion. The three such methods are: __IPYTHON__.system,
3118 .getoutput and .getoutputerror. These need to be documented in a
3124 .getoutput and .getoutputerror. These need to be documented in a
3119 'public API' section (to be written) of the manual.
3125 'public API' section (to be written) of the manual.
3120
3126
3121 2005-03-20 Fernando Perez <fperez@colorado.edu>
3127 2005-03-20 Fernando Perez <fperez@colorado.edu>
3122
3128
3123 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3129 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3124 for custom exception handling. This is quite powerful, and it
3130 for custom exception handling. This is quite powerful, and it
3125 allows for user-installable exception handlers which can trap
3131 allows for user-installable exception handlers which can trap
3126 custom exceptions at runtime and treat them separately from
3132 custom exceptions at runtime and treat them separately from
3127 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3133 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3128 Mantegazza <mantegazza-AT-ill.fr>.
3134 Mantegazza <mantegazza-AT-ill.fr>.
3129 (InteractiveShell.set_custom_completer): public API function to
3135 (InteractiveShell.set_custom_completer): public API function to
3130 add new completers at runtime.
3136 add new completers at runtime.
3131
3137
3132 2005-03-19 Fernando Perez <fperez@colorado.edu>
3138 2005-03-19 Fernando Perez <fperez@colorado.edu>
3133
3139
3134 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3140 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3135 allow objects which provide their docstrings via non-standard
3141 allow objects which provide their docstrings via non-standard
3136 mechanisms (like Pyro proxies) to still be inspected by ipython's
3142 mechanisms (like Pyro proxies) to still be inspected by ipython's
3137 ? system.
3143 ? system.
3138
3144
3139 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3145 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3140 automatic capture system. I tried quite hard to make it work
3146 automatic capture system. I tried quite hard to make it work
3141 reliably, and simply failed. I tried many combinations with the
3147 reliably, and simply failed. I tried many combinations with the
3142 subprocess module, but eventually nothing worked in all needed
3148 subprocess module, but eventually nothing worked in all needed
3143 cases (not blocking stdin for the child, duplicating stdout
3149 cases (not blocking stdin for the child, duplicating stdout
3144 without blocking, etc). The new %sc/%sx still do capture to these
3150 without blocking, etc). The new %sc/%sx still do capture to these
3145 magical list/string objects which make shell use much more
3151 magical list/string objects which make shell use much more
3146 conveninent, so not all is lost.
3152 conveninent, so not all is lost.
3147
3153
3148 XXX - FIX MANUAL for the change above!
3154 XXX - FIX MANUAL for the change above!
3149
3155
3150 (runsource): I copied code.py's runsource() into ipython to modify
3156 (runsource): I copied code.py's runsource() into ipython to modify
3151 it a bit. Now the code object and source to be executed are
3157 it a bit. Now the code object and source to be executed are
3152 stored in ipython. This makes this info accessible to third-party
3158 stored in ipython. This makes this info accessible to third-party
3153 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3159 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3154 Mantegazza <mantegazza-AT-ill.fr>.
3160 Mantegazza <mantegazza-AT-ill.fr>.
3155
3161
3156 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3162 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3157 history-search via readline (like C-p/C-n). I'd wanted this for a
3163 history-search via readline (like C-p/C-n). I'd wanted this for a
3158 long time, but only recently found out how to do it. For users
3164 long time, but only recently found out how to do it. For users
3159 who already have their ipythonrc files made and want this, just
3165 who already have their ipythonrc files made and want this, just
3160 add:
3166 add:
3161
3167
3162 readline_parse_and_bind "\e[A": history-search-backward
3168 readline_parse_and_bind "\e[A": history-search-backward
3163 readline_parse_and_bind "\e[B": history-search-forward
3169 readline_parse_and_bind "\e[B": history-search-forward
3164
3170
3165 2005-03-18 Fernando Perez <fperez@colorado.edu>
3171 2005-03-18 Fernando Perez <fperez@colorado.edu>
3166
3172
3167 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3173 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3168 LSString and SList classes which allow transparent conversions
3174 LSString and SList classes which allow transparent conversions
3169 between list mode and whitespace-separated string.
3175 between list mode and whitespace-separated string.
3170 (magic_r): Fix recursion problem in %r.
3176 (magic_r): Fix recursion problem in %r.
3171
3177
3172 * IPython/genutils.py (LSString): New class to be used for
3178 * IPython/genutils.py (LSString): New class to be used for
3173 automatic storage of the results of all alias/system calls in _o
3179 automatic storage of the results of all alias/system calls in _o
3174 and _e (stdout/err). These provide a .l/.list attribute which
3180 and _e (stdout/err). These provide a .l/.list attribute which
3175 does automatic splitting on newlines. This means that for most
3181 does automatic splitting on newlines. This means that for most
3176 uses, you'll never need to do capturing of output with %sc/%sx
3182 uses, you'll never need to do capturing of output with %sc/%sx
3177 anymore, since ipython keeps this always done for you. Note that
3183 anymore, since ipython keeps this always done for you. Note that
3178 only the LAST results are stored, the _o/e variables are
3184 only the LAST results are stored, the _o/e variables are
3179 overwritten on each call. If you need to save their contents
3185 overwritten on each call. If you need to save their contents
3180 further, simply bind them to any other name.
3186 further, simply bind them to any other name.
3181
3187
3182 2005-03-17 Fernando Perez <fperez@colorado.edu>
3188 2005-03-17 Fernando Perez <fperez@colorado.edu>
3183
3189
3184 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3190 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3185 prompt namespace handling.
3191 prompt namespace handling.
3186
3192
3187 2005-03-16 Fernando Perez <fperez@colorado.edu>
3193 2005-03-16 Fernando Perez <fperez@colorado.edu>
3188
3194
3189 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3195 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3190 classic prompts to be '>>> ' (final space was missing, and it
3196 classic prompts to be '>>> ' (final space was missing, and it
3191 trips the emacs python mode).
3197 trips the emacs python mode).
3192 (BasePrompt.__str__): Added safe support for dynamic prompt
3198 (BasePrompt.__str__): Added safe support for dynamic prompt
3193 strings. Now you can set your prompt string to be '$x', and the
3199 strings. Now you can set your prompt string to be '$x', and the
3194 value of x will be printed from your interactive namespace. The
3200 value of x will be printed from your interactive namespace. The
3195 interpolation syntax includes the full Itpl support, so
3201 interpolation syntax includes the full Itpl support, so
3196 ${foo()+x+bar()} is a valid prompt string now, and the function
3202 ${foo()+x+bar()} is a valid prompt string now, and the function
3197 calls will be made at runtime.
3203 calls will be made at runtime.
3198
3204
3199 2005-03-15 Fernando Perez <fperez@colorado.edu>
3205 2005-03-15 Fernando Perez <fperez@colorado.edu>
3200
3206
3201 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3207 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3202 avoid name clashes in pylab. %hist still works, it just forwards
3208 avoid name clashes in pylab. %hist still works, it just forwards
3203 the call to %history.
3209 the call to %history.
3204
3210
3205 2005-03-02 *** Released version 0.6.12
3211 2005-03-02 *** Released version 0.6.12
3206
3212
3207 2005-03-02 Fernando Perez <fperez@colorado.edu>
3213 2005-03-02 Fernando Perez <fperez@colorado.edu>
3208
3214
3209 * IPython/iplib.py (handle_magic): log magic calls properly as
3215 * IPython/iplib.py (handle_magic): log magic calls properly as
3210 ipmagic() function calls.
3216 ipmagic() function calls.
3211
3217
3212 * IPython/Magic.py (magic_time): Improved %time to support
3218 * IPython/Magic.py (magic_time): Improved %time to support
3213 statements and provide wall-clock as well as CPU time.
3219 statements and provide wall-clock as well as CPU time.
3214
3220
3215 2005-02-27 Fernando Perez <fperez@colorado.edu>
3221 2005-02-27 Fernando Perez <fperez@colorado.edu>
3216
3222
3217 * IPython/hooks.py: New hooks module, to expose user-modifiable
3223 * IPython/hooks.py: New hooks module, to expose user-modifiable
3218 IPython functionality in a clean manner. For now only the editor
3224 IPython functionality in a clean manner. For now only the editor
3219 hook is actually written, and other thigns which I intend to turn
3225 hook is actually written, and other thigns which I intend to turn
3220 into proper hooks aren't yet there. The display and prefilter
3226 into proper hooks aren't yet there. The display and prefilter
3221 stuff, for example, should be hooks. But at least now the
3227 stuff, for example, should be hooks. But at least now the
3222 framework is in place, and the rest can be moved here with more
3228 framework is in place, and the rest can be moved here with more
3223 time later. IPython had had a .hooks variable for a long time for
3229 time later. IPython had had a .hooks variable for a long time for
3224 this purpose, but I'd never actually used it for anything.
3230 this purpose, but I'd never actually used it for anything.
3225
3231
3226 2005-02-26 Fernando Perez <fperez@colorado.edu>
3232 2005-02-26 Fernando Perez <fperez@colorado.edu>
3227
3233
3228 * IPython/ipmaker.py (make_IPython): make the default ipython
3234 * IPython/ipmaker.py (make_IPython): make the default ipython
3229 directory be called _ipython under win32, to follow more the
3235 directory be called _ipython under win32, to follow more the
3230 naming peculiarities of that platform (where buggy software like
3236 naming peculiarities of that platform (where buggy software like
3231 Visual Sourcesafe breaks with .named directories). Reported by
3237 Visual Sourcesafe breaks with .named directories). Reported by
3232 Ville Vainio.
3238 Ville Vainio.
3233
3239
3234 2005-02-23 Fernando Perez <fperez@colorado.edu>
3240 2005-02-23 Fernando Perez <fperez@colorado.edu>
3235
3241
3236 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3242 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3237 auto_aliases for win32 which were causing problems. Users can
3243 auto_aliases for win32 which were causing problems. Users can
3238 define the ones they personally like.
3244 define the ones they personally like.
3239
3245
3240 2005-02-21 Fernando Perez <fperez@colorado.edu>
3246 2005-02-21 Fernando Perez <fperez@colorado.edu>
3241
3247
3242 * IPython/Magic.py (magic_time): new magic to time execution of
3248 * IPython/Magic.py (magic_time): new magic to time execution of
3243 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3249 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3244
3250
3245 2005-02-19 Fernando Perez <fperez@colorado.edu>
3251 2005-02-19 Fernando Perez <fperez@colorado.edu>
3246
3252
3247 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3253 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3248 into keys (for prompts, for example).
3254 into keys (for prompts, for example).
3249
3255
3250 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3256 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3251 prompts in case users want them. This introduces a small behavior
3257 prompts in case users want them. This introduces a small behavior
3252 change: ipython does not automatically add a space to all prompts
3258 change: ipython does not automatically add a space to all prompts
3253 anymore. To get the old prompts with a space, users should add it
3259 anymore. To get the old prompts with a space, users should add it
3254 manually to their ipythonrc file, so for example prompt_in1 should
3260 manually to their ipythonrc file, so for example prompt_in1 should
3255 now read 'In [\#]: ' instead of 'In [\#]:'.
3261 now read 'In [\#]: ' instead of 'In [\#]:'.
3256 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3262 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3257 file) to control left-padding of secondary prompts.
3263 file) to control left-padding of secondary prompts.
3258
3264
3259 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3265 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3260 the profiler can't be imported. Fix for Debian, which removed
3266 the profiler can't be imported. Fix for Debian, which removed
3261 profile.py because of License issues. I applied a slightly
3267 profile.py because of License issues. I applied a slightly
3262 modified version of the original Debian patch at
3268 modified version of the original Debian patch at
3263 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3269 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3264
3270
3265 2005-02-17 Fernando Perez <fperez@colorado.edu>
3271 2005-02-17 Fernando Perez <fperez@colorado.edu>
3266
3272
3267 * IPython/genutils.py (native_line_ends): Fix bug which would
3273 * IPython/genutils.py (native_line_ends): Fix bug which would
3268 cause improper line-ends under win32 b/c I was not opening files
3274 cause improper line-ends under win32 b/c I was not opening files
3269 in binary mode. Bug report and fix thanks to Ville.
3275 in binary mode. Bug report and fix thanks to Ville.
3270
3276
3271 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3277 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3272 trying to catch spurious foo[1] autocalls. My fix actually broke
3278 trying to catch spurious foo[1] autocalls. My fix actually broke
3273 ',/' autoquote/call with explicit escape (bad regexp).
3279 ',/' autoquote/call with explicit escape (bad regexp).
3274
3280
3275 2005-02-15 *** Released version 0.6.11
3281 2005-02-15 *** Released version 0.6.11
3276
3282
3277 2005-02-14 Fernando Perez <fperez@colorado.edu>
3283 2005-02-14 Fernando Perez <fperez@colorado.edu>
3278
3284
3279 * IPython/background_jobs.py: New background job management
3285 * IPython/background_jobs.py: New background job management
3280 subsystem. This is implemented via a new set of classes, and
3286 subsystem. This is implemented via a new set of classes, and
3281 IPython now provides a builtin 'jobs' object for background job
3287 IPython now provides a builtin 'jobs' object for background job
3282 execution. A convenience %bg magic serves as a lightweight
3288 execution. A convenience %bg magic serves as a lightweight
3283 frontend for starting the more common type of calls. This was
3289 frontend for starting the more common type of calls. This was
3284 inspired by discussions with B. Granger and the BackgroundCommand
3290 inspired by discussions with B. Granger and the BackgroundCommand
3285 class described in the book Python Scripting for Computational
3291 class described in the book Python Scripting for Computational
3286 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3292 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3287 (although ultimately no code from this text was used, as IPython's
3293 (although ultimately no code from this text was used, as IPython's
3288 system is a separate implementation).
3294 system is a separate implementation).
3289
3295
3290 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3296 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3291 to control the completion of single/double underscore names
3297 to control the completion of single/double underscore names
3292 separately. As documented in the example ipytonrc file, the
3298 separately. As documented in the example ipytonrc file, the
3293 readline_omit__names variable can now be set to 2, to omit even
3299 readline_omit__names variable can now be set to 2, to omit even
3294 single underscore names. Thanks to a patch by Brian Wong
3300 single underscore names. Thanks to a patch by Brian Wong
3295 <BrianWong-AT-AirgoNetworks.Com>.
3301 <BrianWong-AT-AirgoNetworks.Com>.
3296 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3302 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3297 be autocalled as foo([1]) if foo were callable. A problem for
3303 be autocalled as foo([1]) if foo were callable. A problem for
3298 things which are both callable and implement __getitem__.
3304 things which are both callable and implement __getitem__.
3299 (init_readline): Fix autoindentation for win32. Thanks to a patch
3305 (init_readline): Fix autoindentation for win32. Thanks to a patch
3300 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3306 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3301
3307
3302 2005-02-12 Fernando Perez <fperez@colorado.edu>
3308 2005-02-12 Fernando Perez <fperez@colorado.edu>
3303
3309
3304 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3310 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3305 which I had written long ago to sort out user error messages which
3311 which I had written long ago to sort out user error messages which
3306 may occur during startup. This seemed like a good idea initially,
3312 may occur during startup. This seemed like a good idea initially,
3307 but it has proven a disaster in retrospect. I don't want to
3313 but it has proven a disaster in retrospect. I don't want to
3308 change much code for now, so my fix is to set the internal 'debug'
3314 change much code for now, so my fix is to set the internal 'debug'
3309 flag to true everywhere, whose only job was precisely to control
3315 flag to true everywhere, whose only job was precisely to control
3310 this subsystem. This closes issue 28 (as well as avoiding all
3316 this subsystem. This closes issue 28 (as well as avoiding all
3311 sorts of strange hangups which occur from time to time).
3317 sorts of strange hangups which occur from time to time).
3312
3318
3313 2005-02-07 Fernando Perez <fperez@colorado.edu>
3319 2005-02-07 Fernando Perez <fperez@colorado.edu>
3314
3320
3315 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3321 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3316 previous call produced a syntax error.
3322 previous call produced a syntax error.
3317
3323
3318 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3324 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3319 classes without constructor.
3325 classes without constructor.
3320
3326
3321 2005-02-06 Fernando Perez <fperez@colorado.edu>
3327 2005-02-06 Fernando Perez <fperez@colorado.edu>
3322
3328
3323 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3329 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3324 completions with the results of each matcher, so we return results
3330 completions with the results of each matcher, so we return results
3325 to the user from all namespaces. This breaks with ipython
3331 to the user from all namespaces. This breaks with ipython
3326 tradition, but I think it's a nicer behavior. Now you get all
3332 tradition, but I think it's a nicer behavior. Now you get all
3327 possible completions listed, from all possible namespaces (python,
3333 possible completions listed, from all possible namespaces (python,
3328 filesystem, magics...) After a request by John Hunter
3334 filesystem, magics...) After a request by John Hunter
3329 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3335 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3330
3336
3331 2005-02-05 Fernando Perez <fperez@colorado.edu>
3337 2005-02-05 Fernando Perez <fperez@colorado.edu>
3332
3338
3333 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3339 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3334 the call had quote characters in it (the quotes were stripped).
3340 the call had quote characters in it (the quotes were stripped).
3335
3341
3336 2005-01-31 Fernando Perez <fperez@colorado.edu>
3342 2005-01-31 Fernando Perez <fperez@colorado.edu>
3337
3343
3338 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3344 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3339 Itpl.itpl() to make the code more robust against psyco
3345 Itpl.itpl() to make the code more robust against psyco
3340 optimizations.
3346 optimizations.
3341
3347
3342 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3348 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3343 of causing an exception. Quicker, cleaner.
3349 of causing an exception. Quicker, cleaner.
3344
3350
3345 2005-01-28 Fernando Perez <fperez@colorado.edu>
3351 2005-01-28 Fernando Perez <fperez@colorado.edu>
3346
3352
3347 * scripts/ipython_win_post_install.py (install): hardcode
3353 * scripts/ipython_win_post_install.py (install): hardcode
3348 sys.prefix+'python.exe' as the executable path. It turns out that
3354 sys.prefix+'python.exe' as the executable path. It turns out that
3349 during the post-installation run, sys.executable resolves to the
3355 during the post-installation run, sys.executable resolves to the
3350 name of the binary installer! I should report this as a distutils
3356 name of the binary installer! I should report this as a distutils
3351 bug, I think. I updated the .10 release with this tiny fix, to
3357 bug, I think. I updated the .10 release with this tiny fix, to
3352 avoid annoying the lists further.
3358 avoid annoying the lists further.
3353
3359
3354 2005-01-27 *** Released version 0.6.10
3360 2005-01-27 *** Released version 0.6.10
3355
3361
3356 2005-01-27 Fernando Perez <fperez@colorado.edu>
3362 2005-01-27 Fernando Perez <fperez@colorado.edu>
3357
3363
3358 * IPython/numutils.py (norm): Added 'inf' as optional name for
3364 * IPython/numutils.py (norm): Added 'inf' as optional name for
3359 L-infinity norm, included references to mathworld.com for vector
3365 L-infinity norm, included references to mathworld.com for vector
3360 norm definitions.
3366 norm definitions.
3361 (amin/amax): added amin/amax for array min/max. Similar to what
3367 (amin/amax): added amin/amax for array min/max. Similar to what
3362 pylab ships with after the recent reorganization of names.
3368 pylab ships with after the recent reorganization of names.
3363 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3369 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3364
3370
3365 * ipython.el: committed Alex's recent fixes and improvements.
3371 * ipython.el: committed Alex's recent fixes and improvements.
3366 Tested with python-mode from CVS, and it looks excellent. Since
3372 Tested with python-mode from CVS, and it looks excellent. Since
3367 python-mode hasn't released anything in a while, I'm temporarily
3373 python-mode hasn't released anything in a while, I'm temporarily
3368 putting a copy of today's CVS (v 4.70) of python-mode in:
3374 putting a copy of today's CVS (v 4.70) of python-mode in:
3369 http://ipython.scipy.org/tmp/python-mode.el
3375 http://ipython.scipy.org/tmp/python-mode.el
3370
3376
3371 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3377 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3372 sys.executable for the executable name, instead of assuming it's
3378 sys.executable for the executable name, instead of assuming it's
3373 called 'python.exe' (the post-installer would have produced broken
3379 called 'python.exe' (the post-installer would have produced broken
3374 setups on systems with a differently named python binary).
3380 setups on systems with a differently named python binary).
3375
3381
3376 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3382 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3377 references to os.linesep, to make the code more
3383 references to os.linesep, to make the code more
3378 platform-independent. This is also part of the win32 coloring
3384 platform-independent. This is also part of the win32 coloring
3379 fixes.
3385 fixes.
3380
3386
3381 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3387 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3382 lines, which actually cause coloring bugs because the length of
3388 lines, which actually cause coloring bugs because the length of
3383 the line is very difficult to correctly compute with embedded
3389 the line is very difficult to correctly compute with embedded
3384 escapes. This was the source of all the coloring problems under
3390 escapes. This was the source of all the coloring problems under
3385 Win32. I think that _finally_, Win32 users have a properly
3391 Win32. I think that _finally_, Win32 users have a properly
3386 working ipython in all respects. This would never have happened
3392 working ipython in all respects. This would never have happened
3387 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3393 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3388
3394
3389 2005-01-26 *** Released version 0.6.9
3395 2005-01-26 *** Released version 0.6.9
3390
3396
3391 2005-01-25 Fernando Perez <fperez@colorado.edu>
3397 2005-01-25 Fernando Perez <fperez@colorado.edu>
3392
3398
3393 * setup.py: finally, we have a true Windows installer, thanks to
3399 * setup.py: finally, we have a true Windows installer, thanks to
3394 the excellent work of Viktor Ransmayr
3400 the excellent work of Viktor Ransmayr
3395 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3401 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3396 Windows users. The setup routine is quite a bit cleaner thanks to
3402 Windows users. The setup routine is quite a bit cleaner thanks to
3397 this, and the post-install script uses the proper functions to
3403 this, and the post-install script uses the proper functions to
3398 allow a clean de-installation using the standard Windows Control
3404 allow a clean de-installation using the standard Windows Control
3399 Panel.
3405 Panel.
3400
3406
3401 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3407 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3402 environment variable under all OSes (including win32) if
3408 environment variable under all OSes (including win32) if
3403 available. This will give consistency to win32 users who have set
3409 available. This will give consistency to win32 users who have set
3404 this variable for any reason. If os.environ['HOME'] fails, the
3410 this variable for any reason. If os.environ['HOME'] fails, the
3405 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3411 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3406
3412
3407 2005-01-24 Fernando Perez <fperez@colorado.edu>
3413 2005-01-24 Fernando Perez <fperez@colorado.edu>
3408
3414
3409 * IPython/numutils.py (empty_like): add empty_like(), similar to
3415 * IPython/numutils.py (empty_like): add empty_like(), similar to
3410 zeros_like() but taking advantage of the new empty() Numeric routine.
3416 zeros_like() but taking advantage of the new empty() Numeric routine.
3411
3417
3412 2005-01-23 *** Released version 0.6.8
3418 2005-01-23 *** Released version 0.6.8
3413
3419
3414 2005-01-22 Fernando Perez <fperez@colorado.edu>
3420 2005-01-22 Fernando Perez <fperez@colorado.edu>
3415
3421
3416 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3422 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3417 automatic show() calls. After discussing things with JDH, it
3423 automatic show() calls. After discussing things with JDH, it
3418 turns out there are too many corner cases where this can go wrong.
3424 turns out there are too many corner cases where this can go wrong.
3419 It's best not to try to be 'too smart', and simply have ipython
3425 It's best not to try to be 'too smart', and simply have ipython
3420 reproduce as much as possible the default behavior of a normal
3426 reproduce as much as possible the default behavior of a normal
3421 python shell.
3427 python shell.
3422
3428
3423 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3429 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3424 line-splitting regexp and _prefilter() to avoid calling getattr()
3430 line-splitting regexp and _prefilter() to avoid calling getattr()
3425 on assignments. This closes
3431 on assignments. This closes
3426 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3432 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3427 readline uses getattr(), so a simple <TAB> keypress is still
3433 readline uses getattr(), so a simple <TAB> keypress is still
3428 enough to trigger getattr() calls on an object.
3434 enough to trigger getattr() calls on an object.
3429
3435
3430 2005-01-21 Fernando Perez <fperez@colorado.edu>
3436 2005-01-21 Fernando Perez <fperez@colorado.edu>
3431
3437
3432 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3438 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3433 docstring under pylab so it doesn't mask the original.
3439 docstring under pylab so it doesn't mask the original.
3434
3440
3435 2005-01-21 *** Released version 0.6.7
3441 2005-01-21 *** Released version 0.6.7
3436
3442
3437 2005-01-21 Fernando Perez <fperez@colorado.edu>
3443 2005-01-21 Fernando Perez <fperez@colorado.edu>
3438
3444
3439 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3445 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3440 signal handling for win32 users in multithreaded mode.
3446 signal handling for win32 users in multithreaded mode.
3441
3447
3442 2005-01-17 Fernando Perez <fperez@colorado.edu>
3448 2005-01-17 Fernando Perez <fperez@colorado.edu>
3443
3449
3444 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3450 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3445 instances with no __init__. After a crash report by Norbert Nemec
3451 instances with no __init__. After a crash report by Norbert Nemec
3446 <Norbert-AT-nemec-online.de>.
3452 <Norbert-AT-nemec-online.de>.
3447
3453
3448 2005-01-14 Fernando Perez <fperez@colorado.edu>
3454 2005-01-14 Fernando Perez <fperez@colorado.edu>
3449
3455
3450 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3456 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3451 names for verbose exceptions, when multiple dotted names and the
3457 names for verbose exceptions, when multiple dotted names and the
3452 'parent' object were present on the same line.
3458 'parent' object were present on the same line.
3453
3459
3454 2005-01-11 Fernando Perez <fperez@colorado.edu>
3460 2005-01-11 Fernando Perez <fperez@colorado.edu>
3455
3461
3456 * IPython/genutils.py (flag_calls): new utility to trap and flag
3462 * IPython/genutils.py (flag_calls): new utility to trap and flag
3457 calls in functions. I need it to clean up matplotlib support.
3463 calls in functions. I need it to clean up matplotlib support.
3458 Also removed some deprecated code in genutils.
3464 Also removed some deprecated code in genutils.
3459
3465
3460 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3466 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3461 that matplotlib scripts called with %run, which don't call show()
3467 that matplotlib scripts called with %run, which don't call show()
3462 themselves, still have their plotting windows open.
3468 themselves, still have their plotting windows open.
3463
3469
3464 2005-01-05 Fernando Perez <fperez@colorado.edu>
3470 2005-01-05 Fernando Perez <fperez@colorado.edu>
3465
3471
3466 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3472 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3467 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3473 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3468
3474
3469 2004-12-19 Fernando Perez <fperez@colorado.edu>
3475 2004-12-19 Fernando Perez <fperez@colorado.edu>
3470
3476
3471 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3477 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3472 parent_runcode, which was an eyesore. The same result can be
3478 parent_runcode, which was an eyesore. The same result can be
3473 obtained with Python's regular superclass mechanisms.
3479 obtained with Python's regular superclass mechanisms.
3474
3480
3475 2004-12-17 Fernando Perez <fperez@colorado.edu>
3481 2004-12-17 Fernando Perez <fperez@colorado.edu>
3476
3482
3477 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3483 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3478 reported by Prabhu.
3484 reported by Prabhu.
3479 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3485 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3480 sys.stderr) instead of explicitly calling sys.stderr. This helps
3486 sys.stderr) instead of explicitly calling sys.stderr. This helps
3481 maintain our I/O abstractions clean, for future GUI embeddings.
3487 maintain our I/O abstractions clean, for future GUI embeddings.
3482
3488
3483 * IPython/genutils.py (info): added new utility for sys.stderr
3489 * IPython/genutils.py (info): added new utility for sys.stderr
3484 unified info message handling (thin wrapper around warn()).
3490 unified info message handling (thin wrapper around warn()).
3485
3491
3486 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3492 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3487 composite (dotted) names on verbose exceptions.
3493 composite (dotted) names on verbose exceptions.
3488 (VerboseTB.nullrepr): harden against another kind of errors which
3494 (VerboseTB.nullrepr): harden against another kind of errors which
3489 Python's inspect module can trigger, and which were crashing
3495 Python's inspect module can trigger, and which were crashing
3490 IPython. Thanks to a report by Marco Lombardi
3496 IPython. Thanks to a report by Marco Lombardi
3491 <mlombard-AT-ma010192.hq.eso.org>.
3497 <mlombard-AT-ma010192.hq.eso.org>.
3492
3498
3493 2004-12-13 *** Released version 0.6.6
3499 2004-12-13 *** Released version 0.6.6
3494
3500
3495 2004-12-12 Fernando Perez <fperez@colorado.edu>
3501 2004-12-12 Fernando Perez <fperez@colorado.edu>
3496
3502
3497 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3503 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3498 generated by pygtk upon initialization if it was built without
3504 generated by pygtk upon initialization if it was built without
3499 threads (for matplotlib users). After a crash reported by
3505 threads (for matplotlib users). After a crash reported by
3500 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3506 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3501
3507
3502 * IPython/ipmaker.py (make_IPython): fix small bug in the
3508 * IPython/ipmaker.py (make_IPython): fix small bug in the
3503 import_some parameter for multiple imports.
3509 import_some parameter for multiple imports.
3504
3510
3505 * IPython/iplib.py (ipmagic): simplified the interface of
3511 * IPython/iplib.py (ipmagic): simplified the interface of
3506 ipmagic() to take a single string argument, just as it would be
3512 ipmagic() to take a single string argument, just as it would be
3507 typed at the IPython cmd line.
3513 typed at the IPython cmd line.
3508 (ipalias): Added new ipalias() with an interface identical to
3514 (ipalias): Added new ipalias() with an interface identical to
3509 ipmagic(). This completes exposing a pure python interface to the
3515 ipmagic(). This completes exposing a pure python interface to the
3510 alias and magic system, which can be used in loops or more complex
3516 alias and magic system, which can be used in loops or more complex
3511 code where IPython's automatic line mangling is not active.
3517 code where IPython's automatic line mangling is not active.
3512
3518
3513 * IPython/genutils.py (timing): changed interface of timing to
3519 * IPython/genutils.py (timing): changed interface of timing to
3514 simply run code once, which is the most common case. timings()
3520 simply run code once, which is the most common case. timings()
3515 remains unchanged, for the cases where you want multiple runs.
3521 remains unchanged, for the cases where you want multiple runs.
3516
3522
3517 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3523 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3518 bug where Python2.2 crashes with exec'ing code which does not end
3524 bug where Python2.2 crashes with exec'ing code which does not end
3519 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3525 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3520 before.
3526 before.
3521
3527
3522 2004-12-10 Fernando Perez <fperez@colorado.edu>
3528 2004-12-10 Fernando Perez <fperez@colorado.edu>
3523
3529
3524 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3530 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3525 -t to -T, to accomodate the new -t flag in %run (the %run and
3531 -t to -T, to accomodate the new -t flag in %run (the %run and
3526 %prun options are kind of intermixed, and it's not easy to change
3532 %prun options are kind of intermixed, and it's not easy to change
3527 this with the limitations of python's getopt).
3533 this with the limitations of python's getopt).
3528
3534
3529 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3535 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3530 the execution of scripts. It's not as fine-tuned as timeit.py,
3536 the execution of scripts. It's not as fine-tuned as timeit.py,
3531 but it works from inside ipython (and under 2.2, which lacks
3537 but it works from inside ipython (and under 2.2, which lacks
3532 timeit.py). Optionally a number of runs > 1 can be given for
3538 timeit.py). Optionally a number of runs > 1 can be given for
3533 timing very short-running code.
3539 timing very short-running code.
3534
3540
3535 * IPython/genutils.py (uniq_stable): new routine which returns a
3541 * IPython/genutils.py (uniq_stable): new routine which returns a
3536 list of unique elements in any iterable, but in stable order of
3542 list of unique elements in any iterable, but in stable order of
3537 appearance. I needed this for the ultraTB fixes, and it's a handy
3543 appearance. I needed this for the ultraTB fixes, and it's a handy
3538 utility.
3544 utility.
3539
3545
3540 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3546 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3541 dotted names in Verbose exceptions. This had been broken since
3547 dotted names in Verbose exceptions. This had been broken since
3542 the very start, now x.y will properly be printed in a Verbose
3548 the very start, now x.y will properly be printed in a Verbose
3543 traceback, instead of x being shown and y appearing always as an
3549 traceback, instead of x being shown and y appearing always as an
3544 'undefined global'. Getting this to work was a bit tricky,
3550 'undefined global'. Getting this to work was a bit tricky,
3545 because by default python tokenizers are stateless. Saved by
3551 because by default python tokenizers are stateless. Saved by
3546 python's ability to easily add a bit of state to an arbitrary
3552 python's ability to easily add a bit of state to an arbitrary
3547 function (without needing to build a full-blown callable object).
3553 function (without needing to build a full-blown callable object).
3548
3554
3549 Also big cleanup of this code, which had horrendous runtime
3555 Also big cleanup of this code, which had horrendous runtime
3550 lookups of zillions of attributes for colorization. Moved all
3556 lookups of zillions of attributes for colorization. Moved all
3551 this code into a few templates, which make it cleaner and quicker.
3557 this code into a few templates, which make it cleaner and quicker.
3552
3558
3553 Printout quality was also improved for Verbose exceptions: one
3559 Printout quality was also improved for Verbose exceptions: one
3554 variable per line, and memory addresses are printed (this can be
3560 variable per line, and memory addresses are printed (this can be
3555 quite handy in nasty debugging situations, which is what Verbose
3561 quite handy in nasty debugging situations, which is what Verbose
3556 is for).
3562 is for).
3557
3563
3558 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3564 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3559 the command line as scripts to be loaded by embedded instances.
3565 the command line as scripts to be loaded by embedded instances.
3560 Doing so has the potential for an infinite recursion if there are
3566 Doing so has the potential for an infinite recursion if there are
3561 exceptions thrown in the process. This fixes a strange crash
3567 exceptions thrown in the process. This fixes a strange crash
3562 reported by Philippe MULLER <muller-AT-irit.fr>.
3568 reported by Philippe MULLER <muller-AT-irit.fr>.
3563
3569
3564 2004-12-09 Fernando Perez <fperez@colorado.edu>
3570 2004-12-09 Fernando Perez <fperez@colorado.edu>
3565
3571
3566 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3572 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3567 to reflect new names in matplotlib, which now expose the
3573 to reflect new names in matplotlib, which now expose the
3568 matlab-compatible interface via a pylab module instead of the
3574 matlab-compatible interface via a pylab module instead of the
3569 'matlab' name. The new code is backwards compatible, so users of
3575 'matlab' name. The new code is backwards compatible, so users of
3570 all matplotlib versions are OK. Patch by J. Hunter.
3576 all matplotlib versions are OK. Patch by J. Hunter.
3571
3577
3572 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3578 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3573 of __init__ docstrings for instances (class docstrings are already
3579 of __init__ docstrings for instances (class docstrings are already
3574 automatically printed). Instances with customized docstrings
3580 automatically printed). Instances with customized docstrings
3575 (indep. of the class) are also recognized and all 3 separate
3581 (indep. of the class) are also recognized and all 3 separate
3576 docstrings are printed (instance, class, constructor). After some
3582 docstrings are printed (instance, class, constructor). After some
3577 comments/suggestions by J. Hunter.
3583 comments/suggestions by J. Hunter.
3578
3584
3579 2004-12-05 Fernando Perez <fperez@colorado.edu>
3585 2004-12-05 Fernando Perez <fperez@colorado.edu>
3580
3586
3581 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3587 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3582 warnings when tab-completion fails and triggers an exception.
3588 warnings when tab-completion fails and triggers an exception.
3583
3589
3584 2004-12-03 Fernando Perez <fperez@colorado.edu>
3590 2004-12-03 Fernando Perez <fperez@colorado.edu>
3585
3591
3586 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3592 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3587 be triggered when using 'run -p'. An incorrect option flag was
3593 be triggered when using 'run -p'. An incorrect option flag was
3588 being set ('d' instead of 'D').
3594 being set ('d' instead of 'D').
3589 (manpage): fix missing escaped \- sign.
3595 (manpage): fix missing escaped \- sign.
3590
3596
3591 2004-11-30 *** Released version 0.6.5
3597 2004-11-30 *** Released version 0.6.5
3592
3598
3593 2004-11-30 Fernando Perez <fperez@colorado.edu>
3599 2004-11-30 Fernando Perez <fperez@colorado.edu>
3594
3600
3595 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3601 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3596 setting with -d option.
3602 setting with -d option.
3597
3603
3598 * setup.py (docfiles): Fix problem where the doc glob I was using
3604 * setup.py (docfiles): Fix problem where the doc glob I was using
3599 was COMPLETELY BROKEN. It was giving the right files by pure
3605 was COMPLETELY BROKEN. It was giving the right files by pure
3600 accident, but failed once I tried to include ipython.el. Note:
3606 accident, but failed once I tried to include ipython.el. Note:
3601 glob() does NOT allow you to do exclusion on multiple endings!
3607 glob() does NOT allow you to do exclusion on multiple endings!
3602
3608
3603 2004-11-29 Fernando Perez <fperez@colorado.edu>
3609 2004-11-29 Fernando Perez <fperez@colorado.edu>
3604
3610
3605 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3611 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3606 the manpage as the source. Better formatting & consistency.
3612 the manpage as the source. Better formatting & consistency.
3607
3613
3608 * IPython/Magic.py (magic_run): Added new -d option, to run
3614 * IPython/Magic.py (magic_run): Added new -d option, to run
3609 scripts under the control of the python pdb debugger. Note that
3615 scripts under the control of the python pdb debugger. Note that
3610 this required changing the %prun option -d to -D, to avoid a clash
3616 this required changing the %prun option -d to -D, to avoid a clash
3611 (since %run must pass options to %prun, and getopt is too dumb to
3617 (since %run must pass options to %prun, and getopt is too dumb to
3612 handle options with string values with embedded spaces). Thanks
3618 handle options with string values with embedded spaces). Thanks
3613 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3619 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3614 (magic_who_ls): added type matching to %who and %whos, so that one
3620 (magic_who_ls): added type matching to %who and %whos, so that one
3615 can filter their output to only include variables of certain
3621 can filter their output to only include variables of certain
3616 types. Another suggestion by Matthew.
3622 types. Another suggestion by Matthew.
3617 (magic_whos): Added memory summaries in kb and Mb for arrays.
3623 (magic_whos): Added memory summaries in kb and Mb for arrays.
3618 (magic_who): Improve formatting (break lines every 9 vars).
3624 (magic_who): Improve formatting (break lines every 9 vars).
3619
3625
3620 2004-11-28 Fernando Perez <fperez@colorado.edu>
3626 2004-11-28 Fernando Perez <fperez@colorado.edu>
3621
3627
3622 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3628 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3623 cache when empty lines were present.
3629 cache when empty lines were present.
3624
3630
3625 2004-11-24 Fernando Perez <fperez@colorado.edu>
3631 2004-11-24 Fernando Perez <fperez@colorado.edu>
3626
3632
3627 * IPython/usage.py (__doc__): document the re-activated threading
3633 * IPython/usage.py (__doc__): document the re-activated threading
3628 options for WX and GTK.
3634 options for WX and GTK.
3629
3635
3630 2004-11-23 Fernando Perez <fperez@colorado.edu>
3636 2004-11-23 Fernando Perez <fperez@colorado.edu>
3631
3637
3632 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3638 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3633 the -wthread and -gthread options, along with a new -tk one to try
3639 the -wthread and -gthread options, along with a new -tk one to try
3634 and coordinate Tk threading with wx/gtk. The tk support is very
3640 and coordinate Tk threading with wx/gtk. The tk support is very
3635 platform dependent, since it seems to require Tcl and Tk to be
3641 platform dependent, since it seems to require Tcl and Tk to be
3636 built with threads (Fedora1/2 appears NOT to have it, but in
3642 built with threads (Fedora1/2 appears NOT to have it, but in
3637 Prabhu's Debian boxes it works OK). But even with some Tk
3643 Prabhu's Debian boxes it works OK). But even with some Tk
3638 limitations, this is a great improvement.
3644 limitations, this is a great improvement.
3639
3645
3640 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3646 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3641 info in user prompts. Patch by Prabhu.
3647 info in user prompts. Patch by Prabhu.
3642
3648
3643 2004-11-18 Fernando Perez <fperez@colorado.edu>
3649 2004-11-18 Fernando Perez <fperez@colorado.edu>
3644
3650
3645 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3651 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3646 EOFErrors and bail, to avoid infinite loops if a non-terminating
3652 EOFErrors and bail, to avoid infinite loops if a non-terminating
3647 file is fed into ipython. Patch submitted in issue 19 by user,
3653 file is fed into ipython. Patch submitted in issue 19 by user,
3648 many thanks.
3654 many thanks.
3649
3655
3650 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3656 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3651 autoquote/parens in continuation prompts, which can cause lots of
3657 autoquote/parens in continuation prompts, which can cause lots of
3652 problems. Closes roundup issue 20.
3658 problems. Closes roundup issue 20.
3653
3659
3654 2004-11-17 Fernando Perez <fperez@colorado.edu>
3660 2004-11-17 Fernando Perez <fperez@colorado.edu>
3655
3661
3656 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3662 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3657 reported as debian bug #280505. I'm not sure my local changelog
3663 reported as debian bug #280505. I'm not sure my local changelog
3658 entry has the proper debian format (Jack?).
3664 entry has the proper debian format (Jack?).
3659
3665
3660 2004-11-08 *** Released version 0.6.4
3666 2004-11-08 *** Released version 0.6.4
3661
3667
3662 2004-11-08 Fernando Perez <fperez@colorado.edu>
3668 2004-11-08 Fernando Perez <fperez@colorado.edu>
3663
3669
3664 * IPython/iplib.py (init_readline): Fix exit message for Windows
3670 * IPython/iplib.py (init_readline): Fix exit message for Windows
3665 when readline is active. Thanks to a report by Eric Jones
3671 when readline is active. Thanks to a report by Eric Jones
3666 <eric-AT-enthought.com>.
3672 <eric-AT-enthought.com>.
3667
3673
3668 2004-11-07 Fernando Perez <fperez@colorado.edu>
3674 2004-11-07 Fernando Perez <fperez@colorado.edu>
3669
3675
3670 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3676 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3671 sometimes seen by win2k/cygwin users.
3677 sometimes seen by win2k/cygwin users.
3672
3678
3673 2004-11-06 Fernando Perez <fperez@colorado.edu>
3679 2004-11-06 Fernando Perez <fperez@colorado.edu>
3674
3680
3675 * IPython/iplib.py (interact): Change the handling of %Exit from
3681 * IPython/iplib.py (interact): Change the handling of %Exit from
3676 trying to propagate a SystemExit to an internal ipython flag.
3682 trying to propagate a SystemExit to an internal ipython flag.
3677 This is less elegant than using Python's exception mechanism, but
3683 This is less elegant than using Python's exception mechanism, but
3678 I can't get that to work reliably with threads, so under -pylab
3684 I can't get that to work reliably with threads, so under -pylab
3679 %Exit was hanging IPython. Cross-thread exception handling is
3685 %Exit was hanging IPython. Cross-thread exception handling is
3680 really a bitch. Thaks to a bug report by Stephen Walton
3686 really a bitch. Thaks to a bug report by Stephen Walton
3681 <stephen.walton-AT-csun.edu>.
3687 <stephen.walton-AT-csun.edu>.
3682
3688
3683 2004-11-04 Fernando Perez <fperez@colorado.edu>
3689 2004-11-04 Fernando Perez <fperez@colorado.edu>
3684
3690
3685 * IPython/iplib.py (raw_input_original): store a pointer to the
3691 * IPython/iplib.py (raw_input_original): store a pointer to the
3686 true raw_input to harden against code which can modify it
3692 true raw_input to harden against code which can modify it
3687 (wx.py.PyShell does this and would otherwise crash ipython).
3693 (wx.py.PyShell does this and would otherwise crash ipython).
3688 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3694 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3689
3695
3690 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3696 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3691 Ctrl-C problem, which does not mess up the input line.
3697 Ctrl-C problem, which does not mess up the input line.
3692
3698
3693 2004-11-03 Fernando Perez <fperez@colorado.edu>
3699 2004-11-03 Fernando Perez <fperez@colorado.edu>
3694
3700
3695 * IPython/Release.py: Changed licensing to BSD, in all files.
3701 * IPython/Release.py: Changed licensing to BSD, in all files.
3696 (name): lowercase name for tarball/RPM release.
3702 (name): lowercase name for tarball/RPM release.
3697
3703
3698 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3704 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3699 use throughout ipython.
3705 use throughout ipython.
3700
3706
3701 * IPython/Magic.py (Magic._ofind): Switch to using the new
3707 * IPython/Magic.py (Magic._ofind): Switch to using the new
3702 OInspect.getdoc() function.
3708 OInspect.getdoc() function.
3703
3709
3704 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3710 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3705 of the line currently being canceled via Ctrl-C. It's extremely
3711 of the line currently being canceled via Ctrl-C. It's extremely
3706 ugly, but I don't know how to do it better (the problem is one of
3712 ugly, but I don't know how to do it better (the problem is one of
3707 handling cross-thread exceptions).
3713 handling cross-thread exceptions).
3708
3714
3709 2004-10-28 Fernando Perez <fperez@colorado.edu>
3715 2004-10-28 Fernando Perez <fperez@colorado.edu>
3710
3716
3711 * IPython/Shell.py (signal_handler): add signal handlers to trap
3717 * IPython/Shell.py (signal_handler): add signal handlers to trap
3712 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3718 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3713 report by Francesc Alted.
3719 report by Francesc Alted.
3714
3720
3715 2004-10-21 Fernando Perez <fperez@colorado.edu>
3721 2004-10-21 Fernando Perez <fperez@colorado.edu>
3716
3722
3717 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3723 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3718 to % for pysh syntax extensions.
3724 to % for pysh syntax extensions.
3719
3725
3720 2004-10-09 Fernando Perez <fperez@colorado.edu>
3726 2004-10-09 Fernando Perez <fperez@colorado.edu>
3721
3727
3722 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3728 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3723 arrays to print a more useful summary, without calling str(arr).
3729 arrays to print a more useful summary, without calling str(arr).
3724 This avoids the problem of extremely lengthy computations which
3730 This avoids the problem of extremely lengthy computations which
3725 occur if arr is large, and appear to the user as a system lockup
3731 occur if arr is large, and appear to the user as a system lockup
3726 with 100% cpu activity. After a suggestion by Kristian Sandberg
3732 with 100% cpu activity. After a suggestion by Kristian Sandberg
3727 <Kristian.Sandberg@colorado.edu>.
3733 <Kristian.Sandberg@colorado.edu>.
3728 (Magic.__init__): fix bug in global magic escapes not being
3734 (Magic.__init__): fix bug in global magic escapes not being
3729 correctly set.
3735 correctly set.
3730
3736
3731 2004-10-08 Fernando Perez <fperez@colorado.edu>
3737 2004-10-08 Fernando Perez <fperez@colorado.edu>
3732
3738
3733 * IPython/Magic.py (__license__): change to absolute imports of
3739 * IPython/Magic.py (__license__): change to absolute imports of
3734 ipython's own internal packages, to start adapting to the absolute
3740 ipython's own internal packages, to start adapting to the absolute
3735 import requirement of PEP-328.
3741 import requirement of PEP-328.
3736
3742
3737 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3743 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3738 files, and standardize author/license marks through the Release
3744 files, and standardize author/license marks through the Release
3739 module instead of having per/file stuff (except for files with
3745 module instead of having per/file stuff (except for files with
3740 particular licenses, like the MIT/PSF-licensed codes).
3746 particular licenses, like the MIT/PSF-licensed codes).
3741
3747
3742 * IPython/Debugger.py: remove dead code for python 2.1
3748 * IPython/Debugger.py: remove dead code for python 2.1
3743
3749
3744 2004-10-04 Fernando Perez <fperez@colorado.edu>
3750 2004-10-04 Fernando Perez <fperez@colorado.edu>
3745
3751
3746 * IPython/iplib.py (ipmagic): New function for accessing magics
3752 * IPython/iplib.py (ipmagic): New function for accessing magics
3747 via a normal python function call.
3753 via a normal python function call.
3748
3754
3749 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3755 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3750 from '@' to '%', to accomodate the new @decorator syntax of python
3756 from '@' to '%', to accomodate the new @decorator syntax of python
3751 2.4.
3757 2.4.
3752
3758
3753 2004-09-29 Fernando Perez <fperez@colorado.edu>
3759 2004-09-29 Fernando Perez <fperez@colorado.edu>
3754
3760
3755 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3761 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3756 matplotlib.use to prevent running scripts which try to switch
3762 matplotlib.use to prevent running scripts which try to switch
3757 interactive backends from within ipython. This will just crash
3763 interactive backends from within ipython. This will just crash
3758 the python interpreter, so we can't allow it (but a detailed error
3764 the python interpreter, so we can't allow it (but a detailed error
3759 is given to the user).
3765 is given to the user).
3760
3766
3761 2004-09-28 Fernando Perez <fperez@colorado.edu>
3767 2004-09-28 Fernando Perez <fperez@colorado.edu>
3762
3768
3763 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3769 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3764 matplotlib-related fixes so that using @run with non-matplotlib
3770 matplotlib-related fixes so that using @run with non-matplotlib
3765 scripts doesn't pop up spurious plot windows. This requires
3771 scripts doesn't pop up spurious plot windows. This requires
3766 matplotlib >= 0.63, where I had to make some changes as well.
3772 matplotlib >= 0.63, where I had to make some changes as well.
3767
3773
3768 * IPython/ipmaker.py (make_IPython): update version requirement to
3774 * IPython/ipmaker.py (make_IPython): update version requirement to
3769 python 2.2.
3775 python 2.2.
3770
3776
3771 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3777 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3772 banner arg for embedded customization.
3778 banner arg for embedded customization.
3773
3779
3774 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3780 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3775 explicit uses of __IP as the IPython's instance name. Now things
3781 explicit uses of __IP as the IPython's instance name. Now things
3776 are properly handled via the shell.name value. The actual code
3782 are properly handled via the shell.name value. The actual code
3777 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3783 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3778 is much better than before. I'll clean things completely when the
3784 is much better than before. I'll clean things completely when the
3779 magic stuff gets a real overhaul.
3785 magic stuff gets a real overhaul.
3780
3786
3781 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3787 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3782 minor changes to debian dir.
3788 minor changes to debian dir.
3783
3789
3784 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3790 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3785 pointer to the shell itself in the interactive namespace even when
3791 pointer to the shell itself in the interactive namespace even when
3786 a user-supplied dict is provided. This is needed for embedding
3792 a user-supplied dict is provided. This is needed for embedding
3787 purposes (found by tests with Michel Sanner).
3793 purposes (found by tests with Michel Sanner).
3788
3794
3789 2004-09-27 Fernando Perez <fperez@colorado.edu>
3795 2004-09-27 Fernando Perez <fperez@colorado.edu>
3790
3796
3791 * IPython/UserConfig/ipythonrc: remove []{} from
3797 * IPython/UserConfig/ipythonrc: remove []{} from
3792 readline_remove_delims, so that things like [modname.<TAB> do
3798 readline_remove_delims, so that things like [modname.<TAB> do
3793 proper completion. This disables [].TAB, but that's a less common
3799 proper completion. This disables [].TAB, but that's a less common
3794 case than module names in list comprehensions, for example.
3800 case than module names in list comprehensions, for example.
3795 Thanks to a report by Andrea Riciputi.
3801 Thanks to a report by Andrea Riciputi.
3796
3802
3797 2004-09-09 Fernando Perez <fperez@colorado.edu>
3803 2004-09-09 Fernando Perez <fperez@colorado.edu>
3798
3804
3799 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3805 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3800 blocking problems in win32 and osx. Fix by John.
3806 blocking problems in win32 and osx. Fix by John.
3801
3807
3802 2004-09-08 Fernando Perez <fperez@colorado.edu>
3808 2004-09-08 Fernando Perez <fperez@colorado.edu>
3803
3809
3804 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3810 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3805 for Win32 and OSX. Fix by John Hunter.
3811 for Win32 and OSX. Fix by John Hunter.
3806
3812
3807 2004-08-30 *** Released version 0.6.3
3813 2004-08-30 *** Released version 0.6.3
3808
3814
3809 2004-08-30 Fernando Perez <fperez@colorado.edu>
3815 2004-08-30 Fernando Perez <fperez@colorado.edu>
3810
3816
3811 * setup.py (isfile): Add manpages to list of dependent files to be
3817 * setup.py (isfile): Add manpages to list of dependent files to be
3812 updated.
3818 updated.
3813
3819
3814 2004-08-27 Fernando Perez <fperez@colorado.edu>
3820 2004-08-27 Fernando Perez <fperez@colorado.edu>
3815
3821
3816 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3822 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3817 for now. They don't really work with standalone WX/GTK code
3823 for now. They don't really work with standalone WX/GTK code
3818 (though matplotlib IS working fine with both of those backends).
3824 (though matplotlib IS working fine with both of those backends).
3819 This will neeed much more testing. I disabled most things with
3825 This will neeed much more testing. I disabled most things with
3820 comments, so turning it back on later should be pretty easy.
3826 comments, so turning it back on later should be pretty easy.
3821
3827
3822 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3828 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3823 autocalling of expressions like r'foo', by modifying the line
3829 autocalling of expressions like r'foo', by modifying the line
3824 split regexp. Closes
3830 split regexp. Closes
3825 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3831 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3826 Riley <ipythonbugs-AT-sabi.net>.
3832 Riley <ipythonbugs-AT-sabi.net>.
3827 (InteractiveShell.mainloop): honor --nobanner with banner
3833 (InteractiveShell.mainloop): honor --nobanner with banner
3828 extensions.
3834 extensions.
3829
3835
3830 * IPython/Shell.py: Significant refactoring of all classes, so
3836 * IPython/Shell.py: Significant refactoring of all classes, so
3831 that we can really support ALL matplotlib backends and threading
3837 that we can really support ALL matplotlib backends and threading
3832 models (John spotted a bug with Tk which required this). Now we
3838 models (John spotted a bug with Tk which required this). Now we
3833 should support single-threaded, WX-threads and GTK-threads, both
3839 should support single-threaded, WX-threads and GTK-threads, both
3834 for generic code and for matplotlib.
3840 for generic code and for matplotlib.
3835
3841
3836 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3842 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3837 -pylab, to simplify things for users. Will also remove the pylab
3843 -pylab, to simplify things for users. Will also remove the pylab
3838 profile, since now all of matplotlib configuration is directly
3844 profile, since now all of matplotlib configuration is directly
3839 handled here. This also reduces startup time.
3845 handled here. This also reduces startup time.
3840
3846
3841 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3847 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3842 shell wasn't being correctly called. Also in IPShellWX.
3848 shell wasn't being correctly called. Also in IPShellWX.
3843
3849
3844 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3850 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3845 fine-tune banner.
3851 fine-tune banner.
3846
3852
3847 * IPython/numutils.py (spike): Deprecate these spike functions,
3853 * IPython/numutils.py (spike): Deprecate these spike functions,
3848 delete (long deprecated) gnuplot_exec handler.
3854 delete (long deprecated) gnuplot_exec handler.
3849
3855
3850 2004-08-26 Fernando Perez <fperez@colorado.edu>
3856 2004-08-26 Fernando Perez <fperez@colorado.edu>
3851
3857
3852 * ipython.1: Update for threading options, plus some others which
3858 * ipython.1: Update for threading options, plus some others which
3853 were missing.
3859 were missing.
3854
3860
3855 * IPython/ipmaker.py (__call__): Added -wthread option for
3861 * IPython/ipmaker.py (__call__): Added -wthread option for
3856 wxpython thread handling. Make sure threading options are only
3862 wxpython thread handling. Make sure threading options are only
3857 valid at the command line.
3863 valid at the command line.
3858
3864
3859 * scripts/ipython: moved shell selection into a factory function
3865 * scripts/ipython: moved shell selection into a factory function
3860 in Shell.py, to keep the starter script to a minimum.
3866 in Shell.py, to keep the starter script to a minimum.
3861
3867
3862 2004-08-25 Fernando Perez <fperez@colorado.edu>
3868 2004-08-25 Fernando Perez <fperez@colorado.edu>
3863
3869
3864 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3870 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3865 John. Along with some recent changes he made to matplotlib, the
3871 John. Along with some recent changes he made to matplotlib, the
3866 next versions of both systems should work very well together.
3872 next versions of both systems should work very well together.
3867
3873
3868 2004-08-24 Fernando Perez <fperez@colorado.edu>
3874 2004-08-24 Fernando Perez <fperez@colorado.edu>
3869
3875
3870 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3876 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3871 tried to switch the profiling to using hotshot, but I'm getting
3877 tried to switch the profiling to using hotshot, but I'm getting
3872 strange errors from prof.runctx() there. I may be misreading the
3878 strange errors from prof.runctx() there. I may be misreading the
3873 docs, but it looks weird. For now the profiling code will
3879 docs, but it looks weird. For now the profiling code will
3874 continue to use the standard profiler.
3880 continue to use the standard profiler.
3875
3881
3876 2004-08-23 Fernando Perez <fperez@colorado.edu>
3882 2004-08-23 Fernando Perez <fperez@colorado.edu>
3877
3883
3878 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3884 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3879 threaded shell, by John Hunter. It's not quite ready yet, but
3885 threaded shell, by John Hunter. It's not quite ready yet, but
3880 close.
3886 close.
3881
3887
3882 2004-08-22 Fernando Perez <fperez@colorado.edu>
3888 2004-08-22 Fernando Perez <fperez@colorado.edu>
3883
3889
3884 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3890 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3885 in Magic and ultraTB.
3891 in Magic and ultraTB.
3886
3892
3887 * ipython.1: document threading options in manpage.
3893 * ipython.1: document threading options in manpage.
3888
3894
3889 * scripts/ipython: Changed name of -thread option to -gthread,
3895 * scripts/ipython: Changed name of -thread option to -gthread,
3890 since this is GTK specific. I want to leave the door open for a
3896 since this is GTK specific. I want to leave the door open for a
3891 -wthread option for WX, which will most likely be necessary. This
3897 -wthread option for WX, which will most likely be necessary. This
3892 change affects usage and ipmaker as well.
3898 change affects usage and ipmaker as well.
3893
3899
3894 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3900 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3895 handle the matplotlib shell issues. Code by John Hunter
3901 handle the matplotlib shell issues. Code by John Hunter
3896 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3902 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3897 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3903 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3898 broken (and disabled for end users) for now, but it puts the
3904 broken (and disabled for end users) for now, but it puts the
3899 infrastructure in place.
3905 infrastructure in place.
3900
3906
3901 2004-08-21 Fernando Perez <fperez@colorado.edu>
3907 2004-08-21 Fernando Perez <fperez@colorado.edu>
3902
3908
3903 * ipythonrc-pylab: Add matplotlib support.
3909 * ipythonrc-pylab: Add matplotlib support.
3904
3910
3905 * matplotlib_config.py: new files for matplotlib support, part of
3911 * matplotlib_config.py: new files for matplotlib support, part of
3906 the pylab profile.
3912 the pylab profile.
3907
3913
3908 * IPython/usage.py (__doc__): documented the threading options.
3914 * IPython/usage.py (__doc__): documented the threading options.
3909
3915
3910 2004-08-20 Fernando Perez <fperez@colorado.edu>
3916 2004-08-20 Fernando Perez <fperez@colorado.edu>
3911
3917
3912 * ipython: Modified the main calling routine to handle the -thread
3918 * ipython: Modified the main calling routine to handle the -thread
3913 and -mpthread options. This needs to be done as a top-level hack,
3919 and -mpthread options. This needs to be done as a top-level hack,
3914 because it determines which class to instantiate for IPython
3920 because it determines which class to instantiate for IPython
3915 itself.
3921 itself.
3916
3922
3917 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3923 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3918 classes to support multithreaded GTK operation without blocking,
3924 classes to support multithreaded GTK operation without blocking,
3919 and matplotlib with all backends. This is a lot of still very
3925 and matplotlib with all backends. This is a lot of still very
3920 experimental code, and threads are tricky. So it may still have a
3926 experimental code, and threads are tricky. So it may still have a
3921 few rough edges... This code owes a lot to
3927 few rough edges... This code owes a lot to
3922 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3928 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3923 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3929 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3924 to John Hunter for all the matplotlib work.
3930 to John Hunter for all the matplotlib work.
3925
3931
3926 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3932 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3927 options for gtk thread and matplotlib support.
3933 options for gtk thread and matplotlib support.
3928
3934
3929 2004-08-16 Fernando Perez <fperez@colorado.edu>
3935 2004-08-16 Fernando Perez <fperez@colorado.edu>
3930
3936
3931 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3937 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3932 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3938 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3933 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3939 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3934
3940
3935 2004-08-11 Fernando Perez <fperez@colorado.edu>
3941 2004-08-11 Fernando Perez <fperez@colorado.edu>
3936
3942
3937 * setup.py (isfile): Fix build so documentation gets updated for
3943 * setup.py (isfile): Fix build so documentation gets updated for
3938 rpms (it was only done for .tgz builds).
3944 rpms (it was only done for .tgz builds).
3939
3945
3940 2004-08-10 Fernando Perez <fperez@colorado.edu>
3946 2004-08-10 Fernando Perez <fperez@colorado.edu>
3941
3947
3942 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3948 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3943
3949
3944 * iplib.py : Silence syntax error exceptions in tab-completion.
3950 * iplib.py : Silence syntax error exceptions in tab-completion.
3945
3951
3946 2004-08-05 Fernando Perez <fperez@colorado.edu>
3952 2004-08-05 Fernando Perez <fperez@colorado.edu>
3947
3953
3948 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3954 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3949 'color off' mark for continuation prompts. This was causing long
3955 'color off' mark for continuation prompts. This was causing long
3950 continuation lines to mis-wrap.
3956 continuation lines to mis-wrap.
3951
3957
3952 2004-08-01 Fernando Perez <fperez@colorado.edu>
3958 2004-08-01 Fernando Perez <fperez@colorado.edu>
3953
3959
3954 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3960 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3955 for building ipython to be a parameter. All this is necessary
3961 for building ipython to be a parameter. All this is necessary
3956 right now to have a multithreaded version, but this insane
3962 right now to have a multithreaded version, but this insane
3957 non-design will be cleaned up soon. For now, it's a hack that
3963 non-design will be cleaned up soon. For now, it's a hack that
3958 works.
3964 works.
3959
3965
3960 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3966 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3961 args in various places. No bugs so far, but it's a dangerous
3967 args in various places. No bugs so far, but it's a dangerous
3962 practice.
3968 practice.
3963
3969
3964 2004-07-31 Fernando Perez <fperez@colorado.edu>
3970 2004-07-31 Fernando Perez <fperez@colorado.edu>
3965
3971
3966 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3972 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3967 fix completion of files with dots in their names under most
3973 fix completion of files with dots in their names under most
3968 profiles (pysh was OK because the completion order is different).
3974 profiles (pysh was OK because the completion order is different).
3969
3975
3970 2004-07-27 Fernando Perez <fperez@colorado.edu>
3976 2004-07-27 Fernando Perez <fperez@colorado.edu>
3971
3977
3972 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3978 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3973 keywords manually, b/c the one in keyword.py was removed in python
3979 keywords manually, b/c the one in keyword.py was removed in python
3974 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3980 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3975 This is NOT a bug under python 2.3 and earlier.
3981 This is NOT a bug under python 2.3 and earlier.
3976
3982
3977 2004-07-26 Fernando Perez <fperez@colorado.edu>
3983 2004-07-26 Fernando Perez <fperez@colorado.edu>
3978
3984
3979 * IPython/ultraTB.py (VerboseTB.text): Add another
3985 * IPython/ultraTB.py (VerboseTB.text): Add another
3980 linecache.checkcache() call to try to prevent inspect.py from
3986 linecache.checkcache() call to try to prevent inspect.py from
3981 crashing under python 2.3. I think this fixes
3987 crashing under python 2.3. I think this fixes
3982 http://www.scipy.net/roundup/ipython/issue17.
3988 http://www.scipy.net/roundup/ipython/issue17.
3983
3989
3984 2004-07-26 *** Released version 0.6.2
3990 2004-07-26 *** Released version 0.6.2
3985
3991
3986 2004-07-26 Fernando Perez <fperez@colorado.edu>
3992 2004-07-26 Fernando Perez <fperez@colorado.edu>
3987
3993
3988 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3994 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3989 fail for any number.
3995 fail for any number.
3990 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3996 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3991 empty bookmarks.
3997 empty bookmarks.
3992
3998
3993 2004-07-26 *** Released version 0.6.1
3999 2004-07-26 *** Released version 0.6.1
3994
4000
3995 2004-07-26 Fernando Perez <fperez@colorado.edu>
4001 2004-07-26 Fernando Perez <fperez@colorado.edu>
3996
4002
3997 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4003 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3998
4004
3999 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4005 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4000 escaping '()[]{}' in filenames.
4006 escaping '()[]{}' in filenames.
4001
4007
4002 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4008 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4003 Python 2.2 users who lack a proper shlex.split.
4009 Python 2.2 users who lack a proper shlex.split.
4004
4010
4005 2004-07-19 Fernando Perez <fperez@colorado.edu>
4011 2004-07-19 Fernando Perez <fperez@colorado.edu>
4006
4012
4007 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4013 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4008 for reading readline's init file. I follow the normal chain:
4014 for reading readline's init file. I follow the normal chain:
4009 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4015 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4010 report by Mike Heeter. This closes
4016 report by Mike Heeter. This closes
4011 http://www.scipy.net/roundup/ipython/issue16.
4017 http://www.scipy.net/roundup/ipython/issue16.
4012
4018
4013 2004-07-18 Fernando Perez <fperez@colorado.edu>
4019 2004-07-18 Fernando Perez <fperez@colorado.edu>
4014
4020
4015 * IPython/iplib.py (__init__): Add better handling of '\' under
4021 * IPython/iplib.py (__init__): Add better handling of '\' under
4016 Win32 for filenames. After a patch by Ville.
4022 Win32 for filenames. After a patch by Ville.
4017
4023
4018 2004-07-17 Fernando Perez <fperez@colorado.edu>
4024 2004-07-17 Fernando Perez <fperez@colorado.edu>
4019
4025
4020 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4026 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4021 autocalling would be triggered for 'foo is bar' if foo is
4027 autocalling would be triggered for 'foo is bar' if foo is
4022 callable. I also cleaned up the autocall detection code to use a
4028 callable. I also cleaned up the autocall detection code to use a
4023 regexp, which is faster. Bug reported by Alexander Schmolck.
4029 regexp, which is faster. Bug reported by Alexander Schmolck.
4024
4030
4025 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4031 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4026 '?' in them would confuse the help system. Reported by Alex
4032 '?' in them would confuse the help system. Reported by Alex
4027 Schmolck.
4033 Schmolck.
4028
4034
4029 2004-07-16 Fernando Perez <fperez@colorado.edu>
4035 2004-07-16 Fernando Perez <fperez@colorado.edu>
4030
4036
4031 * IPython/GnuplotInteractive.py (__all__): added plot2.
4037 * IPython/GnuplotInteractive.py (__all__): added plot2.
4032
4038
4033 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4039 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4034 plotting dictionaries, lists or tuples of 1d arrays.
4040 plotting dictionaries, lists or tuples of 1d arrays.
4035
4041
4036 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4042 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4037 optimizations.
4043 optimizations.
4038
4044
4039 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4045 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4040 the information which was there from Janko's original IPP code:
4046 the information which was there from Janko's original IPP code:
4041
4047
4042 03.05.99 20:53 porto.ifm.uni-kiel.de
4048 03.05.99 20:53 porto.ifm.uni-kiel.de
4043 --Started changelog.
4049 --Started changelog.
4044 --make clear do what it say it does
4050 --make clear do what it say it does
4045 --added pretty output of lines from inputcache
4051 --added pretty output of lines from inputcache
4046 --Made Logger a mixin class, simplifies handling of switches
4052 --Made Logger a mixin class, simplifies handling of switches
4047 --Added own completer class. .string<TAB> expands to last history
4053 --Added own completer class. .string<TAB> expands to last history
4048 line which starts with string. The new expansion is also present
4054 line which starts with string. The new expansion is also present
4049 with Ctrl-r from the readline library. But this shows, who this
4055 with Ctrl-r from the readline library. But this shows, who this
4050 can be done for other cases.
4056 can be done for other cases.
4051 --Added convention that all shell functions should accept a
4057 --Added convention that all shell functions should accept a
4052 parameter_string This opens the door for different behaviour for
4058 parameter_string This opens the door for different behaviour for
4053 each function. @cd is a good example of this.
4059 each function. @cd is a good example of this.
4054
4060
4055 04.05.99 12:12 porto.ifm.uni-kiel.de
4061 04.05.99 12:12 porto.ifm.uni-kiel.de
4056 --added logfile rotation
4062 --added logfile rotation
4057 --added new mainloop method which freezes first the namespace
4063 --added new mainloop method which freezes first the namespace
4058
4064
4059 07.05.99 21:24 porto.ifm.uni-kiel.de
4065 07.05.99 21:24 porto.ifm.uni-kiel.de
4060 --added the docreader classes. Now there is a help system.
4066 --added the docreader classes. Now there is a help system.
4061 -This is only a first try. Currently it's not easy to put new
4067 -This is only a first try. Currently it's not easy to put new
4062 stuff in the indices. But this is the way to go. Info would be
4068 stuff in the indices. But this is the way to go. Info would be
4063 better, but HTML is every where and not everybody has an info
4069 better, but HTML is every where and not everybody has an info
4064 system installed and it's not so easy to change html-docs to info.
4070 system installed and it's not so easy to change html-docs to info.
4065 --added global logfile option
4071 --added global logfile option
4066 --there is now a hook for object inspection method pinfo needs to
4072 --there is now a hook for object inspection method pinfo needs to
4067 be provided for this. Can be reached by two '??'.
4073 be provided for this. Can be reached by two '??'.
4068
4074
4069 08.05.99 20:51 porto.ifm.uni-kiel.de
4075 08.05.99 20:51 porto.ifm.uni-kiel.de
4070 --added a README
4076 --added a README
4071 --bug in rc file. Something has changed so functions in the rc
4077 --bug in rc file. Something has changed so functions in the rc
4072 file need to reference the shell and not self. Not clear if it's a
4078 file need to reference the shell and not self. Not clear if it's a
4073 bug or feature.
4079 bug or feature.
4074 --changed rc file for new behavior
4080 --changed rc file for new behavior
4075
4081
4076 2004-07-15 Fernando Perez <fperez@colorado.edu>
4082 2004-07-15 Fernando Perez <fperez@colorado.edu>
4077
4083
4078 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4084 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4079 cache was falling out of sync in bizarre manners when multi-line
4085 cache was falling out of sync in bizarre manners when multi-line
4080 input was present. Minor optimizations and cleanup.
4086 input was present. Minor optimizations and cleanup.
4081
4087
4082 (Logger): Remove old Changelog info for cleanup. This is the
4088 (Logger): Remove old Changelog info for cleanup. This is the
4083 information which was there from Janko's original code:
4089 information which was there from Janko's original code:
4084
4090
4085 Changes to Logger: - made the default log filename a parameter
4091 Changes to Logger: - made the default log filename a parameter
4086
4092
4087 - put a check for lines beginning with !@? in log(). Needed
4093 - put a check for lines beginning with !@? in log(). Needed
4088 (even if the handlers properly log their lines) for mid-session
4094 (even if the handlers properly log their lines) for mid-session
4089 logging activation to work properly. Without this, lines logged
4095 logging activation to work properly. Without this, lines logged
4090 in mid session, which get read from the cache, would end up
4096 in mid session, which get read from the cache, would end up
4091 'bare' (with !@? in the open) in the log. Now they are caught
4097 'bare' (with !@? in the open) in the log. Now they are caught
4092 and prepended with a #.
4098 and prepended with a #.
4093
4099
4094 * IPython/iplib.py (InteractiveShell.init_readline): added check
4100 * IPython/iplib.py (InteractiveShell.init_readline): added check
4095 in case MagicCompleter fails to be defined, so we don't crash.
4101 in case MagicCompleter fails to be defined, so we don't crash.
4096
4102
4097 2004-07-13 Fernando Perez <fperez@colorado.edu>
4103 2004-07-13 Fernando Perez <fperez@colorado.edu>
4098
4104
4099 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4105 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4100 of EPS if the requested filename ends in '.eps'.
4106 of EPS if the requested filename ends in '.eps'.
4101
4107
4102 2004-07-04 Fernando Perez <fperez@colorado.edu>
4108 2004-07-04 Fernando Perez <fperez@colorado.edu>
4103
4109
4104 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4110 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4105 escaping of quotes when calling the shell.
4111 escaping of quotes when calling the shell.
4106
4112
4107 2004-07-02 Fernando Perez <fperez@colorado.edu>
4113 2004-07-02 Fernando Perez <fperez@colorado.edu>
4108
4114
4109 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4115 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4110 gettext not working because we were clobbering '_'. Fixes
4116 gettext not working because we were clobbering '_'. Fixes
4111 http://www.scipy.net/roundup/ipython/issue6.
4117 http://www.scipy.net/roundup/ipython/issue6.
4112
4118
4113 2004-07-01 Fernando Perez <fperez@colorado.edu>
4119 2004-07-01 Fernando Perez <fperez@colorado.edu>
4114
4120
4115 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4121 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4116 into @cd. Patch by Ville.
4122 into @cd. Patch by Ville.
4117
4123
4118 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4124 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4119 new function to store things after ipmaker runs. Patch by Ville.
4125 new function to store things after ipmaker runs. Patch by Ville.
4120 Eventually this will go away once ipmaker is removed and the class
4126 Eventually this will go away once ipmaker is removed and the class
4121 gets cleaned up, but for now it's ok. Key functionality here is
4127 gets cleaned up, but for now it's ok. Key functionality here is
4122 the addition of the persistent storage mechanism, a dict for
4128 the addition of the persistent storage mechanism, a dict for
4123 keeping data across sessions (for now just bookmarks, but more can
4129 keeping data across sessions (for now just bookmarks, but more can
4124 be implemented later).
4130 be implemented later).
4125
4131
4126 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4132 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4127 persistent across sections. Patch by Ville, I modified it
4133 persistent across sections. Patch by Ville, I modified it
4128 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4134 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4129 added a '-l' option to list all bookmarks.
4135 added a '-l' option to list all bookmarks.
4130
4136
4131 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4137 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4132 center for cleanup. Registered with atexit.register(). I moved
4138 center for cleanup. Registered with atexit.register(). I moved
4133 here the old exit_cleanup(). After a patch by Ville.
4139 here the old exit_cleanup(). After a patch by Ville.
4134
4140
4135 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4141 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4136 characters in the hacked shlex_split for python 2.2.
4142 characters in the hacked shlex_split for python 2.2.
4137
4143
4138 * IPython/iplib.py (file_matches): more fixes to filenames with
4144 * IPython/iplib.py (file_matches): more fixes to filenames with
4139 whitespace in them. It's not perfect, but limitations in python's
4145 whitespace in them. It's not perfect, but limitations in python's
4140 readline make it impossible to go further.
4146 readline make it impossible to go further.
4141
4147
4142 2004-06-29 Fernando Perez <fperez@colorado.edu>
4148 2004-06-29 Fernando Perez <fperez@colorado.edu>
4143
4149
4144 * IPython/iplib.py (file_matches): escape whitespace correctly in
4150 * IPython/iplib.py (file_matches): escape whitespace correctly in
4145 filename completions. Bug reported by Ville.
4151 filename completions. Bug reported by Ville.
4146
4152
4147 2004-06-28 Fernando Perez <fperez@colorado.edu>
4153 2004-06-28 Fernando Perez <fperez@colorado.edu>
4148
4154
4149 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4155 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4150 the history file will be called 'history-PROFNAME' (or just
4156 the history file will be called 'history-PROFNAME' (or just
4151 'history' if no profile is loaded). I was getting annoyed at
4157 'history' if no profile is loaded). I was getting annoyed at
4152 getting my Numerical work history clobbered by pysh sessions.
4158 getting my Numerical work history clobbered by pysh sessions.
4153
4159
4154 * IPython/iplib.py (InteractiveShell.__init__): Internal
4160 * IPython/iplib.py (InteractiveShell.__init__): Internal
4155 getoutputerror() function so that we can honor the system_verbose
4161 getoutputerror() function so that we can honor the system_verbose
4156 flag for _all_ system calls. I also added escaping of #
4162 flag for _all_ system calls. I also added escaping of #
4157 characters here to avoid confusing Itpl.
4163 characters here to avoid confusing Itpl.
4158
4164
4159 * IPython/Magic.py (shlex_split): removed call to shell in
4165 * IPython/Magic.py (shlex_split): removed call to shell in
4160 parse_options and replaced it with shlex.split(). The annoying
4166 parse_options and replaced it with shlex.split(). The annoying
4161 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4167 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4162 to backport it from 2.3, with several frail hacks (the shlex
4168 to backport it from 2.3, with several frail hacks (the shlex
4163 module is rather limited in 2.2). Thanks to a suggestion by Ville
4169 module is rather limited in 2.2). Thanks to a suggestion by Ville
4164 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4170 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4165 problem.
4171 problem.
4166
4172
4167 (Magic.magic_system_verbose): new toggle to print the actual
4173 (Magic.magic_system_verbose): new toggle to print the actual
4168 system calls made by ipython. Mainly for debugging purposes.
4174 system calls made by ipython. Mainly for debugging purposes.
4169
4175
4170 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4176 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4171 doesn't support persistence. Reported (and fix suggested) by
4177 doesn't support persistence. Reported (and fix suggested) by
4172 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4178 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4173
4179
4174 2004-06-26 Fernando Perez <fperez@colorado.edu>
4180 2004-06-26 Fernando Perez <fperez@colorado.edu>
4175
4181
4176 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4182 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4177 continue prompts.
4183 continue prompts.
4178
4184
4179 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4185 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4180 function (basically a big docstring) and a few more things here to
4186 function (basically a big docstring) and a few more things here to
4181 speedup startup. pysh.py is now very lightweight. We want because
4187 speedup startup. pysh.py is now very lightweight. We want because
4182 it gets execfile'd, while InterpreterExec gets imported, so
4188 it gets execfile'd, while InterpreterExec gets imported, so
4183 byte-compilation saves time.
4189 byte-compilation saves time.
4184
4190
4185 2004-06-25 Fernando Perez <fperez@colorado.edu>
4191 2004-06-25 Fernando Perez <fperez@colorado.edu>
4186
4192
4187 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4193 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4188 -NUM', which was recently broken.
4194 -NUM', which was recently broken.
4189
4195
4190 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4196 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4191 in multi-line input (but not !!, which doesn't make sense there).
4197 in multi-line input (but not !!, which doesn't make sense there).
4192
4198
4193 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4199 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4194 It's just too useful, and people can turn it off in the less
4200 It's just too useful, and people can turn it off in the less
4195 common cases where it's a problem.
4201 common cases where it's a problem.
4196
4202
4197 2004-06-24 Fernando Perez <fperez@colorado.edu>
4203 2004-06-24 Fernando Perez <fperez@colorado.edu>
4198
4204
4199 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4205 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4200 special syntaxes (like alias calling) is now allied in multi-line
4206 special syntaxes (like alias calling) is now allied in multi-line
4201 input. This is still _very_ experimental, but it's necessary for
4207 input. This is still _very_ experimental, but it's necessary for
4202 efficient shell usage combining python looping syntax with system
4208 efficient shell usage combining python looping syntax with system
4203 calls. For now it's restricted to aliases, I don't think it
4209 calls. For now it's restricted to aliases, I don't think it
4204 really even makes sense to have this for magics.
4210 really even makes sense to have this for magics.
4205
4211
4206 2004-06-23 Fernando Perez <fperez@colorado.edu>
4212 2004-06-23 Fernando Perez <fperez@colorado.edu>
4207
4213
4208 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4214 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4209 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4215 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4210
4216
4211 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4217 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4212 extensions under Windows (after code sent by Gary Bishop). The
4218 extensions under Windows (after code sent by Gary Bishop). The
4213 extensions considered 'executable' are stored in IPython's rc
4219 extensions considered 'executable' are stored in IPython's rc
4214 structure as win_exec_ext.
4220 structure as win_exec_ext.
4215
4221
4216 * IPython/genutils.py (shell): new function, like system() but
4222 * IPython/genutils.py (shell): new function, like system() but
4217 without return value. Very useful for interactive shell work.
4223 without return value. Very useful for interactive shell work.
4218
4224
4219 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4225 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4220 delete aliases.
4226 delete aliases.
4221
4227
4222 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4228 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4223 sure that the alias table doesn't contain python keywords.
4229 sure that the alias table doesn't contain python keywords.
4224
4230
4225 2004-06-21 Fernando Perez <fperez@colorado.edu>
4231 2004-06-21 Fernando Perez <fperez@colorado.edu>
4226
4232
4227 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4233 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4228 non-existent items are found in $PATH. Reported by Thorsten.
4234 non-existent items are found in $PATH. Reported by Thorsten.
4229
4235
4230 2004-06-20 Fernando Perez <fperez@colorado.edu>
4236 2004-06-20 Fernando Perez <fperez@colorado.edu>
4231
4237
4232 * IPython/iplib.py (complete): modified the completer so that the
4238 * IPython/iplib.py (complete): modified the completer so that the
4233 order of priorities can be easily changed at runtime.
4239 order of priorities can be easily changed at runtime.
4234
4240
4235 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4241 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4236 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4242 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4237
4243
4238 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4244 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4239 expand Python variables prepended with $ in all system calls. The
4245 expand Python variables prepended with $ in all system calls. The
4240 same was done to InteractiveShell.handle_shell_escape. Now all
4246 same was done to InteractiveShell.handle_shell_escape. Now all
4241 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4247 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4242 expansion of python variables and expressions according to the
4248 expansion of python variables and expressions according to the
4243 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4249 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4244
4250
4245 Though PEP-215 has been rejected, a similar (but simpler) one
4251 Though PEP-215 has been rejected, a similar (but simpler) one
4246 seems like it will go into Python 2.4, PEP-292 -
4252 seems like it will go into Python 2.4, PEP-292 -
4247 http://www.python.org/peps/pep-0292.html.
4253 http://www.python.org/peps/pep-0292.html.
4248
4254
4249 I'll keep the full syntax of PEP-215, since IPython has since the
4255 I'll keep the full syntax of PEP-215, since IPython has since the
4250 start used Ka-Ping Yee's reference implementation discussed there
4256 start used Ka-Ping Yee's reference implementation discussed there
4251 (Itpl), and I actually like the powerful semantics it offers.
4257 (Itpl), and I actually like the powerful semantics it offers.
4252
4258
4253 In order to access normal shell variables, the $ has to be escaped
4259 In order to access normal shell variables, the $ has to be escaped
4254 via an extra $. For example:
4260 via an extra $. For example:
4255
4261
4256 In [7]: PATH='a python variable'
4262 In [7]: PATH='a python variable'
4257
4263
4258 In [8]: !echo $PATH
4264 In [8]: !echo $PATH
4259 a python variable
4265 a python variable
4260
4266
4261 In [9]: !echo $$PATH
4267 In [9]: !echo $$PATH
4262 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4268 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4263
4269
4264 (Magic.parse_options): escape $ so the shell doesn't evaluate
4270 (Magic.parse_options): escape $ so the shell doesn't evaluate
4265 things prematurely.
4271 things prematurely.
4266
4272
4267 * IPython/iplib.py (InteractiveShell.call_alias): added the
4273 * IPython/iplib.py (InteractiveShell.call_alias): added the
4268 ability for aliases to expand python variables via $.
4274 ability for aliases to expand python variables via $.
4269
4275
4270 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4276 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4271 system, now there's a @rehash/@rehashx pair of magics. These work
4277 system, now there's a @rehash/@rehashx pair of magics. These work
4272 like the csh rehash command, and can be invoked at any time. They
4278 like the csh rehash command, and can be invoked at any time. They
4273 build a table of aliases to everything in the user's $PATH
4279 build a table of aliases to everything in the user's $PATH
4274 (@rehash uses everything, @rehashx is slower but only adds
4280 (@rehash uses everything, @rehashx is slower but only adds
4275 executable files). With this, the pysh.py-based shell profile can
4281 executable files). With this, the pysh.py-based shell profile can
4276 now simply call rehash upon startup, and full access to all
4282 now simply call rehash upon startup, and full access to all
4277 programs in the user's path is obtained.
4283 programs in the user's path is obtained.
4278
4284
4279 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4285 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4280 functionality is now fully in place. I removed the old dynamic
4286 functionality is now fully in place. I removed the old dynamic
4281 code generation based approach, in favor of a much lighter one
4287 code generation based approach, in favor of a much lighter one
4282 based on a simple dict. The advantage is that this allows me to
4288 based on a simple dict. The advantage is that this allows me to
4283 now have thousands of aliases with negligible cost (unthinkable
4289 now have thousands of aliases with negligible cost (unthinkable
4284 with the old system).
4290 with the old system).
4285
4291
4286 2004-06-19 Fernando Perez <fperez@colorado.edu>
4292 2004-06-19 Fernando Perez <fperez@colorado.edu>
4287
4293
4288 * IPython/iplib.py (__init__): extended MagicCompleter class to
4294 * IPython/iplib.py (__init__): extended MagicCompleter class to
4289 also complete (last in priority) on user aliases.
4295 also complete (last in priority) on user aliases.
4290
4296
4291 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4297 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4292 call to eval.
4298 call to eval.
4293 (ItplNS.__init__): Added a new class which functions like Itpl,
4299 (ItplNS.__init__): Added a new class which functions like Itpl,
4294 but allows configuring the namespace for the evaluation to occur
4300 but allows configuring the namespace for the evaluation to occur
4295 in.
4301 in.
4296
4302
4297 2004-06-18 Fernando Perez <fperez@colorado.edu>
4303 2004-06-18 Fernando Perez <fperez@colorado.edu>
4298
4304
4299 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4305 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4300 better message when 'exit' or 'quit' are typed (a common newbie
4306 better message when 'exit' or 'quit' are typed (a common newbie
4301 confusion).
4307 confusion).
4302
4308
4303 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4309 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4304 check for Windows users.
4310 check for Windows users.
4305
4311
4306 * IPython/iplib.py (InteractiveShell.user_setup): removed
4312 * IPython/iplib.py (InteractiveShell.user_setup): removed
4307 disabling of colors for Windows. I'll test at runtime and issue a
4313 disabling of colors for Windows. I'll test at runtime and issue a
4308 warning if Gary's readline isn't found, as to nudge users to
4314 warning if Gary's readline isn't found, as to nudge users to
4309 download it.
4315 download it.
4310
4316
4311 2004-06-16 Fernando Perez <fperez@colorado.edu>
4317 2004-06-16 Fernando Perez <fperez@colorado.edu>
4312
4318
4313 * IPython/genutils.py (Stream.__init__): changed to print errors
4319 * IPython/genutils.py (Stream.__init__): changed to print errors
4314 to sys.stderr. I had a circular dependency here. Now it's
4320 to sys.stderr. I had a circular dependency here. Now it's
4315 possible to run ipython as IDLE's shell (consider this pre-alpha,
4321 possible to run ipython as IDLE's shell (consider this pre-alpha,
4316 since true stdout things end up in the starting terminal instead
4322 since true stdout things end up in the starting terminal instead
4317 of IDLE's out).
4323 of IDLE's out).
4318
4324
4319 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4325 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4320 users who haven't # updated their prompt_in2 definitions. Remove
4326 users who haven't # updated their prompt_in2 definitions. Remove
4321 eventually.
4327 eventually.
4322 (multiple_replace): added credit to original ASPN recipe.
4328 (multiple_replace): added credit to original ASPN recipe.
4323
4329
4324 2004-06-15 Fernando Perez <fperez@colorado.edu>
4330 2004-06-15 Fernando Perez <fperez@colorado.edu>
4325
4331
4326 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4332 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4327 list of auto-defined aliases.
4333 list of auto-defined aliases.
4328
4334
4329 2004-06-13 Fernando Perez <fperez@colorado.edu>
4335 2004-06-13 Fernando Perez <fperez@colorado.edu>
4330
4336
4331 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4337 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4332 install was really requested (so setup.py can be used for other
4338 install was really requested (so setup.py can be used for other
4333 things under Windows).
4339 things under Windows).
4334
4340
4335 2004-06-10 Fernando Perez <fperez@colorado.edu>
4341 2004-06-10 Fernando Perez <fperez@colorado.edu>
4336
4342
4337 * IPython/Logger.py (Logger.create_log): Manually remove any old
4343 * IPython/Logger.py (Logger.create_log): Manually remove any old
4338 backup, since os.remove may fail under Windows. Fixes bug
4344 backup, since os.remove may fail under Windows. Fixes bug
4339 reported by Thorsten.
4345 reported by Thorsten.
4340
4346
4341 2004-06-09 Fernando Perez <fperez@colorado.edu>
4347 2004-06-09 Fernando Perez <fperez@colorado.edu>
4342
4348
4343 * examples/example-embed.py: fixed all references to %n (replaced
4349 * examples/example-embed.py: fixed all references to %n (replaced
4344 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4350 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4345 for all examples and the manual as well.
4351 for all examples and the manual as well.
4346
4352
4347 2004-06-08 Fernando Perez <fperez@colorado.edu>
4353 2004-06-08 Fernando Perez <fperez@colorado.edu>
4348
4354
4349 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4355 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4350 alignment and color management. All 3 prompt subsystems now
4356 alignment and color management. All 3 prompt subsystems now
4351 inherit from BasePrompt.
4357 inherit from BasePrompt.
4352
4358
4353 * tools/release: updates for windows installer build and tag rpms
4359 * tools/release: updates for windows installer build and tag rpms
4354 with python version (since paths are fixed).
4360 with python version (since paths are fixed).
4355
4361
4356 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4362 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4357 which will become eventually obsolete. Also fixed the default
4363 which will become eventually obsolete. Also fixed the default
4358 prompt_in2 to use \D, so at least new users start with the correct
4364 prompt_in2 to use \D, so at least new users start with the correct
4359 defaults.
4365 defaults.
4360 WARNING: Users with existing ipythonrc files will need to apply
4366 WARNING: Users with existing ipythonrc files will need to apply
4361 this fix manually!
4367 this fix manually!
4362
4368
4363 * setup.py: make windows installer (.exe). This is finally the
4369 * setup.py: make windows installer (.exe). This is finally the
4364 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4370 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4365 which I hadn't included because it required Python 2.3 (or recent
4371 which I hadn't included because it required Python 2.3 (or recent
4366 distutils).
4372 distutils).
4367
4373
4368 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4374 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4369 usage of new '\D' escape.
4375 usage of new '\D' escape.
4370
4376
4371 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4377 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4372 lacks os.getuid())
4378 lacks os.getuid())
4373 (CachedOutput.set_colors): Added the ability to turn coloring
4379 (CachedOutput.set_colors): Added the ability to turn coloring
4374 on/off with @colors even for manually defined prompt colors. It
4380 on/off with @colors even for manually defined prompt colors. It
4375 uses a nasty global, but it works safely and via the generic color
4381 uses a nasty global, but it works safely and via the generic color
4376 handling mechanism.
4382 handling mechanism.
4377 (Prompt2.__init__): Introduced new escape '\D' for continuation
4383 (Prompt2.__init__): Introduced new escape '\D' for continuation
4378 prompts. It represents the counter ('\#') as dots.
4384 prompts. It represents the counter ('\#') as dots.
4379 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4385 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4380 need to update their ipythonrc files and replace '%n' with '\D' in
4386 need to update their ipythonrc files and replace '%n' with '\D' in
4381 their prompt_in2 settings everywhere. Sorry, but there's
4387 their prompt_in2 settings everywhere. Sorry, but there's
4382 otherwise no clean way to get all prompts to properly align. The
4388 otherwise no clean way to get all prompts to properly align. The
4383 ipythonrc shipped with IPython has been updated.
4389 ipythonrc shipped with IPython has been updated.
4384
4390
4385 2004-06-07 Fernando Perez <fperez@colorado.edu>
4391 2004-06-07 Fernando Perez <fperez@colorado.edu>
4386
4392
4387 * setup.py (isfile): Pass local_icons option to latex2html, so the
4393 * setup.py (isfile): Pass local_icons option to latex2html, so the
4388 resulting HTML file is self-contained. Thanks to
4394 resulting HTML file is self-contained. Thanks to
4389 dryice-AT-liu.com.cn for the tip.
4395 dryice-AT-liu.com.cn for the tip.
4390
4396
4391 * pysh.py: I created a new profile 'shell', which implements a
4397 * pysh.py: I created a new profile 'shell', which implements a
4392 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4398 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4393 system shell, nor will it become one anytime soon. It's mainly
4399 system shell, nor will it become one anytime soon. It's mainly
4394 meant to illustrate the use of the new flexible bash-like prompts.
4400 meant to illustrate the use of the new flexible bash-like prompts.
4395 I guess it could be used by hardy souls for true shell management,
4401 I guess it could be used by hardy souls for true shell management,
4396 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4402 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4397 profile. This uses the InterpreterExec extension provided by
4403 profile. This uses the InterpreterExec extension provided by
4398 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4404 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4399
4405
4400 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4406 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4401 auto-align itself with the length of the previous input prompt
4407 auto-align itself with the length of the previous input prompt
4402 (taking into account the invisible color escapes).
4408 (taking into account the invisible color escapes).
4403 (CachedOutput.__init__): Large restructuring of this class. Now
4409 (CachedOutput.__init__): Large restructuring of this class. Now
4404 all three prompts (primary1, primary2, output) are proper objects,
4410 all three prompts (primary1, primary2, output) are proper objects,
4405 managed by the 'parent' CachedOutput class. The code is still a
4411 managed by the 'parent' CachedOutput class. The code is still a
4406 bit hackish (all prompts share state via a pointer to the cache),
4412 bit hackish (all prompts share state via a pointer to the cache),
4407 but it's overall far cleaner than before.
4413 but it's overall far cleaner than before.
4408
4414
4409 * IPython/genutils.py (getoutputerror): modified to add verbose,
4415 * IPython/genutils.py (getoutputerror): modified to add verbose,
4410 debug and header options. This makes the interface of all getout*
4416 debug and header options. This makes the interface of all getout*
4411 functions uniform.
4417 functions uniform.
4412 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4418 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4413
4419
4414 * IPython/Magic.py (Magic.default_option): added a function to
4420 * IPython/Magic.py (Magic.default_option): added a function to
4415 allow registering default options for any magic command. This
4421 allow registering default options for any magic command. This
4416 makes it easy to have profiles which customize the magics globally
4422 makes it easy to have profiles which customize the magics globally
4417 for a certain use. The values set through this function are
4423 for a certain use. The values set through this function are
4418 picked up by the parse_options() method, which all magics should
4424 picked up by the parse_options() method, which all magics should
4419 use to parse their options.
4425 use to parse their options.
4420
4426
4421 * IPython/genutils.py (warn): modified the warnings framework to
4427 * IPython/genutils.py (warn): modified the warnings framework to
4422 use the Term I/O class. I'm trying to slowly unify all of
4428 use the Term I/O class. I'm trying to slowly unify all of
4423 IPython's I/O operations to pass through Term.
4429 IPython's I/O operations to pass through Term.
4424
4430
4425 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4431 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4426 the secondary prompt to correctly match the length of the primary
4432 the secondary prompt to correctly match the length of the primary
4427 one for any prompt. Now multi-line code will properly line up
4433 one for any prompt. Now multi-line code will properly line up
4428 even for path dependent prompts, such as the new ones available
4434 even for path dependent prompts, such as the new ones available
4429 via the prompt_specials.
4435 via the prompt_specials.
4430
4436
4431 2004-06-06 Fernando Perez <fperez@colorado.edu>
4437 2004-06-06 Fernando Perez <fperez@colorado.edu>
4432
4438
4433 * IPython/Prompts.py (prompt_specials): Added the ability to have
4439 * IPython/Prompts.py (prompt_specials): Added the ability to have
4434 bash-like special sequences in the prompts, which get
4440 bash-like special sequences in the prompts, which get
4435 automatically expanded. Things like hostname, current working
4441 automatically expanded. Things like hostname, current working
4436 directory and username are implemented already, but it's easy to
4442 directory and username are implemented already, but it's easy to
4437 add more in the future. Thanks to a patch by W.J. van der Laan
4443 add more in the future. Thanks to a patch by W.J. van der Laan
4438 <gnufnork-AT-hetdigitalegat.nl>
4444 <gnufnork-AT-hetdigitalegat.nl>
4439 (prompt_specials): Added color support for prompt strings, so
4445 (prompt_specials): Added color support for prompt strings, so
4440 users can define arbitrary color setups for their prompts.
4446 users can define arbitrary color setups for their prompts.
4441
4447
4442 2004-06-05 Fernando Perez <fperez@colorado.edu>
4448 2004-06-05 Fernando Perez <fperez@colorado.edu>
4443
4449
4444 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4450 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4445 code to load Gary Bishop's readline and configure it
4451 code to load Gary Bishop's readline and configure it
4446 automatically. Thanks to Gary for help on this.
4452 automatically. Thanks to Gary for help on this.
4447
4453
4448 2004-06-01 Fernando Perez <fperez@colorado.edu>
4454 2004-06-01 Fernando Perez <fperez@colorado.edu>
4449
4455
4450 * IPython/Logger.py (Logger.create_log): fix bug for logging
4456 * IPython/Logger.py (Logger.create_log): fix bug for logging
4451 with no filename (previous fix was incomplete).
4457 with no filename (previous fix was incomplete).
4452
4458
4453 2004-05-25 Fernando Perez <fperez@colorado.edu>
4459 2004-05-25 Fernando Perez <fperez@colorado.edu>
4454
4460
4455 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4461 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4456 parens would get passed to the shell.
4462 parens would get passed to the shell.
4457
4463
4458 2004-05-20 Fernando Perez <fperez@colorado.edu>
4464 2004-05-20 Fernando Perez <fperez@colorado.edu>
4459
4465
4460 * IPython/Magic.py (Magic.magic_prun): changed default profile
4466 * IPython/Magic.py (Magic.magic_prun): changed default profile
4461 sort order to 'time' (the more common profiling need).
4467 sort order to 'time' (the more common profiling need).
4462
4468
4463 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4469 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4464 so that source code shown is guaranteed in sync with the file on
4470 so that source code shown is guaranteed in sync with the file on
4465 disk (also changed in psource). Similar fix to the one for
4471 disk (also changed in psource). Similar fix to the one for
4466 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4472 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4467 <yann.ledu-AT-noos.fr>.
4473 <yann.ledu-AT-noos.fr>.
4468
4474
4469 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4475 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4470 with a single option would not be correctly parsed. Closes
4476 with a single option would not be correctly parsed. Closes
4471 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4477 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4472 introduced in 0.6.0 (on 2004-05-06).
4478 introduced in 0.6.0 (on 2004-05-06).
4473
4479
4474 2004-05-13 *** Released version 0.6.0
4480 2004-05-13 *** Released version 0.6.0
4475
4481
4476 2004-05-13 Fernando Perez <fperez@colorado.edu>
4482 2004-05-13 Fernando Perez <fperez@colorado.edu>
4477
4483
4478 * debian/: Added debian/ directory to CVS, so that debian support
4484 * debian/: Added debian/ directory to CVS, so that debian support
4479 is publicly accessible. The debian package is maintained by Jack
4485 is publicly accessible. The debian package is maintained by Jack
4480 Moffit <jack-AT-xiph.org>.
4486 Moffit <jack-AT-xiph.org>.
4481
4487
4482 * Documentation: included the notes about an ipython-based system
4488 * Documentation: included the notes about an ipython-based system
4483 shell (the hypothetical 'pysh') into the new_design.pdf document,
4489 shell (the hypothetical 'pysh') into the new_design.pdf document,
4484 so that these ideas get distributed to users along with the
4490 so that these ideas get distributed to users along with the
4485 official documentation.
4491 official documentation.
4486
4492
4487 2004-05-10 Fernando Perez <fperez@colorado.edu>
4493 2004-05-10 Fernando Perez <fperez@colorado.edu>
4488
4494
4489 * IPython/Logger.py (Logger.create_log): fix recently introduced
4495 * IPython/Logger.py (Logger.create_log): fix recently introduced
4490 bug (misindented line) where logstart would fail when not given an
4496 bug (misindented line) where logstart would fail when not given an
4491 explicit filename.
4497 explicit filename.
4492
4498
4493 2004-05-09 Fernando Perez <fperez@colorado.edu>
4499 2004-05-09 Fernando Perez <fperez@colorado.edu>
4494
4500
4495 * IPython/Magic.py (Magic.parse_options): skip system call when
4501 * IPython/Magic.py (Magic.parse_options): skip system call when
4496 there are no options to look for. Faster, cleaner for the common
4502 there are no options to look for. Faster, cleaner for the common
4497 case.
4503 case.
4498
4504
4499 * Documentation: many updates to the manual: describing Windows
4505 * Documentation: many updates to the manual: describing Windows
4500 support better, Gnuplot updates, credits, misc small stuff. Also
4506 support better, Gnuplot updates, credits, misc small stuff. Also
4501 updated the new_design doc a bit.
4507 updated the new_design doc a bit.
4502
4508
4503 2004-05-06 *** Released version 0.6.0.rc1
4509 2004-05-06 *** Released version 0.6.0.rc1
4504
4510
4505 2004-05-06 Fernando Perez <fperez@colorado.edu>
4511 2004-05-06 Fernando Perez <fperez@colorado.edu>
4506
4512
4507 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4513 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4508 operations to use the vastly more efficient list/''.join() method.
4514 operations to use the vastly more efficient list/''.join() method.
4509 (FormattedTB.text): Fix
4515 (FormattedTB.text): Fix
4510 http://www.scipy.net/roundup/ipython/issue12 - exception source
4516 http://www.scipy.net/roundup/ipython/issue12 - exception source
4511 extract not updated after reload. Thanks to Mike Salib
4517 extract not updated after reload. Thanks to Mike Salib
4512 <msalib-AT-mit.edu> for pinning the source of the problem.
4518 <msalib-AT-mit.edu> for pinning the source of the problem.
4513 Fortunately, the solution works inside ipython and doesn't require
4519 Fortunately, the solution works inside ipython and doesn't require
4514 any changes to python proper.
4520 any changes to python proper.
4515
4521
4516 * IPython/Magic.py (Magic.parse_options): Improved to process the
4522 * IPython/Magic.py (Magic.parse_options): Improved to process the
4517 argument list as a true shell would (by actually using the
4523 argument list as a true shell would (by actually using the
4518 underlying system shell). This way, all @magics automatically get
4524 underlying system shell). This way, all @magics automatically get
4519 shell expansion for variables. Thanks to a comment by Alex
4525 shell expansion for variables. Thanks to a comment by Alex
4520 Schmolck.
4526 Schmolck.
4521
4527
4522 2004-04-04 Fernando Perez <fperez@colorado.edu>
4528 2004-04-04 Fernando Perez <fperez@colorado.edu>
4523
4529
4524 * IPython/iplib.py (InteractiveShell.interact): Added a special
4530 * IPython/iplib.py (InteractiveShell.interact): Added a special
4525 trap for a debugger quit exception, which is basically impossible
4531 trap for a debugger quit exception, which is basically impossible
4526 to handle by normal mechanisms, given what pdb does to the stack.
4532 to handle by normal mechanisms, given what pdb does to the stack.
4527 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4533 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4528
4534
4529 2004-04-03 Fernando Perez <fperez@colorado.edu>
4535 2004-04-03 Fernando Perez <fperez@colorado.edu>
4530
4536
4531 * IPython/genutils.py (Term): Standardized the names of the Term
4537 * IPython/genutils.py (Term): Standardized the names of the Term
4532 class streams to cin/cout/cerr, following C++ naming conventions
4538 class streams to cin/cout/cerr, following C++ naming conventions
4533 (I can't use in/out/err because 'in' is not a valid attribute
4539 (I can't use in/out/err because 'in' is not a valid attribute
4534 name).
4540 name).
4535
4541
4536 * IPython/iplib.py (InteractiveShell.interact): don't increment
4542 * IPython/iplib.py (InteractiveShell.interact): don't increment
4537 the prompt if there's no user input. By Daniel 'Dang' Griffith
4543 the prompt if there's no user input. By Daniel 'Dang' Griffith
4538 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4544 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4539 Francois Pinard.
4545 Francois Pinard.
4540
4546
4541 2004-04-02 Fernando Perez <fperez@colorado.edu>
4547 2004-04-02 Fernando Perez <fperez@colorado.edu>
4542
4548
4543 * IPython/genutils.py (Stream.__init__): Modified to survive at
4549 * IPython/genutils.py (Stream.__init__): Modified to survive at
4544 least importing in contexts where stdin/out/err aren't true file
4550 least importing in contexts where stdin/out/err aren't true file
4545 objects, such as PyCrust (they lack fileno() and mode). However,
4551 objects, such as PyCrust (they lack fileno() and mode). However,
4546 the recovery facilities which rely on these things existing will
4552 the recovery facilities which rely on these things existing will
4547 not work.
4553 not work.
4548
4554
4549 2004-04-01 Fernando Perez <fperez@colorado.edu>
4555 2004-04-01 Fernando Perez <fperez@colorado.edu>
4550
4556
4551 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4557 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4552 use the new getoutputerror() function, so it properly
4558 use the new getoutputerror() function, so it properly
4553 distinguishes stdout/err.
4559 distinguishes stdout/err.
4554
4560
4555 * IPython/genutils.py (getoutputerror): added a function to
4561 * IPython/genutils.py (getoutputerror): added a function to
4556 capture separately the standard output and error of a command.
4562 capture separately the standard output and error of a command.
4557 After a comment from dang on the mailing lists. This code is
4563 After a comment from dang on the mailing lists. This code is
4558 basically a modified version of commands.getstatusoutput(), from
4564 basically a modified version of commands.getstatusoutput(), from
4559 the standard library.
4565 the standard library.
4560
4566
4561 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4567 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4562 '!!' as a special syntax (shorthand) to access @sx.
4568 '!!' as a special syntax (shorthand) to access @sx.
4563
4569
4564 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4570 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4565 command and return its output as a list split on '\n'.
4571 command and return its output as a list split on '\n'.
4566
4572
4567 2004-03-31 Fernando Perez <fperez@colorado.edu>
4573 2004-03-31 Fernando Perez <fperez@colorado.edu>
4568
4574
4569 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4575 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4570 method to dictionaries used as FakeModule instances if they lack
4576 method to dictionaries used as FakeModule instances if they lack
4571 it. At least pydoc in python2.3 breaks for runtime-defined
4577 it. At least pydoc in python2.3 breaks for runtime-defined
4572 functions without this hack. At some point I need to _really_
4578 functions without this hack. At some point I need to _really_
4573 understand what FakeModule is doing, because it's a gross hack.
4579 understand what FakeModule is doing, because it's a gross hack.
4574 But it solves Arnd's problem for now...
4580 But it solves Arnd's problem for now...
4575
4581
4576 2004-02-27 Fernando Perez <fperez@colorado.edu>
4582 2004-02-27 Fernando Perez <fperez@colorado.edu>
4577
4583
4578 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4584 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4579 mode would behave erratically. Also increased the number of
4585 mode would behave erratically. Also increased the number of
4580 possible logs in rotate mod to 999. Thanks to Rod Holland
4586 possible logs in rotate mod to 999. Thanks to Rod Holland
4581 <rhh@StructureLABS.com> for the report and fixes.
4587 <rhh@StructureLABS.com> for the report and fixes.
4582
4588
4583 2004-02-26 Fernando Perez <fperez@colorado.edu>
4589 2004-02-26 Fernando Perez <fperez@colorado.edu>
4584
4590
4585 * IPython/genutils.py (page): Check that the curses module really
4591 * IPython/genutils.py (page): Check that the curses module really
4586 has the initscr attribute before trying to use it. For some
4592 has the initscr attribute before trying to use it. For some
4587 reason, the Solaris curses module is missing this. I think this
4593 reason, the Solaris curses module is missing this. I think this
4588 should be considered a Solaris python bug, but I'm not sure.
4594 should be considered a Solaris python bug, but I'm not sure.
4589
4595
4590 2004-01-17 Fernando Perez <fperez@colorado.edu>
4596 2004-01-17 Fernando Perez <fperez@colorado.edu>
4591
4597
4592 * IPython/genutils.py (Stream.__init__): Changes to try to make
4598 * IPython/genutils.py (Stream.__init__): Changes to try to make
4593 ipython robust against stdin/out/err being closed by the user.
4599 ipython robust against stdin/out/err being closed by the user.
4594 This is 'user error' (and blocks a normal python session, at least
4600 This is 'user error' (and blocks a normal python session, at least
4595 the stdout case). However, Ipython should be able to survive such
4601 the stdout case). However, Ipython should be able to survive such
4596 instances of abuse as gracefully as possible. To simplify the
4602 instances of abuse as gracefully as possible. To simplify the
4597 coding and maintain compatibility with Gary Bishop's Term
4603 coding and maintain compatibility with Gary Bishop's Term
4598 contributions, I've made use of classmethods for this. I think
4604 contributions, I've made use of classmethods for this. I think
4599 this introduces a dependency on python 2.2.
4605 this introduces a dependency on python 2.2.
4600
4606
4601 2004-01-13 Fernando Perez <fperez@colorado.edu>
4607 2004-01-13 Fernando Perez <fperez@colorado.edu>
4602
4608
4603 * IPython/numutils.py (exp_safe): simplified the code a bit and
4609 * IPython/numutils.py (exp_safe): simplified the code a bit and
4604 removed the need for importing the kinds module altogether.
4610 removed the need for importing the kinds module altogether.
4605
4611
4606 2004-01-06 Fernando Perez <fperez@colorado.edu>
4612 2004-01-06 Fernando Perez <fperez@colorado.edu>
4607
4613
4608 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4614 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4609 a magic function instead, after some community feedback. No
4615 a magic function instead, after some community feedback. No
4610 special syntax will exist for it, but its name is deliberately
4616 special syntax will exist for it, but its name is deliberately
4611 very short.
4617 very short.
4612
4618
4613 2003-12-20 Fernando Perez <fperez@colorado.edu>
4619 2003-12-20 Fernando Perez <fperez@colorado.edu>
4614
4620
4615 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4621 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4616 new functionality, to automagically assign the result of a shell
4622 new functionality, to automagically assign the result of a shell
4617 command to a variable. I'll solicit some community feedback on
4623 command to a variable. I'll solicit some community feedback on
4618 this before making it permanent.
4624 this before making it permanent.
4619
4625
4620 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4626 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4621 requested about callables for which inspect couldn't obtain a
4627 requested about callables for which inspect couldn't obtain a
4622 proper argspec. Thanks to a crash report sent by Etienne
4628 proper argspec. Thanks to a crash report sent by Etienne
4623 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4629 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4624
4630
4625 2003-12-09 Fernando Perez <fperez@colorado.edu>
4631 2003-12-09 Fernando Perez <fperez@colorado.edu>
4626
4632
4627 * IPython/genutils.py (page): patch for the pager to work across
4633 * IPython/genutils.py (page): patch for the pager to work across
4628 various versions of Windows. By Gary Bishop.
4634 various versions of Windows. By Gary Bishop.
4629
4635
4630 2003-12-04 Fernando Perez <fperez@colorado.edu>
4636 2003-12-04 Fernando Perez <fperez@colorado.edu>
4631
4637
4632 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4638 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4633 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4639 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4634 While I tested this and it looks ok, there may still be corner
4640 While I tested this and it looks ok, there may still be corner
4635 cases I've missed.
4641 cases I've missed.
4636
4642
4637 2003-12-01 Fernando Perez <fperez@colorado.edu>
4643 2003-12-01 Fernando Perez <fperez@colorado.edu>
4638
4644
4639 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4645 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4640 where a line like 'p,q=1,2' would fail because the automagic
4646 where a line like 'p,q=1,2' would fail because the automagic
4641 system would be triggered for @p.
4647 system would be triggered for @p.
4642
4648
4643 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4649 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4644 cleanups, code unmodified.
4650 cleanups, code unmodified.
4645
4651
4646 * IPython/genutils.py (Term): added a class for IPython to handle
4652 * IPython/genutils.py (Term): added a class for IPython to handle
4647 output. In most cases it will just be a proxy for stdout/err, but
4653 output. In most cases it will just be a proxy for stdout/err, but
4648 having this allows modifications to be made for some platforms,
4654 having this allows modifications to be made for some platforms,
4649 such as handling color escapes under Windows. All of this code
4655 such as handling color escapes under Windows. All of this code
4650 was contributed by Gary Bishop, with minor modifications by me.
4656 was contributed by Gary Bishop, with minor modifications by me.
4651 The actual changes affect many files.
4657 The actual changes affect many files.
4652
4658
4653 2003-11-30 Fernando Perez <fperez@colorado.edu>
4659 2003-11-30 Fernando Perez <fperez@colorado.edu>
4654
4660
4655 * IPython/iplib.py (file_matches): new completion code, courtesy
4661 * IPython/iplib.py (file_matches): new completion code, courtesy
4656 of Jeff Collins. This enables filename completion again under
4662 of Jeff Collins. This enables filename completion again under
4657 python 2.3, which disabled it at the C level.
4663 python 2.3, which disabled it at the C level.
4658
4664
4659 2003-11-11 Fernando Perez <fperez@colorado.edu>
4665 2003-11-11 Fernando Perez <fperez@colorado.edu>
4660
4666
4661 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4667 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4662 for Numeric.array(map(...)), but often convenient.
4668 for Numeric.array(map(...)), but often convenient.
4663
4669
4664 2003-11-05 Fernando Perez <fperez@colorado.edu>
4670 2003-11-05 Fernando Perez <fperez@colorado.edu>
4665
4671
4666 * IPython/numutils.py (frange): Changed a call from int() to
4672 * IPython/numutils.py (frange): Changed a call from int() to
4667 int(round()) to prevent a problem reported with arange() in the
4673 int(round()) to prevent a problem reported with arange() in the
4668 numpy list.
4674 numpy list.
4669
4675
4670 2003-10-06 Fernando Perez <fperez@colorado.edu>
4676 2003-10-06 Fernando Perez <fperez@colorado.edu>
4671
4677
4672 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4678 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4673 prevent crashes if sys lacks an argv attribute (it happens with
4679 prevent crashes if sys lacks an argv attribute (it happens with
4674 embedded interpreters which build a bare-bones sys module).
4680 embedded interpreters which build a bare-bones sys module).
4675 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4681 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4676
4682
4677 2003-09-24 Fernando Perez <fperez@colorado.edu>
4683 2003-09-24 Fernando Perez <fperez@colorado.edu>
4678
4684
4679 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4685 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4680 to protect against poorly written user objects where __getattr__
4686 to protect against poorly written user objects where __getattr__
4681 raises exceptions other than AttributeError. Thanks to a bug
4687 raises exceptions other than AttributeError. Thanks to a bug
4682 report by Oliver Sander <osander-AT-gmx.de>.
4688 report by Oliver Sander <osander-AT-gmx.de>.
4683
4689
4684 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4690 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4685 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4691 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4686
4692
4687 2003-09-09 Fernando Perez <fperez@colorado.edu>
4693 2003-09-09 Fernando Perez <fperez@colorado.edu>
4688
4694
4689 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4695 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4690 unpacking a list whith a callable as first element would
4696 unpacking a list whith a callable as first element would
4691 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4697 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4692 Collins.
4698 Collins.
4693
4699
4694 2003-08-25 *** Released version 0.5.0
4700 2003-08-25 *** Released version 0.5.0
4695
4701
4696 2003-08-22 Fernando Perez <fperez@colorado.edu>
4702 2003-08-22 Fernando Perez <fperez@colorado.edu>
4697
4703
4698 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4704 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4699 improperly defined user exceptions. Thanks to feedback from Mark
4705 improperly defined user exceptions. Thanks to feedback from Mark
4700 Russell <mrussell-AT-verio.net>.
4706 Russell <mrussell-AT-verio.net>.
4701
4707
4702 2003-08-20 Fernando Perez <fperez@colorado.edu>
4708 2003-08-20 Fernando Perez <fperez@colorado.edu>
4703
4709
4704 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4710 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4705 printing so that it would print multi-line string forms starting
4711 printing so that it would print multi-line string forms starting
4706 with a new line. This way the formatting is better respected for
4712 with a new line. This way the formatting is better respected for
4707 objects which work hard to make nice string forms.
4713 objects which work hard to make nice string forms.
4708
4714
4709 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4715 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4710 autocall would overtake data access for objects with both
4716 autocall would overtake data access for objects with both
4711 __getitem__ and __call__.
4717 __getitem__ and __call__.
4712
4718
4713 2003-08-19 *** Released version 0.5.0-rc1
4719 2003-08-19 *** Released version 0.5.0-rc1
4714
4720
4715 2003-08-19 Fernando Perez <fperez@colorado.edu>
4721 2003-08-19 Fernando Perez <fperez@colorado.edu>
4716
4722
4717 * IPython/deep_reload.py (load_tail): single tiny change here
4723 * IPython/deep_reload.py (load_tail): single tiny change here
4718 seems to fix the long-standing bug of dreload() failing to work
4724 seems to fix the long-standing bug of dreload() failing to work
4719 for dotted names. But this module is pretty tricky, so I may have
4725 for dotted names. But this module is pretty tricky, so I may have
4720 missed some subtlety. Needs more testing!.
4726 missed some subtlety. Needs more testing!.
4721
4727
4722 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4728 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4723 exceptions which have badly implemented __str__ methods.
4729 exceptions which have badly implemented __str__ methods.
4724 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4730 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4725 which I've been getting reports about from Python 2.3 users. I
4731 which I've been getting reports about from Python 2.3 users. I
4726 wish I had a simple test case to reproduce the problem, so I could
4732 wish I had a simple test case to reproduce the problem, so I could
4727 either write a cleaner workaround or file a bug report if
4733 either write a cleaner workaround or file a bug report if
4728 necessary.
4734 necessary.
4729
4735
4730 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4736 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4731 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4737 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4732 a bug report by Tjabo Kloppenburg.
4738 a bug report by Tjabo Kloppenburg.
4733
4739
4734 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4740 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4735 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4741 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4736 seems rather unstable. Thanks to a bug report by Tjabo
4742 seems rather unstable. Thanks to a bug report by Tjabo
4737 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4743 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4738
4744
4739 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4745 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4740 this out soon because of the critical fixes in the inner loop for
4746 this out soon because of the critical fixes in the inner loop for
4741 generators.
4747 generators.
4742
4748
4743 * IPython/Magic.py (Magic.getargspec): removed. This (and
4749 * IPython/Magic.py (Magic.getargspec): removed. This (and
4744 _get_def) have been obsoleted by OInspect for a long time, I
4750 _get_def) have been obsoleted by OInspect for a long time, I
4745 hadn't noticed that they were dead code.
4751 hadn't noticed that they were dead code.
4746 (Magic._ofind): restored _ofind functionality for a few literals
4752 (Magic._ofind): restored _ofind functionality for a few literals
4747 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4753 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4748 for things like "hello".capitalize?, since that would require a
4754 for things like "hello".capitalize?, since that would require a
4749 potentially dangerous eval() again.
4755 potentially dangerous eval() again.
4750
4756
4751 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4757 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4752 logic a bit more to clean up the escapes handling and minimize the
4758 logic a bit more to clean up the escapes handling and minimize the
4753 use of _ofind to only necessary cases. The interactive 'feel' of
4759 use of _ofind to only necessary cases. The interactive 'feel' of
4754 IPython should have improved quite a bit with the changes in
4760 IPython should have improved quite a bit with the changes in
4755 _prefilter and _ofind (besides being far safer than before).
4761 _prefilter and _ofind (besides being far safer than before).
4756
4762
4757 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4763 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4758 obscure, never reported). Edit would fail to find the object to
4764 obscure, never reported). Edit would fail to find the object to
4759 edit under some circumstances.
4765 edit under some circumstances.
4760 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4766 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4761 which were causing double-calling of generators. Those eval calls
4767 which were causing double-calling of generators. Those eval calls
4762 were _very_ dangerous, since code with side effects could be
4768 were _very_ dangerous, since code with side effects could be
4763 triggered. As they say, 'eval is evil'... These were the
4769 triggered. As they say, 'eval is evil'... These were the
4764 nastiest evals in IPython. Besides, _ofind is now far simpler,
4770 nastiest evals in IPython. Besides, _ofind is now far simpler,
4765 and it should also be quite a bit faster. Its use of inspect is
4771 and it should also be quite a bit faster. Its use of inspect is
4766 also safer, so perhaps some of the inspect-related crashes I've
4772 also safer, so perhaps some of the inspect-related crashes I've
4767 seen lately with Python 2.3 might be taken care of. That will
4773 seen lately with Python 2.3 might be taken care of. That will
4768 need more testing.
4774 need more testing.
4769
4775
4770 2003-08-17 Fernando Perez <fperez@colorado.edu>
4776 2003-08-17 Fernando Perez <fperez@colorado.edu>
4771
4777
4772 * IPython/iplib.py (InteractiveShell._prefilter): significant
4778 * IPython/iplib.py (InteractiveShell._prefilter): significant
4773 simplifications to the logic for handling user escapes. Faster
4779 simplifications to the logic for handling user escapes. Faster
4774 and simpler code.
4780 and simpler code.
4775
4781
4776 2003-08-14 Fernando Perez <fperez@colorado.edu>
4782 2003-08-14 Fernando Perez <fperez@colorado.edu>
4777
4783
4778 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4784 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4779 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4785 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4780 but it should be quite a bit faster. And the recursive version
4786 but it should be quite a bit faster. And the recursive version
4781 generated O(log N) intermediate storage for all rank>1 arrays,
4787 generated O(log N) intermediate storage for all rank>1 arrays,
4782 even if they were contiguous.
4788 even if they were contiguous.
4783 (l1norm): Added this function.
4789 (l1norm): Added this function.
4784 (norm): Added this function for arbitrary norms (including
4790 (norm): Added this function for arbitrary norms (including
4785 l-infinity). l1 and l2 are still special cases for convenience
4791 l-infinity). l1 and l2 are still special cases for convenience
4786 and speed.
4792 and speed.
4787
4793
4788 2003-08-03 Fernando Perez <fperez@colorado.edu>
4794 2003-08-03 Fernando Perez <fperez@colorado.edu>
4789
4795
4790 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4796 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4791 exceptions, which now raise PendingDeprecationWarnings in Python
4797 exceptions, which now raise PendingDeprecationWarnings in Python
4792 2.3. There were some in Magic and some in Gnuplot2.
4798 2.3. There were some in Magic and some in Gnuplot2.
4793
4799
4794 2003-06-30 Fernando Perez <fperez@colorado.edu>
4800 2003-06-30 Fernando Perez <fperez@colorado.edu>
4795
4801
4796 * IPython/genutils.py (page): modified to call curses only for
4802 * IPython/genutils.py (page): modified to call curses only for
4797 terminals where TERM=='xterm'. After problems under many other
4803 terminals where TERM=='xterm'. After problems under many other
4798 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4804 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4799
4805
4800 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4806 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4801 would be triggered when readline was absent. This was just an old
4807 would be triggered when readline was absent. This was just an old
4802 debugging statement I'd forgotten to take out.
4808 debugging statement I'd forgotten to take out.
4803
4809
4804 2003-06-20 Fernando Perez <fperez@colorado.edu>
4810 2003-06-20 Fernando Perez <fperez@colorado.edu>
4805
4811
4806 * IPython/genutils.py (clock): modified to return only user time
4812 * IPython/genutils.py (clock): modified to return only user time
4807 (not counting system time), after a discussion on scipy. While
4813 (not counting system time), after a discussion on scipy. While
4808 system time may be a useful quantity occasionally, it may much
4814 system time may be a useful quantity occasionally, it may much
4809 more easily be skewed by occasional swapping or other similar
4815 more easily be skewed by occasional swapping or other similar
4810 activity.
4816 activity.
4811
4817
4812 2003-06-05 Fernando Perez <fperez@colorado.edu>
4818 2003-06-05 Fernando Perez <fperez@colorado.edu>
4813
4819
4814 * IPython/numutils.py (identity): new function, for building
4820 * IPython/numutils.py (identity): new function, for building
4815 arbitrary rank Kronecker deltas (mostly backwards compatible with
4821 arbitrary rank Kronecker deltas (mostly backwards compatible with
4816 Numeric.identity)
4822 Numeric.identity)
4817
4823
4818 2003-06-03 Fernando Perez <fperez@colorado.edu>
4824 2003-06-03 Fernando Perez <fperez@colorado.edu>
4819
4825
4820 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4826 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4821 arguments passed to magics with spaces, to allow trailing '\' to
4827 arguments passed to magics with spaces, to allow trailing '\' to
4822 work normally (mainly for Windows users).
4828 work normally (mainly for Windows users).
4823
4829
4824 2003-05-29 Fernando Perez <fperez@colorado.edu>
4830 2003-05-29 Fernando Perez <fperez@colorado.edu>
4825
4831
4826 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4832 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4827 instead of pydoc.help. This fixes a bizarre behavior where
4833 instead of pydoc.help. This fixes a bizarre behavior where
4828 printing '%s' % locals() would trigger the help system. Now
4834 printing '%s' % locals() would trigger the help system. Now
4829 ipython behaves like normal python does.
4835 ipython behaves like normal python does.
4830
4836
4831 Note that if one does 'from pydoc import help', the bizarre
4837 Note that if one does 'from pydoc import help', the bizarre
4832 behavior returns, but this will also happen in normal python, so
4838 behavior returns, but this will also happen in normal python, so
4833 it's not an ipython bug anymore (it has to do with how pydoc.help
4839 it's not an ipython bug anymore (it has to do with how pydoc.help
4834 is implemented).
4840 is implemented).
4835
4841
4836 2003-05-22 Fernando Perez <fperez@colorado.edu>
4842 2003-05-22 Fernando Perez <fperez@colorado.edu>
4837
4843
4838 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4844 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4839 return [] instead of None when nothing matches, also match to end
4845 return [] instead of None when nothing matches, also match to end
4840 of line. Patch by Gary Bishop.
4846 of line. Patch by Gary Bishop.
4841
4847
4842 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4848 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4843 protection as before, for files passed on the command line. This
4849 protection as before, for files passed on the command line. This
4844 prevents the CrashHandler from kicking in if user files call into
4850 prevents the CrashHandler from kicking in if user files call into
4845 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4851 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4846 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4852 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4847
4853
4848 2003-05-20 *** Released version 0.4.0
4854 2003-05-20 *** Released version 0.4.0
4849
4855
4850 2003-05-20 Fernando Perez <fperez@colorado.edu>
4856 2003-05-20 Fernando Perez <fperez@colorado.edu>
4851
4857
4852 * setup.py: added support for manpages. It's a bit hackish b/c of
4858 * setup.py: added support for manpages. It's a bit hackish b/c of
4853 a bug in the way the bdist_rpm distutils target handles gzipped
4859 a bug in the way the bdist_rpm distutils target handles gzipped
4854 manpages, but it works. After a patch by Jack.
4860 manpages, but it works. After a patch by Jack.
4855
4861
4856 2003-05-19 Fernando Perez <fperez@colorado.edu>
4862 2003-05-19 Fernando Perez <fperez@colorado.edu>
4857
4863
4858 * IPython/numutils.py: added a mockup of the kinds module, since
4864 * IPython/numutils.py: added a mockup of the kinds module, since
4859 it was recently removed from Numeric. This way, numutils will
4865 it was recently removed from Numeric. This way, numutils will
4860 work for all users even if they are missing kinds.
4866 work for all users even if they are missing kinds.
4861
4867
4862 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4868 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4863 failure, which can occur with SWIG-wrapped extensions. After a
4869 failure, which can occur with SWIG-wrapped extensions. After a
4864 crash report from Prabhu.
4870 crash report from Prabhu.
4865
4871
4866 2003-05-16 Fernando Perez <fperez@colorado.edu>
4872 2003-05-16 Fernando Perez <fperez@colorado.edu>
4867
4873
4868 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4874 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4869 protect ipython from user code which may call directly
4875 protect ipython from user code which may call directly
4870 sys.excepthook (this looks like an ipython crash to the user, even
4876 sys.excepthook (this looks like an ipython crash to the user, even
4871 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4877 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4872 This is especially important to help users of WxWindows, but may
4878 This is especially important to help users of WxWindows, but may
4873 also be useful in other cases.
4879 also be useful in other cases.
4874
4880
4875 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4881 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4876 an optional tb_offset to be specified, and to preserve exception
4882 an optional tb_offset to be specified, and to preserve exception
4877 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4883 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4878
4884
4879 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4885 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4880
4886
4881 2003-05-15 Fernando Perez <fperez@colorado.edu>
4887 2003-05-15 Fernando Perez <fperez@colorado.edu>
4882
4888
4883 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4889 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4884 installing for a new user under Windows.
4890 installing for a new user under Windows.
4885
4891
4886 2003-05-12 Fernando Perez <fperez@colorado.edu>
4892 2003-05-12 Fernando Perez <fperez@colorado.edu>
4887
4893
4888 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4894 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4889 handler for Emacs comint-based lines. Currently it doesn't do
4895 handler for Emacs comint-based lines. Currently it doesn't do
4890 much (but importantly, it doesn't update the history cache). In
4896 much (but importantly, it doesn't update the history cache). In
4891 the future it may be expanded if Alex needs more functionality
4897 the future it may be expanded if Alex needs more functionality
4892 there.
4898 there.
4893
4899
4894 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4900 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4895 info to crash reports.
4901 info to crash reports.
4896
4902
4897 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4903 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4898 just like Python's -c. Also fixed crash with invalid -color
4904 just like Python's -c. Also fixed crash with invalid -color
4899 option value at startup. Thanks to Will French
4905 option value at startup. Thanks to Will French
4900 <wfrench-AT-bestweb.net> for the bug report.
4906 <wfrench-AT-bestweb.net> for the bug report.
4901
4907
4902 2003-05-09 Fernando Perez <fperez@colorado.edu>
4908 2003-05-09 Fernando Perez <fperez@colorado.edu>
4903
4909
4904 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4910 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4905 to EvalDict (it's a mapping, after all) and simplified its code
4911 to EvalDict (it's a mapping, after all) and simplified its code
4906 quite a bit, after a nice discussion on c.l.py where Gustavo
4912 quite a bit, after a nice discussion on c.l.py where Gustavo
4907 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4913 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4908
4914
4909 2003-04-30 Fernando Perez <fperez@colorado.edu>
4915 2003-04-30 Fernando Perez <fperez@colorado.edu>
4910
4916
4911 * IPython/genutils.py (timings_out): modified it to reduce its
4917 * IPython/genutils.py (timings_out): modified it to reduce its
4912 overhead in the common reps==1 case.
4918 overhead in the common reps==1 case.
4913
4919
4914 2003-04-29 Fernando Perez <fperez@colorado.edu>
4920 2003-04-29 Fernando Perez <fperez@colorado.edu>
4915
4921
4916 * IPython/genutils.py (timings_out): Modified to use the resource
4922 * IPython/genutils.py (timings_out): Modified to use the resource
4917 module, which avoids the wraparound problems of time.clock().
4923 module, which avoids the wraparound problems of time.clock().
4918
4924
4919 2003-04-17 *** Released version 0.2.15pre4
4925 2003-04-17 *** Released version 0.2.15pre4
4920
4926
4921 2003-04-17 Fernando Perez <fperez@colorado.edu>
4927 2003-04-17 Fernando Perez <fperez@colorado.edu>
4922
4928
4923 * setup.py (scriptfiles): Split windows-specific stuff over to a
4929 * setup.py (scriptfiles): Split windows-specific stuff over to a
4924 separate file, in an attempt to have a Windows GUI installer.
4930 separate file, in an attempt to have a Windows GUI installer.
4925 That didn't work, but part of the groundwork is done.
4931 That didn't work, but part of the groundwork is done.
4926
4932
4927 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4933 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4928 indent/unindent with 4 spaces. Particularly useful in combination
4934 indent/unindent with 4 spaces. Particularly useful in combination
4929 with the new auto-indent option.
4935 with the new auto-indent option.
4930
4936
4931 2003-04-16 Fernando Perez <fperez@colorado.edu>
4937 2003-04-16 Fernando Perez <fperez@colorado.edu>
4932
4938
4933 * IPython/Magic.py: various replacements of self.rc for
4939 * IPython/Magic.py: various replacements of self.rc for
4934 self.shell.rc. A lot more remains to be done to fully disentangle
4940 self.shell.rc. A lot more remains to be done to fully disentangle
4935 this class from the main Shell class.
4941 this class from the main Shell class.
4936
4942
4937 * IPython/GnuplotRuntime.py: added checks for mouse support so
4943 * IPython/GnuplotRuntime.py: added checks for mouse support so
4938 that we don't try to enable it if the current gnuplot doesn't
4944 that we don't try to enable it if the current gnuplot doesn't
4939 really support it. Also added checks so that we don't try to
4945 really support it. Also added checks so that we don't try to
4940 enable persist under Windows (where Gnuplot doesn't recognize the
4946 enable persist under Windows (where Gnuplot doesn't recognize the
4941 option).
4947 option).
4942
4948
4943 * IPython/iplib.py (InteractiveShell.interact): Added optional
4949 * IPython/iplib.py (InteractiveShell.interact): Added optional
4944 auto-indenting code, after a patch by King C. Shu
4950 auto-indenting code, after a patch by King C. Shu
4945 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4951 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4946 get along well with pasting indented code. If I ever figure out
4952 get along well with pasting indented code. If I ever figure out
4947 how to make that part go well, it will become on by default.
4953 how to make that part go well, it will become on by default.
4948
4954
4949 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4955 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4950 crash ipython if there was an unmatched '%' in the user's prompt
4956 crash ipython if there was an unmatched '%' in the user's prompt
4951 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4957 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4952
4958
4953 * IPython/iplib.py (InteractiveShell.interact): removed the
4959 * IPython/iplib.py (InteractiveShell.interact): removed the
4954 ability to ask the user whether he wants to crash or not at the
4960 ability to ask the user whether he wants to crash or not at the
4955 'last line' exception handler. Calling functions at that point
4961 'last line' exception handler. Calling functions at that point
4956 changes the stack, and the error reports would have incorrect
4962 changes the stack, and the error reports would have incorrect
4957 tracebacks.
4963 tracebacks.
4958
4964
4959 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4965 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4960 pass through a peger a pretty-printed form of any object. After a
4966 pass through a peger a pretty-printed form of any object. After a
4961 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4967 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4962
4968
4963 2003-04-14 Fernando Perez <fperez@colorado.edu>
4969 2003-04-14 Fernando Perez <fperez@colorado.edu>
4964
4970
4965 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4971 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4966 all files in ~ would be modified at first install (instead of
4972 all files in ~ would be modified at first install (instead of
4967 ~/.ipython). This could be potentially disastrous, as the
4973 ~/.ipython). This could be potentially disastrous, as the
4968 modification (make line-endings native) could damage binary files.
4974 modification (make line-endings native) could damage binary files.
4969
4975
4970 2003-04-10 Fernando Perez <fperez@colorado.edu>
4976 2003-04-10 Fernando Perez <fperez@colorado.edu>
4971
4977
4972 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4978 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4973 handle only lines which are invalid python. This now means that
4979 handle only lines which are invalid python. This now means that
4974 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4980 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4975 for the bug report.
4981 for the bug report.
4976
4982
4977 2003-04-01 Fernando Perez <fperez@colorado.edu>
4983 2003-04-01 Fernando Perez <fperez@colorado.edu>
4978
4984
4979 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4985 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4980 where failing to set sys.last_traceback would crash pdb.pm().
4986 where failing to set sys.last_traceback would crash pdb.pm().
4981 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4987 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4982 report.
4988 report.
4983
4989
4984 2003-03-25 Fernando Perez <fperez@colorado.edu>
4990 2003-03-25 Fernando Perez <fperez@colorado.edu>
4985
4991
4986 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4992 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4987 before printing it (it had a lot of spurious blank lines at the
4993 before printing it (it had a lot of spurious blank lines at the
4988 end).
4994 end).
4989
4995
4990 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4996 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4991 output would be sent 21 times! Obviously people don't use this
4997 output would be sent 21 times! Obviously people don't use this
4992 too often, or I would have heard about it.
4998 too often, or I would have heard about it.
4993
4999
4994 2003-03-24 Fernando Perez <fperez@colorado.edu>
5000 2003-03-24 Fernando Perez <fperez@colorado.edu>
4995
5001
4996 * setup.py (scriptfiles): renamed the data_files parameter from
5002 * setup.py (scriptfiles): renamed the data_files parameter from
4997 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5003 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4998 for the patch.
5004 for the patch.
4999
5005
5000 2003-03-20 Fernando Perez <fperez@colorado.edu>
5006 2003-03-20 Fernando Perez <fperez@colorado.edu>
5001
5007
5002 * IPython/genutils.py (error): added error() and fatal()
5008 * IPython/genutils.py (error): added error() and fatal()
5003 functions.
5009 functions.
5004
5010
5005 2003-03-18 *** Released version 0.2.15pre3
5011 2003-03-18 *** Released version 0.2.15pre3
5006
5012
5007 2003-03-18 Fernando Perez <fperez@colorado.edu>
5013 2003-03-18 Fernando Perez <fperez@colorado.edu>
5008
5014
5009 * setupext/install_data_ext.py
5015 * setupext/install_data_ext.py
5010 (install_data_ext.initialize_options): Class contributed by Jack
5016 (install_data_ext.initialize_options): Class contributed by Jack
5011 Moffit for fixing the old distutils hack. He is sending this to
5017 Moffit for fixing the old distutils hack. He is sending this to
5012 the distutils folks so in the future we may not need it as a
5018 the distutils folks so in the future we may not need it as a
5013 private fix.
5019 private fix.
5014
5020
5015 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5021 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5016 changes for Debian packaging. See his patch for full details.
5022 changes for Debian packaging. See his patch for full details.
5017 The old distutils hack of making the ipythonrc* files carry a
5023 The old distutils hack of making the ipythonrc* files carry a
5018 bogus .py extension is gone, at last. Examples were moved to a
5024 bogus .py extension is gone, at last. Examples were moved to a
5019 separate subdir under doc/, and the separate executable scripts
5025 separate subdir under doc/, and the separate executable scripts
5020 now live in their own directory. Overall a great cleanup. The
5026 now live in their own directory. Overall a great cleanup. The
5021 manual was updated to use the new files, and setup.py has been
5027 manual was updated to use the new files, and setup.py has been
5022 fixed for this setup.
5028 fixed for this setup.
5023
5029
5024 * IPython/PyColorize.py (Parser.usage): made non-executable and
5030 * IPython/PyColorize.py (Parser.usage): made non-executable and
5025 created a pycolor wrapper around it to be included as a script.
5031 created a pycolor wrapper around it to be included as a script.
5026
5032
5027 2003-03-12 *** Released version 0.2.15pre2
5033 2003-03-12 *** Released version 0.2.15pre2
5028
5034
5029 2003-03-12 Fernando Perez <fperez@colorado.edu>
5035 2003-03-12 Fernando Perez <fperez@colorado.edu>
5030
5036
5031 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5037 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5032 long-standing problem with garbage characters in some terminals.
5038 long-standing problem with garbage characters in some terminals.
5033 The issue was really that the \001 and \002 escapes must _only_ be
5039 The issue was really that the \001 and \002 escapes must _only_ be
5034 passed to input prompts (which call readline), but _never_ to
5040 passed to input prompts (which call readline), but _never_ to
5035 normal text to be printed on screen. I changed ColorANSI to have
5041 normal text to be printed on screen. I changed ColorANSI to have
5036 two classes: TermColors and InputTermColors, each with the
5042 two classes: TermColors and InputTermColors, each with the
5037 appropriate escapes for input prompts or normal text. The code in
5043 appropriate escapes for input prompts or normal text. The code in
5038 Prompts.py got slightly more complicated, but this very old and
5044 Prompts.py got slightly more complicated, but this very old and
5039 annoying bug is finally fixed.
5045 annoying bug is finally fixed.
5040
5046
5041 All the credit for nailing down the real origin of this problem
5047 All the credit for nailing down the real origin of this problem
5042 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5048 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5043 *Many* thanks to him for spending quite a bit of effort on this.
5049 *Many* thanks to him for spending quite a bit of effort on this.
5044
5050
5045 2003-03-05 *** Released version 0.2.15pre1
5051 2003-03-05 *** Released version 0.2.15pre1
5046
5052
5047 2003-03-03 Fernando Perez <fperez@colorado.edu>
5053 2003-03-03 Fernando Perez <fperez@colorado.edu>
5048
5054
5049 * IPython/FakeModule.py: Moved the former _FakeModule to a
5055 * IPython/FakeModule.py: Moved the former _FakeModule to a
5050 separate file, because it's also needed by Magic (to fix a similar
5056 separate file, because it's also needed by Magic (to fix a similar
5051 pickle-related issue in @run).
5057 pickle-related issue in @run).
5052
5058
5053 2003-03-02 Fernando Perez <fperez@colorado.edu>
5059 2003-03-02 Fernando Perez <fperez@colorado.edu>
5054
5060
5055 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5061 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5056 the autocall option at runtime.
5062 the autocall option at runtime.
5057 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5063 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5058 across Magic.py to start separating Magic from InteractiveShell.
5064 across Magic.py to start separating Magic from InteractiveShell.
5059 (Magic._ofind): Fixed to return proper namespace for dotted
5065 (Magic._ofind): Fixed to return proper namespace for dotted
5060 names. Before, a dotted name would always return 'not currently
5066 names. Before, a dotted name would always return 'not currently
5061 defined', because it would find the 'parent'. s.x would be found,
5067 defined', because it would find the 'parent'. s.x would be found,
5062 but since 'x' isn't defined by itself, it would get confused.
5068 but since 'x' isn't defined by itself, it would get confused.
5063 (Magic.magic_run): Fixed pickling problems reported by Ralf
5069 (Magic.magic_run): Fixed pickling problems reported by Ralf
5064 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5070 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5065 that I'd used when Mike Heeter reported similar issues at the
5071 that I'd used when Mike Heeter reported similar issues at the
5066 top-level, but now for @run. It boils down to injecting the
5072 top-level, but now for @run. It boils down to injecting the
5067 namespace where code is being executed with something that looks
5073 namespace where code is being executed with something that looks
5068 enough like a module to fool pickle.dump(). Since a pickle stores
5074 enough like a module to fool pickle.dump(). Since a pickle stores
5069 a named reference to the importing module, we need this for
5075 a named reference to the importing module, we need this for
5070 pickles to save something sensible.
5076 pickles to save something sensible.
5071
5077
5072 * IPython/ipmaker.py (make_IPython): added an autocall option.
5078 * IPython/ipmaker.py (make_IPython): added an autocall option.
5073
5079
5074 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5080 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5075 the auto-eval code. Now autocalling is an option, and the code is
5081 the auto-eval code. Now autocalling is an option, and the code is
5076 also vastly safer. There is no more eval() involved at all.
5082 also vastly safer. There is no more eval() involved at all.
5077
5083
5078 2003-03-01 Fernando Perez <fperez@colorado.edu>
5084 2003-03-01 Fernando Perez <fperez@colorado.edu>
5079
5085
5080 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5086 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5081 dict with named keys instead of a tuple.
5087 dict with named keys instead of a tuple.
5082
5088
5083 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5089 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5084
5090
5085 * setup.py (make_shortcut): Fixed message about directories
5091 * setup.py (make_shortcut): Fixed message about directories
5086 created during Windows installation (the directories were ok, just
5092 created during Windows installation (the directories were ok, just
5087 the printed message was misleading). Thanks to Chris Liechti
5093 the printed message was misleading). Thanks to Chris Liechti
5088 <cliechti-AT-gmx.net> for the heads up.
5094 <cliechti-AT-gmx.net> for the heads up.
5089
5095
5090 2003-02-21 Fernando Perez <fperez@colorado.edu>
5096 2003-02-21 Fernando Perez <fperez@colorado.edu>
5091
5097
5092 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5098 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5093 of ValueError exception when checking for auto-execution. This
5099 of ValueError exception when checking for auto-execution. This
5094 one is raised by things like Numeric arrays arr.flat when the
5100 one is raised by things like Numeric arrays arr.flat when the
5095 array is non-contiguous.
5101 array is non-contiguous.
5096
5102
5097 2003-01-31 Fernando Perez <fperez@colorado.edu>
5103 2003-01-31 Fernando Perez <fperez@colorado.edu>
5098
5104
5099 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5105 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5100 not return any value at all (even though the command would get
5106 not return any value at all (even though the command would get
5101 executed).
5107 executed).
5102 (xsys): Flush stdout right after printing the command to ensure
5108 (xsys): Flush stdout right after printing the command to ensure
5103 proper ordering of commands and command output in the total
5109 proper ordering of commands and command output in the total
5104 output.
5110 output.
5105 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5111 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5106 system/getoutput as defaults. The old ones are kept for
5112 system/getoutput as defaults. The old ones are kept for
5107 compatibility reasons, so no code which uses this library needs
5113 compatibility reasons, so no code which uses this library needs
5108 changing.
5114 changing.
5109
5115
5110 2003-01-27 *** Released version 0.2.14
5116 2003-01-27 *** Released version 0.2.14
5111
5117
5112 2003-01-25 Fernando Perez <fperez@colorado.edu>
5118 2003-01-25 Fernando Perez <fperez@colorado.edu>
5113
5119
5114 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5120 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5115 functions defined in previous edit sessions could not be re-edited
5121 functions defined in previous edit sessions could not be re-edited
5116 (because the temp files were immediately removed). Now temp files
5122 (because the temp files were immediately removed). Now temp files
5117 are removed only at IPython's exit.
5123 are removed only at IPython's exit.
5118 (Magic.magic_run): Improved @run to perform shell-like expansions
5124 (Magic.magic_run): Improved @run to perform shell-like expansions
5119 on its arguments (~users and $VARS). With this, @run becomes more
5125 on its arguments (~users and $VARS). With this, @run becomes more
5120 like a normal command-line.
5126 like a normal command-line.
5121
5127
5122 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5128 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5123 bugs related to embedding and cleaned up that code. A fairly
5129 bugs related to embedding and cleaned up that code. A fairly
5124 important one was the impossibility to access the global namespace
5130 important one was the impossibility to access the global namespace
5125 through the embedded IPython (only local variables were visible).
5131 through the embedded IPython (only local variables were visible).
5126
5132
5127 2003-01-14 Fernando Perez <fperez@colorado.edu>
5133 2003-01-14 Fernando Perez <fperez@colorado.edu>
5128
5134
5129 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5135 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5130 auto-calling to be a bit more conservative. Now it doesn't get
5136 auto-calling to be a bit more conservative. Now it doesn't get
5131 triggered if any of '!=()<>' are in the rest of the input line, to
5137 triggered if any of '!=()<>' are in the rest of the input line, to
5132 allow comparing callables. Thanks to Alex for the heads up.
5138 allow comparing callables. Thanks to Alex for the heads up.
5133
5139
5134 2003-01-07 Fernando Perez <fperez@colorado.edu>
5140 2003-01-07 Fernando Perez <fperez@colorado.edu>
5135
5141
5136 * IPython/genutils.py (page): fixed estimation of the number of
5142 * IPython/genutils.py (page): fixed estimation of the number of
5137 lines in a string to be paged to simply count newlines. This
5143 lines in a string to be paged to simply count newlines. This
5138 prevents over-guessing due to embedded escape sequences. A better
5144 prevents over-guessing due to embedded escape sequences. A better
5139 long-term solution would involve stripping out the control chars
5145 long-term solution would involve stripping out the control chars
5140 for the count, but it's potentially so expensive I just don't
5146 for the count, but it's potentially so expensive I just don't
5141 think it's worth doing.
5147 think it's worth doing.
5142
5148
5143 2002-12-19 *** Released version 0.2.14pre50
5149 2002-12-19 *** Released version 0.2.14pre50
5144
5150
5145 2002-12-19 Fernando Perez <fperez@colorado.edu>
5151 2002-12-19 Fernando Perez <fperez@colorado.edu>
5146
5152
5147 * tools/release (version): Changed release scripts to inform
5153 * tools/release (version): Changed release scripts to inform
5148 Andrea and build a NEWS file with a list of recent changes.
5154 Andrea and build a NEWS file with a list of recent changes.
5149
5155
5150 * IPython/ColorANSI.py (__all__): changed terminal detection
5156 * IPython/ColorANSI.py (__all__): changed terminal detection
5151 code. Seems to work better for xterms without breaking
5157 code. Seems to work better for xterms without breaking
5152 konsole. Will need more testing to determine if WinXP and Mac OSX
5158 konsole. Will need more testing to determine if WinXP and Mac OSX
5153 also work ok.
5159 also work ok.
5154
5160
5155 2002-12-18 *** Released version 0.2.14pre49
5161 2002-12-18 *** Released version 0.2.14pre49
5156
5162
5157 2002-12-18 Fernando Perez <fperez@colorado.edu>
5163 2002-12-18 Fernando Perez <fperez@colorado.edu>
5158
5164
5159 * Docs: added new info about Mac OSX, from Andrea.
5165 * Docs: added new info about Mac OSX, from Andrea.
5160
5166
5161 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5167 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5162 allow direct plotting of python strings whose format is the same
5168 allow direct plotting of python strings whose format is the same
5163 of gnuplot data files.
5169 of gnuplot data files.
5164
5170
5165 2002-12-16 Fernando Perez <fperez@colorado.edu>
5171 2002-12-16 Fernando Perez <fperez@colorado.edu>
5166
5172
5167 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5173 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5168 value of exit question to be acknowledged.
5174 value of exit question to be acknowledged.
5169
5175
5170 2002-12-03 Fernando Perez <fperez@colorado.edu>
5176 2002-12-03 Fernando Perez <fperez@colorado.edu>
5171
5177
5172 * IPython/ipmaker.py: removed generators, which had been added
5178 * IPython/ipmaker.py: removed generators, which had been added
5173 by mistake in an earlier debugging run. This was causing trouble
5179 by mistake in an earlier debugging run. This was causing trouble
5174 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5180 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5175 for pointing this out.
5181 for pointing this out.
5176
5182
5177 2002-11-17 Fernando Perez <fperez@colorado.edu>
5183 2002-11-17 Fernando Perez <fperez@colorado.edu>
5178
5184
5179 * Manual: updated the Gnuplot section.
5185 * Manual: updated the Gnuplot section.
5180
5186
5181 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5187 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5182 a much better split of what goes in Runtime and what goes in
5188 a much better split of what goes in Runtime and what goes in
5183 Interactive.
5189 Interactive.
5184
5190
5185 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5191 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5186 being imported from iplib.
5192 being imported from iplib.
5187
5193
5188 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5194 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5189 for command-passing. Now the global Gnuplot instance is called
5195 for command-passing. Now the global Gnuplot instance is called
5190 'gp' instead of 'g', which was really a far too fragile and
5196 'gp' instead of 'g', which was really a far too fragile and
5191 common name.
5197 common name.
5192
5198
5193 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5199 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5194 bounding boxes generated by Gnuplot for square plots.
5200 bounding boxes generated by Gnuplot for square plots.
5195
5201
5196 * IPython/genutils.py (popkey): new function added. I should
5202 * IPython/genutils.py (popkey): new function added. I should
5197 suggest this on c.l.py as a dict method, it seems useful.
5203 suggest this on c.l.py as a dict method, it seems useful.
5198
5204
5199 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5205 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5200 to transparently handle PostScript generation. MUCH better than
5206 to transparently handle PostScript generation. MUCH better than
5201 the previous plot_eps/replot_eps (which I removed now). The code
5207 the previous plot_eps/replot_eps (which I removed now). The code
5202 is also fairly clean and well documented now (including
5208 is also fairly clean and well documented now (including
5203 docstrings).
5209 docstrings).
5204
5210
5205 2002-11-13 Fernando Perez <fperez@colorado.edu>
5211 2002-11-13 Fernando Perez <fperez@colorado.edu>
5206
5212
5207 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5213 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5208 (inconsistent with options).
5214 (inconsistent with options).
5209
5215
5210 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5216 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5211 manually disabled, I don't know why. Fixed it.
5217 manually disabled, I don't know why. Fixed it.
5212 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5218 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5213 eps output.
5219 eps output.
5214
5220
5215 2002-11-12 Fernando Perez <fperez@colorado.edu>
5221 2002-11-12 Fernando Perez <fperez@colorado.edu>
5216
5222
5217 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5223 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5218 don't propagate up to caller. Fixes crash reported by François
5224 don't propagate up to caller. Fixes crash reported by François
5219 Pinard.
5225 Pinard.
5220
5226
5221 2002-11-09 Fernando Perez <fperez@colorado.edu>
5227 2002-11-09 Fernando Perez <fperez@colorado.edu>
5222
5228
5223 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5229 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5224 history file for new users.
5230 history file for new users.
5225 (make_IPython): fixed bug where initial install would leave the
5231 (make_IPython): fixed bug where initial install would leave the
5226 user running in the .ipython dir.
5232 user running in the .ipython dir.
5227 (make_IPython): fixed bug where config dir .ipython would be
5233 (make_IPython): fixed bug where config dir .ipython would be
5228 created regardless of the given -ipythondir option. Thanks to Cory
5234 created regardless of the given -ipythondir option. Thanks to Cory
5229 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5235 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5230
5236
5231 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5237 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5232 type confirmations. Will need to use it in all of IPython's code
5238 type confirmations. Will need to use it in all of IPython's code
5233 consistently.
5239 consistently.
5234
5240
5235 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5241 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5236 context to print 31 lines instead of the default 5. This will make
5242 context to print 31 lines instead of the default 5. This will make
5237 the crash reports extremely detailed in case the problem is in
5243 the crash reports extremely detailed in case the problem is in
5238 libraries I don't have access to.
5244 libraries I don't have access to.
5239
5245
5240 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5246 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5241 line of defense' code to still crash, but giving users fair
5247 line of defense' code to still crash, but giving users fair
5242 warning. I don't want internal errors to go unreported: if there's
5248 warning. I don't want internal errors to go unreported: if there's
5243 an internal problem, IPython should crash and generate a full
5249 an internal problem, IPython should crash and generate a full
5244 report.
5250 report.
5245
5251
5246 2002-11-08 Fernando Perez <fperez@colorado.edu>
5252 2002-11-08 Fernando Perez <fperez@colorado.edu>
5247
5253
5248 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5254 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5249 otherwise uncaught exceptions which can appear if people set
5255 otherwise uncaught exceptions which can appear if people set
5250 sys.stdout to something badly broken. Thanks to a crash report
5256 sys.stdout to something badly broken. Thanks to a crash report
5251 from henni-AT-mail.brainbot.com.
5257 from henni-AT-mail.brainbot.com.
5252
5258
5253 2002-11-04 Fernando Perez <fperez@colorado.edu>
5259 2002-11-04 Fernando Perez <fperez@colorado.edu>
5254
5260
5255 * IPython/iplib.py (InteractiveShell.interact): added
5261 * IPython/iplib.py (InteractiveShell.interact): added
5256 __IPYTHON__active to the builtins. It's a flag which goes on when
5262 __IPYTHON__active to the builtins. It's a flag which goes on when
5257 the interaction starts and goes off again when it stops. This
5263 the interaction starts and goes off again when it stops. This
5258 allows embedding code to detect being inside IPython. Before this
5264 allows embedding code to detect being inside IPython. Before this
5259 was done via __IPYTHON__, but that only shows that an IPython
5265 was done via __IPYTHON__, but that only shows that an IPython
5260 instance has been created.
5266 instance has been created.
5261
5267
5262 * IPython/Magic.py (Magic.magic_env): I realized that in a
5268 * IPython/Magic.py (Magic.magic_env): I realized that in a
5263 UserDict, instance.data holds the data as a normal dict. So I
5269 UserDict, instance.data holds the data as a normal dict. So I
5264 modified @env to return os.environ.data instead of rebuilding a
5270 modified @env to return os.environ.data instead of rebuilding a
5265 dict by hand.
5271 dict by hand.
5266
5272
5267 2002-11-02 Fernando Perez <fperez@colorado.edu>
5273 2002-11-02 Fernando Perez <fperez@colorado.edu>
5268
5274
5269 * IPython/genutils.py (warn): changed so that level 1 prints no
5275 * IPython/genutils.py (warn): changed so that level 1 prints no
5270 header. Level 2 is now the default (with 'WARNING' header, as
5276 header. Level 2 is now the default (with 'WARNING' header, as
5271 before). I think I tracked all places where changes were needed in
5277 before). I think I tracked all places where changes were needed in
5272 IPython, but outside code using the old level numbering may have
5278 IPython, but outside code using the old level numbering may have
5273 broken.
5279 broken.
5274
5280
5275 * IPython/iplib.py (InteractiveShell.runcode): added this to
5281 * IPython/iplib.py (InteractiveShell.runcode): added this to
5276 handle the tracebacks in SystemExit traps correctly. The previous
5282 handle the tracebacks in SystemExit traps correctly. The previous
5277 code (through interact) was printing more of the stack than
5283 code (through interact) was printing more of the stack than
5278 necessary, showing IPython internal code to the user.
5284 necessary, showing IPython internal code to the user.
5279
5285
5280 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5286 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5281 default. Now that the default at the confirmation prompt is yes,
5287 default. Now that the default at the confirmation prompt is yes,
5282 it's not so intrusive. François' argument that ipython sessions
5288 it's not so intrusive. François' argument that ipython sessions
5283 tend to be complex enough not to lose them from an accidental C-d,
5289 tend to be complex enough not to lose them from an accidental C-d,
5284 is a valid one.
5290 is a valid one.
5285
5291
5286 * IPython/iplib.py (InteractiveShell.interact): added a
5292 * IPython/iplib.py (InteractiveShell.interact): added a
5287 showtraceback() call to the SystemExit trap, and modified the exit
5293 showtraceback() call to the SystemExit trap, and modified the exit
5288 confirmation to have yes as the default.
5294 confirmation to have yes as the default.
5289
5295
5290 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5296 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5291 this file. It's been gone from the code for a long time, this was
5297 this file. It's been gone from the code for a long time, this was
5292 simply leftover junk.
5298 simply leftover junk.
5293
5299
5294 2002-11-01 Fernando Perez <fperez@colorado.edu>
5300 2002-11-01 Fernando Perez <fperez@colorado.edu>
5295
5301
5296 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5302 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5297 added. If set, IPython now traps EOF and asks for
5303 added. If set, IPython now traps EOF and asks for
5298 confirmation. After a request by François Pinard.
5304 confirmation. After a request by François Pinard.
5299
5305
5300 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5306 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5301 of @abort, and with a new (better) mechanism for handling the
5307 of @abort, and with a new (better) mechanism for handling the
5302 exceptions.
5308 exceptions.
5303
5309
5304 2002-10-27 Fernando Perez <fperez@colorado.edu>
5310 2002-10-27 Fernando Perez <fperez@colorado.edu>
5305
5311
5306 * IPython/usage.py (__doc__): updated the --help information and
5312 * IPython/usage.py (__doc__): updated the --help information and
5307 the ipythonrc file to indicate that -log generates
5313 the ipythonrc file to indicate that -log generates
5308 ./ipython.log. Also fixed the corresponding info in @logstart.
5314 ./ipython.log. Also fixed the corresponding info in @logstart.
5309 This and several other fixes in the manuals thanks to reports by
5315 This and several other fixes in the manuals thanks to reports by
5310 François Pinard <pinard-AT-iro.umontreal.ca>.
5316 François Pinard <pinard-AT-iro.umontreal.ca>.
5311
5317
5312 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5318 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5313 refer to @logstart (instead of @log, which doesn't exist).
5319 refer to @logstart (instead of @log, which doesn't exist).
5314
5320
5315 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5321 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5316 AttributeError crash. Thanks to Christopher Armstrong
5322 AttributeError crash. Thanks to Christopher Armstrong
5317 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5323 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5318 introduced recently (in 0.2.14pre37) with the fix to the eval
5324 introduced recently (in 0.2.14pre37) with the fix to the eval
5319 problem mentioned below.
5325 problem mentioned below.
5320
5326
5321 2002-10-17 Fernando Perez <fperez@colorado.edu>
5327 2002-10-17 Fernando Perez <fperez@colorado.edu>
5322
5328
5323 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5329 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5324 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5330 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5325
5331
5326 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5332 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5327 this function to fix a problem reported by Alex Schmolck. He saw
5333 this function to fix a problem reported by Alex Schmolck. He saw
5328 it with list comprehensions and generators, which were getting
5334 it with list comprehensions and generators, which were getting
5329 called twice. The real problem was an 'eval' call in testing for
5335 called twice. The real problem was an 'eval' call in testing for
5330 automagic which was evaluating the input line silently.
5336 automagic which was evaluating the input line silently.
5331
5337
5332 This is a potentially very nasty bug, if the input has side
5338 This is a potentially very nasty bug, if the input has side
5333 effects which must not be repeated. The code is much cleaner now,
5339 effects which must not be repeated. The code is much cleaner now,
5334 without any blanket 'except' left and with a regexp test for
5340 without any blanket 'except' left and with a regexp test for
5335 actual function names.
5341 actual function names.
5336
5342
5337 But an eval remains, which I'm not fully comfortable with. I just
5343 But an eval remains, which I'm not fully comfortable with. I just
5338 don't know how to find out if an expression could be a callable in
5344 don't know how to find out if an expression could be a callable in
5339 the user's namespace without doing an eval on the string. However
5345 the user's namespace without doing an eval on the string. However
5340 that string is now much more strictly checked so that no code
5346 that string is now much more strictly checked so that no code
5341 slips by, so the eval should only happen for things that can
5347 slips by, so the eval should only happen for things that can
5342 really be only function/method names.
5348 really be only function/method names.
5343
5349
5344 2002-10-15 Fernando Perez <fperez@colorado.edu>
5350 2002-10-15 Fernando Perez <fperez@colorado.edu>
5345
5351
5346 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5352 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5347 OSX information to main manual, removed README_Mac_OSX file from
5353 OSX information to main manual, removed README_Mac_OSX file from
5348 distribution. Also updated credits for recent additions.
5354 distribution. Also updated credits for recent additions.
5349
5355
5350 2002-10-10 Fernando Perez <fperez@colorado.edu>
5356 2002-10-10 Fernando Perez <fperez@colorado.edu>
5351
5357
5352 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5358 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5353 terminal-related issues. Many thanks to Andrea Riciputi
5359 terminal-related issues. Many thanks to Andrea Riciputi
5354 <andrea.riciputi-AT-libero.it> for writing it.
5360 <andrea.riciputi-AT-libero.it> for writing it.
5355
5361
5356 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5362 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5357 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5363 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5358
5364
5359 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5365 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5360 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5366 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5361 <syver-en-AT-online.no> who both submitted patches for this problem.
5367 <syver-en-AT-online.no> who both submitted patches for this problem.
5362
5368
5363 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5369 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5364 global embedding to make sure that things don't overwrite user
5370 global embedding to make sure that things don't overwrite user
5365 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5371 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5366
5372
5367 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5373 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5368 compatibility. Thanks to Hayden Callow
5374 compatibility. Thanks to Hayden Callow
5369 <h.callow-AT-elec.canterbury.ac.nz>
5375 <h.callow-AT-elec.canterbury.ac.nz>
5370
5376
5371 2002-10-04 Fernando Perez <fperez@colorado.edu>
5377 2002-10-04 Fernando Perez <fperez@colorado.edu>
5372
5378
5373 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5379 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5374 Gnuplot.File objects.
5380 Gnuplot.File objects.
5375
5381
5376 2002-07-23 Fernando Perez <fperez@colorado.edu>
5382 2002-07-23 Fernando Perez <fperez@colorado.edu>
5377
5383
5378 * IPython/genutils.py (timing): Added timings() and timing() for
5384 * IPython/genutils.py (timing): Added timings() and timing() for
5379 quick access to the most commonly needed data, the execution
5385 quick access to the most commonly needed data, the execution
5380 times. Old timing() renamed to timings_out().
5386 times. Old timing() renamed to timings_out().
5381
5387
5382 2002-07-18 Fernando Perez <fperez@colorado.edu>
5388 2002-07-18 Fernando Perez <fperez@colorado.edu>
5383
5389
5384 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5390 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5385 bug with nested instances disrupting the parent's tab completion.
5391 bug with nested instances disrupting the parent's tab completion.
5386
5392
5387 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5393 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5388 all_completions code to begin the emacs integration.
5394 all_completions code to begin the emacs integration.
5389
5395
5390 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5396 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5391 argument to allow titling individual arrays when plotting.
5397 argument to allow titling individual arrays when plotting.
5392
5398
5393 2002-07-15 Fernando Perez <fperez@colorado.edu>
5399 2002-07-15 Fernando Perez <fperez@colorado.edu>
5394
5400
5395 * setup.py (make_shortcut): changed to retrieve the value of
5401 * setup.py (make_shortcut): changed to retrieve the value of
5396 'Program Files' directory from the registry (this value changes in
5402 'Program Files' directory from the registry (this value changes in
5397 non-english versions of Windows). Thanks to Thomas Fanslau
5403 non-english versions of Windows). Thanks to Thomas Fanslau
5398 <tfanslau-AT-gmx.de> for the report.
5404 <tfanslau-AT-gmx.de> for the report.
5399
5405
5400 2002-07-10 Fernando Perez <fperez@colorado.edu>
5406 2002-07-10 Fernando Perez <fperez@colorado.edu>
5401
5407
5402 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5408 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5403 a bug in pdb, which crashes if a line with only whitespace is
5409 a bug in pdb, which crashes if a line with only whitespace is
5404 entered. Bug report submitted to sourceforge.
5410 entered. Bug report submitted to sourceforge.
5405
5411
5406 2002-07-09 Fernando Perez <fperez@colorado.edu>
5412 2002-07-09 Fernando Perez <fperez@colorado.edu>
5407
5413
5408 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5414 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5409 reporting exceptions (it's a bug in inspect.py, I just set a
5415 reporting exceptions (it's a bug in inspect.py, I just set a
5410 workaround).
5416 workaround).
5411
5417
5412 2002-07-08 Fernando Perez <fperez@colorado.edu>
5418 2002-07-08 Fernando Perez <fperez@colorado.edu>
5413
5419
5414 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5420 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5415 __IPYTHON__ in __builtins__ to show up in user_ns.
5421 __IPYTHON__ in __builtins__ to show up in user_ns.
5416
5422
5417 2002-07-03 Fernando Perez <fperez@colorado.edu>
5423 2002-07-03 Fernando Perez <fperez@colorado.edu>
5418
5424
5419 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5425 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5420 name from @gp_set_instance to @gp_set_default.
5426 name from @gp_set_instance to @gp_set_default.
5421
5427
5422 * IPython/ipmaker.py (make_IPython): default editor value set to
5428 * IPython/ipmaker.py (make_IPython): default editor value set to
5423 '0' (a string), to match the rc file. Otherwise will crash when
5429 '0' (a string), to match the rc file. Otherwise will crash when
5424 .strip() is called on it.
5430 .strip() is called on it.
5425
5431
5426
5432
5427 2002-06-28 Fernando Perez <fperez@colorado.edu>
5433 2002-06-28 Fernando Perez <fperez@colorado.edu>
5428
5434
5429 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5435 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5430 of files in current directory when a file is executed via
5436 of files in current directory when a file is executed via
5431 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5437 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5432
5438
5433 * setup.py (manfiles): fix for rpm builds, submitted by RA
5439 * setup.py (manfiles): fix for rpm builds, submitted by RA
5434 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5440 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5435
5441
5436 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5442 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5437 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5443 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5438 string!). A. Schmolck caught this one.
5444 string!). A. Schmolck caught this one.
5439
5445
5440 2002-06-27 Fernando Perez <fperez@colorado.edu>
5446 2002-06-27 Fernando Perez <fperez@colorado.edu>
5441
5447
5442 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5448 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5443 defined files at the cmd line. __name__ wasn't being set to
5449 defined files at the cmd line. __name__ wasn't being set to
5444 __main__.
5450 __main__.
5445
5451
5446 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5452 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5447 regular lists and tuples besides Numeric arrays.
5453 regular lists and tuples besides Numeric arrays.
5448
5454
5449 * IPython/Prompts.py (CachedOutput.__call__): Added output
5455 * IPython/Prompts.py (CachedOutput.__call__): Added output
5450 supression for input ending with ';'. Similar to Mathematica and
5456 supression for input ending with ';'. Similar to Mathematica and
5451 Matlab. The _* vars and Out[] list are still updated, just like
5457 Matlab. The _* vars and Out[] list are still updated, just like
5452 Mathematica behaves.
5458 Mathematica behaves.
5453
5459
5454 2002-06-25 Fernando Perez <fperez@colorado.edu>
5460 2002-06-25 Fernando Perez <fperez@colorado.edu>
5455
5461
5456 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5462 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5457 .ini extensions for profiels under Windows.
5463 .ini extensions for profiels under Windows.
5458
5464
5459 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5465 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5460 string form. Fix contributed by Alexander Schmolck
5466 string form. Fix contributed by Alexander Schmolck
5461 <a.schmolck-AT-gmx.net>
5467 <a.schmolck-AT-gmx.net>
5462
5468
5463 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5469 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5464 pre-configured Gnuplot instance.
5470 pre-configured Gnuplot instance.
5465
5471
5466 2002-06-21 Fernando Perez <fperez@colorado.edu>
5472 2002-06-21 Fernando Perez <fperez@colorado.edu>
5467
5473
5468 * IPython/numutils.py (exp_safe): new function, works around the
5474 * IPython/numutils.py (exp_safe): new function, works around the
5469 underflow problems in Numeric.
5475 underflow problems in Numeric.
5470 (log2): New fn. Safe log in base 2: returns exact integer answer
5476 (log2): New fn. Safe log in base 2: returns exact integer answer
5471 for exact integer powers of 2.
5477 for exact integer powers of 2.
5472
5478
5473 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5479 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5474 properly.
5480 properly.
5475
5481
5476 2002-06-20 Fernando Perez <fperez@colorado.edu>
5482 2002-06-20 Fernando Perez <fperez@colorado.edu>
5477
5483
5478 * IPython/genutils.py (timing): new function like
5484 * IPython/genutils.py (timing): new function like
5479 Mathematica's. Similar to time_test, but returns more info.
5485 Mathematica's. Similar to time_test, but returns more info.
5480
5486
5481 2002-06-18 Fernando Perez <fperez@colorado.edu>
5487 2002-06-18 Fernando Perez <fperez@colorado.edu>
5482
5488
5483 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5489 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5484 according to Mike Heeter's suggestions.
5490 according to Mike Heeter's suggestions.
5485
5491
5486 2002-06-16 Fernando Perez <fperez@colorado.edu>
5492 2002-06-16 Fernando Perez <fperez@colorado.edu>
5487
5493
5488 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5494 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5489 system. GnuplotMagic is gone as a user-directory option. New files
5495 system. GnuplotMagic is gone as a user-directory option. New files
5490 make it easier to use all the gnuplot stuff both from external
5496 make it easier to use all the gnuplot stuff both from external
5491 programs as well as from IPython. Had to rewrite part of
5497 programs as well as from IPython. Had to rewrite part of
5492 hardcopy() b/c of a strange bug: often the ps files simply don't
5498 hardcopy() b/c of a strange bug: often the ps files simply don't
5493 get created, and require a repeat of the command (often several
5499 get created, and require a repeat of the command (often several
5494 times).
5500 times).
5495
5501
5496 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5502 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5497 resolve output channel at call time, so that if sys.stderr has
5503 resolve output channel at call time, so that if sys.stderr has
5498 been redirected by user this gets honored.
5504 been redirected by user this gets honored.
5499
5505
5500 2002-06-13 Fernando Perez <fperez@colorado.edu>
5506 2002-06-13 Fernando Perez <fperez@colorado.edu>
5501
5507
5502 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5508 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5503 IPShell. Kept a copy with the old names to avoid breaking people's
5509 IPShell. Kept a copy with the old names to avoid breaking people's
5504 embedded code.
5510 embedded code.
5505
5511
5506 * IPython/ipython: simplified it to the bare minimum after
5512 * IPython/ipython: simplified it to the bare minimum after
5507 Holger's suggestions. Added info about how to use it in
5513 Holger's suggestions. Added info about how to use it in
5508 PYTHONSTARTUP.
5514 PYTHONSTARTUP.
5509
5515
5510 * IPython/Shell.py (IPythonShell): changed the options passing
5516 * IPython/Shell.py (IPythonShell): changed the options passing
5511 from a string with funky %s replacements to a straight list. Maybe
5517 from a string with funky %s replacements to a straight list. Maybe
5512 a bit more typing, but it follows sys.argv conventions, so there's
5518 a bit more typing, but it follows sys.argv conventions, so there's
5513 less special-casing to remember.
5519 less special-casing to remember.
5514
5520
5515 2002-06-12 Fernando Perez <fperez@colorado.edu>
5521 2002-06-12 Fernando Perez <fperez@colorado.edu>
5516
5522
5517 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5523 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5518 command. Thanks to a suggestion by Mike Heeter.
5524 command. Thanks to a suggestion by Mike Heeter.
5519 (Magic.magic_pfile): added behavior to look at filenames if given
5525 (Magic.magic_pfile): added behavior to look at filenames if given
5520 arg is not a defined object.
5526 arg is not a defined object.
5521 (Magic.magic_save): New @save function to save code snippets. Also
5527 (Magic.magic_save): New @save function to save code snippets. Also
5522 a Mike Heeter idea.
5528 a Mike Heeter idea.
5523
5529
5524 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5530 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5525 plot() and replot(). Much more convenient now, especially for
5531 plot() and replot(). Much more convenient now, especially for
5526 interactive use.
5532 interactive use.
5527
5533
5528 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5534 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5529 filenames.
5535 filenames.
5530
5536
5531 2002-06-02 Fernando Perez <fperez@colorado.edu>
5537 2002-06-02 Fernando Perez <fperez@colorado.edu>
5532
5538
5533 * IPython/Struct.py (Struct.__init__): modified to admit
5539 * IPython/Struct.py (Struct.__init__): modified to admit
5534 initialization via another struct.
5540 initialization via another struct.
5535
5541
5536 * IPython/genutils.py (SystemExec.__init__): New stateful
5542 * IPython/genutils.py (SystemExec.__init__): New stateful
5537 interface to xsys and bq. Useful for writing system scripts.
5543 interface to xsys and bq. Useful for writing system scripts.
5538
5544
5539 2002-05-30 Fernando Perez <fperez@colorado.edu>
5545 2002-05-30 Fernando Perez <fperez@colorado.edu>
5540
5546
5541 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5547 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5542 documents. This will make the user download smaller (it's getting
5548 documents. This will make the user download smaller (it's getting
5543 too big).
5549 too big).
5544
5550
5545 2002-05-29 Fernando Perez <fperez@colorado.edu>
5551 2002-05-29 Fernando Perez <fperez@colorado.edu>
5546
5552
5547 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5553 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5548 fix problems with shelve and pickle. Seems to work, but I don't
5554 fix problems with shelve and pickle. Seems to work, but I don't
5549 know if corner cases break it. Thanks to Mike Heeter
5555 know if corner cases break it. Thanks to Mike Heeter
5550 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5556 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5551
5557
5552 2002-05-24 Fernando Perez <fperez@colorado.edu>
5558 2002-05-24 Fernando Perez <fperez@colorado.edu>
5553
5559
5554 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5560 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5555 macros having broken.
5561 macros having broken.
5556
5562
5557 2002-05-21 Fernando Perez <fperez@colorado.edu>
5563 2002-05-21 Fernando Perez <fperez@colorado.edu>
5558
5564
5559 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5565 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5560 introduced logging bug: all history before logging started was
5566 introduced logging bug: all history before logging started was
5561 being written one character per line! This came from the redesign
5567 being written one character per line! This came from the redesign
5562 of the input history as a special list which slices to strings,
5568 of the input history as a special list which slices to strings,
5563 not to lists.
5569 not to lists.
5564
5570
5565 2002-05-20 Fernando Perez <fperez@colorado.edu>
5571 2002-05-20 Fernando Perez <fperez@colorado.edu>
5566
5572
5567 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5573 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5568 be an attribute of all classes in this module. The design of these
5574 be an attribute of all classes in this module. The design of these
5569 classes needs some serious overhauling.
5575 classes needs some serious overhauling.
5570
5576
5571 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5577 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5572 which was ignoring '_' in option names.
5578 which was ignoring '_' in option names.
5573
5579
5574 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5580 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5575 'Verbose_novars' to 'Context' and made it the new default. It's a
5581 'Verbose_novars' to 'Context' and made it the new default. It's a
5576 bit more readable and also safer than verbose.
5582 bit more readable and also safer than verbose.
5577
5583
5578 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5584 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5579 triple-quoted strings.
5585 triple-quoted strings.
5580
5586
5581 * IPython/OInspect.py (__all__): new module exposing the object
5587 * IPython/OInspect.py (__all__): new module exposing the object
5582 introspection facilities. Now the corresponding magics are dummy
5588 introspection facilities. Now the corresponding magics are dummy
5583 wrappers around this. Having this module will make it much easier
5589 wrappers around this. Having this module will make it much easier
5584 to put these functions into our modified pdb.
5590 to put these functions into our modified pdb.
5585 This new object inspector system uses the new colorizing module,
5591 This new object inspector system uses the new colorizing module,
5586 so source code and other things are nicely syntax highlighted.
5592 so source code and other things are nicely syntax highlighted.
5587
5593
5588 2002-05-18 Fernando Perez <fperez@colorado.edu>
5594 2002-05-18 Fernando Perez <fperez@colorado.edu>
5589
5595
5590 * IPython/ColorANSI.py: Split the coloring tools into a separate
5596 * IPython/ColorANSI.py: Split the coloring tools into a separate
5591 module so I can use them in other code easier (they were part of
5597 module so I can use them in other code easier (they were part of
5592 ultraTB).
5598 ultraTB).
5593
5599
5594 2002-05-17 Fernando Perez <fperez@colorado.edu>
5600 2002-05-17 Fernando Perez <fperez@colorado.edu>
5595
5601
5596 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5602 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5597 fixed it to set the global 'g' also to the called instance, as
5603 fixed it to set the global 'g' also to the called instance, as
5598 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5604 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5599 user's 'g' variables).
5605 user's 'g' variables).
5600
5606
5601 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5607 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5602 global variables (aliases to _ih,_oh) so that users which expect
5608 global variables (aliases to _ih,_oh) so that users which expect
5603 In[5] or Out[7] to work aren't unpleasantly surprised.
5609 In[5] or Out[7] to work aren't unpleasantly surprised.
5604 (InputList.__getslice__): new class to allow executing slices of
5610 (InputList.__getslice__): new class to allow executing slices of
5605 input history directly. Very simple class, complements the use of
5611 input history directly. Very simple class, complements the use of
5606 macros.
5612 macros.
5607
5613
5608 2002-05-16 Fernando Perez <fperez@colorado.edu>
5614 2002-05-16 Fernando Perez <fperez@colorado.edu>
5609
5615
5610 * setup.py (docdirbase): make doc directory be just doc/IPython
5616 * setup.py (docdirbase): make doc directory be just doc/IPython
5611 without version numbers, it will reduce clutter for users.
5617 without version numbers, it will reduce clutter for users.
5612
5618
5613 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5619 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5614 execfile call to prevent possible memory leak. See for details:
5620 execfile call to prevent possible memory leak. See for details:
5615 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5621 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5616
5622
5617 2002-05-15 Fernando Perez <fperez@colorado.edu>
5623 2002-05-15 Fernando Perez <fperez@colorado.edu>
5618
5624
5619 * IPython/Magic.py (Magic.magic_psource): made the object
5625 * IPython/Magic.py (Magic.magic_psource): made the object
5620 introspection names be more standard: pdoc, pdef, pfile and
5626 introspection names be more standard: pdoc, pdef, pfile and
5621 psource. They all print/page their output, and it makes
5627 psource. They all print/page their output, and it makes
5622 remembering them easier. Kept old names for compatibility as
5628 remembering them easier. Kept old names for compatibility as
5623 aliases.
5629 aliases.
5624
5630
5625 2002-05-14 Fernando Perez <fperez@colorado.edu>
5631 2002-05-14 Fernando Perez <fperez@colorado.edu>
5626
5632
5627 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5633 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5628 what the mouse problem was. The trick is to use gnuplot with temp
5634 what the mouse problem was. The trick is to use gnuplot with temp
5629 files and NOT with pipes (for data communication), because having
5635 files and NOT with pipes (for data communication), because having
5630 both pipes and the mouse on is bad news.
5636 both pipes and the mouse on is bad news.
5631
5637
5632 2002-05-13 Fernando Perez <fperez@colorado.edu>
5638 2002-05-13 Fernando Perez <fperez@colorado.edu>
5633
5639
5634 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5640 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5635 bug. Information would be reported about builtins even when
5641 bug. Information would be reported about builtins even when
5636 user-defined functions overrode them.
5642 user-defined functions overrode them.
5637
5643
5638 2002-05-11 Fernando Perez <fperez@colorado.edu>
5644 2002-05-11 Fernando Perez <fperez@colorado.edu>
5639
5645
5640 * IPython/__init__.py (__all__): removed FlexCompleter from
5646 * IPython/__init__.py (__all__): removed FlexCompleter from
5641 __all__ so that things don't fail in platforms without readline.
5647 __all__ so that things don't fail in platforms without readline.
5642
5648
5643 2002-05-10 Fernando Perez <fperez@colorado.edu>
5649 2002-05-10 Fernando Perez <fperez@colorado.edu>
5644
5650
5645 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5651 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5646 it requires Numeric, effectively making Numeric a dependency for
5652 it requires Numeric, effectively making Numeric a dependency for
5647 IPython.
5653 IPython.
5648
5654
5649 * Released 0.2.13
5655 * Released 0.2.13
5650
5656
5651 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5657 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5652 profiler interface. Now all the major options from the profiler
5658 profiler interface. Now all the major options from the profiler
5653 module are directly supported in IPython, both for single
5659 module are directly supported in IPython, both for single
5654 expressions (@prun) and for full programs (@run -p).
5660 expressions (@prun) and for full programs (@run -p).
5655
5661
5656 2002-05-09 Fernando Perez <fperez@colorado.edu>
5662 2002-05-09 Fernando Perez <fperez@colorado.edu>
5657
5663
5658 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5664 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5659 magic properly formatted for screen.
5665 magic properly formatted for screen.
5660
5666
5661 * setup.py (make_shortcut): Changed things to put pdf version in
5667 * setup.py (make_shortcut): Changed things to put pdf version in
5662 doc/ instead of doc/manual (had to change lyxport a bit).
5668 doc/ instead of doc/manual (had to change lyxport a bit).
5663
5669
5664 * IPython/Magic.py (Profile.string_stats): made profile runs go
5670 * IPython/Magic.py (Profile.string_stats): made profile runs go
5665 through pager (they are long and a pager allows searching, saving,
5671 through pager (they are long and a pager allows searching, saving,
5666 etc.)
5672 etc.)
5667
5673
5668 2002-05-08 Fernando Perez <fperez@colorado.edu>
5674 2002-05-08 Fernando Perez <fperez@colorado.edu>
5669
5675
5670 * Released 0.2.12
5676 * Released 0.2.12
5671
5677
5672 2002-05-06 Fernando Perez <fperez@colorado.edu>
5678 2002-05-06 Fernando Perez <fperez@colorado.edu>
5673
5679
5674 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5680 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5675 introduced); 'hist n1 n2' was broken.
5681 introduced); 'hist n1 n2' was broken.
5676 (Magic.magic_pdb): added optional on/off arguments to @pdb
5682 (Magic.magic_pdb): added optional on/off arguments to @pdb
5677 (Magic.magic_run): added option -i to @run, which executes code in
5683 (Magic.magic_run): added option -i to @run, which executes code in
5678 the IPython namespace instead of a clean one. Also added @irun as
5684 the IPython namespace instead of a clean one. Also added @irun as
5679 an alias to @run -i.
5685 an alias to @run -i.
5680
5686
5681 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5687 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5682 fixed (it didn't really do anything, the namespaces were wrong).
5688 fixed (it didn't really do anything, the namespaces were wrong).
5683
5689
5684 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5690 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5685
5691
5686 * IPython/__init__.py (__all__): Fixed package namespace, now
5692 * IPython/__init__.py (__all__): Fixed package namespace, now
5687 'import IPython' does give access to IPython.<all> as
5693 'import IPython' does give access to IPython.<all> as
5688 expected. Also renamed __release__ to Release.
5694 expected. Also renamed __release__ to Release.
5689
5695
5690 * IPython/Debugger.py (__license__): created new Pdb class which
5696 * IPython/Debugger.py (__license__): created new Pdb class which
5691 functions like a drop-in for the normal pdb.Pdb but does NOT
5697 functions like a drop-in for the normal pdb.Pdb but does NOT
5692 import readline by default. This way it doesn't muck up IPython's
5698 import readline by default. This way it doesn't muck up IPython's
5693 readline handling, and now tab-completion finally works in the
5699 readline handling, and now tab-completion finally works in the
5694 debugger -- sort of. It completes things globally visible, but the
5700 debugger -- sort of. It completes things globally visible, but the
5695 completer doesn't track the stack as pdb walks it. That's a bit
5701 completer doesn't track the stack as pdb walks it. That's a bit
5696 tricky, and I'll have to implement it later.
5702 tricky, and I'll have to implement it later.
5697
5703
5698 2002-05-05 Fernando Perez <fperez@colorado.edu>
5704 2002-05-05 Fernando Perez <fperez@colorado.edu>
5699
5705
5700 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5706 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5701 magic docstrings when printed via ? (explicit \'s were being
5707 magic docstrings when printed via ? (explicit \'s were being
5702 printed).
5708 printed).
5703
5709
5704 * IPython/ipmaker.py (make_IPython): fixed namespace
5710 * IPython/ipmaker.py (make_IPython): fixed namespace
5705 identification bug. Now variables loaded via logs or command-line
5711 identification bug. Now variables loaded via logs or command-line
5706 files are recognized in the interactive namespace by @who.
5712 files are recognized in the interactive namespace by @who.
5707
5713
5708 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5714 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5709 log replay system stemming from the string form of Structs.
5715 log replay system stemming from the string form of Structs.
5710
5716
5711 * IPython/Magic.py (Macro.__init__): improved macros to properly
5717 * IPython/Magic.py (Macro.__init__): improved macros to properly
5712 handle magic commands in them.
5718 handle magic commands in them.
5713 (Magic.magic_logstart): usernames are now expanded so 'logstart
5719 (Magic.magic_logstart): usernames are now expanded so 'logstart
5714 ~/mylog' now works.
5720 ~/mylog' now works.
5715
5721
5716 * IPython/iplib.py (complete): fixed bug where paths starting with
5722 * IPython/iplib.py (complete): fixed bug where paths starting with
5717 '/' would be completed as magic names.
5723 '/' would be completed as magic names.
5718
5724
5719 2002-05-04 Fernando Perez <fperez@colorado.edu>
5725 2002-05-04 Fernando Perez <fperez@colorado.edu>
5720
5726
5721 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5727 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5722 allow running full programs under the profiler's control.
5728 allow running full programs under the profiler's control.
5723
5729
5724 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5730 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5725 mode to report exceptions verbosely but without formatting
5731 mode to report exceptions verbosely but without formatting
5726 variables. This addresses the issue of ipython 'freezing' (it's
5732 variables. This addresses the issue of ipython 'freezing' (it's
5727 not frozen, but caught in an expensive formatting loop) when huge
5733 not frozen, but caught in an expensive formatting loop) when huge
5728 variables are in the context of an exception.
5734 variables are in the context of an exception.
5729 (VerboseTB.text): Added '--->' markers at line where exception was
5735 (VerboseTB.text): Added '--->' markers at line where exception was
5730 triggered. Much clearer to read, especially in NoColor modes.
5736 triggered. Much clearer to read, especially in NoColor modes.
5731
5737
5732 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5738 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5733 implemented in reverse when changing to the new parse_options().
5739 implemented in reverse when changing to the new parse_options().
5734
5740
5735 2002-05-03 Fernando Perez <fperez@colorado.edu>
5741 2002-05-03 Fernando Perez <fperez@colorado.edu>
5736
5742
5737 * IPython/Magic.py (Magic.parse_options): new function so that
5743 * IPython/Magic.py (Magic.parse_options): new function so that
5738 magics can parse options easier.
5744 magics can parse options easier.
5739 (Magic.magic_prun): new function similar to profile.run(),
5745 (Magic.magic_prun): new function similar to profile.run(),
5740 suggested by Chris Hart.
5746 suggested by Chris Hart.
5741 (Magic.magic_cd): fixed behavior so that it only changes if
5747 (Magic.magic_cd): fixed behavior so that it only changes if
5742 directory actually is in history.
5748 directory actually is in history.
5743
5749
5744 * IPython/usage.py (__doc__): added information about potential
5750 * IPython/usage.py (__doc__): added information about potential
5745 slowness of Verbose exception mode when there are huge data
5751 slowness of Verbose exception mode when there are huge data
5746 structures to be formatted (thanks to Archie Paulson).
5752 structures to be formatted (thanks to Archie Paulson).
5747
5753
5748 * IPython/ipmaker.py (make_IPython): Changed default logging
5754 * IPython/ipmaker.py (make_IPython): Changed default logging
5749 (when simply called with -log) to use curr_dir/ipython.log in
5755 (when simply called with -log) to use curr_dir/ipython.log in
5750 rotate mode. Fixed crash which was occuring with -log before
5756 rotate mode. Fixed crash which was occuring with -log before
5751 (thanks to Jim Boyle).
5757 (thanks to Jim Boyle).
5752
5758
5753 2002-05-01 Fernando Perez <fperez@colorado.edu>
5759 2002-05-01 Fernando Perez <fperez@colorado.edu>
5754
5760
5755 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5761 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5756 was nasty -- though somewhat of a corner case).
5762 was nasty -- though somewhat of a corner case).
5757
5763
5758 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5764 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5759 text (was a bug).
5765 text (was a bug).
5760
5766
5761 2002-04-30 Fernando Perez <fperez@colorado.edu>
5767 2002-04-30 Fernando Perez <fperez@colorado.edu>
5762
5768
5763 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5769 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5764 a print after ^D or ^C from the user so that the In[] prompt
5770 a print after ^D or ^C from the user so that the In[] prompt
5765 doesn't over-run the gnuplot one.
5771 doesn't over-run the gnuplot one.
5766
5772
5767 2002-04-29 Fernando Perez <fperez@colorado.edu>
5773 2002-04-29 Fernando Perez <fperez@colorado.edu>
5768
5774
5769 * Released 0.2.10
5775 * Released 0.2.10
5770
5776
5771 * IPython/__release__.py (version): get date dynamically.
5777 * IPython/__release__.py (version): get date dynamically.
5772
5778
5773 * Misc. documentation updates thanks to Arnd's comments. Also ran
5779 * Misc. documentation updates thanks to Arnd's comments. Also ran
5774 a full spellcheck on the manual (hadn't been done in a while).
5780 a full spellcheck on the manual (hadn't been done in a while).
5775
5781
5776 2002-04-27 Fernando Perez <fperez@colorado.edu>
5782 2002-04-27 Fernando Perez <fperez@colorado.edu>
5777
5783
5778 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5784 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5779 starting a log in mid-session would reset the input history list.
5785 starting a log in mid-session would reset the input history list.
5780
5786
5781 2002-04-26 Fernando Perez <fperez@colorado.edu>
5787 2002-04-26 Fernando Perez <fperez@colorado.edu>
5782
5788
5783 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5789 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5784 all files were being included in an update. Now anything in
5790 all files were being included in an update. Now anything in
5785 UserConfig that matches [A-Za-z]*.py will go (this excludes
5791 UserConfig that matches [A-Za-z]*.py will go (this excludes
5786 __init__.py)
5792 __init__.py)
5787
5793
5788 2002-04-25 Fernando Perez <fperez@colorado.edu>
5794 2002-04-25 Fernando Perez <fperez@colorado.edu>
5789
5795
5790 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5796 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5791 to __builtins__ so that any form of embedded or imported code can
5797 to __builtins__ so that any form of embedded or imported code can
5792 test for being inside IPython.
5798 test for being inside IPython.
5793
5799
5794 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5800 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5795 changed to GnuplotMagic because it's now an importable module,
5801 changed to GnuplotMagic because it's now an importable module,
5796 this makes the name follow that of the standard Gnuplot module.
5802 this makes the name follow that of the standard Gnuplot module.
5797 GnuplotMagic can now be loaded at any time in mid-session.
5803 GnuplotMagic can now be loaded at any time in mid-session.
5798
5804
5799 2002-04-24 Fernando Perez <fperez@colorado.edu>
5805 2002-04-24 Fernando Perez <fperez@colorado.edu>
5800
5806
5801 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5807 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5802 the globals (IPython has its own namespace) and the
5808 the globals (IPython has its own namespace) and the
5803 PhysicalQuantity stuff is much better anyway.
5809 PhysicalQuantity stuff is much better anyway.
5804
5810
5805 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5811 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5806 embedding example to standard user directory for
5812 embedding example to standard user directory for
5807 distribution. Also put it in the manual.
5813 distribution. Also put it in the manual.
5808
5814
5809 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5815 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5810 instance as first argument (so it doesn't rely on some obscure
5816 instance as first argument (so it doesn't rely on some obscure
5811 hidden global).
5817 hidden global).
5812
5818
5813 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5819 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5814 delimiters. While it prevents ().TAB from working, it allows
5820 delimiters. While it prevents ().TAB from working, it allows
5815 completions in open (... expressions. This is by far a more common
5821 completions in open (... expressions. This is by far a more common
5816 case.
5822 case.
5817
5823
5818 2002-04-23 Fernando Perez <fperez@colorado.edu>
5824 2002-04-23 Fernando Perez <fperez@colorado.edu>
5819
5825
5820 * IPython/Extensions/InterpreterPasteInput.py: new
5826 * IPython/Extensions/InterpreterPasteInput.py: new
5821 syntax-processing module for pasting lines with >>> or ... at the
5827 syntax-processing module for pasting lines with >>> or ... at the
5822 start.
5828 start.
5823
5829
5824 * IPython/Extensions/PhysicalQ_Interactive.py
5830 * IPython/Extensions/PhysicalQ_Interactive.py
5825 (PhysicalQuantityInteractive.__int__): fixed to work with either
5831 (PhysicalQuantityInteractive.__int__): fixed to work with either
5826 Numeric or math.
5832 Numeric or math.
5827
5833
5828 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5834 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5829 provided profiles. Now we have:
5835 provided profiles. Now we have:
5830 -math -> math module as * and cmath with its own namespace.
5836 -math -> math module as * and cmath with its own namespace.
5831 -numeric -> Numeric as *, plus gnuplot & grace
5837 -numeric -> Numeric as *, plus gnuplot & grace
5832 -physics -> same as before
5838 -physics -> same as before
5833
5839
5834 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5840 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5835 user-defined magics wouldn't be found by @magic if they were
5841 user-defined magics wouldn't be found by @magic if they were
5836 defined as class methods. Also cleaned up the namespace search
5842 defined as class methods. Also cleaned up the namespace search
5837 logic and the string building (to use %s instead of many repeated
5843 logic and the string building (to use %s instead of many repeated
5838 string adds).
5844 string adds).
5839
5845
5840 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5846 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5841 of user-defined magics to operate with class methods (cleaner, in
5847 of user-defined magics to operate with class methods (cleaner, in
5842 line with the gnuplot code).
5848 line with the gnuplot code).
5843
5849
5844 2002-04-22 Fernando Perez <fperez@colorado.edu>
5850 2002-04-22 Fernando Perez <fperez@colorado.edu>
5845
5851
5846 * setup.py: updated dependency list so that manual is updated when
5852 * setup.py: updated dependency list so that manual is updated when
5847 all included files change.
5853 all included files change.
5848
5854
5849 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5855 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5850 the delimiter removal option (the fix is ugly right now).
5856 the delimiter removal option (the fix is ugly right now).
5851
5857
5852 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5858 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5853 all of the math profile (quicker loading, no conflict between
5859 all of the math profile (quicker loading, no conflict between
5854 g-9.8 and g-gnuplot).
5860 g-9.8 and g-gnuplot).
5855
5861
5856 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5862 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5857 name of post-mortem files to IPython_crash_report.txt.
5863 name of post-mortem files to IPython_crash_report.txt.
5858
5864
5859 * Cleanup/update of the docs. Added all the new readline info and
5865 * Cleanup/update of the docs. Added all the new readline info and
5860 formatted all lists as 'real lists'.
5866 formatted all lists as 'real lists'.
5861
5867
5862 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5868 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5863 tab-completion options, since the full readline parse_and_bind is
5869 tab-completion options, since the full readline parse_and_bind is
5864 now accessible.
5870 now accessible.
5865
5871
5866 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5872 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5867 handling of readline options. Now users can specify any string to
5873 handling of readline options. Now users can specify any string to
5868 be passed to parse_and_bind(), as well as the delimiters to be
5874 be passed to parse_and_bind(), as well as the delimiters to be
5869 removed.
5875 removed.
5870 (InteractiveShell.__init__): Added __name__ to the global
5876 (InteractiveShell.__init__): Added __name__ to the global
5871 namespace so that things like Itpl which rely on its existence
5877 namespace so that things like Itpl which rely on its existence
5872 don't crash.
5878 don't crash.
5873 (InteractiveShell._prefilter): Defined the default with a _ so
5879 (InteractiveShell._prefilter): Defined the default with a _ so
5874 that prefilter() is easier to override, while the default one
5880 that prefilter() is easier to override, while the default one
5875 remains available.
5881 remains available.
5876
5882
5877 2002-04-18 Fernando Perez <fperez@colorado.edu>
5883 2002-04-18 Fernando Perez <fperez@colorado.edu>
5878
5884
5879 * Added information about pdb in the docs.
5885 * Added information about pdb in the docs.
5880
5886
5881 2002-04-17 Fernando Perez <fperez@colorado.edu>
5887 2002-04-17 Fernando Perez <fperez@colorado.edu>
5882
5888
5883 * IPython/ipmaker.py (make_IPython): added rc_override option to
5889 * IPython/ipmaker.py (make_IPython): added rc_override option to
5884 allow passing config options at creation time which may override
5890 allow passing config options at creation time which may override
5885 anything set in the config files or command line. This is
5891 anything set in the config files or command line. This is
5886 particularly useful for configuring embedded instances.
5892 particularly useful for configuring embedded instances.
5887
5893
5888 2002-04-15 Fernando Perez <fperez@colorado.edu>
5894 2002-04-15 Fernando Perez <fperez@colorado.edu>
5889
5895
5890 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5896 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5891 crash embedded instances because of the input cache falling out of
5897 crash embedded instances because of the input cache falling out of
5892 sync with the output counter.
5898 sync with the output counter.
5893
5899
5894 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5900 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5895 mode which calls pdb after an uncaught exception in IPython itself.
5901 mode which calls pdb after an uncaught exception in IPython itself.
5896
5902
5897 2002-04-14 Fernando Perez <fperez@colorado.edu>
5903 2002-04-14 Fernando Perez <fperez@colorado.edu>
5898
5904
5899 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5905 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5900 readline, fix it back after each call.
5906 readline, fix it back after each call.
5901
5907
5902 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5908 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5903 method to force all access via __call__(), which guarantees that
5909 method to force all access via __call__(), which guarantees that
5904 traceback references are properly deleted.
5910 traceback references are properly deleted.
5905
5911
5906 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5912 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5907 improve printing when pprint is in use.
5913 improve printing when pprint is in use.
5908
5914
5909 2002-04-13 Fernando Perez <fperez@colorado.edu>
5915 2002-04-13 Fernando Perez <fperez@colorado.edu>
5910
5916
5911 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5917 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5912 exceptions aren't caught anymore. If the user triggers one, he
5918 exceptions aren't caught anymore. If the user triggers one, he
5913 should know why he's doing it and it should go all the way up,
5919 should know why he's doing it and it should go all the way up,
5914 just like any other exception. So now @abort will fully kill the
5920 just like any other exception. So now @abort will fully kill the
5915 embedded interpreter and the embedding code (unless that happens
5921 embedded interpreter and the embedding code (unless that happens
5916 to catch SystemExit).
5922 to catch SystemExit).
5917
5923
5918 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5924 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5919 and a debugger() method to invoke the interactive pdb debugger
5925 and a debugger() method to invoke the interactive pdb debugger
5920 after printing exception information. Also added the corresponding
5926 after printing exception information. Also added the corresponding
5921 -pdb option and @pdb magic to control this feature, and updated
5927 -pdb option and @pdb magic to control this feature, and updated
5922 the docs. After a suggestion from Christopher Hart
5928 the docs. After a suggestion from Christopher Hart
5923 (hart-AT-caltech.edu).
5929 (hart-AT-caltech.edu).
5924
5930
5925 2002-04-12 Fernando Perez <fperez@colorado.edu>
5931 2002-04-12 Fernando Perez <fperez@colorado.edu>
5926
5932
5927 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5933 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5928 the exception handlers defined by the user (not the CrashHandler)
5934 the exception handlers defined by the user (not the CrashHandler)
5929 so that user exceptions don't trigger an ipython bug report.
5935 so that user exceptions don't trigger an ipython bug report.
5930
5936
5931 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5937 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5932 configurable (it should have always been so).
5938 configurable (it should have always been so).
5933
5939
5934 2002-03-26 Fernando Perez <fperez@colorado.edu>
5940 2002-03-26 Fernando Perez <fperez@colorado.edu>
5935
5941
5936 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5942 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5937 and there to fix embedding namespace issues. This should all be
5943 and there to fix embedding namespace issues. This should all be
5938 done in a more elegant way.
5944 done in a more elegant way.
5939
5945
5940 2002-03-25 Fernando Perez <fperez@colorado.edu>
5946 2002-03-25 Fernando Perez <fperez@colorado.edu>
5941
5947
5942 * IPython/genutils.py (get_home_dir): Try to make it work under
5948 * IPython/genutils.py (get_home_dir): Try to make it work under
5943 win9x also.
5949 win9x also.
5944
5950
5945 2002-03-20 Fernando Perez <fperez@colorado.edu>
5951 2002-03-20 Fernando Perez <fperez@colorado.edu>
5946
5952
5947 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5953 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5948 sys.displayhook untouched upon __init__.
5954 sys.displayhook untouched upon __init__.
5949
5955
5950 2002-03-19 Fernando Perez <fperez@colorado.edu>
5956 2002-03-19 Fernando Perez <fperez@colorado.edu>
5951
5957
5952 * Released 0.2.9 (for embedding bug, basically).
5958 * Released 0.2.9 (for embedding bug, basically).
5953
5959
5954 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5960 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5955 exceptions so that enclosing shell's state can be restored.
5961 exceptions so that enclosing shell's state can be restored.
5956
5962
5957 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5963 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5958 naming conventions in the .ipython/ dir.
5964 naming conventions in the .ipython/ dir.
5959
5965
5960 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5966 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5961 from delimiters list so filenames with - in them get expanded.
5967 from delimiters list so filenames with - in them get expanded.
5962
5968
5963 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5969 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5964 sys.displayhook not being properly restored after an embedded call.
5970 sys.displayhook not being properly restored after an embedded call.
5965
5971
5966 2002-03-18 Fernando Perez <fperez@colorado.edu>
5972 2002-03-18 Fernando Perez <fperez@colorado.edu>
5967
5973
5968 * Released 0.2.8
5974 * Released 0.2.8
5969
5975
5970 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5976 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5971 some files weren't being included in a -upgrade.
5977 some files weren't being included in a -upgrade.
5972 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5978 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5973 on' so that the first tab completes.
5979 on' so that the first tab completes.
5974 (InteractiveShell.handle_magic): fixed bug with spaces around
5980 (InteractiveShell.handle_magic): fixed bug with spaces around
5975 quotes breaking many magic commands.
5981 quotes breaking many magic commands.
5976
5982
5977 * setup.py: added note about ignoring the syntax error messages at
5983 * setup.py: added note about ignoring the syntax error messages at
5978 installation.
5984 installation.
5979
5985
5980 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5986 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5981 streamlining the gnuplot interface, now there's only one magic @gp.
5987 streamlining the gnuplot interface, now there's only one magic @gp.
5982
5988
5983 2002-03-17 Fernando Perez <fperez@colorado.edu>
5989 2002-03-17 Fernando Perez <fperez@colorado.edu>
5984
5990
5985 * IPython/UserConfig/magic_gnuplot.py: new name for the
5991 * IPython/UserConfig/magic_gnuplot.py: new name for the
5986 example-magic_pm.py file. Much enhanced system, now with a shell
5992 example-magic_pm.py file. Much enhanced system, now with a shell
5987 for communicating directly with gnuplot, one command at a time.
5993 for communicating directly with gnuplot, one command at a time.
5988
5994
5989 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5995 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5990 setting __name__=='__main__'.
5996 setting __name__=='__main__'.
5991
5997
5992 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5998 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5993 mini-shell for accessing gnuplot from inside ipython. Should
5999 mini-shell for accessing gnuplot from inside ipython. Should
5994 extend it later for grace access too. Inspired by Arnd's
6000 extend it later for grace access too. Inspired by Arnd's
5995 suggestion.
6001 suggestion.
5996
6002
5997 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6003 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5998 calling magic functions with () in their arguments. Thanks to Arnd
6004 calling magic functions with () in their arguments. Thanks to Arnd
5999 Baecker for pointing this to me.
6005 Baecker for pointing this to me.
6000
6006
6001 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6007 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6002 infinitely for integer or complex arrays (only worked with floats).
6008 infinitely for integer or complex arrays (only worked with floats).
6003
6009
6004 2002-03-16 Fernando Perez <fperez@colorado.edu>
6010 2002-03-16 Fernando Perez <fperez@colorado.edu>
6005
6011
6006 * setup.py: Merged setup and setup_windows into a single script
6012 * setup.py: Merged setup and setup_windows into a single script
6007 which properly handles things for windows users.
6013 which properly handles things for windows users.
6008
6014
6009 2002-03-15 Fernando Perez <fperez@colorado.edu>
6015 2002-03-15 Fernando Perez <fperez@colorado.edu>
6010
6016
6011 * Big change to the manual: now the magics are all automatically
6017 * Big change to the manual: now the magics are all automatically
6012 documented. This information is generated from their docstrings
6018 documented. This information is generated from their docstrings
6013 and put in a latex file included by the manual lyx file. This way
6019 and put in a latex file included by the manual lyx file. This way
6014 we get always up to date information for the magics. The manual
6020 we get always up to date information for the magics. The manual
6015 now also has proper version information, also auto-synced.
6021 now also has proper version information, also auto-synced.
6016
6022
6017 For this to work, an undocumented --magic_docstrings option was added.
6023 For this to work, an undocumented --magic_docstrings option was added.
6018
6024
6019 2002-03-13 Fernando Perez <fperez@colorado.edu>
6025 2002-03-13 Fernando Perez <fperez@colorado.edu>
6020
6026
6021 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6027 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6022 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6028 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6023
6029
6024 2002-03-12 Fernando Perez <fperez@colorado.edu>
6030 2002-03-12 Fernando Perez <fperez@colorado.edu>
6025
6031
6026 * IPython/ultraTB.py (TermColors): changed color escapes again to
6032 * IPython/ultraTB.py (TermColors): changed color escapes again to
6027 fix the (old, reintroduced) line-wrapping bug. Basically, if
6033 fix the (old, reintroduced) line-wrapping bug. Basically, if
6028 \001..\002 aren't given in the color escapes, lines get wrapped
6034 \001..\002 aren't given in the color escapes, lines get wrapped
6029 weirdly. But giving those screws up old xterms and emacs terms. So
6035 weirdly. But giving those screws up old xterms and emacs terms. So
6030 I added some logic for emacs terms to be ok, but I can't identify old
6036 I added some logic for emacs terms to be ok, but I can't identify old
6031 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6037 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6032
6038
6033 2002-03-10 Fernando Perez <fperez@colorado.edu>
6039 2002-03-10 Fernando Perez <fperez@colorado.edu>
6034
6040
6035 * IPython/usage.py (__doc__): Various documentation cleanups and
6041 * IPython/usage.py (__doc__): Various documentation cleanups and
6036 updates, both in usage docstrings and in the manual.
6042 updates, both in usage docstrings and in the manual.
6037
6043
6038 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6044 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6039 handling of caching. Set minimum acceptabe value for having a
6045 handling of caching. Set minimum acceptabe value for having a
6040 cache at 20 values.
6046 cache at 20 values.
6041
6047
6042 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6048 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6043 install_first_time function to a method, renamed it and added an
6049 install_first_time function to a method, renamed it and added an
6044 'upgrade' mode. Now people can update their config directory with
6050 'upgrade' mode. Now people can update their config directory with
6045 a simple command line switch (-upgrade, also new).
6051 a simple command line switch (-upgrade, also new).
6046
6052
6047 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6053 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6048 @file (convenient for automagic users under Python >= 2.2).
6054 @file (convenient for automagic users under Python >= 2.2).
6049 Removed @files (it seemed more like a plural than an abbrev. of
6055 Removed @files (it seemed more like a plural than an abbrev. of
6050 'file show').
6056 'file show').
6051
6057
6052 * IPython/iplib.py (install_first_time): Fixed crash if there were
6058 * IPython/iplib.py (install_first_time): Fixed crash if there were
6053 backup files ('~') in .ipython/ install directory.
6059 backup files ('~') in .ipython/ install directory.
6054
6060
6055 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6061 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6056 system. Things look fine, but these changes are fairly
6062 system. Things look fine, but these changes are fairly
6057 intrusive. Test them for a few days.
6063 intrusive. Test them for a few days.
6058
6064
6059 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6065 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6060 the prompts system. Now all in/out prompt strings are user
6066 the prompts system. Now all in/out prompt strings are user
6061 controllable. This is particularly useful for embedding, as one
6067 controllable. This is particularly useful for embedding, as one
6062 can tag embedded instances with particular prompts.
6068 can tag embedded instances with particular prompts.
6063
6069
6064 Also removed global use of sys.ps1/2, which now allows nested
6070 Also removed global use of sys.ps1/2, which now allows nested
6065 embeddings without any problems. Added command-line options for
6071 embeddings without any problems. Added command-line options for
6066 the prompt strings.
6072 the prompt strings.
6067
6073
6068 2002-03-08 Fernando Perez <fperez@colorado.edu>
6074 2002-03-08 Fernando Perez <fperez@colorado.edu>
6069
6075
6070 * IPython/UserConfig/example-embed-short.py (ipshell): added
6076 * IPython/UserConfig/example-embed-short.py (ipshell): added
6071 example file with the bare minimum code for embedding.
6077 example file with the bare minimum code for embedding.
6072
6078
6073 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6079 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6074 functionality for the embeddable shell to be activated/deactivated
6080 functionality for the embeddable shell to be activated/deactivated
6075 either globally or at each call.
6081 either globally or at each call.
6076
6082
6077 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6083 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6078 rewriting the prompt with '--->' for auto-inputs with proper
6084 rewriting the prompt with '--->' for auto-inputs with proper
6079 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6085 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6080 this is handled by the prompts class itself, as it should.
6086 this is handled by the prompts class itself, as it should.
6081
6087
6082 2002-03-05 Fernando Perez <fperez@colorado.edu>
6088 2002-03-05 Fernando Perez <fperez@colorado.edu>
6083
6089
6084 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6090 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6085 @logstart to avoid name clashes with the math log function.
6091 @logstart to avoid name clashes with the math log function.
6086
6092
6087 * Big updates to X/Emacs section of the manual.
6093 * Big updates to X/Emacs section of the manual.
6088
6094
6089 * Removed ipython_emacs. Milan explained to me how to pass
6095 * Removed ipython_emacs. Milan explained to me how to pass
6090 arguments to ipython through Emacs. Some day I'm going to end up
6096 arguments to ipython through Emacs. Some day I'm going to end up
6091 learning some lisp...
6097 learning some lisp...
6092
6098
6093 2002-03-04 Fernando Perez <fperez@colorado.edu>
6099 2002-03-04 Fernando Perez <fperez@colorado.edu>
6094
6100
6095 * IPython/ipython_emacs: Created script to be used as the
6101 * IPython/ipython_emacs: Created script to be used as the
6096 py-python-command Emacs variable so we can pass IPython
6102 py-python-command Emacs variable so we can pass IPython
6097 parameters. I can't figure out how to tell Emacs directly to pass
6103 parameters. I can't figure out how to tell Emacs directly to pass
6098 parameters to IPython, so a dummy shell script will do it.
6104 parameters to IPython, so a dummy shell script will do it.
6099
6105
6100 Other enhancements made for things to work better under Emacs'
6106 Other enhancements made for things to work better under Emacs'
6101 various types of terminals. Many thanks to Milan Zamazal
6107 various types of terminals. Many thanks to Milan Zamazal
6102 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6108 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6103
6109
6104 2002-03-01 Fernando Perez <fperez@colorado.edu>
6110 2002-03-01 Fernando Perez <fperez@colorado.edu>
6105
6111
6106 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6112 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6107 that loading of readline is now optional. This gives better
6113 that loading of readline is now optional. This gives better
6108 control to emacs users.
6114 control to emacs users.
6109
6115
6110 * IPython/ultraTB.py (__date__): Modified color escape sequences
6116 * IPython/ultraTB.py (__date__): Modified color escape sequences
6111 and now things work fine under xterm and in Emacs' term buffers
6117 and now things work fine under xterm and in Emacs' term buffers
6112 (though not shell ones). Well, in emacs you get colors, but all
6118 (though not shell ones). Well, in emacs you get colors, but all
6113 seem to be 'light' colors (no difference between dark and light
6119 seem to be 'light' colors (no difference between dark and light
6114 ones). But the garbage chars are gone, and also in xterms. It
6120 ones). But the garbage chars are gone, and also in xterms. It
6115 seems that now I'm using 'cleaner' ansi sequences.
6121 seems that now I'm using 'cleaner' ansi sequences.
6116
6122
6117 2002-02-21 Fernando Perez <fperez@colorado.edu>
6123 2002-02-21 Fernando Perez <fperez@colorado.edu>
6118
6124
6119 * Released 0.2.7 (mainly to publish the scoping fix).
6125 * Released 0.2.7 (mainly to publish the scoping fix).
6120
6126
6121 * IPython/Logger.py (Logger.logstate): added. A corresponding
6127 * IPython/Logger.py (Logger.logstate): added. A corresponding
6122 @logstate magic was created.
6128 @logstate magic was created.
6123
6129
6124 * IPython/Magic.py: fixed nested scoping problem under Python
6130 * IPython/Magic.py: fixed nested scoping problem under Python
6125 2.1.x (automagic wasn't working).
6131 2.1.x (automagic wasn't working).
6126
6132
6127 2002-02-20 Fernando Perez <fperez@colorado.edu>
6133 2002-02-20 Fernando Perez <fperez@colorado.edu>
6128
6134
6129 * Released 0.2.6.
6135 * Released 0.2.6.
6130
6136
6131 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6137 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6132 option so that logs can come out without any headers at all.
6138 option so that logs can come out without any headers at all.
6133
6139
6134 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6140 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6135 SciPy.
6141 SciPy.
6136
6142
6137 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6143 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6138 that embedded IPython calls don't require vars() to be explicitly
6144 that embedded IPython calls don't require vars() to be explicitly
6139 passed. Now they are extracted from the caller's frame (code
6145 passed. Now they are extracted from the caller's frame (code
6140 snatched from Eric Jones' weave). Added better documentation to
6146 snatched from Eric Jones' weave). Added better documentation to
6141 the section on embedding and the example file.
6147 the section on embedding and the example file.
6142
6148
6143 * IPython/genutils.py (page): Changed so that under emacs, it just
6149 * IPython/genutils.py (page): Changed so that under emacs, it just
6144 prints the string. You can then page up and down in the emacs
6150 prints the string. You can then page up and down in the emacs
6145 buffer itself. This is how the builtin help() works.
6151 buffer itself. This is how the builtin help() works.
6146
6152
6147 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6153 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6148 macro scoping: macros need to be executed in the user's namespace
6154 macro scoping: macros need to be executed in the user's namespace
6149 to work as if they had been typed by the user.
6155 to work as if they had been typed by the user.
6150
6156
6151 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6157 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6152 execute automatically (no need to type 'exec...'). They then
6158 execute automatically (no need to type 'exec...'). They then
6153 behave like 'true macros'. The printing system was also modified
6159 behave like 'true macros'. The printing system was also modified
6154 for this to work.
6160 for this to work.
6155
6161
6156 2002-02-19 Fernando Perez <fperez@colorado.edu>
6162 2002-02-19 Fernando Perez <fperez@colorado.edu>
6157
6163
6158 * IPython/genutils.py (page_file): new function for paging files
6164 * IPython/genutils.py (page_file): new function for paging files
6159 in an OS-independent way. Also necessary for file viewing to work
6165 in an OS-independent way. Also necessary for file viewing to work
6160 well inside Emacs buffers.
6166 well inside Emacs buffers.
6161 (page): Added checks for being in an emacs buffer.
6167 (page): Added checks for being in an emacs buffer.
6162 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6168 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6163 same bug in iplib.
6169 same bug in iplib.
6164
6170
6165 2002-02-18 Fernando Perez <fperez@colorado.edu>
6171 2002-02-18 Fernando Perez <fperez@colorado.edu>
6166
6172
6167 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6173 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6168 of readline so that IPython can work inside an Emacs buffer.
6174 of readline so that IPython can work inside an Emacs buffer.
6169
6175
6170 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6176 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6171 method signatures (they weren't really bugs, but it looks cleaner
6177 method signatures (they weren't really bugs, but it looks cleaner
6172 and keeps PyChecker happy).
6178 and keeps PyChecker happy).
6173
6179
6174 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6180 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6175 for implementing various user-defined hooks. Currently only
6181 for implementing various user-defined hooks. Currently only
6176 display is done.
6182 display is done.
6177
6183
6178 * IPython/Prompts.py (CachedOutput._display): changed display
6184 * IPython/Prompts.py (CachedOutput._display): changed display
6179 functions so that they can be dynamically changed by users easily.
6185 functions so that they can be dynamically changed by users easily.
6180
6186
6181 * IPython/Extensions/numeric_formats.py (num_display): added an
6187 * IPython/Extensions/numeric_formats.py (num_display): added an
6182 extension for printing NumPy arrays in flexible manners. It
6188 extension for printing NumPy arrays in flexible manners. It
6183 doesn't do anything yet, but all the structure is in
6189 doesn't do anything yet, but all the structure is in
6184 place. Ultimately the plan is to implement output format control
6190 place. Ultimately the plan is to implement output format control
6185 like in Octave.
6191 like in Octave.
6186
6192
6187 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6193 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6188 methods are found at run-time by all the automatic machinery.
6194 methods are found at run-time by all the automatic machinery.
6189
6195
6190 2002-02-17 Fernando Perez <fperez@colorado.edu>
6196 2002-02-17 Fernando Perez <fperez@colorado.edu>
6191
6197
6192 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6198 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6193 whole file a little.
6199 whole file a little.
6194
6200
6195 * ToDo: closed this document. Now there's a new_design.lyx
6201 * ToDo: closed this document. Now there's a new_design.lyx
6196 document for all new ideas. Added making a pdf of it for the
6202 document for all new ideas. Added making a pdf of it for the
6197 end-user distro.
6203 end-user distro.
6198
6204
6199 * IPython/Logger.py (Logger.switch_log): Created this to replace
6205 * IPython/Logger.py (Logger.switch_log): Created this to replace
6200 logon() and logoff(). It also fixes a nasty crash reported by
6206 logon() and logoff(). It also fixes a nasty crash reported by
6201 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6207 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6202
6208
6203 * IPython/iplib.py (complete): got auto-completion to work with
6209 * IPython/iplib.py (complete): got auto-completion to work with
6204 automagic (I had wanted this for a long time).
6210 automagic (I had wanted this for a long time).
6205
6211
6206 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6212 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6207 to @file, since file() is now a builtin and clashes with automagic
6213 to @file, since file() is now a builtin and clashes with automagic
6208 for @file.
6214 for @file.
6209
6215
6210 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6216 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6211 of this was previously in iplib, which had grown to more than 2000
6217 of this was previously in iplib, which had grown to more than 2000
6212 lines, way too long. No new functionality, but it makes managing
6218 lines, way too long. No new functionality, but it makes managing
6213 the code a bit easier.
6219 the code a bit easier.
6214
6220
6215 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6221 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6216 information to crash reports.
6222 information to crash reports.
6217
6223
6218 2002-02-12 Fernando Perez <fperez@colorado.edu>
6224 2002-02-12 Fernando Perez <fperez@colorado.edu>
6219
6225
6220 * Released 0.2.5.
6226 * Released 0.2.5.
6221
6227
6222 2002-02-11 Fernando Perez <fperez@colorado.edu>
6228 2002-02-11 Fernando Perez <fperez@colorado.edu>
6223
6229
6224 * Wrote a relatively complete Windows installer. It puts
6230 * Wrote a relatively complete Windows installer. It puts
6225 everything in place, creates Start Menu entries and fixes the
6231 everything in place, creates Start Menu entries and fixes the
6226 color issues. Nothing fancy, but it works.
6232 color issues. Nothing fancy, but it works.
6227
6233
6228 2002-02-10 Fernando Perez <fperez@colorado.edu>
6234 2002-02-10 Fernando Perez <fperez@colorado.edu>
6229
6235
6230 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6236 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6231 os.path.expanduser() call so that we can type @run ~/myfile.py and
6237 os.path.expanduser() call so that we can type @run ~/myfile.py and
6232 have thigs work as expected.
6238 have thigs work as expected.
6233
6239
6234 * IPython/genutils.py (page): fixed exception handling so things
6240 * IPython/genutils.py (page): fixed exception handling so things
6235 work both in Unix and Windows correctly. Quitting a pager triggers
6241 work both in Unix and Windows correctly. Quitting a pager triggers
6236 an IOError/broken pipe in Unix, and in windows not finding a pager
6242 an IOError/broken pipe in Unix, and in windows not finding a pager
6237 is also an IOError, so I had to actually look at the return value
6243 is also an IOError, so I had to actually look at the return value
6238 of the exception, not just the exception itself. Should be ok now.
6244 of the exception, not just the exception itself. Should be ok now.
6239
6245
6240 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6246 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6241 modified to allow case-insensitive color scheme changes.
6247 modified to allow case-insensitive color scheme changes.
6242
6248
6243 2002-02-09 Fernando Perez <fperez@colorado.edu>
6249 2002-02-09 Fernando Perez <fperez@colorado.edu>
6244
6250
6245 * IPython/genutils.py (native_line_ends): new function to leave
6251 * IPython/genutils.py (native_line_ends): new function to leave
6246 user config files with os-native line-endings.
6252 user config files with os-native line-endings.
6247
6253
6248 * README and manual updates.
6254 * README and manual updates.
6249
6255
6250 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6256 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6251 instead of StringType to catch Unicode strings.
6257 instead of StringType to catch Unicode strings.
6252
6258
6253 * IPython/genutils.py (filefind): fixed bug for paths with
6259 * IPython/genutils.py (filefind): fixed bug for paths with
6254 embedded spaces (very common in Windows).
6260 embedded spaces (very common in Windows).
6255
6261
6256 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6262 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6257 files under Windows, so that they get automatically associated
6263 files under Windows, so that they get automatically associated
6258 with a text editor. Windows makes it a pain to handle
6264 with a text editor. Windows makes it a pain to handle
6259 extension-less files.
6265 extension-less files.
6260
6266
6261 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6267 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6262 warning about readline only occur for Posix. In Windows there's no
6268 warning about readline only occur for Posix. In Windows there's no
6263 way to get readline, so why bother with the warning.
6269 way to get readline, so why bother with the warning.
6264
6270
6265 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6271 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6266 for __str__ instead of dir(self), since dir() changed in 2.2.
6272 for __str__ instead of dir(self), since dir() changed in 2.2.
6267
6273
6268 * Ported to Windows! Tested on XP, I suspect it should work fine
6274 * Ported to Windows! Tested on XP, I suspect it should work fine
6269 on NT/2000, but I don't think it will work on 98 et al. That
6275 on NT/2000, but I don't think it will work on 98 et al. That
6270 series of Windows is such a piece of junk anyway that I won't try
6276 series of Windows is such a piece of junk anyway that I won't try
6271 porting it there. The XP port was straightforward, showed a few
6277 porting it there. The XP port was straightforward, showed a few
6272 bugs here and there (fixed all), in particular some string
6278 bugs here and there (fixed all), in particular some string
6273 handling stuff which required considering Unicode strings (which
6279 handling stuff which required considering Unicode strings (which
6274 Windows uses). This is good, but hasn't been too tested :) No
6280 Windows uses). This is good, but hasn't been too tested :) No
6275 fancy installer yet, I'll put a note in the manual so people at
6281 fancy installer yet, I'll put a note in the manual so people at
6276 least make manually a shortcut.
6282 least make manually a shortcut.
6277
6283
6278 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6284 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6279 into a single one, "colors". This now controls both prompt and
6285 into a single one, "colors". This now controls both prompt and
6280 exception color schemes, and can be changed both at startup
6286 exception color schemes, and can be changed both at startup
6281 (either via command-line switches or via ipythonrc files) and at
6287 (either via command-line switches or via ipythonrc files) and at
6282 runtime, with @colors.
6288 runtime, with @colors.
6283 (Magic.magic_run): renamed @prun to @run and removed the old
6289 (Magic.magic_run): renamed @prun to @run and removed the old
6284 @run. The two were too similar to warrant keeping both.
6290 @run. The two were too similar to warrant keeping both.
6285
6291
6286 2002-02-03 Fernando Perez <fperez@colorado.edu>
6292 2002-02-03 Fernando Perez <fperez@colorado.edu>
6287
6293
6288 * IPython/iplib.py (install_first_time): Added comment on how to
6294 * IPython/iplib.py (install_first_time): Added comment on how to
6289 configure the color options for first-time users. Put a <return>
6295 configure the color options for first-time users. Put a <return>
6290 request at the end so that small-terminal users get a chance to
6296 request at the end so that small-terminal users get a chance to
6291 read the startup info.
6297 read the startup info.
6292
6298
6293 2002-01-23 Fernando Perez <fperez@colorado.edu>
6299 2002-01-23 Fernando Perez <fperez@colorado.edu>
6294
6300
6295 * IPython/iplib.py (CachedOutput.update): Changed output memory
6301 * IPython/iplib.py (CachedOutput.update): Changed output memory
6296 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6302 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6297 input history we still use _i. Did this b/c these variable are
6303 input history we still use _i. Did this b/c these variable are
6298 very commonly used in interactive work, so the less we need to
6304 very commonly used in interactive work, so the less we need to
6299 type the better off we are.
6305 type the better off we are.
6300 (Magic.magic_prun): updated @prun to better handle the namespaces
6306 (Magic.magic_prun): updated @prun to better handle the namespaces
6301 the file will run in, including a fix for __name__ not being set
6307 the file will run in, including a fix for __name__ not being set
6302 before.
6308 before.
6303
6309
6304 2002-01-20 Fernando Perez <fperez@colorado.edu>
6310 2002-01-20 Fernando Perez <fperez@colorado.edu>
6305
6311
6306 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6312 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6307 extra garbage for Python 2.2. Need to look more carefully into
6313 extra garbage for Python 2.2. Need to look more carefully into
6308 this later.
6314 this later.
6309
6315
6310 2002-01-19 Fernando Perez <fperez@colorado.edu>
6316 2002-01-19 Fernando Perez <fperez@colorado.edu>
6311
6317
6312 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6318 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6313 display SyntaxError exceptions properly formatted when they occur
6319 display SyntaxError exceptions properly formatted when they occur
6314 (they can be triggered by imported code).
6320 (they can be triggered by imported code).
6315
6321
6316 2002-01-18 Fernando Perez <fperez@colorado.edu>
6322 2002-01-18 Fernando Perez <fperez@colorado.edu>
6317
6323
6318 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6324 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6319 SyntaxError exceptions are reported nicely formatted, instead of
6325 SyntaxError exceptions are reported nicely formatted, instead of
6320 spitting out only offset information as before.
6326 spitting out only offset information as before.
6321 (Magic.magic_prun): Added the @prun function for executing
6327 (Magic.magic_prun): Added the @prun function for executing
6322 programs with command line args inside IPython.
6328 programs with command line args inside IPython.
6323
6329
6324 2002-01-16 Fernando Perez <fperez@colorado.edu>
6330 2002-01-16 Fernando Perez <fperez@colorado.edu>
6325
6331
6326 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6332 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6327 to *not* include the last item given in a range. This brings their
6333 to *not* include the last item given in a range. This brings their
6328 behavior in line with Python's slicing:
6334 behavior in line with Python's slicing:
6329 a[n1:n2] -> a[n1]...a[n2-1]
6335 a[n1:n2] -> a[n1]...a[n2-1]
6330 It may be a bit less convenient, but I prefer to stick to Python's
6336 It may be a bit less convenient, but I prefer to stick to Python's
6331 conventions *everywhere*, so users never have to wonder.
6337 conventions *everywhere*, so users never have to wonder.
6332 (Magic.magic_macro): Added @macro function to ease the creation of
6338 (Magic.magic_macro): Added @macro function to ease the creation of
6333 macros.
6339 macros.
6334
6340
6335 2002-01-05 Fernando Perez <fperez@colorado.edu>
6341 2002-01-05 Fernando Perez <fperez@colorado.edu>
6336
6342
6337 * Released 0.2.4.
6343 * Released 0.2.4.
6338
6344
6339 * IPython/iplib.py (Magic.magic_pdef):
6345 * IPython/iplib.py (Magic.magic_pdef):
6340 (InteractiveShell.safe_execfile): report magic lines and error
6346 (InteractiveShell.safe_execfile): report magic lines and error
6341 lines without line numbers so one can easily copy/paste them for
6347 lines without line numbers so one can easily copy/paste them for
6342 re-execution.
6348 re-execution.
6343
6349
6344 * Updated manual with recent changes.
6350 * Updated manual with recent changes.
6345
6351
6346 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6352 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6347 docstring printing when class? is called. Very handy for knowing
6353 docstring printing when class? is called. Very handy for knowing
6348 how to create class instances (as long as __init__ is well
6354 how to create class instances (as long as __init__ is well
6349 documented, of course :)
6355 documented, of course :)
6350 (Magic.magic_doc): print both class and constructor docstrings.
6356 (Magic.magic_doc): print both class and constructor docstrings.
6351 (Magic.magic_pdef): give constructor info if passed a class and
6357 (Magic.magic_pdef): give constructor info if passed a class and
6352 __call__ info for callable object instances.
6358 __call__ info for callable object instances.
6353
6359
6354 2002-01-04 Fernando Perez <fperez@colorado.edu>
6360 2002-01-04 Fernando Perez <fperez@colorado.edu>
6355
6361
6356 * Made deep_reload() off by default. It doesn't always work
6362 * Made deep_reload() off by default. It doesn't always work
6357 exactly as intended, so it's probably safer to have it off. It's
6363 exactly as intended, so it's probably safer to have it off. It's
6358 still available as dreload() anyway, so nothing is lost.
6364 still available as dreload() anyway, so nothing is lost.
6359
6365
6360 2002-01-02 Fernando Perez <fperez@colorado.edu>
6366 2002-01-02 Fernando Perez <fperez@colorado.edu>
6361
6367
6362 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6368 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6363 so I wanted an updated release).
6369 so I wanted an updated release).
6364
6370
6365 2001-12-27 Fernando Perez <fperez@colorado.edu>
6371 2001-12-27 Fernando Perez <fperez@colorado.edu>
6366
6372
6367 * IPython/iplib.py (InteractiveShell.interact): Added the original
6373 * IPython/iplib.py (InteractiveShell.interact): Added the original
6368 code from 'code.py' for this module in order to change the
6374 code from 'code.py' for this module in order to change the
6369 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6375 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6370 the history cache would break when the user hit Ctrl-C, and
6376 the history cache would break when the user hit Ctrl-C, and
6371 interact() offers no way to add any hooks to it.
6377 interact() offers no way to add any hooks to it.
6372
6378
6373 2001-12-23 Fernando Perez <fperez@colorado.edu>
6379 2001-12-23 Fernando Perez <fperez@colorado.edu>
6374
6380
6375 * setup.py: added check for 'MANIFEST' before trying to remove
6381 * setup.py: added check for 'MANIFEST' before trying to remove
6376 it. Thanks to Sean Reifschneider.
6382 it. Thanks to Sean Reifschneider.
6377
6383
6378 2001-12-22 Fernando Perez <fperez@colorado.edu>
6384 2001-12-22 Fernando Perez <fperez@colorado.edu>
6379
6385
6380 * Released 0.2.2.
6386 * Released 0.2.2.
6381
6387
6382 * Finished (reasonably) writing the manual. Later will add the
6388 * Finished (reasonably) writing the manual. Later will add the
6383 python-standard navigation stylesheets, but for the time being
6389 python-standard navigation stylesheets, but for the time being
6384 it's fairly complete. Distribution will include html and pdf
6390 it's fairly complete. Distribution will include html and pdf
6385 versions.
6391 versions.
6386
6392
6387 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6393 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6388 (MayaVi author).
6394 (MayaVi author).
6389
6395
6390 2001-12-21 Fernando Perez <fperez@colorado.edu>
6396 2001-12-21 Fernando Perez <fperez@colorado.edu>
6391
6397
6392 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6398 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6393 good public release, I think (with the manual and the distutils
6399 good public release, I think (with the manual and the distutils
6394 installer). The manual can use some work, but that can go
6400 installer). The manual can use some work, but that can go
6395 slowly. Otherwise I think it's quite nice for end users. Next
6401 slowly. Otherwise I think it's quite nice for end users. Next
6396 summer, rewrite the guts of it...
6402 summer, rewrite the guts of it...
6397
6403
6398 * Changed format of ipythonrc files to use whitespace as the
6404 * Changed format of ipythonrc files to use whitespace as the
6399 separator instead of an explicit '='. Cleaner.
6405 separator instead of an explicit '='. Cleaner.
6400
6406
6401 2001-12-20 Fernando Perez <fperez@colorado.edu>
6407 2001-12-20 Fernando Perez <fperez@colorado.edu>
6402
6408
6403 * Started a manual in LyX. For now it's just a quick merge of the
6409 * Started a manual in LyX. For now it's just a quick merge of the
6404 various internal docstrings and READMEs. Later it may grow into a
6410 various internal docstrings and READMEs. Later it may grow into a
6405 nice, full-blown manual.
6411 nice, full-blown manual.
6406
6412
6407 * Set up a distutils based installer. Installation should now be
6413 * Set up a distutils based installer. Installation should now be
6408 trivially simple for end-users.
6414 trivially simple for end-users.
6409
6415
6410 2001-12-11 Fernando Perez <fperez@colorado.edu>
6416 2001-12-11 Fernando Perez <fperez@colorado.edu>
6411
6417
6412 * Released 0.2.0. First public release, announced it at
6418 * Released 0.2.0. First public release, announced it at
6413 comp.lang.python. From now on, just bugfixes...
6419 comp.lang.python. From now on, just bugfixes...
6414
6420
6415 * Went through all the files, set copyright/license notices and
6421 * Went through all the files, set copyright/license notices and
6416 cleaned up things. Ready for release.
6422 cleaned up things. Ready for release.
6417
6423
6418 2001-12-10 Fernando Perez <fperez@colorado.edu>
6424 2001-12-10 Fernando Perez <fperez@colorado.edu>
6419
6425
6420 * Changed the first-time installer not to use tarfiles. It's more
6426 * Changed the first-time installer not to use tarfiles. It's more
6421 robust now and less unix-dependent. Also makes it easier for
6427 robust now and less unix-dependent. Also makes it easier for
6422 people to later upgrade versions.
6428 people to later upgrade versions.
6423
6429
6424 * Changed @exit to @abort to reflect the fact that it's pretty
6430 * Changed @exit to @abort to reflect the fact that it's pretty
6425 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6431 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6426 becomes significant only when IPyhton is embedded: in that case,
6432 becomes significant only when IPyhton is embedded: in that case,
6427 C-D closes IPython only, but @abort kills the enclosing program
6433 C-D closes IPython only, but @abort kills the enclosing program
6428 too (unless it had called IPython inside a try catching
6434 too (unless it had called IPython inside a try catching
6429 SystemExit).
6435 SystemExit).
6430
6436
6431 * Created Shell module which exposes the actuall IPython Shell
6437 * Created Shell module which exposes the actuall IPython Shell
6432 classes, currently the normal and the embeddable one. This at
6438 classes, currently the normal and the embeddable one. This at
6433 least offers a stable interface we won't need to change when
6439 least offers a stable interface we won't need to change when
6434 (later) the internals are rewritten. That rewrite will be confined
6440 (later) the internals are rewritten. That rewrite will be confined
6435 to iplib and ipmaker, but the Shell interface should remain as is.
6441 to iplib and ipmaker, but the Shell interface should remain as is.
6436
6442
6437 * Added embed module which offers an embeddable IPShell object,
6443 * Added embed module which offers an embeddable IPShell object,
6438 useful to fire up IPython *inside* a running program. Great for
6444 useful to fire up IPython *inside* a running program. Great for
6439 debugging or dynamical data analysis.
6445 debugging or dynamical data analysis.
6440
6446
6441 2001-12-08 Fernando Perez <fperez@colorado.edu>
6447 2001-12-08 Fernando Perez <fperez@colorado.edu>
6442
6448
6443 * Fixed small bug preventing seeing info from methods of defined
6449 * Fixed small bug preventing seeing info from methods of defined
6444 objects (incorrect namespace in _ofind()).
6450 objects (incorrect namespace in _ofind()).
6445
6451
6446 * Documentation cleanup. Moved the main usage docstrings to a
6452 * Documentation cleanup. Moved the main usage docstrings to a
6447 separate file, usage.py (cleaner to maintain, and hopefully in the
6453 separate file, usage.py (cleaner to maintain, and hopefully in the
6448 future some perlpod-like way of producing interactive, man and
6454 future some perlpod-like way of producing interactive, man and
6449 html docs out of it will be found).
6455 html docs out of it will be found).
6450
6456
6451 * Added @profile to see your profile at any time.
6457 * Added @profile to see your profile at any time.
6452
6458
6453 * Added @p as an alias for 'print'. It's especially convenient if
6459 * Added @p as an alias for 'print'. It's especially convenient if
6454 using automagic ('p x' prints x).
6460 using automagic ('p x' prints x).
6455
6461
6456 * Small cleanups and fixes after a pychecker run.
6462 * Small cleanups and fixes after a pychecker run.
6457
6463
6458 * Changed the @cd command to handle @cd - and @cd -<n> for
6464 * Changed the @cd command to handle @cd - and @cd -<n> for
6459 visiting any directory in _dh.
6465 visiting any directory in _dh.
6460
6466
6461 * Introduced _dh, a history of visited directories. @dhist prints
6467 * Introduced _dh, a history of visited directories. @dhist prints
6462 it out with numbers.
6468 it out with numbers.
6463
6469
6464 2001-12-07 Fernando Perez <fperez@colorado.edu>
6470 2001-12-07 Fernando Perez <fperez@colorado.edu>
6465
6471
6466 * Released 0.1.22
6472 * Released 0.1.22
6467
6473
6468 * Made initialization a bit more robust against invalid color
6474 * Made initialization a bit more robust against invalid color
6469 options in user input (exit, not traceback-crash).
6475 options in user input (exit, not traceback-crash).
6470
6476
6471 * Changed the bug crash reporter to write the report only in the
6477 * Changed the bug crash reporter to write the report only in the
6472 user's .ipython directory. That way IPython won't litter people's
6478 user's .ipython directory. That way IPython won't litter people's
6473 hard disks with crash files all over the place. Also print on
6479 hard disks with crash files all over the place. Also print on
6474 screen the necessary mail command.
6480 screen the necessary mail command.
6475
6481
6476 * With the new ultraTB, implemented LightBG color scheme for light
6482 * With the new ultraTB, implemented LightBG color scheme for light
6477 background terminals. A lot of people like white backgrounds, so I
6483 background terminals. A lot of people like white backgrounds, so I
6478 guess we should at least give them something readable.
6484 guess we should at least give them something readable.
6479
6485
6480 2001-12-06 Fernando Perez <fperez@colorado.edu>
6486 2001-12-06 Fernando Perez <fperez@colorado.edu>
6481
6487
6482 * Modified the structure of ultraTB. Now there's a proper class
6488 * Modified the structure of ultraTB. Now there's a proper class
6483 for tables of color schemes which allow adding schemes easily and
6489 for tables of color schemes which allow adding schemes easily and
6484 switching the active scheme without creating a new instance every
6490 switching the active scheme without creating a new instance every
6485 time (which was ridiculous). The syntax for creating new schemes
6491 time (which was ridiculous). The syntax for creating new schemes
6486 is also cleaner. I think ultraTB is finally done, with a clean
6492 is also cleaner. I think ultraTB is finally done, with a clean
6487 class structure. Names are also much cleaner (now there's proper
6493 class structure. Names are also much cleaner (now there's proper
6488 color tables, no need for every variable to also have 'color' in
6494 color tables, no need for every variable to also have 'color' in
6489 its name).
6495 its name).
6490
6496
6491 * Broke down genutils into separate files. Now genutils only
6497 * Broke down genutils into separate files. Now genutils only
6492 contains utility functions, and classes have been moved to their
6498 contains utility functions, and classes have been moved to their
6493 own files (they had enough independent functionality to warrant
6499 own files (they had enough independent functionality to warrant
6494 it): ConfigLoader, OutputTrap, Struct.
6500 it): ConfigLoader, OutputTrap, Struct.
6495
6501
6496 2001-12-05 Fernando Perez <fperez@colorado.edu>
6502 2001-12-05 Fernando Perez <fperez@colorado.edu>
6497
6503
6498 * IPython turns 21! Released version 0.1.21, as a candidate for
6504 * IPython turns 21! Released version 0.1.21, as a candidate for
6499 public consumption. If all goes well, release in a few days.
6505 public consumption. If all goes well, release in a few days.
6500
6506
6501 * Fixed path bug (files in Extensions/ directory wouldn't be found
6507 * Fixed path bug (files in Extensions/ directory wouldn't be found
6502 unless IPython/ was explicitly in sys.path).
6508 unless IPython/ was explicitly in sys.path).
6503
6509
6504 * Extended the FlexCompleter class as MagicCompleter to allow
6510 * Extended the FlexCompleter class as MagicCompleter to allow
6505 completion of @-starting lines.
6511 completion of @-starting lines.
6506
6512
6507 * Created __release__.py file as a central repository for release
6513 * Created __release__.py file as a central repository for release
6508 info that other files can read from.
6514 info that other files can read from.
6509
6515
6510 * Fixed small bug in logging: when logging was turned on in
6516 * Fixed small bug in logging: when logging was turned on in
6511 mid-session, old lines with special meanings (!@?) were being
6517 mid-session, old lines with special meanings (!@?) were being
6512 logged without the prepended comment, which is necessary since
6518 logged without the prepended comment, which is necessary since
6513 they are not truly valid python syntax. This should make session
6519 they are not truly valid python syntax. This should make session
6514 restores produce less errors.
6520 restores produce less errors.
6515
6521
6516 * The namespace cleanup forced me to make a FlexCompleter class
6522 * The namespace cleanup forced me to make a FlexCompleter class
6517 which is nothing but a ripoff of rlcompleter, but with selectable
6523 which is nothing but a ripoff of rlcompleter, but with selectable
6518 namespace (rlcompleter only works in __main__.__dict__). I'll try
6524 namespace (rlcompleter only works in __main__.__dict__). I'll try
6519 to submit a note to the authors to see if this change can be
6525 to submit a note to the authors to see if this change can be
6520 incorporated in future rlcompleter releases (Dec.6: done)
6526 incorporated in future rlcompleter releases (Dec.6: done)
6521
6527
6522 * More fixes to namespace handling. It was a mess! Now all
6528 * More fixes to namespace handling. It was a mess! Now all
6523 explicit references to __main__.__dict__ are gone (except when
6529 explicit references to __main__.__dict__ are gone (except when
6524 really needed) and everything is handled through the namespace
6530 really needed) and everything is handled through the namespace
6525 dicts in the IPython instance. We seem to be getting somewhere
6531 dicts in the IPython instance. We seem to be getting somewhere
6526 with this, finally...
6532 with this, finally...
6527
6533
6528 * Small documentation updates.
6534 * Small documentation updates.
6529
6535
6530 * Created the Extensions directory under IPython (with an
6536 * Created the Extensions directory under IPython (with an
6531 __init__.py). Put the PhysicalQ stuff there. This directory should
6537 __init__.py). Put the PhysicalQ stuff there. This directory should
6532 be used for all special-purpose extensions.
6538 be used for all special-purpose extensions.
6533
6539
6534 * File renaming:
6540 * File renaming:
6535 ipythonlib --> ipmaker
6541 ipythonlib --> ipmaker
6536 ipplib --> iplib
6542 ipplib --> iplib
6537 This makes a bit more sense in terms of what these files actually do.
6543 This makes a bit more sense in terms of what these files actually do.
6538
6544
6539 * Moved all the classes and functions in ipythonlib to ipplib, so
6545 * Moved all the classes and functions in ipythonlib to ipplib, so
6540 now ipythonlib only has make_IPython(). This will ease up its
6546 now ipythonlib only has make_IPython(). This will ease up its
6541 splitting in smaller functional chunks later.
6547 splitting in smaller functional chunks later.
6542
6548
6543 * Cleaned up (done, I think) output of @whos. Better column
6549 * Cleaned up (done, I think) output of @whos. Better column
6544 formatting, and now shows str(var) for as much as it can, which is
6550 formatting, and now shows str(var) for as much as it can, which is
6545 typically what one gets with a 'print var'.
6551 typically what one gets with a 'print var'.
6546
6552
6547 2001-12-04 Fernando Perez <fperez@colorado.edu>
6553 2001-12-04 Fernando Perez <fperez@colorado.edu>
6548
6554
6549 * Fixed namespace problems. Now builtin/IPyhton/user names get
6555 * Fixed namespace problems. Now builtin/IPyhton/user names get
6550 properly reported in their namespace. Internal namespace handling
6556 properly reported in their namespace. Internal namespace handling
6551 is finally getting decent (not perfect yet, but much better than
6557 is finally getting decent (not perfect yet, but much better than
6552 the ad-hoc mess we had).
6558 the ad-hoc mess we had).
6553
6559
6554 * Removed -exit option. If people just want to run a python
6560 * Removed -exit option. If people just want to run a python
6555 script, that's what the normal interpreter is for. Less
6561 script, that's what the normal interpreter is for. Less
6556 unnecessary options, less chances for bugs.
6562 unnecessary options, less chances for bugs.
6557
6563
6558 * Added a crash handler which generates a complete post-mortem if
6564 * Added a crash handler which generates a complete post-mortem if
6559 IPython crashes. This will help a lot in tracking bugs down the
6565 IPython crashes. This will help a lot in tracking bugs down the
6560 road.
6566 road.
6561
6567
6562 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6568 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6563 which were boud to functions being reassigned would bypass the
6569 which were boud to functions being reassigned would bypass the
6564 logger, breaking the sync of _il with the prompt counter. This
6570 logger, breaking the sync of _il with the prompt counter. This
6565 would then crash IPython later when a new line was logged.
6571 would then crash IPython later when a new line was logged.
6566
6572
6567 2001-12-02 Fernando Perez <fperez@colorado.edu>
6573 2001-12-02 Fernando Perez <fperez@colorado.edu>
6568
6574
6569 * Made IPython a package. This means people don't have to clutter
6575 * Made IPython a package. This means people don't have to clutter
6570 their sys.path with yet another directory. Changed the INSTALL
6576 their sys.path with yet another directory. Changed the INSTALL
6571 file accordingly.
6577 file accordingly.
6572
6578
6573 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6579 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6574 sorts its output (so @who shows it sorted) and @whos formats the
6580 sorts its output (so @who shows it sorted) and @whos formats the
6575 table according to the width of the first column. Nicer, easier to
6581 table according to the width of the first column. Nicer, easier to
6576 read. Todo: write a generic table_format() which takes a list of
6582 read. Todo: write a generic table_format() which takes a list of
6577 lists and prints it nicely formatted, with optional row/column
6583 lists and prints it nicely formatted, with optional row/column
6578 separators and proper padding and justification.
6584 separators and proper padding and justification.
6579
6585
6580 * Released 0.1.20
6586 * Released 0.1.20
6581
6587
6582 * Fixed bug in @log which would reverse the inputcache list (a
6588 * Fixed bug in @log which would reverse the inputcache list (a
6583 copy operation was missing).
6589 copy operation was missing).
6584
6590
6585 * Code cleanup. @config was changed to use page(). Better, since
6591 * Code cleanup. @config was changed to use page(). Better, since
6586 its output is always quite long.
6592 its output is always quite long.
6587
6593
6588 * Itpl is back as a dependency. I was having too many problems
6594 * Itpl is back as a dependency. I was having too many problems
6589 getting the parametric aliases to work reliably, and it's just
6595 getting the parametric aliases to work reliably, and it's just
6590 easier to code weird string operations with it than playing %()s
6596 easier to code weird string operations with it than playing %()s
6591 games. It's only ~6k, so I don't think it's too big a deal.
6597 games. It's only ~6k, so I don't think it's too big a deal.
6592
6598
6593 * Found (and fixed) a very nasty bug with history. !lines weren't
6599 * Found (and fixed) a very nasty bug with history. !lines weren't
6594 getting cached, and the out of sync caches would crash
6600 getting cached, and the out of sync caches would crash
6595 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6601 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6596 division of labor a bit better. Bug fixed, cleaner structure.
6602 division of labor a bit better. Bug fixed, cleaner structure.
6597
6603
6598 2001-12-01 Fernando Perez <fperez@colorado.edu>
6604 2001-12-01 Fernando Perez <fperez@colorado.edu>
6599
6605
6600 * Released 0.1.19
6606 * Released 0.1.19
6601
6607
6602 * Added option -n to @hist to prevent line number printing. Much
6608 * Added option -n to @hist to prevent line number printing. Much
6603 easier to copy/paste code this way.
6609 easier to copy/paste code this way.
6604
6610
6605 * Created global _il to hold the input list. Allows easy
6611 * Created global _il to hold the input list. Allows easy
6606 re-execution of blocks of code by slicing it (inspired by Janko's
6612 re-execution of blocks of code by slicing it (inspired by Janko's
6607 comment on 'macros').
6613 comment on 'macros').
6608
6614
6609 * Small fixes and doc updates.
6615 * Small fixes and doc updates.
6610
6616
6611 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6617 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6612 much too fragile with automagic. Handles properly multi-line
6618 much too fragile with automagic. Handles properly multi-line
6613 statements and takes parameters.
6619 statements and takes parameters.
6614
6620
6615 2001-11-30 Fernando Perez <fperez@colorado.edu>
6621 2001-11-30 Fernando Perez <fperez@colorado.edu>
6616
6622
6617 * Version 0.1.18 released.
6623 * Version 0.1.18 released.
6618
6624
6619 * Fixed nasty namespace bug in initial module imports.
6625 * Fixed nasty namespace bug in initial module imports.
6620
6626
6621 * Added copyright/license notes to all code files (except
6627 * Added copyright/license notes to all code files (except
6622 DPyGetOpt). For the time being, LGPL. That could change.
6628 DPyGetOpt). For the time being, LGPL. That could change.
6623
6629
6624 * Rewrote a much nicer README, updated INSTALL, cleaned up
6630 * Rewrote a much nicer README, updated INSTALL, cleaned up
6625 ipythonrc-* samples.
6631 ipythonrc-* samples.
6626
6632
6627 * Overall code/documentation cleanup. Basically ready for
6633 * Overall code/documentation cleanup. Basically ready for
6628 release. Only remaining thing: licence decision (LGPL?).
6634 release. Only remaining thing: licence decision (LGPL?).
6629
6635
6630 * Converted load_config to a class, ConfigLoader. Now recursion
6636 * Converted load_config to a class, ConfigLoader. Now recursion
6631 control is better organized. Doesn't include the same file twice.
6637 control is better organized. Doesn't include the same file twice.
6632
6638
6633 2001-11-29 Fernando Perez <fperez@colorado.edu>
6639 2001-11-29 Fernando Perez <fperez@colorado.edu>
6634
6640
6635 * Got input history working. Changed output history variables from
6641 * Got input history working. Changed output history variables from
6636 _p to _o so that _i is for input and _o for output. Just cleaner
6642 _p to _o so that _i is for input and _o for output. Just cleaner
6637 convention.
6643 convention.
6638
6644
6639 * Implemented parametric aliases. This pretty much allows the
6645 * Implemented parametric aliases. This pretty much allows the
6640 alias system to offer full-blown shell convenience, I think.
6646 alias system to offer full-blown shell convenience, I think.
6641
6647
6642 * Version 0.1.17 released, 0.1.18 opened.
6648 * Version 0.1.17 released, 0.1.18 opened.
6643
6649
6644 * dot_ipython/ipythonrc (alias): added documentation.
6650 * dot_ipython/ipythonrc (alias): added documentation.
6645 (xcolor): Fixed small bug (xcolors -> xcolor)
6651 (xcolor): Fixed small bug (xcolors -> xcolor)
6646
6652
6647 * Changed the alias system. Now alias is a magic command to define
6653 * Changed the alias system. Now alias is a magic command to define
6648 aliases just like the shell. Rationale: the builtin magics should
6654 aliases just like the shell. Rationale: the builtin magics should
6649 be there for things deeply connected to IPython's
6655 be there for things deeply connected to IPython's
6650 architecture. And this is a much lighter system for what I think
6656 architecture. And this is a much lighter system for what I think
6651 is the really important feature: allowing users to define quickly
6657 is the really important feature: allowing users to define quickly
6652 magics that will do shell things for them, so they can customize
6658 magics that will do shell things for them, so they can customize
6653 IPython easily to match their work habits. If someone is really
6659 IPython easily to match their work habits. If someone is really
6654 desperate to have another name for a builtin alias, they can
6660 desperate to have another name for a builtin alias, they can
6655 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6661 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6656 works.
6662 works.
6657
6663
6658 2001-11-28 Fernando Perez <fperez@colorado.edu>
6664 2001-11-28 Fernando Perez <fperez@colorado.edu>
6659
6665
6660 * Changed @file so that it opens the source file at the proper
6666 * Changed @file so that it opens the source file at the proper
6661 line. Since it uses less, if your EDITOR environment is
6667 line. Since it uses less, if your EDITOR environment is
6662 configured, typing v will immediately open your editor of choice
6668 configured, typing v will immediately open your editor of choice
6663 right at the line where the object is defined. Not as quick as
6669 right at the line where the object is defined. Not as quick as
6664 having a direct @edit command, but for all intents and purposes it
6670 having a direct @edit command, but for all intents and purposes it
6665 works. And I don't have to worry about writing @edit to deal with
6671 works. And I don't have to worry about writing @edit to deal with
6666 all the editors, less does that.
6672 all the editors, less does that.
6667
6673
6668 * Version 0.1.16 released, 0.1.17 opened.
6674 * Version 0.1.16 released, 0.1.17 opened.
6669
6675
6670 * Fixed some nasty bugs in the page/page_dumb combo that could
6676 * Fixed some nasty bugs in the page/page_dumb combo that could
6671 crash IPython.
6677 crash IPython.
6672
6678
6673 2001-11-27 Fernando Perez <fperez@colorado.edu>
6679 2001-11-27 Fernando Perez <fperez@colorado.edu>
6674
6680
6675 * Version 0.1.15 released, 0.1.16 opened.
6681 * Version 0.1.15 released, 0.1.16 opened.
6676
6682
6677 * Finally got ? and ?? to work for undefined things: now it's
6683 * Finally got ? and ?? to work for undefined things: now it's
6678 possible to type {}.get? and get information about the get method
6684 possible to type {}.get? and get information about the get method
6679 of dicts, or os.path? even if only os is defined (so technically
6685 of dicts, or os.path? even if only os is defined (so technically
6680 os.path isn't). Works at any level. For example, after import os,
6686 os.path isn't). Works at any level. For example, after import os,
6681 os?, os.path?, os.path.abspath? all work. This is great, took some
6687 os?, os.path?, os.path.abspath? all work. This is great, took some
6682 work in _ofind.
6688 work in _ofind.
6683
6689
6684 * Fixed more bugs with logging. The sanest way to do it was to add
6690 * Fixed more bugs with logging. The sanest way to do it was to add
6685 to @log a 'mode' parameter. Killed two in one shot (this mode
6691 to @log a 'mode' parameter. Killed two in one shot (this mode
6686 option was a request of Janko's). I think it's finally clean
6692 option was a request of Janko's). I think it's finally clean
6687 (famous last words).
6693 (famous last words).
6688
6694
6689 * Added a page_dumb() pager which does a decent job of paging on
6695 * Added a page_dumb() pager which does a decent job of paging on
6690 screen, if better things (like less) aren't available. One less
6696 screen, if better things (like less) aren't available. One less
6691 unix dependency (someday maybe somebody will port this to
6697 unix dependency (someday maybe somebody will port this to
6692 windows).
6698 windows).
6693
6699
6694 * Fixed problem in magic_log: would lock of logging out if log
6700 * Fixed problem in magic_log: would lock of logging out if log
6695 creation failed (because it would still think it had succeeded).
6701 creation failed (because it would still think it had succeeded).
6696
6702
6697 * Improved the page() function using curses to auto-detect screen
6703 * Improved the page() function using curses to auto-detect screen
6698 size. Now it can make a much better decision on whether to print
6704 size. Now it can make a much better decision on whether to print
6699 or page a string. Option screen_length was modified: a value 0
6705 or page a string. Option screen_length was modified: a value 0
6700 means auto-detect, and that's the default now.
6706 means auto-detect, and that's the default now.
6701
6707
6702 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6708 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6703 go out. I'll test it for a few days, then talk to Janko about
6709 go out. I'll test it for a few days, then talk to Janko about
6704 licences and announce it.
6710 licences and announce it.
6705
6711
6706 * Fixed the length of the auto-generated ---> prompt which appears
6712 * Fixed the length of the auto-generated ---> prompt which appears
6707 for auto-parens and auto-quotes. Getting this right isn't trivial,
6713 for auto-parens and auto-quotes. Getting this right isn't trivial,
6708 with all the color escapes, different prompt types and optional
6714 with all the color escapes, different prompt types and optional
6709 separators. But it seems to be working in all the combinations.
6715 separators. But it seems to be working in all the combinations.
6710
6716
6711 2001-11-26 Fernando Perez <fperez@colorado.edu>
6717 2001-11-26 Fernando Perez <fperez@colorado.edu>
6712
6718
6713 * Wrote a regexp filter to get option types from the option names
6719 * Wrote a regexp filter to get option types from the option names
6714 string. This eliminates the need to manually keep two duplicate
6720 string. This eliminates the need to manually keep two duplicate
6715 lists.
6721 lists.
6716
6722
6717 * Removed the unneeded check_option_names. Now options are handled
6723 * Removed the unneeded check_option_names. Now options are handled
6718 in a much saner manner and it's easy to visually check that things
6724 in a much saner manner and it's easy to visually check that things
6719 are ok.
6725 are ok.
6720
6726
6721 * Updated version numbers on all files I modified to carry a
6727 * Updated version numbers on all files I modified to carry a
6722 notice so Janko and Nathan have clear version markers.
6728 notice so Janko and Nathan have clear version markers.
6723
6729
6724 * Updated docstring for ultraTB with my changes. I should send
6730 * Updated docstring for ultraTB with my changes. I should send
6725 this to Nathan.
6731 this to Nathan.
6726
6732
6727 * Lots of small fixes. Ran everything through pychecker again.
6733 * Lots of small fixes. Ran everything through pychecker again.
6728
6734
6729 * Made loading of deep_reload an cmd line option. If it's not too
6735 * Made loading of deep_reload an cmd line option. If it's not too
6730 kosher, now people can just disable it. With -nodeep_reload it's
6736 kosher, now people can just disable it. With -nodeep_reload it's
6731 still available as dreload(), it just won't overwrite reload().
6737 still available as dreload(), it just won't overwrite reload().
6732
6738
6733 * Moved many options to the no| form (-opt and -noopt
6739 * Moved many options to the no| form (-opt and -noopt
6734 accepted). Cleaner.
6740 accepted). Cleaner.
6735
6741
6736 * Changed magic_log so that if called with no parameters, it uses
6742 * Changed magic_log so that if called with no parameters, it uses
6737 'rotate' mode. That way auto-generated logs aren't automatically
6743 'rotate' mode. That way auto-generated logs aren't automatically
6738 over-written. For normal logs, now a backup is made if it exists
6744 over-written. For normal logs, now a backup is made if it exists
6739 (only 1 level of backups). A new 'backup' mode was added to the
6745 (only 1 level of backups). A new 'backup' mode was added to the
6740 Logger class to support this. This was a request by Janko.
6746 Logger class to support this. This was a request by Janko.
6741
6747
6742 * Added @logoff/@logon to stop/restart an active log.
6748 * Added @logoff/@logon to stop/restart an active log.
6743
6749
6744 * Fixed a lot of bugs in log saving/replay. It was pretty
6750 * Fixed a lot of bugs in log saving/replay. It was pretty
6745 broken. Now special lines (!@,/) appear properly in the command
6751 broken. Now special lines (!@,/) appear properly in the command
6746 history after a log replay.
6752 history after a log replay.
6747
6753
6748 * Tried and failed to implement full session saving via pickle. My
6754 * Tried and failed to implement full session saving via pickle. My
6749 idea was to pickle __main__.__dict__, but modules can't be
6755 idea was to pickle __main__.__dict__, but modules can't be
6750 pickled. This would be a better alternative to replaying logs, but
6756 pickled. This would be a better alternative to replaying logs, but
6751 seems quite tricky to get to work. Changed -session to be called
6757 seems quite tricky to get to work. Changed -session to be called
6752 -logplay, which more accurately reflects what it does. And if we
6758 -logplay, which more accurately reflects what it does. And if we
6753 ever get real session saving working, -session is now available.
6759 ever get real session saving working, -session is now available.
6754
6760
6755 * Implemented color schemes for prompts also. As for tracebacks,
6761 * Implemented color schemes for prompts also. As for tracebacks,
6756 currently only NoColor and Linux are supported. But now the
6762 currently only NoColor and Linux are supported. But now the
6757 infrastructure is in place, based on a generic ColorScheme
6763 infrastructure is in place, based on a generic ColorScheme
6758 class. So writing and activating new schemes both for the prompts
6764 class. So writing and activating new schemes both for the prompts
6759 and the tracebacks should be straightforward.
6765 and the tracebacks should be straightforward.
6760
6766
6761 * Version 0.1.13 released, 0.1.14 opened.
6767 * Version 0.1.13 released, 0.1.14 opened.
6762
6768
6763 * Changed handling of options for output cache. Now counter is
6769 * Changed handling of options for output cache. Now counter is
6764 hardwired starting at 1 and one specifies the maximum number of
6770 hardwired starting at 1 and one specifies the maximum number of
6765 entries *in the outcache* (not the max prompt counter). This is
6771 entries *in the outcache* (not the max prompt counter). This is
6766 much better, since many statements won't increase the cache
6772 much better, since many statements won't increase the cache
6767 count. It also eliminated some confusing options, now there's only
6773 count. It also eliminated some confusing options, now there's only
6768 one: cache_size.
6774 one: cache_size.
6769
6775
6770 * Added 'alias' magic function and magic_alias option in the
6776 * Added 'alias' magic function and magic_alias option in the
6771 ipythonrc file. Now the user can easily define whatever names he
6777 ipythonrc file. Now the user can easily define whatever names he
6772 wants for the magic functions without having to play weird
6778 wants for the magic functions without having to play weird
6773 namespace games. This gives IPython a real shell-like feel.
6779 namespace games. This gives IPython a real shell-like feel.
6774
6780
6775 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6781 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6776 @ or not).
6782 @ or not).
6777
6783
6778 This was one of the last remaining 'visible' bugs (that I know
6784 This was one of the last remaining 'visible' bugs (that I know
6779 of). I think if I can clean up the session loading so it works
6785 of). I think if I can clean up the session loading so it works
6780 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6786 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6781 about licensing).
6787 about licensing).
6782
6788
6783 2001-11-25 Fernando Perez <fperez@colorado.edu>
6789 2001-11-25 Fernando Perez <fperez@colorado.edu>
6784
6790
6785 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6791 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6786 there's a cleaner distinction between what ? and ?? show.
6792 there's a cleaner distinction between what ? and ?? show.
6787
6793
6788 * Added screen_length option. Now the user can define his own
6794 * Added screen_length option. Now the user can define his own
6789 screen size for page() operations.
6795 screen size for page() operations.
6790
6796
6791 * Implemented magic shell-like functions with automatic code
6797 * Implemented magic shell-like functions with automatic code
6792 generation. Now adding another function is just a matter of adding
6798 generation. Now adding another function is just a matter of adding
6793 an entry to a dict, and the function is dynamically generated at
6799 an entry to a dict, and the function is dynamically generated at
6794 run-time. Python has some really cool features!
6800 run-time. Python has some really cool features!
6795
6801
6796 * Renamed many options to cleanup conventions a little. Now all
6802 * Renamed many options to cleanup conventions a little. Now all
6797 are lowercase, and only underscores where needed. Also in the code
6803 are lowercase, and only underscores where needed. Also in the code
6798 option name tables are clearer.
6804 option name tables are clearer.
6799
6805
6800 * Changed prompts a little. Now input is 'In [n]:' instead of
6806 * Changed prompts a little. Now input is 'In [n]:' instead of
6801 'In[n]:='. This allows it the numbers to be aligned with the
6807 'In[n]:='. This allows it the numbers to be aligned with the
6802 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6808 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6803 Python (it was a Mathematica thing). The '...' continuation prompt
6809 Python (it was a Mathematica thing). The '...' continuation prompt
6804 was also changed a little to align better.
6810 was also changed a little to align better.
6805
6811
6806 * Fixed bug when flushing output cache. Not all _p<n> variables
6812 * Fixed bug when flushing output cache. Not all _p<n> variables
6807 exist, so their deletion needs to be wrapped in a try:
6813 exist, so their deletion needs to be wrapped in a try:
6808
6814
6809 * Figured out how to properly use inspect.formatargspec() (it
6815 * Figured out how to properly use inspect.formatargspec() (it
6810 requires the args preceded by *). So I removed all the code from
6816 requires the args preceded by *). So I removed all the code from
6811 _get_pdef in Magic, which was just replicating that.
6817 _get_pdef in Magic, which was just replicating that.
6812
6818
6813 * Added test to prefilter to allow redefining magic function names
6819 * Added test to prefilter to allow redefining magic function names
6814 as variables. This is ok, since the @ form is always available,
6820 as variables. This is ok, since the @ form is always available,
6815 but whe should allow the user to define a variable called 'ls' if
6821 but whe should allow the user to define a variable called 'ls' if
6816 he needs it.
6822 he needs it.
6817
6823
6818 * Moved the ToDo information from README into a separate ToDo.
6824 * Moved the ToDo information from README into a separate ToDo.
6819
6825
6820 * General code cleanup and small bugfixes. I think it's close to a
6826 * General code cleanup and small bugfixes. I think it's close to a
6821 state where it can be released, obviously with a big 'beta'
6827 state where it can be released, obviously with a big 'beta'
6822 warning on it.
6828 warning on it.
6823
6829
6824 * Got the magic function split to work. Now all magics are defined
6830 * Got the magic function split to work. Now all magics are defined
6825 in a separate class. It just organizes things a bit, and now
6831 in a separate class. It just organizes things a bit, and now
6826 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6832 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6827 was too long).
6833 was too long).
6828
6834
6829 * Changed @clear to @reset to avoid potential confusions with
6835 * Changed @clear to @reset to avoid potential confusions with
6830 the shell command clear. Also renamed @cl to @clear, which does
6836 the shell command clear. Also renamed @cl to @clear, which does
6831 exactly what people expect it to from their shell experience.
6837 exactly what people expect it to from their shell experience.
6832
6838
6833 Added a check to the @reset command (since it's so
6839 Added a check to the @reset command (since it's so
6834 destructive, it's probably a good idea to ask for confirmation).
6840 destructive, it's probably a good idea to ask for confirmation).
6835 But now reset only works for full namespace resetting. Since the
6841 But now reset only works for full namespace resetting. Since the
6836 del keyword is already there for deleting a few specific
6842 del keyword is already there for deleting a few specific
6837 variables, I don't see the point of having a redundant magic
6843 variables, I don't see the point of having a redundant magic
6838 function for the same task.
6844 function for the same task.
6839
6845
6840 2001-11-24 Fernando Perez <fperez@colorado.edu>
6846 2001-11-24 Fernando Perez <fperez@colorado.edu>
6841
6847
6842 * Updated the builtin docs (esp. the ? ones).
6848 * Updated the builtin docs (esp. the ? ones).
6843
6849
6844 * Ran all the code through pychecker. Not terribly impressed with
6850 * Ran all the code through pychecker. Not terribly impressed with
6845 it: lots of spurious warnings and didn't really find anything of
6851 it: lots of spurious warnings and didn't really find anything of
6846 substance (just a few modules being imported and not used).
6852 substance (just a few modules being imported and not used).
6847
6853
6848 * Implemented the new ultraTB functionality into IPython. New
6854 * Implemented the new ultraTB functionality into IPython. New
6849 option: xcolors. This chooses color scheme. xmode now only selects
6855 option: xcolors. This chooses color scheme. xmode now only selects
6850 between Plain and Verbose. Better orthogonality.
6856 between Plain and Verbose. Better orthogonality.
6851
6857
6852 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6858 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6853 mode and color scheme for the exception handlers. Now it's
6859 mode and color scheme for the exception handlers. Now it's
6854 possible to have the verbose traceback with no coloring.
6860 possible to have the verbose traceback with no coloring.
6855
6861
6856 2001-11-23 Fernando Perez <fperez@colorado.edu>
6862 2001-11-23 Fernando Perez <fperez@colorado.edu>
6857
6863
6858 * Version 0.1.12 released, 0.1.13 opened.
6864 * Version 0.1.12 released, 0.1.13 opened.
6859
6865
6860 * Removed option to set auto-quote and auto-paren escapes by
6866 * Removed option to set auto-quote and auto-paren escapes by
6861 user. The chances of breaking valid syntax are just too high. If
6867 user. The chances of breaking valid syntax are just too high. If
6862 someone *really* wants, they can always dig into the code.
6868 someone *really* wants, they can always dig into the code.
6863
6869
6864 * Made prompt separators configurable.
6870 * Made prompt separators configurable.
6865
6871
6866 2001-11-22 Fernando Perez <fperez@colorado.edu>
6872 2001-11-22 Fernando Perez <fperez@colorado.edu>
6867
6873
6868 * Small bugfixes in many places.
6874 * Small bugfixes in many places.
6869
6875
6870 * Removed the MyCompleter class from ipplib. It seemed redundant
6876 * Removed the MyCompleter class from ipplib. It seemed redundant
6871 with the C-p,C-n history search functionality. Less code to
6877 with the C-p,C-n history search functionality. Less code to
6872 maintain.
6878 maintain.
6873
6879
6874 * Moved all the original ipython.py code into ipythonlib.py. Right
6880 * Moved all the original ipython.py code into ipythonlib.py. Right
6875 now it's just one big dump into a function called make_IPython, so
6881 now it's just one big dump into a function called make_IPython, so
6876 no real modularity has been gained. But at least it makes the
6882 no real modularity has been gained. But at least it makes the
6877 wrapper script tiny, and since ipythonlib is a module, it gets
6883 wrapper script tiny, and since ipythonlib is a module, it gets
6878 compiled and startup is much faster.
6884 compiled and startup is much faster.
6879
6885
6880 This is a reasobably 'deep' change, so we should test it for a
6886 This is a reasobably 'deep' change, so we should test it for a
6881 while without messing too much more with the code.
6887 while without messing too much more with the code.
6882
6888
6883 2001-11-21 Fernando Perez <fperez@colorado.edu>
6889 2001-11-21 Fernando Perez <fperez@colorado.edu>
6884
6890
6885 * Version 0.1.11 released, 0.1.12 opened for further work.
6891 * Version 0.1.11 released, 0.1.12 opened for further work.
6886
6892
6887 * Removed dependency on Itpl. It was only needed in one place. It
6893 * Removed dependency on Itpl. It was only needed in one place. It
6888 would be nice if this became part of python, though. It makes life
6894 would be nice if this became part of python, though. It makes life
6889 *a lot* easier in some cases.
6895 *a lot* easier in some cases.
6890
6896
6891 * Simplified the prefilter code a bit. Now all handlers are
6897 * Simplified the prefilter code a bit. Now all handlers are
6892 expected to explicitly return a value (at least a blank string).
6898 expected to explicitly return a value (at least a blank string).
6893
6899
6894 * Heavy edits in ipplib. Removed the help system altogether. Now
6900 * Heavy edits in ipplib. Removed the help system altogether. Now
6895 obj?/?? is used for inspecting objects, a magic @doc prints
6901 obj?/?? is used for inspecting objects, a magic @doc prints
6896 docstrings, and full-blown Python help is accessed via the 'help'
6902 docstrings, and full-blown Python help is accessed via the 'help'
6897 keyword. This cleans up a lot of code (less to maintain) and does
6903 keyword. This cleans up a lot of code (less to maintain) and does
6898 the job. Since 'help' is now a standard Python component, might as
6904 the job. Since 'help' is now a standard Python component, might as
6899 well use it and remove duplicate functionality.
6905 well use it and remove duplicate functionality.
6900
6906
6901 Also removed the option to use ipplib as a standalone program. By
6907 Also removed the option to use ipplib as a standalone program. By
6902 now it's too dependent on other parts of IPython to function alone.
6908 now it's too dependent on other parts of IPython to function alone.
6903
6909
6904 * Fixed bug in genutils.pager. It would crash if the pager was
6910 * Fixed bug in genutils.pager. It would crash if the pager was
6905 exited immediately after opening (broken pipe).
6911 exited immediately after opening (broken pipe).
6906
6912
6907 * Trimmed down the VerboseTB reporting a little. The header is
6913 * Trimmed down the VerboseTB reporting a little. The header is
6908 much shorter now and the repeated exception arguments at the end
6914 much shorter now and the repeated exception arguments at the end
6909 have been removed. For interactive use the old header seemed a bit
6915 have been removed. For interactive use the old header seemed a bit
6910 excessive.
6916 excessive.
6911
6917
6912 * Fixed small bug in output of @whos for variables with multi-word
6918 * Fixed small bug in output of @whos for variables with multi-word
6913 types (only first word was displayed).
6919 types (only first word was displayed).
6914
6920
6915 2001-11-17 Fernando Perez <fperez@colorado.edu>
6921 2001-11-17 Fernando Perez <fperez@colorado.edu>
6916
6922
6917 * Version 0.1.10 released, 0.1.11 opened for further work.
6923 * Version 0.1.10 released, 0.1.11 opened for further work.
6918
6924
6919 * Modified dirs and friends. dirs now *returns* the stack (not
6925 * Modified dirs and friends. dirs now *returns* the stack (not
6920 prints), so one can manipulate it as a variable. Convenient to
6926 prints), so one can manipulate it as a variable. Convenient to
6921 travel along many directories.
6927 travel along many directories.
6922
6928
6923 * Fixed bug in magic_pdef: would only work with functions with
6929 * Fixed bug in magic_pdef: would only work with functions with
6924 arguments with default values.
6930 arguments with default values.
6925
6931
6926 2001-11-14 Fernando Perez <fperez@colorado.edu>
6932 2001-11-14 Fernando Perez <fperez@colorado.edu>
6927
6933
6928 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6934 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6929 example with IPython. Various other minor fixes and cleanups.
6935 example with IPython. Various other minor fixes and cleanups.
6930
6936
6931 * Version 0.1.9 released, 0.1.10 opened for further work.
6937 * Version 0.1.9 released, 0.1.10 opened for further work.
6932
6938
6933 * Added sys.path to the list of directories searched in the
6939 * Added sys.path to the list of directories searched in the
6934 execfile= option. It used to be the current directory and the
6940 execfile= option. It used to be the current directory and the
6935 user's IPYTHONDIR only.
6941 user's IPYTHONDIR only.
6936
6942
6937 2001-11-13 Fernando Perez <fperez@colorado.edu>
6943 2001-11-13 Fernando Perez <fperez@colorado.edu>
6938
6944
6939 * Reinstated the raw_input/prefilter separation that Janko had
6945 * Reinstated the raw_input/prefilter separation that Janko had
6940 initially. This gives a more convenient setup for extending the
6946 initially. This gives a more convenient setup for extending the
6941 pre-processor from the outside: raw_input always gets a string,
6947 pre-processor from the outside: raw_input always gets a string,
6942 and prefilter has to process it. We can then redefine prefilter
6948 and prefilter has to process it. We can then redefine prefilter
6943 from the outside and implement extensions for special
6949 from the outside and implement extensions for special
6944 purposes.
6950 purposes.
6945
6951
6946 Today I got one for inputting PhysicalQuantity objects
6952 Today I got one for inputting PhysicalQuantity objects
6947 (from Scientific) without needing any function calls at
6953 (from Scientific) without needing any function calls at
6948 all. Extremely convenient, and it's all done as a user-level
6954 all. Extremely convenient, and it's all done as a user-level
6949 extension (no IPython code was touched). Now instead of:
6955 extension (no IPython code was touched). Now instead of:
6950 a = PhysicalQuantity(4.2,'m/s**2')
6956 a = PhysicalQuantity(4.2,'m/s**2')
6951 one can simply say
6957 one can simply say
6952 a = 4.2 m/s**2
6958 a = 4.2 m/s**2
6953 or even
6959 or even
6954 a = 4.2 m/s^2
6960 a = 4.2 m/s^2
6955
6961
6956 I use this, but it's also a proof of concept: IPython really is
6962 I use this, but it's also a proof of concept: IPython really is
6957 fully user-extensible, even at the level of the parsing of the
6963 fully user-extensible, even at the level of the parsing of the
6958 command line. It's not trivial, but it's perfectly doable.
6964 command line. It's not trivial, but it's perfectly doable.
6959
6965
6960 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6966 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6961 the problem of modules being loaded in the inverse order in which
6967 the problem of modules being loaded in the inverse order in which
6962 they were defined in
6968 they were defined in
6963
6969
6964 * Version 0.1.8 released, 0.1.9 opened for further work.
6970 * Version 0.1.8 released, 0.1.9 opened for further work.
6965
6971
6966 * Added magics pdef, source and file. They respectively show the
6972 * Added magics pdef, source and file. They respectively show the
6967 definition line ('prototype' in C), source code and full python
6973 definition line ('prototype' in C), source code and full python
6968 file for any callable object. The object inspector oinfo uses
6974 file for any callable object. The object inspector oinfo uses
6969 these to show the same information.
6975 these to show the same information.
6970
6976
6971 * Version 0.1.7 released, 0.1.8 opened for further work.
6977 * Version 0.1.7 released, 0.1.8 opened for further work.
6972
6978
6973 * Separated all the magic functions into a class called Magic. The
6979 * Separated all the magic functions into a class called Magic. The
6974 InteractiveShell class was becoming too big for Xemacs to handle
6980 InteractiveShell class was becoming too big for Xemacs to handle
6975 (de-indenting a line would lock it up for 10 seconds while it
6981 (de-indenting a line would lock it up for 10 seconds while it
6976 backtracked on the whole class!)
6982 backtracked on the whole class!)
6977
6983
6978 FIXME: didn't work. It can be done, but right now namespaces are
6984 FIXME: didn't work. It can be done, but right now namespaces are
6979 all messed up. Do it later (reverted it for now, so at least
6985 all messed up. Do it later (reverted it for now, so at least
6980 everything works as before).
6986 everything works as before).
6981
6987
6982 * Got the object introspection system (magic_oinfo) working! I
6988 * Got the object introspection system (magic_oinfo) working! I
6983 think this is pretty much ready for release to Janko, so he can
6989 think this is pretty much ready for release to Janko, so he can
6984 test it for a while and then announce it. Pretty much 100% of what
6990 test it for a while and then announce it. Pretty much 100% of what
6985 I wanted for the 'phase 1' release is ready. Happy, tired.
6991 I wanted for the 'phase 1' release is ready. Happy, tired.
6986
6992
6987 2001-11-12 Fernando Perez <fperez@colorado.edu>
6993 2001-11-12 Fernando Perez <fperez@colorado.edu>
6988
6994
6989 * Version 0.1.6 released, 0.1.7 opened for further work.
6995 * Version 0.1.6 released, 0.1.7 opened for further work.
6990
6996
6991 * Fixed bug in printing: it used to test for truth before
6997 * Fixed bug in printing: it used to test for truth before
6992 printing, so 0 wouldn't print. Now checks for None.
6998 printing, so 0 wouldn't print. Now checks for None.
6993
6999
6994 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7000 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6995 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7001 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6996 reaches by hand into the outputcache. Think of a better way to do
7002 reaches by hand into the outputcache. Think of a better way to do
6997 this later.
7003 this later.
6998
7004
6999 * Various small fixes thanks to Nathan's comments.
7005 * Various small fixes thanks to Nathan's comments.
7000
7006
7001 * Changed magic_pprint to magic_Pprint. This way it doesn't
7007 * Changed magic_pprint to magic_Pprint. This way it doesn't
7002 collide with pprint() and the name is consistent with the command
7008 collide with pprint() and the name is consistent with the command
7003 line option.
7009 line option.
7004
7010
7005 * Changed prompt counter behavior to be fully like
7011 * Changed prompt counter behavior to be fully like
7006 Mathematica's. That is, even input that doesn't return a result
7012 Mathematica's. That is, even input that doesn't return a result
7007 raises the prompt counter. The old behavior was kind of confusing
7013 raises the prompt counter. The old behavior was kind of confusing
7008 (getting the same prompt number several times if the operation
7014 (getting the same prompt number several times if the operation
7009 didn't return a result).
7015 didn't return a result).
7010
7016
7011 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7017 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7012
7018
7013 * Fixed -Classic mode (wasn't working anymore).
7019 * Fixed -Classic mode (wasn't working anymore).
7014
7020
7015 * Added colored prompts using Nathan's new code. Colors are
7021 * Added colored prompts using Nathan's new code. Colors are
7016 currently hardwired, they can be user-configurable. For
7022 currently hardwired, they can be user-configurable. For
7017 developers, they can be chosen in file ipythonlib.py, at the
7023 developers, they can be chosen in file ipythonlib.py, at the
7018 beginning of the CachedOutput class def.
7024 beginning of the CachedOutput class def.
7019
7025
7020 2001-11-11 Fernando Perez <fperez@colorado.edu>
7026 2001-11-11 Fernando Perez <fperez@colorado.edu>
7021
7027
7022 * Version 0.1.5 released, 0.1.6 opened for further work.
7028 * Version 0.1.5 released, 0.1.6 opened for further work.
7023
7029
7024 * Changed magic_env to *return* the environment as a dict (not to
7030 * Changed magic_env to *return* the environment as a dict (not to
7025 print it). This way it prints, but it can also be processed.
7031 print it). This way it prints, but it can also be processed.
7026
7032
7027 * Added Verbose exception reporting to interactive
7033 * Added Verbose exception reporting to interactive
7028 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7034 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7029 traceback. Had to make some changes to the ultraTB file. This is
7035 traceback. Had to make some changes to the ultraTB file. This is
7030 probably the last 'big' thing in my mental todo list. This ties
7036 probably the last 'big' thing in my mental todo list. This ties
7031 in with the next entry:
7037 in with the next entry:
7032
7038
7033 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7039 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7034 has to specify is Plain, Color or Verbose for all exception
7040 has to specify is Plain, Color or Verbose for all exception
7035 handling.
7041 handling.
7036
7042
7037 * Removed ShellServices option. All this can really be done via
7043 * Removed ShellServices option. All this can really be done via
7038 the magic system. It's easier to extend, cleaner and has automatic
7044 the magic system. It's easier to extend, cleaner and has automatic
7039 namespace protection and documentation.
7045 namespace protection and documentation.
7040
7046
7041 2001-11-09 Fernando Perez <fperez@colorado.edu>
7047 2001-11-09 Fernando Perez <fperez@colorado.edu>
7042
7048
7043 * Fixed bug in output cache flushing (missing parameter to
7049 * Fixed bug in output cache flushing (missing parameter to
7044 __init__). Other small bugs fixed (found using pychecker).
7050 __init__). Other small bugs fixed (found using pychecker).
7045
7051
7046 * Version 0.1.4 opened for bugfixing.
7052 * Version 0.1.4 opened for bugfixing.
7047
7053
7048 2001-11-07 Fernando Perez <fperez@colorado.edu>
7054 2001-11-07 Fernando Perez <fperez@colorado.edu>
7049
7055
7050 * Version 0.1.3 released, mainly because of the raw_input bug.
7056 * Version 0.1.3 released, mainly because of the raw_input bug.
7051
7057
7052 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7058 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7053 and when testing for whether things were callable, a call could
7059 and when testing for whether things were callable, a call could
7054 actually be made to certain functions. They would get called again
7060 actually be made to certain functions. They would get called again
7055 once 'really' executed, with a resulting double call. A disaster
7061 once 'really' executed, with a resulting double call. A disaster
7056 in many cases (list.reverse() would never work!).
7062 in many cases (list.reverse() would never work!).
7057
7063
7058 * Removed prefilter() function, moved its code to raw_input (which
7064 * Removed prefilter() function, moved its code to raw_input (which
7059 after all was just a near-empty caller for prefilter). This saves
7065 after all was just a near-empty caller for prefilter). This saves
7060 a function call on every prompt, and simplifies the class a tiny bit.
7066 a function call on every prompt, and simplifies the class a tiny bit.
7061
7067
7062 * Fix _ip to __ip name in magic example file.
7068 * Fix _ip to __ip name in magic example file.
7063
7069
7064 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7070 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7065 work with non-gnu versions of tar.
7071 work with non-gnu versions of tar.
7066
7072
7067 2001-11-06 Fernando Perez <fperez@colorado.edu>
7073 2001-11-06 Fernando Perez <fperez@colorado.edu>
7068
7074
7069 * Version 0.1.2. Just to keep track of the recent changes.
7075 * Version 0.1.2. Just to keep track of the recent changes.
7070
7076
7071 * Fixed nasty bug in output prompt routine. It used to check 'if
7077 * Fixed nasty bug in output prompt routine. It used to check 'if
7072 arg != None...'. Problem is, this fails if arg implements a
7078 arg != None...'. Problem is, this fails if arg implements a
7073 special comparison (__cmp__) which disallows comparing to
7079 special comparison (__cmp__) which disallows comparing to
7074 None. Found it when trying to use the PhysicalQuantity module from
7080 None. Found it when trying to use the PhysicalQuantity module from
7075 ScientificPython.
7081 ScientificPython.
7076
7082
7077 2001-11-05 Fernando Perez <fperez@colorado.edu>
7083 2001-11-05 Fernando Perez <fperez@colorado.edu>
7078
7084
7079 * Also added dirs. Now the pushd/popd/dirs family functions
7085 * Also added dirs. Now the pushd/popd/dirs family functions
7080 basically like the shell, with the added convenience of going home
7086 basically like the shell, with the added convenience of going home
7081 when called with no args.
7087 when called with no args.
7082
7088
7083 * pushd/popd slightly modified to mimic shell behavior more
7089 * pushd/popd slightly modified to mimic shell behavior more
7084 closely.
7090 closely.
7085
7091
7086 * Added env,pushd,popd from ShellServices as magic functions. I
7092 * Added env,pushd,popd from ShellServices as magic functions. I
7087 think the cleanest will be to port all desired functions from
7093 think the cleanest will be to port all desired functions from
7088 ShellServices as magics and remove ShellServices altogether. This
7094 ShellServices as magics and remove ShellServices altogether. This
7089 will provide a single, clean way of adding functionality
7095 will provide a single, clean way of adding functionality
7090 (shell-type or otherwise) to IP.
7096 (shell-type or otherwise) to IP.
7091
7097
7092 2001-11-04 Fernando Perez <fperez@colorado.edu>
7098 2001-11-04 Fernando Perez <fperez@colorado.edu>
7093
7099
7094 * Added .ipython/ directory to sys.path. This way users can keep
7100 * Added .ipython/ directory to sys.path. This way users can keep
7095 customizations there and access them via import.
7101 customizations there and access them via import.
7096
7102
7097 2001-11-03 Fernando Perez <fperez@colorado.edu>
7103 2001-11-03 Fernando Perez <fperez@colorado.edu>
7098
7104
7099 * Opened version 0.1.1 for new changes.
7105 * Opened version 0.1.1 for new changes.
7100
7106
7101 * Changed version number to 0.1.0: first 'public' release, sent to
7107 * Changed version number to 0.1.0: first 'public' release, sent to
7102 Nathan and Janko.
7108 Nathan and Janko.
7103
7109
7104 * Lots of small fixes and tweaks.
7110 * Lots of small fixes and tweaks.
7105
7111
7106 * Minor changes to whos format. Now strings are shown, snipped if
7112 * Minor changes to whos format. Now strings are shown, snipped if
7107 too long.
7113 too long.
7108
7114
7109 * Changed ShellServices to work on __main__ so they show up in @who
7115 * Changed ShellServices to work on __main__ so they show up in @who
7110
7116
7111 * Help also works with ? at the end of a line:
7117 * Help also works with ? at the end of a line:
7112 ?sin and sin?
7118 ?sin and sin?
7113 both produce the same effect. This is nice, as often I use the
7119 both produce the same effect. This is nice, as often I use the
7114 tab-complete to find the name of a method, but I used to then have
7120 tab-complete to find the name of a method, but I used to then have
7115 to go to the beginning of the line to put a ? if I wanted more
7121 to go to the beginning of the line to put a ? if I wanted more
7116 info. Now I can just add the ? and hit return. Convenient.
7122 info. Now I can just add the ? and hit return. Convenient.
7117
7123
7118 2001-11-02 Fernando Perez <fperez@colorado.edu>
7124 2001-11-02 Fernando Perez <fperez@colorado.edu>
7119
7125
7120 * Python version check (>=2.1) added.
7126 * Python version check (>=2.1) added.
7121
7127
7122 * Added LazyPython documentation. At this point the docs are quite
7128 * Added LazyPython documentation. At this point the docs are quite
7123 a mess. A cleanup is in order.
7129 a mess. A cleanup is in order.
7124
7130
7125 * Auto-installer created. For some bizarre reason, the zipfiles
7131 * Auto-installer created. For some bizarre reason, the zipfiles
7126 module isn't working on my system. So I made a tar version
7132 module isn't working on my system. So I made a tar version
7127 (hopefully the command line options in various systems won't kill
7133 (hopefully the command line options in various systems won't kill
7128 me).
7134 me).
7129
7135
7130 * Fixes to Struct in genutils. Now all dictionary-like methods are
7136 * Fixes to Struct in genutils. Now all dictionary-like methods are
7131 protected (reasonably).
7137 protected (reasonably).
7132
7138
7133 * Added pager function to genutils and changed ? to print usage
7139 * Added pager function to genutils and changed ? to print usage
7134 note through it (it was too long).
7140 note through it (it was too long).
7135
7141
7136 * Added the LazyPython functionality. Works great! I changed the
7142 * Added the LazyPython functionality. Works great! I changed the
7137 auto-quote escape to ';', it's on home row and next to '. But
7143 auto-quote escape to ';', it's on home row and next to '. But
7138 both auto-quote and auto-paren (still /) escapes are command-line
7144 both auto-quote and auto-paren (still /) escapes are command-line
7139 parameters.
7145 parameters.
7140
7146
7141
7147
7142 2001-11-01 Fernando Perez <fperez@colorado.edu>
7148 2001-11-01 Fernando Perez <fperez@colorado.edu>
7143
7149
7144 * Version changed to 0.0.7. Fairly large change: configuration now
7150 * Version changed to 0.0.7. Fairly large change: configuration now
7145 is all stored in a directory, by default .ipython. There, all
7151 is all stored in a directory, by default .ipython. There, all
7146 config files have normal looking names (not .names)
7152 config files have normal looking names (not .names)
7147
7153
7148 * Version 0.0.6 Released first to Lucas and Archie as a test
7154 * Version 0.0.6 Released first to Lucas and Archie as a test
7149 run. Since it's the first 'semi-public' release, change version to
7155 run. Since it's the first 'semi-public' release, change version to
7150 > 0.0.6 for any changes now.
7156 > 0.0.6 for any changes now.
7151
7157
7152 * Stuff I had put in the ipplib.py changelog:
7158 * Stuff I had put in the ipplib.py changelog:
7153
7159
7154 Changes to InteractiveShell:
7160 Changes to InteractiveShell:
7155
7161
7156 - Made the usage message a parameter.
7162 - Made the usage message a parameter.
7157
7163
7158 - Require the name of the shell variable to be given. It's a bit
7164 - Require the name of the shell variable to be given. It's a bit
7159 of a hack, but allows the name 'shell' not to be hardwired in the
7165 of a hack, but allows the name 'shell' not to be hardwired in the
7160 magic (@) handler, which is problematic b/c it requires
7166 magic (@) handler, which is problematic b/c it requires
7161 polluting the global namespace with 'shell'. This in turn is
7167 polluting the global namespace with 'shell'. This in turn is
7162 fragile: if a user redefines a variable called shell, things
7168 fragile: if a user redefines a variable called shell, things
7163 break.
7169 break.
7164
7170
7165 - magic @: all functions available through @ need to be defined
7171 - magic @: all functions available through @ need to be defined
7166 as magic_<name>, even though they can be called simply as
7172 as magic_<name>, even though they can be called simply as
7167 @<name>. This allows the special command @magic to gather
7173 @<name>. This allows the special command @magic to gather
7168 information automatically about all existing magic functions,
7174 information automatically about all existing magic functions,
7169 even if they are run-time user extensions, by parsing the shell
7175 even if they are run-time user extensions, by parsing the shell
7170 instance __dict__ looking for special magic_ names.
7176 instance __dict__ looking for special magic_ names.
7171
7177
7172 - mainloop: added *two* local namespace parameters. This allows
7178 - mainloop: added *two* local namespace parameters. This allows
7173 the class to differentiate between parameters which were there
7179 the class to differentiate between parameters which were there
7174 before and after command line initialization was processed. This
7180 before and after command line initialization was processed. This
7175 way, later @who can show things loaded at startup by the
7181 way, later @who can show things loaded at startup by the
7176 user. This trick was necessary to make session saving/reloading
7182 user. This trick was necessary to make session saving/reloading
7177 really work: ideally after saving/exiting/reloading a session,
7183 really work: ideally after saving/exiting/reloading a session,
7178 *everything* should look the same, including the output of @who. I
7184 *everything* should look the same, including the output of @who. I
7179 was only able to make this work with this double namespace
7185 was only able to make this work with this double namespace
7180 trick.
7186 trick.
7181
7187
7182 - added a header to the logfile which allows (almost) full
7188 - added a header to the logfile which allows (almost) full
7183 session restoring.
7189 session restoring.
7184
7190
7185 - prepend lines beginning with @ or !, with a and log
7191 - prepend lines beginning with @ or !, with a and log
7186 them. Why? !lines: may be useful to know what you did @lines:
7192 them. Why? !lines: may be useful to know what you did @lines:
7187 they may affect session state. So when restoring a session, at
7193 they may affect session state. So when restoring a session, at
7188 least inform the user of their presence. I couldn't quite get
7194 least inform the user of their presence. I couldn't quite get
7189 them to properly re-execute, but at least the user is warned.
7195 them to properly re-execute, but at least the user is warned.
7190
7196
7191 * Started ChangeLog.
7197 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now