##// END OF EJS Templates
fix dir stack - push *current* directory, not the target directory
vivainio -
Show More
@@ -1,3219 +1,3221 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 2728 2007-09-07 16:12:42Z vivainio $"""
4 $Id: Magic.py 2744 2007-09-08 12:58:56Z vivainio $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
9 #
9 #
10 # Distributed under the terms of the BSD License. The full license is in
10 # Distributed under the terms of the BSD License. The full license is in
11 # the file COPYING, distributed as part of this software.
11 # the file COPYING, distributed as part of this software.
12 #*****************************************************************************
12 #*****************************************************************************
13
13
14 #****************************************************************************
14 #****************************************************************************
15 # Modules and globals
15 # Modules and globals
16
16
17 from IPython import Release
17 from IPython import Release
18 __author__ = '%s <%s>\n%s <%s>' % \
18 __author__ = '%s <%s>\n%s <%s>' % \
19 ( Release.authors['Janko'] + Release.authors['Fernando'] )
19 ( Release.authors['Janko'] + Release.authors['Fernando'] )
20 __license__ = Release.license
20 __license__ = Release.license
21
21
22 # Python standard modules
22 # Python standard modules
23 import __builtin__
23 import __builtin__
24 import bdb
24 import bdb
25 import inspect
25 import inspect
26 import os
26 import os
27 import pdb
27 import pdb
28 import pydoc
28 import pydoc
29 import sys
29 import sys
30 import re
30 import re
31 import tempfile
31 import tempfile
32 import time
32 import time
33 import cPickle as pickle
33 import cPickle as pickle
34 import textwrap
34 import textwrap
35 from cStringIO import StringIO
35 from cStringIO import StringIO
36 from getopt import getopt,GetoptError
36 from getopt import getopt,GetoptError
37 from pprint import pprint, pformat
37 from pprint import pprint, pformat
38 from sets import Set
38 from sets import Set
39
39
40 # cProfile was added in Python2.5
40 # cProfile was added in Python2.5
41 try:
41 try:
42 import cProfile as profile
42 import cProfile as profile
43 import pstats
43 import pstats
44 except ImportError:
44 except ImportError:
45 # profile isn't bundled by default in Debian for license reasons
45 # profile isn't bundled by default in Debian for license reasons
46 try:
46 try:
47 import profile,pstats
47 import profile,pstats
48 except ImportError:
48 except ImportError:
49 profile = pstats = None
49 profile = pstats = None
50
50
51 # Homebrewed
51 # Homebrewed
52 import IPython
52 import IPython
53 from IPython import Debugger, OInspect, wildcard
53 from IPython import Debugger, OInspect, wildcard
54 from IPython.FakeModule import FakeModule
54 from IPython.FakeModule import FakeModule
55 from IPython.Itpl import Itpl, itpl, printpl,itplns
55 from IPython.Itpl import Itpl, itpl, printpl,itplns
56 from IPython.PyColorize import Parser
56 from IPython.PyColorize import Parser
57 from IPython.ipstruct import Struct
57 from IPython.ipstruct import Struct
58 from IPython.macro import Macro
58 from IPython.macro import Macro
59 from IPython.genutils import *
59 from IPython.genutils import *
60 from IPython import platutils
60 from IPython import platutils
61 import IPython.generics
61 import IPython.generics
62 import IPython.ipapi
62 import IPython.ipapi
63
63
64 #***************************************************************************
64 #***************************************************************************
65 # Utility functions
65 # Utility functions
66 def on_off(tag):
66 def on_off(tag):
67 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
67 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
68 return ['OFF','ON'][tag]
68 return ['OFF','ON'][tag]
69
69
70 class Bunch: pass
70 class Bunch: pass
71
71
72 def compress_dhist(dh):
72 def compress_dhist(dh):
73 head, tail = dh[:-10], dh[-10:]
73 head, tail = dh[:-10], dh[-10:]
74
74
75 newhead = []
75 newhead = []
76 done = Set()
76 done = Set()
77 for h in head:
77 for h in head:
78 if h in done:
78 if h in done:
79 continue
79 continue
80 newhead.append(h)
80 newhead.append(h)
81 done.add(h)
81 done.add(h)
82
82
83 return newhead + tail
83 return newhead + tail
84
84
85
85
86 #***************************************************************************
86 #***************************************************************************
87 # Main class implementing Magic functionality
87 # Main class implementing Magic functionality
88 class Magic:
88 class Magic:
89 """Magic functions for InteractiveShell.
89 """Magic functions for InteractiveShell.
90
90
91 Shell functions which can be reached as %function_name. All magic
91 Shell functions which can be reached as %function_name. All magic
92 functions should accept a string, which they can parse for their own
92 functions should accept a string, which they can parse for their own
93 needs. This can make some functions easier to type, eg `%cd ../`
93 needs. This can make some functions easier to type, eg `%cd ../`
94 vs. `%cd("../")`
94 vs. `%cd("../")`
95
95
96 ALL definitions MUST begin with the prefix magic_. The user won't need it
96 ALL definitions MUST begin with the prefix magic_. The user won't need it
97 at the command line, but it is is needed in the definition. """
97 at the command line, but it is is needed in the definition. """
98
98
99 # class globals
99 # class globals
100 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
100 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
101 'Automagic is ON, % prefix NOT needed for magic functions.']
101 'Automagic is ON, % prefix NOT needed for magic functions.']
102
102
103 #......................................................................
103 #......................................................................
104 # some utility functions
104 # some utility functions
105
105
106 def __init__(self,shell):
106 def __init__(self,shell):
107
107
108 self.options_table = {}
108 self.options_table = {}
109 if profile is None:
109 if profile is None:
110 self.magic_prun = self.profile_missing_notice
110 self.magic_prun = self.profile_missing_notice
111 self.shell = shell
111 self.shell = shell
112
112
113 # namespace for holding state we may need
113 # namespace for holding state we may need
114 self._magic_state = Bunch()
114 self._magic_state = Bunch()
115
115
116 def profile_missing_notice(self, *args, **kwargs):
116 def profile_missing_notice(self, *args, **kwargs):
117 error("""\
117 error("""\
118 The profile module could not be found. If you are a Debian user,
118 The profile module could not be found. If you are a Debian user,
119 it has been removed from the standard Debian package because of its non-free
119 it has been removed from the standard Debian package because of its non-free
120 license. To use profiling, please install"python2.3-profiler" from non-free.""")
120 license. To use profiling, please install"python2.3-profiler" from non-free.""")
121
121
122 def default_option(self,fn,optstr):
122 def default_option(self,fn,optstr):
123 """Make an entry in the options_table for fn, with value optstr"""
123 """Make an entry in the options_table for fn, with value optstr"""
124
124
125 if fn not in self.lsmagic():
125 if fn not in self.lsmagic():
126 error("%s is not a magic function" % fn)
126 error("%s is not a magic function" % fn)
127 self.options_table[fn] = optstr
127 self.options_table[fn] = optstr
128
128
129 def lsmagic(self):
129 def lsmagic(self):
130 """Return a list of currently available magic functions.
130 """Return a list of currently available magic functions.
131
131
132 Gives a list of the bare names after mangling (['ls','cd', ...], not
132 Gives a list of the bare names after mangling (['ls','cd', ...], not
133 ['magic_ls','magic_cd',...]"""
133 ['magic_ls','magic_cd',...]"""
134
134
135 # FIXME. This needs a cleanup, in the way the magics list is built.
135 # FIXME. This needs a cleanup, in the way the magics list is built.
136
136
137 # magics in class definition
137 # magics in class definition
138 class_magic = lambda fn: fn.startswith('magic_') and \
138 class_magic = lambda fn: fn.startswith('magic_') and \
139 callable(Magic.__dict__[fn])
139 callable(Magic.__dict__[fn])
140 # in instance namespace (run-time user additions)
140 # in instance namespace (run-time user additions)
141 inst_magic = lambda fn: fn.startswith('magic_') and \
141 inst_magic = lambda fn: fn.startswith('magic_') and \
142 callable(self.__dict__[fn])
142 callable(self.__dict__[fn])
143 # and bound magics by user (so they can access self):
143 # and bound magics by user (so they can access self):
144 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
144 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
145 callable(self.__class__.__dict__[fn])
145 callable(self.__class__.__dict__[fn])
146 magics = filter(class_magic,Magic.__dict__.keys()) + \
146 magics = filter(class_magic,Magic.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
149 out = []
149 out = []
150 for fn in magics:
150 for fn in magics:
151 out.append(fn.replace('magic_','',1))
151 out.append(fn.replace('magic_','',1))
152 out.sort()
152 out.sort()
153 return out
153 return out
154
154
155 def extract_input_slices(self,slices,raw=False):
155 def extract_input_slices(self,slices,raw=False):
156 """Return as a string a set of input history slices.
156 """Return as a string a set of input history slices.
157
157
158 Inputs:
158 Inputs:
159
159
160 - slices: the set of slices is given as a list of strings (like
160 - slices: the set of slices is given as a list of strings (like
161 ['1','4:8','9'], since this function is for use by magic functions
161 ['1','4:8','9'], since this function is for use by magic functions
162 which get their arguments as strings.
162 which get their arguments as strings.
163
163
164 Optional inputs:
164 Optional inputs:
165
165
166 - raw(False): by default, the processed input is used. If this is
166 - raw(False): by default, the processed input is used. If this is
167 true, the raw input history is used instead.
167 true, the raw input history is used instead.
168
168
169 Note that slices can be called with two notations:
169 Note that slices can be called with two notations:
170
170
171 N:M -> standard python form, means including items N...(M-1).
171 N:M -> standard python form, means including items N...(M-1).
172
172
173 N-M -> include items N..M (closed endpoint)."""
173 N-M -> include items N..M (closed endpoint)."""
174
174
175 if raw:
175 if raw:
176 hist = self.shell.input_hist_raw
176 hist = self.shell.input_hist_raw
177 else:
177 else:
178 hist = self.shell.input_hist
178 hist = self.shell.input_hist
179
179
180 cmds = []
180 cmds = []
181 for chunk in slices:
181 for chunk in slices:
182 if ':' in chunk:
182 if ':' in chunk:
183 ini,fin = map(int,chunk.split(':'))
183 ini,fin = map(int,chunk.split(':'))
184 elif '-' in chunk:
184 elif '-' in chunk:
185 ini,fin = map(int,chunk.split('-'))
185 ini,fin = map(int,chunk.split('-'))
186 fin += 1
186 fin += 1
187 else:
187 else:
188 ini = int(chunk)
188 ini = int(chunk)
189 fin = ini+1
189 fin = ini+1
190 cmds.append(hist[ini:fin])
190 cmds.append(hist[ini:fin])
191 return cmds
191 return cmds
192
192
193 def _ofind(self, oname, namespaces=None):
193 def _ofind(self, oname, namespaces=None):
194 """Find an object in the available namespaces.
194 """Find an object in the available namespaces.
195
195
196 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
196 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
197
197
198 Has special code to detect magic functions.
198 Has special code to detect magic functions.
199 """
199 """
200
200
201 oname = oname.strip()
201 oname = oname.strip()
202
202
203 alias_ns = None
203 alias_ns = None
204 if namespaces is None:
204 if namespaces is None:
205 # Namespaces to search in:
205 # Namespaces to search in:
206 # Put them in a list. The order is important so that we
206 # Put them in a list. The order is important so that we
207 # find things in the same order that Python finds them.
207 # find things in the same order that Python finds them.
208 namespaces = [ ('Interactive', self.shell.user_ns),
208 namespaces = [ ('Interactive', self.shell.user_ns),
209 ('IPython internal', self.shell.internal_ns),
209 ('IPython internal', self.shell.internal_ns),
210 ('Python builtin', __builtin__.__dict__),
210 ('Python builtin', __builtin__.__dict__),
211 ('Alias', self.shell.alias_table),
211 ('Alias', self.shell.alias_table),
212 ]
212 ]
213 alias_ns = self.shell.alias_table
213 alias_ns = self.shell.alias_table
214
214
215 # initialize results to 'null'
215 # initialize results to 'null'
216 found = 0; obj = None; ospace = None; ds = None;
216 found = 0; obj = None; ospace = None; ds = None;
217 ismagic = 0; isalias = 0; parent = None
217 ismagic = 0; isalias = 0; parent = None
218
218
219 # Look for the given name by splitting it in parts. If the head is
219 # Look for the given name by splitting it in parts. If the head is
220 # found, then we look for all the remaining parts as members, and only
220 # found, then we look for all the remaining parts as members, and only
221 # declare success if we can find them all.
221 # declare success if we can find them all.
222 oname_parts = oname.split('.')
222 oname_parts = oname.split('.')
223 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
223 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
224 for nsname,ns in namespaces:
224 for nsname,ns in namespaces:
225 try:
225 try:
226 obj = ns[oname_head]
226 obj = ns[oname_head]
227 except KeyError:
227 except KeyError:
228 continue
228 continue
229 else:
229 else:
230 #print 'oname_rest:', oname_rest # dbg
230 #print 'oname_rest:', oname_rest # dbg
231 for part in oname_rest:
231 for part in oname_rest:
232 try:
232 try:
233 parent = obj
233 parent = obj
234 obj = getattr(obj,part)
234 obj = getattr(obj,part)
235 except:
235 except:
236 # Blanket except b/c some badly implemented objects
236 # Blanket except b/c some badly implemented objects
237 # allow __getattr__ to raise exceptions other than
237 # allow __getattr__ to raise exceptions other than
238 # AttributeError, which then crashes IPython.
238 # AttributeError, which then crashes IPython.
239 break
239 break
240 else:
240 else:
241 # If we finish the for loop (no break), we got all members
241 # If we finish the for loop (no break), we got all members
242 found = 1
242 found = 1
243 ospace = nsname
243 ospace = nsname
244 if ns == alias_ns:
244 if ns == alias_ns:
245 isalias = 1
245 isalias = 1
246 break # namespace loop
246 break # namespace loop
247
247
248 # Try to see if it's magic
248 # Try to see if it's magic
249 if not found:
249 if not found:
250 if oname.startswith(self.shell.ESC_MAGIC):
250 if oname.startswith(self.shell.ESC_MAGIC):
251 oname = oname[1:]
251 oname = oname[1:]
252 obj = getattr(self,'magic_'+oname,None)
252 obj = getattr(self,'magic_'+oname,None)
253 if obj is not None:
253 if obj is not None:
254 found = 1
254 found = 1
255 ospace = 'IPython internal'
255 ospace = 'IPython internal'
256 ismagic = 1
256 ismagic = 1
257
257
258 # Last try: special-case some literals like '', [], {}, etc:
258 # Last try: special-case some literals like '', [], {}, etc:
259 if not found and oname_head in ["''",'""','[]','{}','()']:
259 if not found and oname_head in ["''",'""','[]','{}','()']:
260 obj = eval(oname_head)
260 obj = eval(oname_head)
261 found = 1
261 found = 1
262 ospace = 'Interactive'
262 ospace = 'Interactive'
263
263
264 return {'found':found, 'obj':obj, 'namespace':ospace,
264 return {'found':found, 'obj':obj, 'namespace':ospace,
265 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
265 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
266
266
267 def arg_err(self,func):
267 def arg_err(self,func):
268 """Print docstring if incorrect arguments were passed"""
268 """Print docstring if incorrect arguments were passed"""
269 print 'Error in arguments:'
269 print 'Error in arguments:'
270 print OInspect.getdoc(func)
270 print OInspect.getdoc(func)
271
271
272 def format_latex(self,strng):
272 def format_latex(self,strng):
273 """Format a string for latex inclusion."""
273 """Format a string for latex inclusion."""
274
274
275 # Characters that need to be escaped for latex:
275 # Characters that need to be escaped for latex:
276 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
276 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
277 # Magic command names as headers:
277 # Magic command names as headers:
278 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
278 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
279 re.MULTILINE)
279 re.MULTILINE)
280 # Magic commands
280 # Magic commands
281 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
281 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
282 re.MULTILINE)
282 re.MULTILINE)
283 # Paragraph continue
283 # Paragraph continue
284 par_re = re.compile(r'\\$',re.MULTILINE)
284 par_re = re.compile(r'\\$',re.MULTILINE)
285
285
286 # The "\n" symbol
286 # The "\n" symbol
287 newline_re = re.compile(r'\\n')
287 newline_re = re.compile(r'\\n')
288
288
289 # Now build the string for output:
289 # Now build the string for output:
290 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
290 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
291 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
291 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
292 strng)
292 strng)
293 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
293 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
294 strng = par_re.sub(r'\\\\',strng)
294 strng = par_re.sub(r'\\\\',strng)
295 strng = escape_re.sub(r'\\\1',strng)
295 strng = escape_re.sub(r'\\\1',strng)
296 strng = newline_re.sub(r'\\textbackslash{}n',strng)
296 strng = newline_re.sub(r'\\textbackslash{}n',strng)
297 return strng
297 return strng
298
298
299 def format_screen(self,strng):
299 def format_screen(self,strng):
300 """Format a string for screen printing.
300 """Format a string for screen printing.
301
301
302 This removes some latex-type format codes."""
302 This removes some latex-type format codes."""
303 # Paragraph continue
303 # Paragraph continue
304 par_re = re.compile(r'\\$',re.MULTILINE)
304 par_re = re.compile(r'\\$',re.MULTILINE)
305 strng = par_re.sub('',strng)
305 strng = par_re.sub('',strng)
306 return strng
306 return strng
307
307
308 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
308 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
309 """Parse options passed to an argument string.
309 """Parse options passed to an argument string.
310
310
311 The interface is similar to that of getopt(), but it returns back a
311 The interface is similar to that of getopt(), but it returns back a
312 Struct with the options as keys and the stripped argument string still
312 Struct with the options as keys and the stripped argument string still
313 as a string.
313 as a string.
314
314
315 arg_str is quoted as a true sys.argv vector by using shlex.split.
315 arg_str is quoted as a true sys.argv vector by using shlex.split.
316 This allows us to easily expand variables, glob files, quote
316 This allows us to easily expand variables, glob files, quote
317 arguments, etc.
317 arguments, etc.
318
318
319 Options:
319 Options:
320 -mode: default 'string'. If given as 'list', the argument string is
320 -mode: default 'string'. If given as 'list', the argument string is
321 returned as a list (split on whitespace) instead of a string.
321 returned as a list (split on whitespace) instead of a string.
322
322
323 -list_all: put all option values in lists. Normally only options
323 -list_all: put all option values in lists. Normally only options
324 appearing more than once are put in a list.
324 appearing more than once are put in a list.
325
325
326 -posix (True): whether to split the input line in POSIX mode or not,
326 -posix (True): whether to split the input line in POSIX mode or not,
327 as per the conventions outlined in the shlex module from the
327 as per the conventions outlined in the shlex module from the
328 standard library."""
328 standard library."""
329
329
330 # inject default options at the beginning of the input line
330 # inject default options at the beginning of the input line
331 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
331 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
332 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
332 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
333
333
334 mode = kw.get('mode','string')
334 mode = kw.get('mode','string')
335 if mode not in ['string','list']:
335 if mode not in ['string','list']:
336 raise ValueError,'incorrect mode given: %s' % mode
336 raise ValueError,'incorrect mode given: %s' % mode
337 # Get options
337 # Get options
338 list_all = kw.get('list_all',0)
338 list_all = kw.get('list_all',0)
339 posix = kw.get('posix',True)
339 posix = kw.get('posix',True)
340
340
341 # Check if we have more than one argument to warrant extra processing:
341 # Check if we have more than one argument to warrant extra processing:
342 odict = {} # Dictionary with options
342 odict = {} # Dictionary with options
343 args = arg_str.split()
343 args = arg_str.split()
344 if len(args) >= 1:
344 if len(args) >= 1:
345 # If the list of inputs only has 0 or 1 thing in it, there's no
345 # If the list of inputs only has 0 or 1 thing in it, there's no
346 # need to look for options
346 # need to look for options
347 argv = arg_split(arg_str,posix)
347 argv = arg_split(arg_str,posix)
348 # Do regular option processing
348 # Do regular option processing
349 try:
349 try:
350 opts,args = getopt(argv,opt_str,*long_opts)
350 opts,args = getopt(argv,opt_str,*long_opts)
351 except GetoptError,e:
351 except GetoptError,e:
352 raise GetoptError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
352 raise GetoptError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
353 " ".join(long_opts)))
353 " ".join(long_opts)))
354 for o,a in opts:
354 for o,a in opts:
355 if o.startswith('--'):
355 if o.startswith('--'):
356 o = o[2:]
356 o = o[2:]
357 else:
357 else:
358 o = o[1:]
358 o = o[1:]
359 try:
359 try:
360 odict[o].append(a)
360 odict[o].append(a)
361 except AttributeError:
361 except AttributeError:
362 odict[o] = [odict[o],a]
362 odict[o] = [odict[o],a]
363 except KeyError:
363 except KeyError:
364 if list_all:
364 if list_all:
365 odict[o] = [a]
365 odict[o] = [a]
366 else:
366 else:
367 odict[o] = a
367 odict[o] = a
368
368
369 # Prepare opts,args for return
369 # Prepare opts,args for return
370 opts = Struct(odict)
370 opts = Struct(odict)
371 if mode == 'string':
371 if mode == 'string':
372 args = ' '.join(args)
372 args = ' '.join(args)
373
373
374 return opts,args
374 return opts,args
375
375
376 #......................................................................
376 #......................................................................
377 # And now the actual magic functions
377 # And now the actual magic functions
378
378
379 # Functions for IPython shell work (vars,funcs, config, etc)
379 # Functions for IPython shell work (vars,funcs, config, etc)
380 def magic_lsmagic(self, parameter_s = ''):
380 def magic_lsmagic(self, parameter_s = ''):
381 """List currently available magic functions."""
381 """List currently available magic functions."""
382 mesc = self.shell.ESC_MAGIC
382 mesc = self.shell.ESC_MAGIC
383 print 'Available magic functions:\n'+mesc+\
383 print 'Available magic functions:\n'+mesc+\
384 (' '+mesc).join(self.lsmagic())
384 (' '+mesc).join(self.lsmagic())
385 print '\n' + Magic.auto_status[self.shell.rc.automagic]
385 print '\n' + Magic.auto_status[self.shell.rc.automagic]
386 return None
386 return None
387
387
388 def magic_magic(self, parameter_s = ''):
388 def magic_magic(self, parameter_s = ''):
389 """Print information about the magic function system."""
389 """Print information about the magic function system."""
390
390
391 mode = ''
391 mode = ''
392 try:
392 try:
393 if parameter_s.split()[0] == '-latex':
393 if parameter_s.split()[0] == '-latex':
394 mode = 'latex'
394 mode = 'latex'
395 if parameter_s.split()[0] == '-brief':
395 if parameter_s.split()[0] == '-brief':
396 mode = 'brief'
396 mode = 'brief'
397 except:
397 except:
398 pass
398 pass
399
399
400 magic_docs = []
400 magic_docs = []
401 for fname in self.lsmagic():
401 for fname in self.lsmagic():
402 mname = 'magic_' + fname
402 mname = 'magic_' + fname
403 for space in (Magic,self,self.__class__):
403 for space in (Magic,self,self.__class__):
404 try:
404 try:
405 fn = space.__dict__[mname]
405 fn = space.__dict__[mname]
406 except KeyError:
406 except KeyError:
407 pass
407 pass
408 else:
408 else:
409 break
409 break
410 if mode == 'brief':
410 if mode == 'brief':
411 # only first line
411 # only first line
412 fndoc = fn.__doc__.split('\n',1)[0]
412 fndoc = fn.__doc__.split('\n',1)[0]
413 else:
413 else:
414 fndoc = fn.__doc__
414 fndoc = fn.__doc__
415
415
416 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
416 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
417 fname,fndoc))
417 fname,fndoc))
418 magic_docs = ''.join(magic_docs)
418 magic_docs = ''.join(magic_docs)
419
419
420 if mode == 'latex':
420 if mode == 'latex':
421 print self.format_latex(magic_docs)
421 print self.format_latex(magic_docs)
422 return
422 return
423 else:
423 else:
424 magic_docs = self.format_screen(magic_docs)
424 magic_docs = self.format_screen(magic_docs)
425 if mode == 'brief':
425 if mode == 'brief':
426 return magic_docs
426 return magic_docs
427
427
428 outmsg = """
428 outmsg = """
429 IPython's 'magic' functions
429 IPython's 'magic' functions
430 ===========================
430 ===========================
431
431
432 The magic function system provides a series of functions which allow you to
432 The magic function system provides a series of functions which allow you to
433 control the behavior of IPython itself, plus a lot of system-type
433 control the behavior of IPython itself, plus a lot of system-type
434 features. All these functions are prefixed with a % character, but parameters
434 features. All these functions are prefixed with a % character, but parameters
435 are given without parentheses or quotes.
435 are given without parentheses or quotes.
436
436
437 NOTE: If you have 'automagic' enabled (via the command line option or with the
437 NOTE: If you have 'automagic' enabled (via the command line option or with the
438 %automagic function), you don't need to type in the % explicitly. By default,
438 %automagic function), you don't need to type in the % explicitly. By default,
439 IPython ships with automagic on, so you should only rarely need the % escape.
439 IPython ships with automagic on, so you should only rarely need the % escape.
440
440
441 Example: typing '%cd mydir' (without the quotes) changes you working directory
441 Example: typing '%cd mydir' (without the quotes) changes you working directory
442 to 'mydir', if it exists.
442 to 'mydir', if it exists.
443
443
444 You can define your own magic functions to extend the system. See the supplied
444 You can define your own magic functions to extend the system. See the supplied
445 ipythonrc and example-magic.py files for details (in your ipython
445 ipythonrc and example-magic.py files for details (in your ipython
446 configuration directory, typically $HOME/.ipython/).
446 configuration directory, typically $HOME/.ipython/).
447
447
448 You can also define your own aliased names for magic functions. In your
448 You can also define your own aliased names for magic functions. In your
449 ipythonrc file, placing a line like:
449 ipythonrc file, placing a line like:
450
450
451 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
451 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
452
452
453 will define %pf as a new name for %profile.
453 will define %pf as a new name for %profile.
454
454
455 You can also call magics in code using the ipmagic() function, which IPython
455 You can also call magics in code using the ipmagic() function, which IPython
456 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
456 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
457
457
458 For a list of the available magic functions, use %lsmagic. For a description
458 For a list of the available magic functions, use %lsmagic. For a description
459 of any of them, type %magic_name?, e.g. '%cd?'.
459 of any of them, type %magic_name?, e.g. '%cd?'.
460
460
461 Currently the magic system has the following functions:\n"""
461 Currently the magic system has the following functions:\n"""
462
462
463 mesc = self.shell.ESC_MAGIC
463 mesc = self.shell.ESC_MAGIC
464 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
464 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
465 "\n\n%s%s\n\n%s" % (outmsg,
465 "\n\n%s%s\n\n%s" % (outmsg,
466 magic_docs,mesc,mesc,
466 magic_docs,mesc,mesc,
467 (' '+mesc).join(self.lsmagic()),
467 (' '+mesc).join(self.lsmagic()),
468 Magic.auto_status[self.shell.rc.automagic] ) )
468 Magic.auto_status[self.shell.rc.automagic] ) )
469
469
470 page(outmsg,screen_lines=self.shell.rc.screen_length)
470 page(outmsg,screen_lines=self.shell.rc.screen_length)
471
471
472
472
473 def magic_autoindent(self, parameter_s = ''):
473 def magic_autoindent(self, parameter_s = ''):
474 """Toggle autoindent on/off (if available)."""
474 """Toggle autoindent on/off (if available)."""
475
475
476 self.shell.set_autoindent()
476 self.shell.set_autoindent()
477 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
477 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
478
478
479
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 def magic_logstart(self,parameter_s=''):
1041 def magic_logstart(self,parameter_s=''):
1042 """Start logging anywhere in a session.
1042 """Start logging anywhere in a session.
1043
1043
1044 %logstart [-o|-r|-t] [log_name [log_mode]]
1044 %logstart [-o|-r|-t] [log_name [log_mode]]
1045
1045
1046 If no name is given, it defaults to a file named 'ipython_log.py' in your
1046 If no name is given, it defaults to a file named 'ipython_log.py' in your
1047 current directory, in 'rotate' mode (see below).
1047 current directory, in 'rotate' mode (see below).
1048
1048
1049 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
1049 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
1050 history up to that point and then continues logging.
1050 history up to that point and then continues logging.
1051
1051
1052 %logstart takes a second optional parameter: logging mode. This can be one
1052 %logstart takes a second optional parameter: logging mode. This can be one
1053 of (note that the modes are given unquoted):\\
1053 of (note that the modes are given unquoted):\\
1054 append: well, that says it.\\
1054 append: well, that says it.\\
1055 backup: rename (if exists) to name~ and start name.\\
1055 backup: rename (if exists) to name~ and start name.\\
1056 global: single logfile in your home dir, appended to.\\
1056 global: single logfile in your home dir, appended to.\\
1057 over : overwrite existing log.\\
1057 over : overwrite existing log.\\
1058 rotate: create rotating logs name.1~, name.2~, etc.
1058 rotate: create rotating logs name.1~, name.2~, etc.
1059
1059
1060 Options:
1060 Options:
1061
1061
1062 -o: log also IPython's output. In this mode, all commands which
1062 -o: log also IPython's output. In this mode, all commands which
1063 generate an Out[NN] prompt are recorded to the logfile, right after
1063 generate an Out[NN] prompt are recorded to the logfile, right after
1064 their corresponding input line. The output lines are always
1064 their corresponding input line. The output lines are always
1065 prepended with a '#[Out]# ' marker, so that the log remains valid
1065 prepended with a '#[Out]# ' marker, so that the log remains valid
1066 Python code.
1066 Python code.
1067
1067
1068 Since this marker is always the same, filtering only the output from
1068 Since this marker is always the same, filtering only the output from
1069 a log is very easy, using for example a simple awk call:
1069 a log is very easy, using for example a simple awk call:
1070
1070
1071 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
1071 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
1072
1072
1073 -r: log 'raw' input. Normally, IPython's logs contain the processed
1073 -r: log 'raw' input. Normally, IPython's logs contain the processed
1074 input, so that user lines are logged in their final form, converted
1074 input, so that user lines are logged in their final form, converted
1075 into valid Python. For example, %Exit is logged as
1075 into valid Python. For example, %Exit is logged as
1076 '_ip.magic("Exit"). If the -r flag is given, all input is logged
1076 '_ip.magic("Exit"). If the -r flag is given, all input is logged
1077 exactly as typed, with no transformations applied.
1077 exactly as typed, with no transformations applied.
1078
1078
1079 -t: put timestamps before each input line logged (these are put in
1079 -t: put timestamps before each input line logged (these are put in
1080 comments)."""
1080 comments)."""
1081
1081
1082 opts,par = self.parse_options(parameter_s,'ort')
1082 opts,par = self.parse_options(parameter_s,'ort')
1083 log_output = 'o' in opts
1083 log_output = 'o' in opts
1084 log_raw_input = 'r' in opts
1084 log_raw_input = 'r' in opts
1085 timestamp = 't' in opts
1085 timestamp = 't' in opts
1086
1086
1087 rc = self.shell.rc
1087 rc = self.shell.rc
1088 logger = self.shell.logger
1088 logger = self.shell.logger
1089
1089
1090 # if no args are given, the defaults set in the logger constructor by
1090 # if no args are given, the defaults set in the logger constructor by
1091 # ipytohn remain valid
1091 # ipytohn remain valid
1092 if par:
1092 if par:
1093 try:
1093 try:
1094 logfname,logmode = par.split()
1094 logfname,logmode = par.split()
1095 except:
1095 except:
1096 logfname = par
1096 logfname = par
1097 logmode = 'backup'
1097 logmode = 'backup'
1098 else:
1098 else:
1099 logfname = logger.logfname
1099 logfname = logger.logfname
1100 logmode = logger.logmode
1100 logmode = logger.logmode
1101 # put logfname into rc struct as if it had been called on the command
1101 # put logfname into rc struct as if it had been called on the command
1102 # line, so it ends up saved in the log header Save it in case we need
1102 # line, so it ends up saved in the log header Save it in case we need
1103 # to restore it...
1103 # to restore it...
1104 old_logfile = rc.opts.get('logfile','')
1104 old_logfile = rc.opts.get('logfile','')
1105 if logfname:
1105 if logfname:
1106 logfname = os.path.expanduser(logfname)
1106 logfname = os.path.expanduser(logfname)
1107 rc.opts.logfile = logfname
1107 rc.opts.logfile = logfname
1108 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
1108 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
1109 try:
1109 try:
1110 started = logger.logstart(logfname,loghead,logmode,
1110 started = logger.logstart(logfname,loghead,logmode,
1111 log_output,timestamp,log_raw_input)
1111 log_output,timestamp,log_raw_input)
1112 except:
1112 except:
1113 rc.opts.logfile = old_logfile
1113 rc.opts.logfile = old_logfile
1114 warn("Couldn't start log: %s" % sys.exc_info()[1])
1114 warn("Couldn't start log: %s" % sys.exc_info()[1])
1115 else:
1115 else:
1116 # log input history up to this point, optionally interleaving
1116 # log input history up to this point, optionally interleaving
1117 # output if requested
1117 # output if requested
1118
1118
1119 if timestamp:
1119 if timestamp:
1120 # disable timestamping for the previous history, since we've
1120 # disable timestamping for the previous history, since we've
1121 # lost those already (no time machine here).
1121 # lost those already (no time machine here).
1122 logger.timestamp = False
1122 logger.timestamp = False
1123
1123
1124 if log_raw_input:
1124 if log_raw_input:
1125 input_hist = self.shell.input_hist_raw
1125 input_hist = self.shell.input_hist_raw
1126 else:
1126 else:
1127 input_hist = self.shell.input_hist
1127 input_hist = self.shell.input_hist
1128
1128
1129 if log_output:
1129 if log_output:
1130 log_write = logger.log_write
1130 log_write = logger.log_write
1131 output_hist = self.shell.output_hist
1131 output_hist = self.shell.output_hist
1132 for n in range(1,len(input_hist)-1):
1132 for n in range(1,len(input_hist)-1):
1133 log_write(input_hist[n].rstrip())
1133 log_write(input_hist[n].rstrip())
1134 if n in output_hist:
1134 if n in output_hist:
1135 log_write(repr(output_hist[n]),'output')
1135 log_write(repr(output_hist[n]),'output')
1136 else:
1136 else:
1137 logger.log_write(input_hist[1:])
1137 logger.log_write(input_hist[1:])
1138 if timestamp:
1138 if timestamp:
1139 # re-enable timestamping
1139 # re-enable timestamping
1140 logger.timestamp = True
1140 logger.timestamp = True
1141
1141
1142 print ('Activating auto-logging. '
1142 print ('Activating auto-logging. '
1143 'Current session state plus future input saved.')
1143 'Current session state plus future input saved.')
1144 logger.logstate()
1144 logger.logstate()
1145
1145
1146 def magic_logoff(self,parameter_s=''):
1146 def magic_logoff(self,parameter_s=''):
1147 """Temporarily stop logging.
1147 """Temporarily stop logging.
1148
1148
1149 You must have previously started logging."""
1149 You must have previously started logging."""
1150 self.shell.logger.switch_log(0)
1150 self.shell.logger.switch_log(0)
1151
1151
1152 def magic_logon(self,parameter_s=''):
1152 def magic_logon(self,parameter_s=''):
1153 """Restart logging.
1153 """Restart logging.
1154
1154
1155 This function is for restarting logging which you've temporarily
1155 This function is for restarting logging which you've temporarily
1156 stopped with %logoff. For starting logging for the first time, you
1156 stopped with %logoff. For starting logging for the first time, you
1157 must use the %logstart function, which allows you to specify an
1157 must use the %logstart function, which allows you to specify an
1158 optional log filename."""
1158 optional log filename."""
1159
1159
1160 self.shell.logger.switch_log(1)
1160 self.shell.logger.switch_log(1)
1161
1161
1162 def magic_logstate(self,parameter_s=''):
1162 def magic_logstate(self,parameter_s=''):
1163 """Print the status of the logging system."""
1163 """Print the status of the logging system."""
1164
1164
1165 self.shell.logger.logstate()
1165 self.shell.logger.logstate()
1166
1166
1167 def magic_pdb(self, parameter_s=''):
1167 def magic_pdb(self, parameter_s=''):
1168 """Control the automatic calling of the pdb interactive debugger.
1168 """Control the automatic calling of the pdb interactive debugger.
1169
1169
1170 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1170 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1171 argument it works as a toggle.
1171 argument it works as a toggle.
1172
1172
1173 When an exception is triggered, IPython can optionally call the
1173 When an exception is triggered, IPython can optionally call the
1174 interactive pdb debugger after the traceback printout. %pdb toggles
1174 interactive pdb debugger after the traceback printout. %pdb toggles
1175 this feature on and off.
1175 this feature on and off.
1176
1176
1177 The initial state of this feature is set in your ipythonrc
1177 The initial state of this feature is set in your ipythonrc
1178 configuration file (the variable is called 'pdb').
1178 configuration file (the variable is called 'pdb').
1179
1179
1180 If you want to just activate the debugger AFTER an exception has fired,
1180 If you want to just activate the debugger AFTER an exception has fired,
1181 without having to type '%pdb on' and rerunning your code, you can use
1181 without having to type '%pdb on' and rerunning your code, you can use
1182 the %debug magic."""
1182 the %debug magic."""
1183
1183
1184 par = parameter_s.strip().lower()
1184 par = parameter_s.strip().lower()
1185
1185
1186 if par:
1186 if par:
1187 try:
1187 try:
1188 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1188 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1189 except KeyError:
1189 except KeyError:
1190 print ('Incorrect argument. Use on/1, off/0, '
1190 print ('Incorrect argument. Use on/1, off/0, '
1191 'or nothing for a toggle.')
1191 'or nothing for a toggle.')
1192 return
1192 return
1193 else:
1193 else:
1194 # toggle
1194 # toggle
1195 new_pdb = not self.shell.call_pdb
1195 new_pdb = not self.shell.call_pdb
1196
1196
1197 # set on the shell
1197 # set on the shell
1198 self.shell.call_pdb = new_pdb
1198 self.shell.call_pdb = new_pdb
1199 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1199 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1200
1200
1201 def magic_debug(self, parameter_s=''):
1201 def magic_debug(self, parameter_s=''):
1202 """Activate the interactive debugger in post-mortem mode.
1202 """Activate the interactive debugger in post-mortem mode.
1203
1203
1204 If an exception has just occurred, this lets you inspect its stack
1204 If an exception has just occurred, this lets you inspect its stack
1205 frames interactively. Note that this will always work only on the last
1205 frames interactively. Note that this will always work only on the last
1206 traceback that occurred, so you must call this quickly after an
1206 traceback that occurred, so you must call this quickly after an
1207 exception that you wish to inspect has fired, because if another one
1207 exception that you wish to inspect has fired, because if another one
1208 occurs, it clobbers the previous one.
1208 occurs, it clobbers the previous one.
1209
1209
1210 If you want IPython to automatically do this on every exception, see
1210 If you want IPython to automatically do this on every exception, see
1211 the %pdb magic for more details.
1211 the %pdb magic for more details.
1212 """
1212 """
1213
1213
1214 self.shell.debugger(force=True)
1214 self.shell.debugger(force=True)
1215
1215
1216 def magic_prun(self, parameter_s ='',user_mode=1,
1216 def magic_prun(self, parameter_s ='',user_mode=1,
1217 opts=None,arg_lst=None,prog_ns=None):
1217 opts=None,arg_lst=None,prog_ns=None):
1218
1218
1219 """Run a statement through the python code profiler.
1219 """Run a statement through the python code profiler.
1220
1220
1221 Usage:\\
1221 Usage:\\
1222 %prun [options] statement
1222 %prun [options] statement
1223
1223
1224 The given statement (which doesn't require quote marks) is run via the
1224 The given statement (which doesn't require quote marks) is run via the
1225 python profiler in a manner similar to the profile.run() function.
1225 python profiler in a manner similar to the profile.run() function.
1226 Namespaces are internally managed to work correctly; profile.run
1226 Namespaces are internally managed to work correctly; profile.run
1227 cannot be used in IPython because it makes certain assumptions about
1227 cannot be used in IPython because it makes certain assumptions about
1228 namespaces which do not hold under IPython.
1228 namespaces which do not hold under IPython.
1229
1229
1230 Options:
1230 Options:
1231
1231
1232 -l <limit>: you can place restrictions on what or how much of the
1232 -l <limit>: you can place restrictions on what or how much of the
1233 profile gets printed. The limit value can be:
1233 profile gets printed. The limit value can be:
1234
1234
1235 * A string: only information for function names containing this string
1235 * A string: only information for function names containing this string
1236 is printed.
1236 is printed.
1237
1237
1238 * An integer: only these many lines are printed.
1238 * An integer: only these many lines are printed.
1239
1239
1240 * A float (between 0 and 1): this fraction of the report is printed
1240 * A float (between 0 and 1): this fraction of the report is printed
1241 (for example, use a limit of 0.4 to see the topmost 40% only).
1241 (for example, use a limit of 0.4 to see the topmost 40% only).
1242
1242
1243 You can combine several limits with repeated use of the option. For
1243 You can combine several limits with repeated use of the option. For
1244 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1244 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1245 information about class constructors.
1245 information about class constructors.
1246
1246
1247 -r: return the pstats.Stats object generated by the profiling. This
1247 -r: return the pstats.Stats object generated by the profiling. This
1248 object has all the information about the profile in it, and you can
1248 object has all the information about the profile in it, and you can
1249 later use it for further analysis or in other functions.
1249 later use it for further analysis or in other functions.
1250
1250
1251 -s <key>: sort profile by given key. You can provide more than one key
1251 -s <key>: sort profile by given key. You can provide more than one key
1252 by using the option several times: '-s key1 -s key2 -s key3...'. The
1252 by using the option several times: '-s key1 -s key2 -s key3...'. The
1253 default sorting key is 'time'.
1253 default sorting key is 'time'.
1254
1254
1255 The following is copied verbatim from the profile documentation
1255 The following is copied verbatim from the profile documentation
1256 referenced below:
1256 referenced below:
1257
1257
1258 When more than one key is provided, additional keys are used as
1258 When more than one key is provided, additional keys are used as
1259 secondary criteria when the there is equality in all keys selected
1259 secondary criteria when the there is equality in all keys selected
1260 before them.
1260 before them.
1261
1261
1262 Abbreviations can be used for any key names, as long as the
1262 Abbreviations can be used for any key names, as long as the
1263 abbreviation is unambiguous. The following are the keys currently
1263 abbreviation is unambiguous. The following are the keys currently
1264 defined:
1264 defined:
1265
1265
1266 Valid Arg Meaning\\
1266 Valid Arg Meaning\\
1267 "calls" call count\\
1267 "calls" call count\\
1268 "cumulative" cumulative time\\
1268 "cumulative" cumulative time\\
1269 "file" file name\\
1269 "file" file name\\
1270 "module" file name\\
1270 "module" file name\\
1271 "pcalls" primitive call count\\
1271 "pcalls" primitive call count\\
1272 "line" line number\\
1272 "line" line number\\
1273 "name" function name\\
1273 "name" function name\\
1274 "nfl" name/file/line\\
1274 "nfl" name/file/line\\
1275 "stdname" standard name\\
1275 "stdname" standard name\\
1276 "time" internal time
1276 "time" internal time
1277
1277
1278 Note that all sorts on statistics are in descending order (placing
1278 Note that all sorts on statistics are in descending order (placing
1279 most time consuming items first), where as name, file, and line number
1279 most time consuming items first), where as name, file, and line number
1280 searches are in ascending order (i.e., alphabetical). The subtle
1280 searches are in ascending order (i.e., alphabetical). The subtle
1281 distinction between "nfl" and "stdname" is that the standard name is a
1281 distinction between "nfl" and "stdname" is that the standard name is a
1282 sort of the name as printed, which means that the embedded line
1282 sort of the name as printed, which means that the embedded line
1283 numbers get compared in an odd way. For example, lines 3, 20, and 40
1283 numbers get compared in an odd way. For example, lines 3, 20, and 40
1284 would (if the file names were the same) appear in the string order
1284 would (if the file names were the same) appear in the string order
1285 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1285 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1286 line numbers. In fact, sort_stats("nfl") is the same as
1286 line numbers. In fact, sort_stats("nfl") is the same as
1287 sort_stats("name", "file", "line").
1287 sort_stats("name", "file", "line").
1288
1288
1289 -T <filename>: save profile results as shown on screen to a text
1289 -T <filename>: save profile results as shown on screen to a text
1290 file. The profile is still shown on screen.
1290 file. The profile is still shown on screen.
1291
1291
1292 -D <filename>: save (via dump_stats) profile statistics to given
1292 -D <filename>: save (via dump_stats) profile statistics to given
1293 filename. This data is in a format understod by the pstats module, and
1293 filename. This data is in a format understod by the pstats module, and
1294 is generated by a call to the dump_stats() method of profile
1294 is generated by a call to the dump_stats() method of profile
1295 objects. The profile is still shown on screen.
1295 objects. The profile is still shown on screen.
1296
1296
1297 If you want to run complete programs under the profiler's control, use
1297 If you want to run complete programs under the profiler's control, use
1298 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1298 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1299 contains profiler specific options as described here.
1299 contains profiler specific options as described here.
1300
1300
1301 You can read the complete documentation for the profile module with:\\
1301 You can read the complete documentation for the profile module with:\\
1302 In [1]: import profile; profile.help() """
1302 In [1]: import profile; profile.help() """
1303
1303
1304 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1304 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1305 # protect user quote marks
1305 # protect user quote marks
1306 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1306 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1307
1307
1308 if user_mode: # regular user call
1308 if user_mode: # regular user call
1309 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1309 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1310 list_all=1)
1310 list_all=1)
1311 namespace = self.shell.user_ns
1311 namespace = self.shell.user_ns
1312 else: # called to run a program by %run -p
1312 else: # called to run a program by %run -p
1313 try:
1313 try:
1314 filename = get_py_filename(arg_lst[0])
1314 filename = get_py_filename(arg_lst[0])
1315 except IOError,msg:
1315 except IOError,msg:
1316 error(msg)
1316 error(msg)
1317 return
1317 return
1318
1318
1319 arg_str = 'execfile(filename,prog_ns)'
1319 arg_str = 'execfile(filename,prog_ns)'
1320 namespace = locals()
1320 namespace = locals()
1321
1321
1322 opts.merge(opts_def)
1322 opts.merge(opts_def)
1323
1323
1324 prof = profile.Profile()
1324 prof = profile.Profile()
1325 try:
1325 try:
1326 prof = prof.runctx(arg_str,namespace,namespace)
1326 prof = prof.runctx(arg_str,namespace,namespace)
1327 sys_exit = ''
1327 sys_exit = ''
1328 except SystemExit:
1328 except SystemExit:
1329 sys_exit = """*** SystemExit exception caught in code being profiled."""
1329 sys_exit = """*** SystemExit exception caught in code being profiled."""
1330
1330
1331 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1331 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1332
1332
1333 lims = opts.l
1333 lims = opts.l
1334 if lims:
1334 if lims:
1335 lims = [] # rebuild lims with ints/floats/strings
1335 lims = [] # rebuild lims with ints/floats/strings
1336 for lim in opts.l:
1336 for lim in opts.l:
1337 try:
1337 try:
1338 lims.append(int(lim))
1338 lims.append(int(lim))
1339 except ValueError:
1339 except ValueError:
1340 try:
1340 try:
1341 lims.append(float(lim))
1341 lims.append(float(lim))
1342 except ValueError:
1342 except ValueError:
1343 lims.append(lim)
1343 lims.append(lim)
1344
1344
1345 # Trap output.
1345 # Trap output.
1346 stdout_trap = StringIO()
1346 stdout_trap = StringIO()
1347
1347
1348 if hasattr(stats,'stream'):
1348 if hasattr(stats,'stream'):
1349 # In newer versions of python, the stats object has a 'stream'
1349 # In newer versions of python, the stats object has a 'stream'
1350 # attribute to write into.
1350 # attribute to write into.
1351 stats.stream = stdout_trap
1351 stats.stream = stdout_trap
1352 stats.print_stats(*lims)
1352 stats.print_stats(*lims)
1353 else:
1353 else:
1354 # For older versions, we manually redirect stdout during printing
1354 # For older versions, we manually redirect stdout during printing
1355 sys_stdout = sys.stdout
1355 sys_stdout = sys.stdout
1356 try:
1356 try:
1357 sys.stdout = stdout_trap
1357 sys.stdout = stdout_trap
1358 stats.print_stats(*lims)
1358 stats.print_stats(*lims)
1359 finally:
1359 finally:
1360 sys.stdout = sys_stdout
1360 sys.stdout = sys_stdout
1361
1361
1362 output = stdout_trap.getvalue()
1362 output = stdout_trap.getvalue()
1363 output = output.rstrip()
1363 output = output.rstrip()
1364
1364
1365 page(output,screen_lines=self.shell.rc.screen_length)
1365 page(output,screen_lines=self.shell.rc.screen_length)
1366 print sys_exit,
1366 print sys_exit,
1367
1367
1368 dump_file = opts.D[0]
1368 dump_file = opts.D[0]
1369 text_file = opts.T[0]
1369 text_file = opts.T[0]
1370 if dump_file:
1370 if dump_file:
1371 prof.dump_stats(dump_file)
1371 prof.dump_stats(dump_file)
1372 print '\n*** Profile stats marshalled to file',\
1372 print '\n*** Profile stats marshalled to file',\
1373 `dump_file`+'.',sys_exit
1373 `dump_file`+'.',sys_exit
1374 if text_file:
1374 if text_file:
1375 pfile = file(text_file,'w')
1375 pfile = file(text_file,'w')
1376 pfile.write(output)
1376 pfile.write(output)
1377 pfile.close()
1377 pfile.close()
1378 print '\n*** Profile printout saved to text file',\
1378 print '\n*** Profile printout saved to text file',\
1379 `text_file`+'.',sys_exit
1379 `text_file`+'.',sys_exit
1380
1380
1381 if opts.has_key('r'):
1381 if opts.has_key('r'):
1382 return stats
1382 return stats
1383 else:
1383 else:
1384 return None
1384 return None
1385
1385
1386 def magic_run(self, parameter_s ='',runner=None):
1386 def magic_run(self, parameter_s ='',runner=None):
1387 """Run the named file inside IPython as a program.
1387 """Run the named file inside IPython as a program.
1388
1388
1389 Usage:\\
1389 Usage:\\
1390 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1390 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1391
1391
1392 Parameters after the filename are passed as command-line arguments to
1392 Parameters after the filename are passed as command-line arguments to
1393 the program (put in sys.argv). Then, control returns to IPython's
1393 the program (put in sys.argv). Then, control returns to IPython's
1394 prompt.
1394 prompt.
1395
1395
1396 This is similar to running at a system prompt:\\
1396 This is similar to running at a system prompt:\\
1397 $ python file args\\
1397 $ python file args\\
1398 but with the advantage of giving you IPython's tracebacks, and of
1398 but with the advantage of giving you IPython's tracebacks, and of
1399 loading all variables into your interactive namespace for further use
1399 loading all variables into your interactive namespace for further use
1400 (unless -p is used, see below).
1400 (unless -p is used, see below).
1401
1401
1402 The file is executed in a namespace initially consisting only of
1402 The file is executed in a namespace initially consisting only of
1403 __name__=='__main__' and sys.argv constructed as indicated. It thus
1403 __name__=='__main__' and sys.argv constructed as indicated. It thus
1404 sees its environment as if it were being run as a stand-alone
1404 sees its environment as if it were being run as a stand-alone
1405 program. But after execution, the IPython interactive namespace gets
1405 program. But after execution, the IPython interactive namespace gets
1406 updated with all variables defined in the program (except for __name__
1406 updated with all variables defined in the program (except for __name__
1407 and sys.argv). This allows for very convenient loading of code for
1407 and sys.argv). This allows for very convenient loading of code for
1408 interactive work, while giving each program a 'clean sheet' to run in.
1408 interactive work, while giving each program a 'clean sheet' to run in.
1409
1409
1410 Options:
1410 Options:
1411
1411
1412 -n: __name__ is NOT set to '__main__', but to the running file's name
1412 -n: __name__ is NOT set to '__main__', but to the running file's name
1413 without extension (as python does under import). This allows running
1413 without extension (as python does under import). This allows running
1414 scripts and reloading the definitions in them without calling code
1414 scripts and reloading the definitions in them without calling code
1415 protected by an ' if __name__ == "__main__" ' clause.
1415 protected by an ' if __name__ == "__main__" ' clause.
1416
1416
1417 -i: run the file in IPython's namespace instead of an empty one. This
1417 -i: run the file in IPython's namespace instead of an empty one. This
1418 is useful if you are experimenting with code written in a text editor
1418 is useful if you are experimenting with code written in a text editor
1419 which depends on variables defined interactively.
1419 which depends on variables defined interactively.
1420
1420
1421 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1421 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1422 being run. This is particularly useful if IPython is being used to
1422 being run. This is particularly useful if IPython is being used to
1423 run unittests, which always exit with a sys.exit() call. In such
1423 run unittests, which always exit with a sys.exit() call. In such
1424 cases you are interested in the output of the test results, not in
1424 cases you are interested in the output of the test results, not in
1425 seeing a traceback of the unittest module.
1425 seeing a traceback of the unittest module.
1426
1426
1427 -t: print timing information at the end of the run. IPython will give
1427 -t: print timing information at the end of the run. IPython will give
1428 you an estimated CPU time consumption for your script, which under
1428 you an estimated CPU time consumption for your script, which under
1429 Unix uses the resource module to avoid the wraparound problems of
1429 Unix uses the resource module to avoid the wraparound problems of
1430 time.clock(). Under Unix, an estimate of time spent on system tasks
1430 time.clock(). Under Unix, an estimate of time spent on system tasks
1431 is also given (for Windows platforms this is reported as 0.0).
1431 is also given (for Windows platforms this is reported as 0.0).
1432
1432
1433 If -t is given, an additional -N<N> option can be given, where <N>
1433 If -t is given, an additional -N<N> option can be given, where <N>
1434 must be an integer indicating how many times you want the script to
1434 must be an integer indicating how many times you want the script to
1435 run. The final timing report will include total and per run results.
1435 run. The final timing report will include total and per run results.
1436
1436
1437 For example (testing the script uniq_stable.py):
1437 For example (testing the script uniq_stable.py):
1438
1438
1439 In [1]: run -t uniq_stable
1439 In [1]: run -t uniq_stable
1440
1440
1441 IPython CPU timings (estimated):\\
1441 IPython CPU timings (estimated):\\
1442 User : 0.19597 s.\\
1442 User : 0.19597 s.\\
1443 System: 0.0 s.\\
1443 System: 0.0 s.\\
1444
1444
1445 In [2]: run -t -N5 uniq_stable
1445 In [2]: run -t -N5 uniq_stable
1446
1446
1447 IPython CPU timings (estimated):\\
1447 IPython CPU timings (estimated):\\
1448 Total runs performed: 5\\
1448 Total runs performed: 5\\
1449 Times : Total Per run\\
1449 Times : Total Per run\\
1450 User : 0.910862 s, 0.1821724 s.\\
1450 User : 0.910862 s, 0.1821724 s.\\
1451 System: 0.0 s, 0.0 s.
1451 System: 0.0 s, 0.0 s.
1452
1452
1453 -d: run your program under the control of pdb, the Python debugger.
1453 -d: run your program under the control of pdb, the Python debugger.
1454 This allows you to execute your program step by step, watch variables,
1454 This allows you to execute your program step by step, watch variables,
1455 etc. Internally, what IPython does is similar to calling:
1455 etc. Internally, what IPython does is similar to calling:
1456
1456
1457 pdb.run('execfile("YOURFILENAME")')
1457 pdb.run('execfile("YOURFILENAME")')
1458
1458
1459 with a breakpoint set on line 1 of your file. You can change the line
1459 with a breakpoint set on line 1 of your file. You can change the line
1460 number for this automatic breakpoint to be <N> by using the -bN option
1460 number for this automatic breakpoint to be <N> by using the -bN option
1461 (where N must be an integer). For example:
1461 (where N must be an integer). For example:
1462
1462
1463 %run -d -b40 myscript
1463 %run -d -b40 myscript
1464
1464
1465 will set the first breakpoint at line 40 in myscript.py. Note that
1465 will set the first breakpoint at line 40 in myscript.py. Note that
1466 the first breakpoint must be set on a line which actually does
1466 the first breakpoint must be set on a line which actually does
1467 something (not a comment or docstring) for it to stop execution.
1467 something (not a comment or docstring) for it to stop execution.
1468
1468
1469 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1469 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1470 first enter 'c' (without qoutes) to start execution up to the first
1470 first enter 'c' (without qoutes) to start execution up to the first
1471 breakpoint.
1471 breakpoint.
1472
1472
1473 Entering 'help' gives information about the use of the debugger. You
1473 Entering 'help' gives information about the use of the debugger. You
1474 can easily see pdb's full documentation with "import pdb;pdb.help()"
1474 can easily see pdb's full documentation with "import pdb;pdb.help()"
1475 at a prompt.
1475 at a prompt.
1476
1476
1477 -p: run program under the control of the Python profiler module (which
1477 -p: run program under the control of the Python profiler module (which
1478 prints a detailed report of execution times, function calls, etc).
1478 prints a detailed report of execution times, function calls, etc).
1479
1479
1480 You can pass other options after -p which affect the behavior of the
1480 You can pass other options after -p which affect the behavior of the
1481 profiler itself. See the docs for %prun for details.
1481 profiler itself. See the docs for %prun for details.
1482
1482
1483 In this mode, the program's variables do NOT propagate back to the
1483 In this mode, the program's variables do NOT propagate back to the
1484 IPython interactive namespace (because they remain in the namespace
1484 IPython interactive namespace (because they remain in the namespace
1485 where the profiler executes them).
1485 where the profiler executes them).
1486
1486
1487 Internally this triggers a call to %prun, see its documentation for
1487 Internally this triggers a call to %prun, see its documentation for
1488 details on the options available specifically for profiling.
1488 details on the options available specifically for profiling.
1489
1489
1490 There is one special usage for which the text above doesn't apply:
1490 There is one special usage for which the text above doesn't apply:
1491 if the filename ends with .ipy, the file is run as ipython script,
1491 if the filename ends with .ipy, the file is run as ipython script,
1492 just as if the commands were written on IPython prompt.
1492 just as if the commands were written on IPython prompt.
1493 """
1493 """
1494
1494
1495 # get arguments and set sys.argv for program to be run.
1495 # get arguments and set sys.argv for program to be run.
1496 opts,arg_lst = self.parse_options(parameter_s,'nidtN:b:pD:l:rs:T:e',
1496 opts,arg_lst = self.parse_options(parameter_s,'nidtN:b:pD:l:rs:T:e',
1497 mode='list',list_all=1)
1497 mode='list',list_all=1)
1498
1498
1499 try:
1499 try:
1500 filename = get_py_filename(arg_lst[0])
1500 filename = get_py_filename(arg_lst[0])
1501 except IndexError:
1501 except IndexError:
1502 warn('you must provide at least a filename.')
1502 warn('you must provide at least a filename.')
1503 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1503 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1504 return
1504 return
1505 except IOError,msg:
1505 except IOError,msg:
1506 error(msg)
1506 error(msg)
1507 return
1507 return
1508
1508
1509 if filename.lower().endswith('.ipy'):
1509 if filename.lower().endswith('.ipy'):
1510 self.api.runlines(open(filename).read())
1510 self.api.runlines(open(filename).read())
1511 return
1511 return
1512
1512
1513 # Control the response to exit() calls made by the script being run
1513 # Control the response to exit() calls made by the script being run
1514 exit_ignore = opts.has_key('e')
1514 exit_ignore = opts.has_key('e')
1515
1515
1516 # Make sure that the running script gets a proper sys.argv as if it
1516 # Make sure that the running script gets a proper sys.argv as if it
1517 # were run from a system shell.
1517 # were run from a system shell.
1518 save_argv = sys.argv # save it for later restoring
1518 save_argv = sys.argv # save it for later restoring
1519 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1519 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1520
1520
1521 if opts.has_key('i'):
1521 if opts.has_key('i'):
1522 prog_ns = self.shell.user_ns
1522 prog_ns = self.shell.user_ns
1523 __name__save = self.shell.user_ns['__name__']
1523 __name__save = self.shell.user_ns['__name__']
1524 prog_ns['__name__'] = '__main__'
1524 prog_ns['__name__'] = '__main__'
1525 else:
1525 else:
1526 if opts.has_key('n'):
1526 if opts.has_key('n'):
1527 name = os.path.splitext(os.path.basename(filename))[0]
1527 name = os.path.splitext(os.path.basename(filename))[0]
1528 else:
1528 else:
1529 name = '__main__'
1529 name = '__main__'
1530 prog_ns = {'__name__':name}
1530 prog_ns = {'__name__':name}
1531
1531
1532 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1532 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1533 # set the __file__ global in the script's namespace
1533 # set the __file__ global in the script's namespace
1534 prog_ns['__file__'] = filename
1534 prog_ns['__file__'] = filename
1535
1535
1536 # pickle fix. See iplib for an explanation. But we need to make sure
1536 # pickle fix. See iplib for an explanation. But we need to make sure
1537 # that, if we overwrite __main__, we replace it at the end
1537 # that, if we overwrite __main__, we replace it at the end
1538 if prog_ns['__name__'] == '__main__':
1538 if prog_ns['__name__'] == '__main__':
1539 restore_main = sys.modules['__main__']
1539 restore_main = sys.modules['__main__']
1540 else:
1540 else:
1541 restore_main = False
1541 restore_main = False
1542
1542
1543 sys.modules[prog_ns['__name__']] = FakeModule(prog_ns)
1543 sys.modules[prog_ns['__name__']] = FakeModule(prog_ns)
1544
1544
1545 stats = None
1545 stats = None
1546 try:
1546 try:
1547 if self.shell.has_readline:
1547 if self.shell.has_readline:
1548 self.shell.savehist()
1548 self.shell.savehist()
1549
1549
1550 if opts.has_key('p'):
1550 if opts.has_key('p'):
1551 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1551 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1552 else:
1552 else:
1553 if opts.has_key('d'):
1553 if opts.has_key('d'):
1554 deb = Debugger.Pdb(self.shell.rc.colors)
1554 deb = Debugger.Pdb(self.shell.rc.colors)
1555 # reset Breakpoint state, which is moronically kept
1555 # reset Breakpoint state, which is moronically kept
1556 # in a class
1556 # in a class
1557 bdb.Breakpoint.next = 1
1557 bdb.Breakpoint.next = 1
1558 bdb.Breakpoint.bplist = {}
1558 bdb.Breakpoint.bplist = {}
1559 bdb.Breakpoint.bpbynumber = [None]
1559 bdb.Breakpoint.bpbynumber = [None]
1560 # Set an initial breakpoint to stop execution
1560 # Set an initial breakpoint to stop execution
1561 maxtries = 10
1561 maxtries = 10
1562 bp = int(opts.get('b',[1])[0])
1562 bp = int(opts.get('b',[1])[0])
1563 checkline = deb.checkline(filename,bp)
1563 checkline = deb.checkline(filename,bp)
1564 if not checkline:
1564 if not checkline:
1565 for bp in range(bp+1,bp+maxtries+1):
1565 for bp in range(bp+1,bp+maxtries+1):
1566 if deb.checkline(filename,bp):
1566 if deb.checkline(filename,bp):
1567 break
1567 break
1568 else:
1568 else:
1569 msg = ("\nI failed to find a valid line to set "
1569 msg = ("\nI failed to find a valid line to set "
1570 "a breakpoint\n"
1570 "a breakpoint\n"
1571 "after trying up to line: %s.\n"
1571 "after trying up to line: %s.\n"
1572 "Please set a valid breakpoint manually "
1572 "Please set a valid breakpoint manually "
1573 "with the -b option." % bp)
1573 "with the -b option." % bp)
1574 error(msg)
1574 error(msg)
1575 return
1575 return
1576 # if we find a good linenumber, set the breakpoint
1576 # if we find a good linenumber, set the breakpoint
1577 deb.do_break('%s:%s' % (filename,bp))
1577 deb.do_break('%s:%s' % (filename,bp))
1578 # Start file run
1578 # Start file run
1579 print "NOTE: Enter 'c' at the",
1579 print "NOTE: Enter 'c' at the",
1580 print "%s prompt to start your script." % deb.prompt
1580 print "%s prompt to start your script." % deb.prompt
1581 try:
1581 try:
1582 deb.run('execfile("%s")' % filename,prog_ns)
1582 deb.run('execfile("%s")' % filename,prog_ns)
1583
1583
1584 except:
1584 except:
1585 etype, value, tb = sys.exc_info()
1585 etype, value, tb = sys.exc_info()
1586 # Skip three frames in the traceback: the %run one,
1586 # Skip three frames in the traceback: the %run one,
1587 # one inside bdb.py, and the command-line typed by the
1587 # one inside bdb.py, and the command-line typed by the
1588 # user (run by exec in pdb itself).
1588 # user (run by exec in pdb itself).
1589 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1589 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1590 else:
1590 else:
1591 if runner is None:
1591 if runner is None:
1592 runner = self.shell.safe_execfile
1592 runner = self.shell.safe_execfile
1593 if opts.has_key('t'):
1593 if opts.has_key('t'):
1594 try:
1594 try:
1595 nruns = int(opts['N'][0])
1595 nruns = int(opts['N'][0])
1596 if nruns < 1:
1596 if nruns < 1:
1597 error('Number of runs must be >=1')
1597 error('Number of runs must be >=1')
1598 return
1598 return
1599 except (KeyError):
1599 except (KeyError):
1600 nruns = 1
1600 nruns = 1
1601 if nruns == 1:
1601 if nruns == 1:
1602 t0 = clock2()
1602 t0 = clock2()
1603 runner(filename,prog_ns,prog_ns,
1603 runner(filename,prog_ns,prog_ns,
1604 exit_ignore=exit_ignore)
1604 exit_ignore=exit_ignore)
1605 t1 = clock2()
1605 t1 = clock2()
1606 t_usr = t1[0]-t0[0]
1606 t_usr = t1[0]-t0[0]
1607 t_sys = t1[1]-t1[1]
1607 t_sys = t1[1]-t1[1]
1608 print "\nIPython CPU timings (estimated):"
1608 print "\nIPython CPU timings (estimated):"
1609 print " User : %10s s." % t_usr
1609 print " User : %10s s." % t_usr
1610 print " System: %10s s." % t_sys
1610 print " System: %10s s." % t_sys
1611 else:
1611 else:
1612 runs = range(nruns)
1612 runs = range(nruns)
1613 t0 = clock2()
1613 t0 = clock2()
1614 for nr in runs:
1614 for nr in runs:
1615 runner(filename,prog_ns,prog_ns,
1615 runner(filename,prog_ns,prog_ns,
1616 exit_ignore=exit_ignore)
1616 exit_ignore=exit_ignore)
1617 t1 = clock2()
1617 t1 = clock2()
1618 t_usr = t1[0]-t0[0]
1618 t_usr = t1[0]-t0[0]
1619 t_sys = t1[1]-t1[1]
1619 t_sys = t1[1]-t1[1]
1620 print "\nIPython CPU timings (estimated):"
1620 print "\nIPython CPU timings (estimated):"
1621 print "Total runs performed:",nruns
1621 print "Total runs performed:",nruns
1622 print " Times : %10s %10s" % ('Total','Per run')
1622 print " Times : %10s %10s" % ('Total','Per run')
1623 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1623 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1624 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1624 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1625
1625
1626 else:
1626 else:
1627 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1627 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1628 if opts.has_key('i'):
1628 if opts.has_key('i'):
1629 self.shell.user_ns['__name__'] = __name__save
1629 self.shell.user_ns['__name__'] = __name__save
1630 else:
1630 else:
1631 # update IPython interactive namespace
1631 # update IPython interactive namespace
1632 del prog_ns['__name__']
1632 del prog_ns['__name__']
1633 self.shell.user_ns.update(prog_ns)
1633 self.shell.user_ns.update(prog_ns)
1634 finally:
1634 finally:
1635 sys.argv = save_argv
1635 sys.argv = save_argv
1636 if restore_main:
1636 if restore_main:
1637 sys.modules['__main__'] = restore_main
1637 sys.modules['__main__'] = restore_main
1638 self.shell.reloadhist()
1638 self.shell.reloadhist()
1639
1639
1640 return stats
1640 return stats
1641
1641
1642 def magic_runlog(self, parameter_s =''):
1642 def magic_runlog(self, parameter_s =''):
1643 """Run files as logs.
1643 """Run files as logs.
1644
1644
1645 Usage:\\
1645 Usage:\\
1646 %runlog file1 file2 ...
1646 %runlog file1 file2 ...
1647
1647
1648 Run the named files (treating them as log files) in sequence inside
1648 Run the named files (treating them as log files) in sequence inside
1649 the interpreter, and return to the prompt. This is much slower than
1649 the interpreter, and return to the prompt. This is much slower than
1650 %run because each line is executed in a try/except block, but it
1650 %run because each line is executed in a try/except block, but it
1651 allows running files with syntax errors in them.
1651 allows running files with syntax errors in them.
1652
1652
1653 Normally IPython will guess when a file is one of its own logfiles, so
1653 Normally IPython will guess when a file is one of its own logfiles, so
1654 you can typically use %run even for logs. This shorthand allows you to
1654 you can typically use %run even for logs. This shorthand allows you to
1655 force any file to be treated as a log file."""
1655 force any file to be treated as a log file."""
1656
1656
1657 for f in parameter_s.split():
1657 for f in parameter_s.split():
1658 self.shell.safe_execfile(f,self.shell.user_ns,
1658 self.shell.safe_execfile(f,self.shell.user_ns,
1659 self.shell.user_ns,islog=1)
1659 self.shell.user_ns,islog=1)
1660
1660
1661 def magic_timeit(self, parameter_s =''):
1661 def magic_timeit(self, parameter_s =''):
1662 """Time execution of a Python statement or expression
1662 """Time execution of a Python statement or expression
1663
1663
1664 Usage:\\
1664 Usage:\\
1665 %timeit [-n<N> -r<R> [-t|-c]] statement
1665 %timeit [-n<N> -r<R> [-t|-c]] statement
1666
1666
1667 Time execution of a Python statement or expression using the timeit
1667 Time execution of a Python statement or expression using the timeit
1668 module.
1668 module.
1669
1669
1670 Options:
1670 Options:
1671 -n<N>: execute the given statement <N> times in a loop. If this value
1671 -n<N>: execute the given statement <N> times in a loop. If this value
1672 is not given, a fitting value is chosen.
1672 is not given, a fitting value is chosen.
1673
1673
1674 -r<R>: repeat the loop iteration <R> times and take the best result.
1674 -r<R>: repeat the loop iteration <R> times and take the best result.
1675 Default: 3
1675 Default: 3
1676
1676
1677 -t: use time.time to measure the time, which is the default on Unix.
1677 -t: use time.time to measure the time, which is the default on Unix.
1678 This function measures wall time.
1678 This function measures wall time.
1679
1679
1680 -c: use time.clock to measure the time, which is the default on
1680 -c: use time.clock to measure the time, which is the default on
1681 Windows and measures wall time. On Unix, resource.getrusage is used
1681 Windows and measures wall time. On Unix, resource.getrusage is used
1682 instead and returns the CPU user time.
1682 instead and returns the CPU user time.
1683
1683
1684 -p<P>: use a precision of <P> digits to display the timing result.
1684 -p<P>: use a precision of <P> digits to display the timing result.
1685 Default: 3
1685 Default: 3
1686
1686
1687
1687
1688 Examples:\\
1688 Examples:\\
1689 In [1]: %timeit pass
1689 In [1]: %timeit pass
1690 10000000 loops, best of 3: 53.3 ns per loop
1690 10000000 loops, best of 3: 53.3 ns per loop
1691
1691
1692 In [2]: u = None
1692 In [2]: u = None
1693
1693
1694 In [3]: %timeit u is None
1694 In [3]: %timeit u is None
1695 10000000 loops, best of 3: 184 ns per loop
1695 10000000 loops, best of 3: 184 ns per loop
1696
1696
1697 In [4]: %timeit -r 4 u == None
1697 In [4]: %timeit -r 4 u == None
1698 1000000 loops, best of 4: 242 ns per loop
1698 1000000 loops, best of 4: 242 ns per loop
1699
1699
1700 In [5]: import time
1700 In [5]: import time
1701
1701
1702 In [6]: %timeit -n1 time.sleep(2)
1702 In [6]: %timeit -n1 time.sleep(2)
1703 1 loops, best of 3: 2 s per loop
1703 1 loops, best of 3: 2 s per loop
1704
1704
1705
1705
1706 The times reported by %timeit will be slightly higher than those
1706 The times reported by %timeit will be slightly higher than those
1707 reported by the timeit.py script when variables are accessed. This is
1707 reported by the timeit.py script when variables are accessed. This is
1708 due to the fact that %timeit executes the statement in the namespace
1708 due to the fact that %timeit executes the statement in the namespace
1709 of the shell, compared with timeit.py, which uses a single setup
1709 of the shell, compared with timeit.py, which uses a single setup
1710 statement to import function or create variables. Generally, the bias
1710 statement to import function or create variables. Generally, the bias
1711 does not matter as long as results from timeit.py are not mixed with
1711 does not matter as long as results from timeit.py are not mixed with
1712 those from %timeit."""
1712 those from %timeit."""
1713
1713
1714 import timeit
1714 import timeit
1715 import math
1715 import math
1716
1716
1717 units = ["s", "ms", "\xc2\xb5s", "ns"]
1717 units = ["s", "ms", "\xc2\xb5s", "ns"]
1718 scaling = [1, 1e3, 1e6, 1e9]
1718 scaling = [1, 1e3, 1e6, 1e9]
1719
1719
1720 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1720 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1721 posix=False)
1721 posix=False)
1722 if stmt == "":
1722 if stmt == "":
1723 return
1723 return
1724 timefunc = timeit.default_timer
1724 timefunc = timeit.default_timer
1725 number = int(getattr(opts, "n", 0))
1725 number = int(getattr(opts, "n", 0))
1726 repeat = int(getattr(opts, "r", timeit.default_repeat))
1726 repeat = int(getattr(opts, "r", timeit.default_repeat))
1727 precision = int(getattr(opts, "p", 3))
1727 precision = int(getattr(opts, "p", 3))
1728 if hasattr(opts, "t"):
1728 if hasattr(opts, "t"):
1729 timefunc = time.time
1729 timefunc = time.time
1730 if hasattr(opts, "c"):
1730 if hasattr(opts, "c"):
1731 timefunc = clock
1731 timefunc = clock
1732
1732
1733 timer = timeit.Timer(timer=timefunc)
1733 timer = timeit.Timer(timer=timefunc)
1734 # this code has tight coupling to the inner workings of timeit.Timer,
1734 # this code has tight coupling to the inner workings of timeit.Timer,
1735 # but is there a better way to achieve that the code stmt has access
1735 # but is there a better way to achieve that the code stmt has access
1736 # to the shell namespace?
1736 # to the shell namespace?
1737
1737
1738 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1738 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1739 'setup': "pass"}
1739 'setup': "pass"}
1740 code = compile(src, "<magic-timeit>", "exec")
1740 code = compile(src, "<magic-timeit>", "exec")
1741 ns = {}
1741 ns = {}
1742 exec code in self.shell.user_ns, ns
1742 exec code in self.shell.user_ns, ns
1743 timer.inner = ns["inner"]
1743 timer.inner = ns["inner"]
1744
1744
1745 if number == 0:
1745 if number == 0:
1746 # determine number so that 0.2 <= total time < 2.0
1746 # determine number so that 0.2 <= total time < 2.0
1747 number = 1
1747 number = 1
1748 for i in range(1, 10):
1748 for i in range(1, 10):
1749 number *= 10
1749 number *= 10
1750 if timer.timeit(number) >= 0.2:
1750 if timer.timeit(number) >= 0.2:
1751 break
1751 break
1752
1752
1753 best = min(timer.repeat(repeat, number)) / number
1753 best = min(timer.repeat(repeat, number)) / number
1754
1754
1755 if best > 0.0:
1755 if best > 0.0:
1756 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1756 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1757 else:
1757 else:
1758 order = 3
1758 order = 3
1759 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1759 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1760 precision,
1760 precision,
1761 best * scaling[order],
1761 best * scaling[order],
1762 units[order])
1762 units[order])
1763
1763
1764 def magic_time(self,parameter_s = ''):
1764 def magic_time(self,parameter_s = ''):
1765 """Time execution of a Python statement or expression.
1765 """Time execution of a Python statement or expression.
1766
1766
1767 The CPU and wall clock times are printed, and the value of the
1767 The CPU and wall clock times are printed, and the value of the
1768 expression (if any) is returned. Note that under Win32, system time
1768 expression (if any) is returned. Note that under Win32, system time
1769 is always reported as 0, since it can not be measured.
1769 is always reported as 0, since it can not be measured.
1770
1770
1771 This function provides very basic timing functionality. In Python
1771 This function provides very basic timing functionality. In Python
1772 2.3, the timeit module offers more control and sophistication, so this
1772 2.3, the timeit module offers more control and sophistication, so this
1773 could be rewritten to use it (patches welcome).
1773 could be rewritten to use it (patches welcome).
1774
1774
1775 Some examples:
1775 Some examples:
1776
1776
1777 In [1]: time 2**128
1777 In [1]: time 2**128
1778 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1778 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1779 Wall time: 0.00
1779 Wall time: 0.00
1780 Out[1]: 340282366920938463463374607431768211456L
1780 Out[1]: 340282366920938463463374607431768211456L
1781
1781
1782 In [2]: n = 1000000
1782 In [2]: n = 1000000
1783
1783
1784 In [3]: time sum(range(n))
1784 In [3]: time sum(range(n))
1785 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1785 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1786 Wall time: 1.37
1786 Wall time: 1.37
1787 Out[3]: 499999500000L
1787 Out[3]: 499999500000L
1788
1788
1789 In [4]: time print 'hello world'
1789 In [4]: time print 'hello world'
1790 hello world
1790 hello world
1791 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1791 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1792 Wall time: 0.00
1792 Wall time: 0.00
1793 """
1793 """
1794
1794
1795 # fail immediately if the given expression can't be compiled
1795 # fail immediately if the given expression can't be compiled
1796
1796
1797 expr = self.shell.prefilter(parameter_s,False)
1797 expr = self.shell.prefilter(parameter_s,False)
1798
1798
1799 try:
1799 try:
1800 mode = 'eval'
1800 mode = 'eval'
1801 code = compile(expr,'<timed eval>',mode)
1801 code = compile(expr,'<timed eval>',mode)
1802 except SyntaxError:
1802 except SyntaxError:
1803 mode = 'exec'
1803 mode = 'exec'
1804 code = compile(expr,'<timed exec>',mode)
1804 code = compile(expr,'<timed exec>',mode)
1805 # skew measurement as little as possible
1805 # skew measurement as little as possible
1806 glob = self.shell.user_ns
1806 glob = self.shell.user_ns
1807 clk = clock2
1807 clk = clock2
1808 wtime = time.time
1808 wtime = time.time
1809 # time execution
1809 # time execution
1810 wall_st = wtime()
1810 wall_st = wtime()
1811 if mode=='eval':
1811 if mode=='eval':
1812 st = clk()
1812 st = clk()
1813 out = eval(code,glob)
1813 out = eval(code,glob)
1814 end = clk()
1814 end = clk()
1815 else:
1815 else:
1816 st = clk()
1816 st = clk()
1817 exec code in glob
1817 exec code in glob
1818 end = clk()
1818 end = clk()
1819 out = None
1819 out = None
1820 wall_end = wtime()
1820 wall_end = wtime()
1821 # Compute actual times and report
1821 # Compute actual times and report
1822 wall_time = wall_end-wall_st
1822 wall_time = wall_end-wall_st
1823 cpu_user = end[0]-st[0]
1823 cpu_user = end[0]-st[0]
1824 cpu_sys = end[1]-st[1]
1824 cpu_sys = end[1]-st[1]
1825 cpu_tot = cpu_user+cpu_sys
1825 cpu_tot = cpu_user+cpu_sys
1826 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1826 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1827 (cpu_user,cpu_sys,cpu_tot)
1827 (cpu_user,cpu_sys,cpu_tot)
1828 print "Wall time: %.2f" % wall_time
1828 print "Wall time: %.2f" % wall_time
1829 return out
1829 return out
1830
1830
1831 def magic_macro(self,parameter_s = ''):
1831 def magic_macro(self,parameter_s = ''):
1832 """Define a set of input lines as a macro for future re-execution.
1832 """Define a set of input lines as a macro for future re-execution.
1833
1833
1834 Usage:\\
1834 Usage:\\
1835 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1835 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1836
1836
1837 Options:
1837 Options:
1838
1838
1839 -r: use 'raw' input. By default, the 'processed' history is used,
1839 -r: use 'raw' input. By default, the 'processed' history is used,
1840 so that magics are loaded in their transformed version to valid
1840 so that magics are loaded in their transformed version to valid
1841 Python. If this option is given, the raw input as typed as the
1841 Python. If this option is given, the raw input as typed as the
1842 command line is used instead.
1842 command line is used instead.
1843
1843
1844 This will define a global variable called `name` which is a string
1844 This will define a global variable called `name` which is a string
1845 made of joining the slices and lines you specify (n1,n2,... numbers
1845 made of joining the slices and lines you specify (n1,n2,... numbers
1846 above) from your input history into a single string. This variable
1846 above) from your input history into a single string. This variable
1847 acts like an automatic function which re-executes those lines as if
1847 acts like an automatic function which re-executes those lines as if
1848 you had typed them. You just type 'name' at the prompt and the code
1848 you had typed them. You just type 'name' at the prompt and the code
1849 executes.
1849 executes.
1850
1850
1851 The notation for indicating number ranges is: n1-n2 means 'use line
1851 The notation for indicating number ranges is: n1-n2 means 'use line
1852 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1852 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1853 using the lines numbered 5,6 and 7.
1853 using the lines numbered 5,6 and 7.
1854
1854
1855 Note: as a 'hidden' feature, you can also use traditional python slice
1855 Note: as a 'hidden' feature, you can also use traditional python slice
1856 notation, where N:M means numbers N through M-1.
1856 notation, where N:M means numbers N through M-1.
1857
1857
1858 For example, if your history contains (%hist prints it):
1858 For example, if your history contains (%hist prints it):
1859
1859
1860 44: x=1\\
1860 44: x=1\\
1861 45: y=3\\
1861 45: y=3\\
1862 46: z=x+y\\
1862 46: z=x+y\\
1863 47: print x\\
1863 47: print x\\
1864 48: a=5\\
1864 48: a=5\\
1865 49: print 'x',x,'y',y\\
1865 49: print 'x',x,'y',y\\
1866
1866
1867 you can create a macro with lines 44 through 47 (included) and line 49
1867 you can create a macro with lines 44 through 47 (included) and line 49
1868 called my_macro with:
1868 called my_macro with:
1869
1869
1870 In [51]: %macro my_macro 44-47 49
1870 In [51]: %macro my_macro 44-47 49
1871
1871
1872 Now, typing `my_macro` (without quotes) will re-execute all this code
1872 Now, typing `my_macro` (without quotes) will re-execute all this code
1873 in one pass.
1873 in one pass.
1874
1874
1875 You don't need to give the line-numbers in order, and any given line
1875 You don't need to give the line-numbers in order, and any given line
1876 number can appear multiple times. You can assemble macros with any
1876 number can appear multiple times. You can assemble macros with any
1877 lines from your input history in any order.
1877 lines from your input history in any order.
1878
1878
1879 The macro is a simple object which holds its value in an attribute,
1879 The macro is a simple object which holds its value in an attribute,
1880 but IPython's display system checks for macros and executes them as
1880 but IPython's display system checks for macros and executes them as
1881 code instead of printing them when you type their name.
1881 code instead of printing them when you type their name.
1882
1882
1883 You can view a macro's contents by explicitly printing it with:
1883 You can view a macro's contents by explicitly printing it with:
1884
1884
1885 'print macro_name'.
1885 'print macro_name'.
1886
1886
1887 For one-off cases which DON'T contain magic function calls in them you
1887 For one-off cases which DON'T contain magic function calls in them you
1888 can obtain similar results by explicitly executing slices from your
1888 can obtain similar results by explicitly executing slices from your
1889 input history with:
1889 input history with:
1890
1890
1891 In [60]: exec In[44:48]+In[49]"""
1891 In [60]: exec In[44:48]+In[49]"""
1892
1892
1893 opts,args = self.parse_options(parameter_s,'r',mode='list')
1893 opts,args = self.parse_options(parameter_s,'r',mode='list')
1894 if not args:
1894 if not args:
1895 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1895 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1896 macs.sort()
1896 macs.sort()
1897 return macs
1897 return macs
1898 name,ranges = args[0], args[1:]
1898 name,ranges = args[0], args[1:]
1899 #print 'rng',ranges # dbg
1899 #print 'rng',ranges # dbg
1900 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1900 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1901 macro = Macro(lines)
1901 macro = Macro(lines)
1902 self.shell.user_ns.update({name:macro})
1902 self.shell.user_ns.update({name:macro})
1903 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1903 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1904 print 'Macro contents:'
1904 print 'Macro contents:'
1905 print macro,
1905 print macro,
1906
1906
1907 def magic_save(self,parameter_s = ''):
1907 def magic_save(self,parameter_s = ''):
1908 """Save a set of lines to a given filename.
1908 """Save a set of lines to a given filename.
1909
1909
1910 Usage:\\
1910 Usage:\\
1911 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1911 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1912
1912
1913 Options:
1913 Options:
1914
1914
1915 -r: use 'raw' input. By default, the 'processed' history is used,
1915 -r: use 'raw' input. By default, the 'processed' history is used,
1916 so that magics are loaded in their transformed version to valid
1916 so that magics are loaded in their transformed version to valid
1917 Python. If this option is given, the raw input as typed as the
1917 Python. If this option is given, the raw input as typed as the
1918 command line is used instead.
1918 command line is used instead.
1919
1919
1920 This function uses the same syntax as %macro for line extraction, but
1920 This function uses the same syntax as %macro for line extraction, but
1921 instead of creating a macro it saves the resulting string to the
1921 instead of creating a macro it saves the resulting string to the
1922 filename you specify.
1922 filename you specify.
1923
1923
1924 It adds a '.py' extension to the file if you don't do so yourself, and
1924 It adds a '.py' extension to the file if you don't do so yourself, and
1925 it asks for confirmation before overwriting existing files."""
1925 it asks for confirmation before overwriting existing files."""
1926
1926
1927 opts,args = self.parse_options(parameter_s,'r',mode='list')
1927 opts,args = self.parse_options(parameter_s,'r',mode='list')
1928 fname,ranges = args[0], args[1:]
1928 fname,ranges = args[0], args[1:]
1929 if not fname.endswith('.py'):
1929 if not fname.endswith('.py'):
1930 fname += '.py'
1930 fname += '.py'
1931 if os.path.isfile(fname):
1931 if os.path.isfile(fname):
1932 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1932 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1933 if ans.lower() not in ['y','yes']:
1933 if ans.lower() not in ['y','yes']:
1934 print 'Operation cancelled.'
1934 print 'Operation cancelled.'
1935 return
1935 return
1936 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1936 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1937 f = file(fname,'w')
1937 f = file(fname,'w')
1938 f.write(cmds)
1938 f.write(cmds)
1939 f.close()
1939 f.close()
1940 print 'The following commands were written to file `%s`:' % fname
1940 print 'The following commands were written to file `%s`:' % fname
1941 print cmds
1941 print cmds
1942
1942
1943 def _edit_macro(self,mname,macro):
1943 def _edit_macro(self,mname,macro):
1944 """open an editor with the macro data in a file"""
1944 """open an editor with the macro data in a file"""
1945 filename = self.shell.mktempfile(macro.value)
1945 filename = self.shell.mktempfile(macro.value)
1946 self.shell.hooks.editor(filename)
1946 self.shell.hooks.editor(filename)
1947
1947
1948 # and make a new macro object, to replace the old one
1948 # and make a new macro object, to replace the old one
1949 mfile = open(filename)
1949 mfile = open(filename)
1950 mvalue = mfile.read()
1950 mvalue = mfile.read()
1951 mfile.close()
1951 mfile.close()
1952 self.shell.user_ns[mname] = Macro(mvalue)
1952 self.shell.user_ns[mname] = Macro(mvalue)
1953
1953
1954 def magic_ed(self,parameter_s=''):
1954 def magic_ed(self,parameter_s=''):
1955 """Alias to %edit."""
1955 """Alias to %edit."""
1956 return self.magic_edit(parameter_s)
1956 return self.magic_edit(parameter_s)
1957
1957
1958 def magic_edit(self,parameter_s='',last_call=['','']):
1958 def magic_edit(self,parameter_s='',last_call=['','']):
1959 """Bring up an editor and execute the resulting code.
1959 """Bring up an editor and execute the resulting code.
1960
1960
1961 Usage:
1961 Usage:
1962 %edit [options] [args]
1962 %edit [options] [args]
1963
1963
1964 %edit runs IPython's editor hook. The default version of this hook is
1964 %edit runs IPython's editor hook. The default version of this hook is
1965 set to call the __IPYTHON__.rc.editor command. This is read from your
1965 set to call the __IPYTHON__.rc.editor command. This is read from your
1966 environment variable $EDITOR. If this isn't found, it will default to
1966 environment variable $EDITOR. If this isn't found, it will default to
1967 vi under Linux/Unix and to notepad under Windows. See the end of this
1967 vi under Linux/Unix and to notepad under Windows. See the end of this
1968 docstring for how to change the editor hook.
1968 docstring for how to change the editor hook.
1969
1969
1970 You can also set the value of this editor via the command line option
1970 You can also set the value of this editor via the command line option
1971 '-editor' or in your ipythonrc file. This is useful if you wish to use
1971 '-editor' or in your ipythonrc file. This is useful if you wish to use
1972 specifically for IPython an editor different from your typical default
1972 specifically for IPython an editor different from your typical default
1973 (and for Windows users who typically don't set environment variables).
1973 (and for Windows users who typically don't set environment variables).
1974
1974
1975 This command allows you to conveniently edit multi-line code right in
1975 This command allows you to conveniently edit multi-line code right in
1976 your IPython session.
1976 your IPython session.
1977
1977
1978 If called without arguments, %edit opens up an empty editor with a
1978 If called without arguments, %edit opens up an empty editor with a
1979 temporary file and will execute the contents of this file when you
1979 temporary file and will execute the contents of this file when you
1980 close it (don't forget to save it!).
1980 close it (don't forget to save it!).
1981
1981
1982
1982
1983 Options:
1983 Options:
1984
1984
1985 -n <number>: open the editor at a specified line number. By default,
1985 -n <number>: open the editor at a specified line number. By default,
1986 the IPython editor hook uses the unix syntax 'editor +N filename', but
1986 the IPython editor hook uses the unix syntax 'editor +N filename', but
1987 you can configure this by providing your own modified hook if your
1987 you can configure this by providing your own modified hook if your
1988 favorite editor supports line-number specifications with a different
1988 favorite editor supports line-number specifications with a different
1989 syntax.
1989 syntax.
1990
1990
1991 -p: this will call the editor with the same data as the previous time
1991 -p: this will call the editor with the same data as the previous time
1992 it was used, regardless of how long ago (in your current session) it
1992 it was used, regardless of how long ago (in your current session) it
1993 was.
1993 was.
1994
1994
1995 -r: use 'raw' input. This option only applies to input taken from the
1995 -r: use 'raw' input. This option only applies to input taken from the
1996 user's history. By default, the 'processed' history is used, so that
1996 user's history. By default, the 'processed' history is used, so that
1997 magics are loaded in their transformed version to valid Python. If
1997 magics are loaded in their transformed version to valid Python. If
1998 this option is given, the raw input as typed as the command line is
1998 this option is given, the raw input as typed as the command line is
1999 used instead. When you exit the editor, it will be executed by
1999 used instead. When you exit the editor, it will be executed by
2000 IPython's own processor.
2000 IPython's own processor.
2001
2001
2002 -x: do not execute the edited code immediately upon exit. This is
2002 -x: do not execute the edited code immediately upon exit. This is
2003 mainly useful if you are editing programs which need to be called with
2003 mainly useful if you are editing programs which need to be called with
2004 command line arguments, which you can then do using %run.
2004 command line arguments, which you can then do using %run.
2005
2005
2006
2006
2007 Arguments:
2007 Arguments:
2008
2008
2009 If arguments are given, the following possibilites exist:
2009 If arguments are given, the following possibilites exist:
2010
2010
2011 - The arguments are numbers or pairs of colon-separated numbers (like
2011 - The arguments are numbers or pairs of colon-separated numbers (like
2012 1 4:8 9). These are interpreted as lines of previous input to be
2012 1 4:8 9). These are interpreted as lines of previous input to be
2013 loaded into the editor. The syntax is the same of the %macro command.
2013 loaded into the editor. The syntax is the same of the %macro command.
2014
2014
2015 - If the argument doesn't start with a number, it is evaluated as a
2015 - If the argument doesn't start with a number, it is evaluated as a
2016 variable and its contents loaded into the editor. You can thus edit
2016 variable and its contents loaded into the editor. You can thus edit
2017 any string which contains python code (including the result of
2017 any string which contains python code (including the result of
2018 previous edits).
2018 previous edits).
2019
2019
2020 - If the argument is the name of an object (other than a string),
2020 - If the argument is the name of an object (other than a string),
2021 IPython will try to locate the file where it was defined and open the
2021 IPython will try to locate the file where it was defined and open the
2022 editor at the point where it is defined. You can use `%edit function`
2022 editor at the point where it is defined. You can use `%edit function`
2023 to load an editor exactly at the point where 'function' is defined,
2023 to load an editor exactly at the point where 'function' is defined,
2024 edit it and have the file be executed automatically.
2024 edit it and have the file be executed automatically.
2025
2025
2026 If the object is a macro (see %macro for details), this opens up your
2026 If the object is a macro (see %macro for details), this opens up your
2027 specified editor with a temporary file containing the macro's data.
2027 specified editor with a temporary file containing the macro's data.
2028 Upon exit, the macro is reloaded with the contents of the file.
2028 Upon exit, the macro is reloaded with the contents of the file.
2029
2029
2030 Note: opening at an exact line is only supported under Unix, and some
2030 Note: opening at an exact line is only supported under Unix, and some
2031 editors (like kedit and gedit up to Gnome 2.8) do not understand the
2031 editors (like kedit and gedit up to Gnome 2.8) do not understand the
2032 '+NUMBER' parameter necessary for this feature. Good editors like
2032 '+NUMBER' parameter necessary for this feature. Good editors like
2033 (X)Emacs, vi, jed, pico and joe all do.
2033 (X)Emacs, vi, jed, pico and joe all do.
2034
2034
2035 - If the argument is not found as a variable, IPython will look for a
2035 - If the argument is not found as a variable, IPython will look for a
2036 file with that name (adding .py if necessary) and load it into the
2036 file with that name (adding .py if necessary) and load it into the
2037 editor. It will execute its contents with execfile() when you exit,
2037 editor. It will execute its contents with execfile() when you exit,
2038 loading any code in the file into your interactive namespace.
2038 loading any code in the file into your interactive namespace.
2039
2039
2040 After executing your code, %edit will return as output the code you
2040 After executing your code, %edit will return as output the code you
2041 typed in the editor (except when it was an existing file). This way
2041 typed in the editor (except when it was an existing file). This way
2042 you can reload the code in further invocations of %edit as a variable,
2042 you can reload the code in further invocations of %edit as a variable,
2043 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
2043 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
2044 the output.
2044 the output.
2045
2045
2046 Note that %edit is also available through the alias %ed.
2046 Note that %edit is also available through the alias %ed.
2047
2047
2048 This is an example of creating a simple function inside the editor and
2048 This is an example of creating a simple function inside the editor and
2049 then modifying it. First, start up the editor:
2049 then modifying it. First, start up the editor:
2050
2050
2051 In [1]: ed\\
2051 In [1]: ed\\
2052 Editing... done. Executing edited code...\\
2052 Editing... done. Executing edited code...\\
2053 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
2053 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
2054
2054
2055 We can then call the function foo():
2055 We can then call the function foo():
2056
2056
2057 In [2]: foo()\\
2057 In [2]: foo()\\
2058 foo() was defined in an editing session
2058 foo() was defined in an editing session
2059
2059
2060 Now we edit foo. IPython automatically loads the editor with the
2060 Now we edit foo. IPython automatically loads the editor with the
2061 (temporary) file where foo() was previously defined:
2061 (temporary) file where foo() was previously defined:
2062
2062
2063 In [3]: ed foo\\
2063 In [3]: ed foo\\
2064 Editing... done. Executing edited code...
2064 Editing... done. Executing edited code...
2065
2065
2066 And if we call foo() again we get the modified version:
2066 And if we call foo() again we get the modified version:
2067
2067
2068 In [4]: foo()\\
2068 In [4]: foo()\\
2069 foo() has now been changed!
2069 foo() has now been changed!
2070
2070
2071 Here is an example of how to edit a code snippet successive
2071 Here is an example of how to edit a code snippet successive
2072 times. First we call the editor:
2072 times. First we call the editor:
2073
2073
2074 In [8]: ed\\
2074 In [8]: ed\\
2075 Editing... done. Executing edited code...\\
2075 Editing... done. Executing edited code...\\
2076 hello\\
2076 hello\\
2077 Out[8]: "print 'hello'\\n"
2077 Out[8]: "print 'hello'\\n"
2078
2078
2079 Now we call it again with the previous output (stored in _):
2079 Now we call it again with the previous output (stored in _):
2080
2080
2081 In [9]: ed _\\
2081 In [9]: ed _\\
2082 Editing... done. Executing edited code...\\
2082 Editing... done. Executing edited code...\\
2083 hello world\\
2083 hello world\\
2084 Out[9]: "print 'hello world'\\n"
2084 Out[9]: "print 'hello world'\\n"
2085
2085
2086 Now we call it with the output #8 (stored in _8, also as Out[8]):
2086 Now we call it with the output #8 (stored in _8, also as Out[8]):
2087
2087
2088 In [10]: ed _8\\
2088 In [10]: ed _8\\
2089 Editing... done. Executing edited code...\\
2089 Editing... done. Executing edited code...\\
2090 hello again\\
2090 hello again\\
2091 Out[10]: "print 'hello again'\\n"
2091 Out[10]: "print 'hello again'\\n"
2092
2092
2093
2093
2094 Changing the default editor hook:
2094 Changing the default editor hook:
2095
2095
2096 If you wish to write your own editor hook, you can put it in a
2096 If you wish to write your own editor hook, you can put it in a
2097 configuration file which you load at startup time. The default hook
2097 configuration file which you load at startup time. The default hook
2098 is defined in the IPython.hooks module, and you can use that as a
2098 is defined in the IPython.hooks module, and you can use that as a
2099 starting example for further modifications. That file also has
2099 starting example for further modifications. That file also has
2100 general instructions on how to set a new hook for use once you've
2100 general instructions on how to set a new hook for use once you've
2101 defined it."""
2101 defined it."""
2102
2102
2103 # FIXME: This function has become a convoluted mess. It needs a
2103 # FIXME: This function has become a convoluted mess. It needs a
2104 # ground-up rewrite with clean, simple logic.
2104 # ground-up rewrite with clean, simple logic.
2105
2105
2106 def make_filename(arg):
2106 def make_filename(arg):
2107 "Make a filename from the given args"
2107 "Make a filename from the given args"
2108 try:
2108 try:
2109 filename = get_py_filename(arg)
2109 filename = get_py_filename(arg)
2110 except IOError:
2110 except IOError:
2111 if args.endswith('.py'):
2111 if args.endswith('.py'):
2112 filename = arg
2112 filename = arg
2113 else:
2113 else:
2114 filename = None
2114 filename = None
2115 return filename
2115 return filename
2116
2116
2117 # custom exceptions
2117 # custom exceptions
2118 class DataIsObject(Exception): pass
2118 class DataIsObject(Exception): pass
2119
2119
2120 opts,args = self.parse_options(parameter_s,'prxn:')
2120 opts,args = self.parse_options(parameter_s,'prxn:')
2121 # Set a few locals from the options for convenience:
2121 # Set a few locals from the options for convenience:
2122 opts_p = opts.has_key('p')
2122 opts_p = opts.has_key('p')
2123 opts_r = opts.has_key('r')
2123 opts_r = opts.has_key('r')
2124
2124
2125 # Default line number value
2125 # Default line number value
2126 lineno = opts.get('n',None)
2126 lineno = opts.get('n',None)
2127
2127
2128 if opts_p:
2128 if opts_p:
2129 args = '_%s' % last_call[0]
2129 args = '_%s' % last_call[0]
2130 if not self.shell.user_ns.has_key(args):
2130 if not self.shell.user_ns.has_key(args):
2131 args = last_call[1]
2131 args = last_call[1]
2132
2132
2133 # use last_call to remember the state of the previous call, but don't
2133 # use last_call to remember the state of the previous call, but don't
2134 # let it be clobbered by successive '-p' calls.
2134 # let it be clobbered by successive '-p' calls.
2135 try:
2135 try:
2136 last_call[0] = self.shell.outputcache.prompt_count
2136 last_call[0] = self.shell.outputcache.prompt_count
2137 if not opts_p:
2137 if not opts_p:
2138 last_call[1] = parameter_s
2138 last_call[1] = parameter_s
2139 except:
2139 except:
2140 pass
2140 pass
2141
2141
2142 # by default this is done with temp files, except when the given
2142 # by default this is done with temp files, except when the given
2143 # arg is a filename
2143 # arg is a filename
2144 use_temp = 1
2144 use_temp = 1
2145
2145
2146 if re.match(r'\d',args):
2146 if re.match(r'\d',args):
2147 # Mode where user specifies ranges of lines, like in %macro.
2147 # Mode where user specifies ranges of lines, like in %macro.
2148 # This means that you can't edit files whose names begin with
2148 # This means that you can't edit files whose names begin with
2149 # numbers this way. Tough.
2149 # numbers this way. Tough.
2150 ranges = args.split()
2150 ranges = args.split()
2151 data = ''.join(self.extract_input_slices(ranges,opts_r))
2151 data = ''.join(self.extract_input_slices(ranges,opts_r))
2152 elif args.endswith('.py'):
2152 elif args.endswith('.py'):
2153 filename = make_filename(args)
2153 filename = make_filename(args)
2154 data = ''
2154 data = ''
2155 use_temp = 0
2155 use_temp = 0
2156 elif args:
2156 elif args:
2157 try:
2157 try:
2158 # Load the parameter given as a variable. If not a string,
2158 # Load the parameter given as a variable. If not a string,
2159 # process it as an object instead (below)
2159 # process it as an object instead (below)
2160
2160
2161 #print '*** args',args,'type',type(args) # dbg
2161 #print '*** args',args,'type',type(args) # dbg
2162 data = eval(args,self.shell.user_ns)
2162 data = eval(args,self.shell.user_ns)
2163 if not type(data) in StringTypes:
2163 if not type(data) in StringTypes:
2164 raise DataIsObject
2164 raise DataIsObject
2165
2165
2166 except (NameError,SyntaxError):
2166 except (NameError,SyntaxError):
2167 # given argument is not a variable, try as a filename
2167 # given argument is not a variable, try as a filename
2168 filename = make_filename(args)
2168 filename = make_filename(args)
2169 if filename is None:
2169 if filename is None:
2170 warn("Argument given (%s) can't be found as a variable "
2170 warn("Argument given (%s) can't be found as a variable "
2171 "or as a filename." % args)
2171 "or as a filename." % args)
2172 return
2172 return
2173
2173
2174 data = ''
2174 data = ''
2175 use_temp = 0
2175 use_temp = 0
2176 except DataIsObject:
2176 except DataIsObject:
2177
2177
2178 # macros have a special edit function
2178 # macros have a special edit function
2179 if isinstance(data,Macro):
2179 if isinstance(data,Macro):
2180 self._edit_macro(args,data)
2180 self._edit_macro(args,data)
2181 return
2181 return
2182
2182
2183 # For objects, try to edit the file where they are defined
2183 # For objects, try to edit the file where they are defined
2184 try:
2184 try:
2185 filename = inspect.getabsfile(data)
2185 filename = inspect.getabsfile(data)
2186 datafile = 1
2186 datafile = 1
2187 except TypeError:
2187 except TypeError:
2188 filename = make_filename(args)
2188 filename = make_filename(args)
2189 datafile = 1
2189 datafile = 1
2190 warn('Could not find file where `%s` is defined.\n'
2190 warn('Could not find file where `%s` is defined.\n'
2191 'Opening a file named `%s`' % (args,filename))
2191 'Opening a file named `%s`' % (args,filename))
2192 # Now, make sure we can actually read the source (if it was in
2192 # Now, make sure we can actually read the source (if it was in
2193 # a temp file it's gone by now).
2193 # a temp file it's gone by now).
2194 if datafile:
2194 if datafile:
2195 try:
2195 try:
2196 if lineno is None:
2196 if lineno is None:
2197 lineno = inspect.getsourcelines(data)[1]
2197 lineno = inspect.getsourcelines(data)[1]
2198 except IOError:
2198 except IOError:
2199 filename = make_filename(args)
2199 filename = make_filename(args)
2200 if filename is None:
2200 if filename is None:
2201 warn('The file `%s` where `%s` was defined cannot '
2201 warn('The file `%s` where `%s` was defined cannot '
2202 'be read.' % (filename,data))
2202 'be read.' % (filename,data))
2203 return
2203 return
2204 use_temp = 0
2204 use_temp = 0
2205 else:
2205 else:
2206 data = ''
2206 data = ''
2207
2207
2208 if use_temp:
2208 if use_temp:
2209 filename = self.shell.mktempfile(data)
2209 filename = self.shell.mktempfile(data)
2210 print 'IPython will make a temporary file named:',filename
2210 print 'IPython will make a temporary file named:',filename
2211
2211
2212 # do actual editing here
2212 # do actual editing here
2213 print 'Editing...',
2213 print 'Editing...',
2214 sys.stdout.flush()
2214 sys.stdout.flush()
2215 self.shell.hooks.editor(filename,lineno)
2215 self.shell.hooks.editor(filename,lineno)
2216 if opts.has_key('x'): # -x prevents actual execution
2216 if opts.has_key('x'): # -x prevents actual execution
2217 print
2217 print
2218 else:
2218 else:
2219 print 'done. Executing edited code...'
2219 print 'done. Executing edited code...'
2220 if opts_r:
2220 if opts_r:
2221 self.shell.runlines(file_read(filename))
2221 self.shell.runlines(file_read(filename))
2222 else:
2222 else:
2223 self.shell.safe_execfile(filename,self.shell.user_ns,
2223 self.shell.safe_execfile(filename,self.shell.user_ns,
2224 self.shell.user_ns)
2224 self.shell.user_ns)
2225 if use_temp:
2225 if use_temp:
2226 try:
2226 try:
2227 return open(filename).read()
2227 return open(filename).read()
2228 except IOError,msg:
2228 except IOError,msg:
2229 if msg.filename == filename:
2229 if msg.filename == filename:
2230 warn('File not found. Did you forget to save?')
2230 warn('File not found. Did you forget to save?')
2231 return
2231 return
2232 else:
2232 else:
2233 self.shell.showtraceback()
2233 self.shell.showtraceback()
2234
2234
2235 def magic_xmode(self,parameter_s = ''):
2235 def magic_xmode(self,parameter_s = ''):
2236 """Switch modes for the exception handlers.
2236 """Switch modes for the exception handlers.
2237
2237
2238 Valid modes: Plain, Context and Verbose.
2238 Valid modes: Plain, Context and Verbose.
2239
2239
2240 If called without arguments, acts as a toggle."""
2240 If called without arguments, acts as a toggle."""
2241
2241
2242 def xmode_switch_err(name):
2242 def xmode_switch_err(name):
2243 warn('Error changing %s exception modes.\n%s' %
2243 warn('Error changing %s exception modes.\n%s' %
2244 (name,sys.exc_info()[1]))
2244 (name,sys.exc_info()[1]))
2245
2245
2246 shell = self.shell
2246 shell = self.shell
2247 new_mode = parameter_s.strip().capitalize()
2247 new_mode = parameter_s.strip().capitalize()
2248 try:
2248 try:
2249 shell.InteractiveTB.set_mode(mode=new_mode)
2249 shell.InteractiveTB.set_mode(mode=new_mode)
2250 print 'Exception reporting mode:',shell.InteractiveTB.mode
2250 print 'Exception reporting mode:',shell.InteractiveTB.mode
2251 except:
2251 except:
2252 xmode_switch_err('user')
2252 xmode_switch_err('user')
2253
2253
2254 # threaded shells use a special handler in sys.excepthook
2254 # threaded shells use a special handler in sys.excepthook
2255 if shell.isthreaded:
2255 if shell.isthreaded:
2256 try:
2256 try:
2257 shell.sys_excepthook.set_mode(mode=new_mode)
2257 shell.sys_excepthook.set_mode(mode=new_mode)
2258 except:
2258 except:
2259 xmode_switch_err('threaded')
2259 xmode_switch_err('threaded')
2260
2260
2261 def magic_colors(self,parameter_s = ''):
2261 def magic_colors(self,parameter_s = ''):
2262 """Switch color scheme for prompts, info system and exception handlers.
2262 """Switch color scheme for prompts, info system and exception handlers.
2263
2263
2264 Currently implemented schemes: NoColor, Linux, LightBG.
2264 Currently implemented schemes: NoColor, Linux, LightBG.
2265
2265
2266 Color scheme names are not case-sensitive."""
2266 Color scheme names are not case-sensitive."""
2267
2267
2268 def color_switch_err(name):
2268 def color_switch_err(name):
2269 warn('Error changing %s color schemes.\n%s' %
2269 warn('Error changing %s color schemes.\n%s' %
2270 (name,sys.exc_info()[1]))
2270 (name,sys.exc_info()[1]))
2271
2271
2272
2272
2273 new_scheme = parameter_s.strip()
2273 new_scheme = parameter_s.strip()
2274 if not new_scheme:
2274 if not new_scheme:
2275 print 'You must specify a color scheme.'
2275 print 'You must specify a color scheme.'
2276 return
2276 return
2277 # local shortcut
2277 # local shortcut
2278 shell = self.shell
2278 shell = self.shell
2279
2279
2280 import IPython.rlineimpl as readline
2280 import IPython.rlineimpl as readline
2281
2281
2282 if not readline.have_readline and sys.platform == "win32":
2282 if not readline.have_readline and sys.platform == "win32":
2283 msg = """\
2283 msg = """\
2284 Proper color support under MS Windows requires the pyreadline library.
2284 Proper color support under MS Windows requires the pyreadline library.
2285 You can find it at:
2285 You can find it at:
2286 http://ipython.scipy.org/moin/PyReadline/Intro
2286 http://ipython.scipy.org/moin/PyReadline/Intro
2287 Gary's readline needs the ctypes module, from:
2287 Gary's readline needs the ctypes module, from:
2288 http://starship.python.net/crew/theller/ctypes
2288 http://starship.python.net/crew/theller/ctypes
2289 (Note that ctypes is already part of Python versions 2.5 and newer).
2289 (Note that ctypes is already part of Python versions 2.5 and newer).
2290
2290
2291 Defaulting color scheme to 'NoColor'"""
2291 Defaulting color scheme to 'NoColor'"""
2292 new_scheme = 'NoColor'
2292 new_scheme = 'NoColor'
2293 warn(msg)
2293 warn(msg)
2294
2294
2295 # readline option is 0
2295 # readline option is 0
2296 if not shell.has_readline:
2296 if not shell.has_readline:
2297 new_scheme = 'NoColor'
2297 new_scheme = 'NoColor'
2298
2298
2299 # Set prompt colors
2299 # Set prompt colors
2300 try:
2300 try:
2301 shell.outputcache.set_colors(new_scheme)
2301 shell.outputcache.set_colors(new_scheme)
2302 except:
2302 except:
2303 color_switch_err('prompt')
2303 color_switch_err('prompt')
2304 else:
2304 else:
2305 shell.rc.colors = \
2305 shell.rc.colors = \
2306 shell.outputcache.color_table.active_scheme_name
2306 shell.outputcache.color_table.active_scheme_name
2307 # Set exception colors
2307 # Set exception colors
2308 try:
2308 try:
2309 shell.InteractiveTB.set_colors(scheme = new_scheme)
2309 shell.InteractiveTB.set_colors(scheme = new_scheme)
2310 shell.SyntaxTB.set_colors(scheme = new_scheme)
2310 shell.SyntaxTB.set_colors(scheme = new_scheme)
2311 except:
2311 except:
2312 color_switch_err('exception')
2312 color_switch_err('exception')
2313
2313
2314 # threaded shells use a verbose traceback in sys.excepthook
2314 # threaded shells use a verbose traceback in sys.excepthook
2315 if shell.isthreaded:
2315 if shell.isthreaded:
2316 try:
2316 try:
2317 shell.sys_excepthook.set_colors(scheme=new_scheme)
2317 shell.sys_excepthook.set_colors(scheme=new_scheme)
2318 except:
2318 except:
2319 color_switch_err('system exception handler')
2319 color_switch_err('system exception handler')
2320
2320
2321 # Set info (for 'object?') colors
2321 # Set info (for 'object?') colors
2322 if shell.rc.color_info:
2322 if shell.rc.color_info:
2323 try:
2323 try:
2324 shell.inspector.set_active_scheme(new_scheme)
2324 shell.inspector.set_active_scheme(new_scheme)
2325 except:
2325 except:
2326 color_switch_err('object inspector')
2326 color_switch_err('object inspector')
2327 else:
2327 else:
2328 shell.inspector.set_active_scheme('NoColor')
2328 shell.inspector.set_active_scheme('NoColor')
2329
2329
2330 def magic_color_info(self,parameter_s = ''):
2330 def magic_color_info(self,parameter_s = ''):
2331 """Toggle color_info.
2331 """Toggle color_info.
2332
2332
2333 The color_info configuration parameter controls whether colors are
2333 The color_info configuration parameter controls whether colors are
2334 used for displaying object details (by things like %psource, %pfile or
2334 used for displaying object details (by things like %psource, %pfile or
2335 the '?' system). This function toggles this value with each call.
2335 the '?' system). This function toggles this value with each call.
2336
2336
2337 Note that unless you have a fairly recent pager (less works better
2337 Note that unless you have a fairly recent pager (less works better
2338 than more) in your system, using colored object information displays
2338 than more) in your system, using colored object information displays
2339 will not work properly. Test it and see."""
2339 will not work properly. Test it and see."""
2340
2340
2341 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2341 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2342 self.magic_colors(self.shell.rc.colors)
2342 self.magic_colors(self.shell.rc.colors)
2343 print 'Object introspection functions have now coloring:',
2343 print 'Object introspection functions have now coloring:',
2344 print ['OFF','ON'][self.shell.rc.color_info]
2344 print ['OFF','ON'][self.shell.rc.color_info]
2345
2345
2346 def magic_Pprint(self, parameter_s=''):
2346 def magic_Pprint(self, parameter_s=''):
2347 """Toggle pretty printing on/off."""
2347 """Toggle pretty printing on/off."""
2348
2348
2349 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2349 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2350 print 'Pretty printing has been turned', \
2350 print 'Pretty printing has been turned', \
2351 ['OFF','ON'][self.shell.rc.pprint]
2351 ['OFF','ON'][self.shell.rc.pprint]
2352
2352
2353 def magic_exit(self, parameter_s=''):
2353 def magic_exit(self, parameter_s=''):
2354 """Exit IPython, confirming if configured to do so.
2354 """Exit IPython, confirming if configured to do so.
2355
2355
2356 You can configure whether IPython asks for confirmation upon exit by
2356 You can configure whether IPython asks for confirmation upon exit by
2357 setting the confirm_exit flag in the ipythonrc file."""
2357 setting the confirm_exit flag in the ipythonrc file."""
2358
2358
2359 self.shell.exit()
2359 self.shell.exit()
2360
2360
2361 def magic_quit(self, parameter_s=''):
2361 def magic_quit(self, parameter_s=''):
2362 """Exit IPython, confirming if configured to do so (like %exit)"""
2362 """Exit IPython, confirming if configured to do so (like %exit)"""
2363
2363
2364 self.shell.exit()
2364 self.shell.exit()
2365
2365
2366 def magic_Exit(self, parameter_s=''):
2366 def magic_Exit(self, parameter_s=''):
2367 """Exit IPython without confirmation."""
2367 """Exit IPython without confirmation."""
2368
2368
2369 self.shell.exit_now = True
2369 self.shell.exit_now = True
2370
2370
2371 #......................................................................
2371 #......................................................................
2372 # Functions to implement unix shell-type things
2372 # Functions to implement unix shell-type things
2373
2373
2374 def magic_alias(self, parameter_s = ''):
2374 def magic_alias(self, parameter_s = ''):
2375 """Define an alias for a system command.
2375 """Define an alias for a system command.
2376
2376
2377 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2377 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2378
2378
2379 Then, typing 'alias_name params' will execute the system command 'cmd
2379 Then, typing 'alias_name params' will execute the system command 'cmd
2380 params' (from your underlying operating system).
2380 params' (from your underlying operating system).
2381
2381
2382 Aliases have lower precedence than magic functions and Python normal
2382 Aliases have lower precedence than magic functions and Python normal
2383 variables, so if 'foo' is both a Python variable and an alias, the
2383 variables, so if 'foo' is both a Python variable and an alias, the
2384 alias can not be executed until 'del foo' removes the Python variable.
2384 alias can not be executed until 'del foo' removes the Python variable.
2385
2385
2386 You can use the %l specifier in an alias definition to represent the
2386 You can use the %l specifier in an alias definition to represent the
2387 whole line when the alias is called. For example:
2387 whole line when the alias is called. For example:
2388
2388
2389 In [2]: alias all echo "Input in brackets: <%l>"\\
2389 In [2]: alias all echo "Input in brackets: <%l>"\\
2390 In [3]: all hello world\\
2390 In [3]: all hello world\\
2391 Input in brackets: <hello world>
2391 Input in brackets: <hello world>
2392
2392
2393 You can also define aliases with parameters using %s specifiers (one
2393 You can also define aliases with parameters using %s specifiers (one
2394 per parameter):
2394 per parameter):
2395
2395
2396 In [1]: alias parts echo first %s second %s\\
2396 In [1]: alias parts echo first %s second %s\\
2397 In [2]: %parts A B\\
2397 In [2]: %parts A B\\
2398 first A second B\\
2398 first A second B\\
2399 In [3]: %parts A\\
2399 In [3]: %parts A\\
2400 Incorrect number of arguments: 2 expected.\\
2400 Incorrect number of arguments: 2 expected.\\
2401 parts is an alias to: 'echo first %s second %s'
2401 parts is an alias to: 'echo first %s second %s'
2402
2402
2403 Note that %l and %s are mutually exclusive. You can only use one or
2403 Note that %l and %s are mutually exclusive. You can only use one or
2404 the other in your aliases.
2404 the other in your aliases.
2405
2405
2406 Aliases expand Python variables just like system calls using ! or !!
2406 Aliases expand Python variables just like system calls using ! or !!
2407 do: all expressions prefixed with '$' get expanded. For details of
2407 do: all expressions prefixed with '$' get expanded. For details of
2408 the semantic rules, see PEP-215:
2408 the semantic rules, see PEP-215:
2409 http://www.python.org/peps/pep-0215.html. This is the library used by
2409 http://www.python.org/peps/pep-0215.html. This is the library used by
2410 IPython for variable expansion. If you want to access a true shell
2410 IPython for variable expansion. If you want to access a true shell
2411 variable, an extra $ is necessary to prevent its expansion by IPython:
2411 variable, an extra $ is necessary to prevent its expansion by IPython:
2412
2412
2413 In [6]: alias show echo\\
2413 In [6]: alias show echo\\
2414 In [7]: PATH='A Python string'\\
2414 In [7]: PATH='A Python string'\\
2415 In [8]: show $PATH\\
2415 In [8]: show $PATH\\
2416 A Python string\\
2416 A Python string\\
2417 In [9]: show $$PATH\\
2417 In [9]: show $$PATH\\
2418 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2418 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2419
2419
2420 You can use the alias facility to acess all of $PATH. See the %rehash
2420 You can use the alias facility to acess all of $PATH. See the %rehash
2421 and %rehashx functions, which automatically create aliases for the
2421 and %rehashx functions, which automatically create aliases for the
2422 contents of your $PATH.
2422 contents of your $PATH.
2423
2423
2424 If called with no parameters, %alias prints the current alias table."""
2424 If called with no parameters, %alias prints the current alias table."""
2425
2425
2426 par = parameter_s.strip()
2426 par = parameter_s.strip()
2427 if not par:
2427 if not par:
2428 stored = self.db.get('stored_aliases', {} )
2428 stored = self.db.get('stored_aliases', {} )
2429 atab = self.shell.alias_table
2429 atab = self.shell.alias_table
2430 aliases = atab.keys()
2430 aliases = atab.keys()
2431 aliases.sort()
2431 aliases.sort()
2432 res = []
2432 res = []
2433 showlast = []
2433 showlast = []
2434 for alias in aliases:
2434 for alias in aliases:
2435 special = False
2435 special = False
2436 try:
2436 try:
2437 tgt = atab[alias][1]
2437 tgt = atab[alias][1]
2438 except (TypeError, AttributeError):
2438 except (TypeError, AttributeError):
2439 # unsubscriptable? probably a callable
2439 # unsubscriptable? probably a callable
2440 tgt = atab[alias]
2440 tgt = atab[alias]
2441 special = True
2441 special = True
2442 # 'interesting' aliases
2442 # 'interesting' aliases
2443 if (alias in stored or
2443 if (alias in stored or
2444 special or
2444 special or
2445 alias.lower() != os.path.splitext(tgt)[0].lower() or
2445 alias.lower() != os.path.splitext(tgt)[0].lower() or
2446 ' ' in tgt):
2446 ' ' in tgt):
2447 showlast.append((alias, tgt))
2447 showlast.append((alias, tgt))
2448 else:
2448 else:
2449 res.append((alias, tgt ))
2449 res.append((alias, tgt ))
2450
2450
2451 # show most interesting aliases last
2451 # show most interesting aliases last
2452 res.extend(showlast)
2452 res.extend(showlast)
2453 print "Total number of aliases:",len(aliases)
2453 print "Total number of aliases:",len(aliases)
2454 return res
2454 return res
2455 try:
2455 try:
2456 alias,cmd = par.split(None,1)
2456 alias,cmd = par.split(None,1)
2457 except:
2457 except:
2458 print OInspect.getdoc(self.magic_alias)
2458 print OInspect.getdoc(self.magic_alias)
2459 else:
2459 else:
2460 nargs = cmd.count('%s')
2460 nargs = cmd.count('%s')
2461 if nargs>0 and cmd.find('%l')>=0:
2461 if nargs>0 and cmd.find('%l')>=0:
2462 error('The %s and %l specifiers are mutually exclusive '
2462 error('The %s and %l specifiers are mutually exclusive '
2463 'in alias definitions.')
2463 'in alias definitions.')
2464 else: # all looks OK
2464 else: # all looks OK
2465 self.shell.alias_table[alias] = (nargs,cmd)
2465 self.shell.alias_table[alias] = (nargs,cmd)
2466 self.shell.alias_table_validate(verbose=0)
2466 self.shell.alias_table_validate(verbose=0)
2467 # end magic_alias
2467 # end magic_alias
2468
2468
2469 def magic_unalias(self, parameter_s = ''):
2469 def magic_unalias(self, parameter_s = ''):
2470 """Remove an alias"""
2470 """Remove an alias"""
2471
2471
2472 aname = parameter_s.strip()
2472 aname = parameter_s.strip()
2473 if aname in self.shell.alias_table:
2473 if aname in self.shell.alias_table:
2474 del self.shell.alias_table[aname]
2474 del self.shell.alias_table[aname]
2475 stored = self.db.get('stored_aliases', {} )
2475 stored = self.db.get('stored_aliases', {} )
2476 if aname in stored:
2476 if aname in stored:
2477 print "Removing %stored alias",aname
2477 print "Removing %stored alias",aname
2478 del stored[aname]
2478 del stored[aname]
2479 self.db['stored_aliases'] = stored
2479 self.db['stored_aliases'] = stored
2480
2480
2481
2481
2482 def magic_rehashx(self, parameter_s = ''):
2482 def magic_rehashx(self, parameter_s = ''):
2483 """Update the alias table with all executable files in $PATH.
2483 """Update the alias table with all executable files in $PATH.
2484
2484
2485 This version explicitly checks that every entry in $PATH is a file
2485 This version explicitly checks that every entry in $PATH is a file
2486 with execute access (os.X_OK), so it is much slower than %rehash.
2486 with execute access (os.X_OK), so it is much slower than %rehash.
2487
2487
2488 Under Windows, it checks executability as a match agains a
2488 Under Windows, it checks executability as a match agains a
2489 '|'-separated string of extensions, stored in the IPython config
2489 '|'-separated string of extensions, stored in the IPython config
2490 variable win_exec_ext. This defaults to 'exe|com|bat'.
2490 variable win_exec_ext. This defaults to 'exe|com|bat'.
2491
2491
2492 This function also resets the root module cache of module completer,
2492 This function also resets the root module cache of module completer,
2493 used on slow filesystems.
2493 used on slow filesystems.
2494 """
2494 """
2495
2495
2496
2496
2497 ip = self.api
2497 ip = self.api
2498
2498
2499 # for the benefit of module completer in ipy_completers.py
2499 # for the benefit of module completer in ipy_completers.py
2500 del ip.db['rootmodules']
2500 del ip.db['rootmodules']
2501
2501
2502 path = [os.path.abspath(os.path.expanduser(p)) for p in
2502 path = [os.path.abspath(os.path.expanduser(p)) for p in
2503 os.environ.get('PATH','').split(os.pathsep)]
2503 os.environ.get('PATH','').split(os.pathsep)]
2504 path = filter(os.path.isdir,path)
2504 path = filter(os.path.isdir,path)
2505
2505
2506 alias_table = self.shell.alias_table
2506 alias_table = self.shell.alias_table
2507 syscmdlist = []
2507 syscmdlist = []
2508 if os.name == 'posix':
2508 if os.name == 'posix':
2509 isexec = lambda fname:os.path.isfile(fname) and \
2509 isexec = lambda fname:os.path.isfile(fname) and \
2510 os.access(fname,os.X_OK)
2510 os.access(fname,os.X_OK)
2511 else:
2511 else:
2512
2512
2513 try:
2513 try:
2514 winext = os.environ['pathext'].replace(';','|').replace('.','')
2514 winext = os.environ['pathext'].replace(';','|').replace('.','')
2515 except KeyError:
2515 except KeyError:
2516 winext = 'exe|com|bat|py'
2516 winext = 'exe|com|bat|py'
2517 if 'py' not in winext:
2517 if 'py' not in winext:
2518 winext += '|py'
2518 winext += '|py'
2519 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2519 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2520 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2520 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2521 savedir = os.getcwd()
2521 savedir = os.getcwd()
2522 try:
2522 try:
2523 # write the whole loop for posix/Windows so we don't have an if in
2523 # write the whole loop for posix/Windows so we don't have an if in
2524 # the innermost part
2524 # the innermost part
2525 if os.name == 'posix':
2525 if os.name == 'posix':
2526 for pdir in path:
2526 for pdir in path:
2527 os.chdir(pdir)
2527 os.chdir(pdir)
2528 for ff in os.listdir(pdir):
2528 for ff in os.listdir(pdir):
2529 if isexec(ff) and ff not in self.shell.no_alias:
2529 if isexec(ff) and ff not in self.shell.no_alias:
2530 # each entry in the alias table must be (N,name),
2530 # each entry in the alias table must be (N,name),
2531 # where N is the number of positional arguments of the
2531 # where N is the number of positional arguments of the
2532 # alias.
2532 # alias.
2533 alias_table[ff] = (0,ff)
2533 alias_table[ff] = (0,ff)
2534 syscmdlist.append(ff)
2534 syscmdlist.append(ff)
2535 else:
2535 else:
2536 for pdir in path:
2536 for pdir in path:
2537 os.chdir(pdir)
2537 os.chdir(pdir)
2538 for ff in os.listdir(pdir):
2538 for ff in os.listdir(pdir):
2539 base, ext = os.path.splitext(ff)
2539 base, ext = os.path.splitext(ff)
2540 if isexec(ff) and base not in self.shell.no_alias:
2540 if isexec(ff) and base not in self.shell.no_alias:
2541 if ext.lower() == '.exe':
2541 if ext.lower() == '.exe':
2542 ff = base
2542 ff = base
2543 alias_table[base.lower()] = (0,ff)
2543 alias_table[base.lower()] = (0,ff)
2544 syscmdlist.append(ff)
2544 syscmdlist.append(ff)
2545 # Make sure the alias table doesn't contain keywords or builtins
2545 # Make sure the alias table doesn't contain keywords or builtins
2546 self.shell.alias_table_validate()
2546 self.shell.alias_table_validate()
2547 # Call again init_auto_alias() so we get 'rm -i' and other
2547 # Call again init_auto_alias() so we get 'rm -i' and other
2548 # modified aliases since %rehashx will probably clobber them
2548 # modified aliases since %rehashx will probably clobber them
2549
2549
2550 # no, we don't want them. if %rehashx clobbers them, good,
2550 # no, we don't want them. if %rehashx clobbers them, good,
2551 # we'll probably get better versions
2551 # we'll probably get better versions
2552 # self.shell.init_auto_alias()
2552 # self.shell.init_auto_alias()
2553 db = ip.db
2553 db = ip.db
2554 db['syscmdlist'] = syscmdlist
2554 db['syscmdlist'] = syscmdlist
2555 finally:
2555 finally:
2556 os.chdir(savedir)
2556 os.chdir(savedir)
2557
2557
2558 def magic_pwd(self, parameter_s = ''):
2558 def magic_pwd(self, parameter_s = ''):
2559 """Return the current working directory path."""
2559 """Return the current working directory path."""
2560 return os.getcwd()
2560 return os.getcwd()
2561
2561
2562 def magic_cd(self, parameter_s=''):
2562 def magic_cd(self, parameter_s=''):
2563 """Change the current working directory.
2563 """Change the current working directory.
2564
2564
2565 This command automatically maintains an internal list of directories
2565 This command automatically maintains an internal list of directories
2566 you visit during your IPython session, in the variable _dh. The
2566 you visit during your IPython session, in the variable _dh. The
2567 command %dhist shows this history nicely formatted. You can also
2567 command %dhist shows this history nicely formatted. You can also
2568 do 'cd -<tab>' to see directory history conveniently.
2568 do 'cd -<tab>' to see directory history conveniently.
2569
2569
2570 Usage:
2570 Usage:
2571
2571
2572 cd 'dir': changes to directory 'dir'.
2572 cd 'dir': changes to directory 'dir'.
2573
2573
2574 cd -: changes to the last visited directory.
2574 cd -: changes to the last visited directory.
2575
2575
2576 cd -<n>: changes to the n-th directory in the directory history.
2576 cd -<n>: changes to the n-th directory in the directory history.
2577
2577
2578 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2578 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2579 (note: cd <bookmark_name> is enough if there is no
2579 (note: cd <bookmark_name> is enough if there is no
2580 directory <bookmark_name>, but a bookmark with the name exists.)
2580 directory <bookmark_name>, but a bookmark with the name exists.)
2581 'cd -b <tab>' allows you to tab-complete bookmark names.
2581 'cd -b <tab>' allows you to tab-complete bookmark names.
2582
2582
2583 Options:
2583 Options:
2584
2584
2585 -q: quiet. Do not print the working directory after the cd command is
2585 -q: quiet. Do not print the working directory after the cd command is
2586 executed. By default IPython's cd command does print this directory,
2586 executed. By default IPython's cd command does print this directory,
2587 since the default prompts do not display path information.
2587 since the default prompts do not display path information.
2588
2588
2589 Note that !cd doesn't work for this purpose because the shell where
2589 Note that !cd doesn't work for this purpose because the shell where
2590 !command runs is immediately discarded after executing 'command'."""
2590 !command runs is immediately discarded after executing 'command'."""
2591
2591
2592 parameter_s = parameter_s.strip()
2592 parameter_s = parameter_s.strip()
2593 #bkms = self.shell.persist.get("bookmarks",{})
2593 #bkms = self.shell.persist.get("bookmarks",{})
2594
2594
2595 numcd = re.match(r'(-)(\d+)$',parameter_s)
2595 numcd = re.match(r'(-)(\d+)$',parameter_s)
2596 # jump in directory history by number
2596 # jump in directory history by number
2597 if numcd:
2597 if numcd:
2598 nn = int(numcd.group(2))
2598 nn = int(numcd.group(2))
2599 try:
2599 try:
2600 ps = self.shell.user_ns['_dh'][nn]
2600 ps = self.shell.user_ns['_dh'][nn]
2601 except IndexError:
2601 except IndexError:
2602 print 'The requested directory does not exist in history.'
2602 print 'The requested directory does not exist in history.'
2603 return
2603 return
2604 else:
2604 else:
2605 opts = {}
2605 opts = {}
2606 else:
2606 else:
2607 #turn all non-space-escaping backslashes to slashes,
2607 #turn all non-space-escaping backslashes to slashes,
2608 # for c:\windows\directory\names\
2608 # for c:\windows\directory\names\
2609 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2609 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2610 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2610 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2611 # jump to previous
2611 # jump to previous
2612 if ps == '-':
2612 if ps == '-':
2613 try:
2613 try:
2614 ps = self.shell.user_ns['_dh'][-2]
2614 ps = self.shell.user_ns['_dh'][-2]
2615 except IndexError:
2615 except IndexError:
2616 print 'No previous directory to change to.'
2616 print 'No previous directory to change to.'
2617 return
2617 return
2618 # jump to bookmark if needed
2618 # jump to bookmark if needed
2619 else:
2619 else:
2620 if not os.path.isdir(ps) or opts.has_key('b'):
2620 if not os.path.isdir(ps) or opts.has_key('b'):
2621 bkms = self.db.get('bookmarks', {})
2621 bkms = self.db.get('bookmarks', {})
2622
2622
2623 if bkms.has_key(ps):
2623 if bkms.has_key(ps):
2624 target = bkms[ps]
2624 target = bkms[ps]
2625 print '(bookmark:%s) -> %s' % (ps,target)
2625 print '(bookmark:%s) -> %s' % (ps,target)
2626 ps = target
2626 ps = target
2627 else:
2627 else:
2628 if opts.has_key('b'):
2628 if opts.has_key('b'):
2629 error("Bookmark '%s' not found. "
2629 error("Bookmark '%s' not found. "
2630 "Use '%%bookmark -l' to see your bookmarks." % ps)
2630 "Use '%%bookmark -l' to see your bookmarks." % ps)
2631 return
2631 return
2632
2632
2633 # at this point ps should point to the target dir
2633 # at this point ps should point to the target dir
2634 if ps:
2634 if ps:
2635 try:
2635 try:
2636 os.chdir(os.path.expanduser(ps))
2636 os.chdir(os.path.expanduser(ps))
2637 if self.shell.rc.term_title:
2637 if self.shell.rc.term_title:
2638 #print 'set term title:',self.shell.rc.term_title # dbg
2638 #print 'set term title:',self.shell.rc.term_title # dbg
2639 ttitle = 'IPy ' + abbrev_cwd()
2639 ttitle = 'IPy ' + abbrev_cwd()
2640 platutils.set_term_title(ttitle)
2640 platutils.set_term_title(ttitle)
2641 except OSError:
2641 except OSError:
2642 print sys.exc_info()[1]
2642 print sys.exc_info()[1]
2643 else:
2643 else:
2644 cwd = os.getcwd()
2644 cwd = os.getcwd()
2645 dhist = self.shell.user_ns['_dh']
2645 dhist = self.shell.user_ns['_dh']
2646 dhist.append(cwd)
2646 dhist.append(cwd)
2647 self.db['dhist'] = compress_dhist(dhist)[-100:]
2647 self.db['dhist'] = compress_dhist(dhist)[-100:]
2648
2648
2649 else:
2649 else:
2650 os.chdir(self.shell.home_dir)
2650 os.chdir(self.shell.home_dir)
2651 if self.shell.rc.term_title:
2651 if self.shell.rc.term_title:
2652 platutils.set_term_title("IPy ~")
2652 platutils.set_term_title("IPy ~")
2653 cwd = os.getcwd()
2653 cwd = os.getcwd()
2654 dhist = self.shell.user_ns['_dh']
2654 dhist = self.shell.user_ns['_dh']
2655 dhist.append(cwd)
2655 dhist.append(cwd)
2656 self.db['dhist'] = compress_dhist(dhist)[-100:]
2656 self.db['dhist'] = compress_dhist(dhist)[-100:]
2657 if not 'q' in opts and self.shell.user_ns['_dh']:
2657 if not 'q' in opts and self.shell.user_ns['_dh']:
2658 print self.shell.user_ns['_dh'][-1]
2658 print self.shell.user_ns['_dh'][-1]
2659
2659
2660
2660
2661 def magic_env(self, parameter_s=''):
2661 def magic_env(self, parameter_s=''):
2662 """List environment variables."""
2662 """List environment variables."""
2663
2663
2664 return os.environ.data
2664 return os.environ.data
2665
2665
2666 def magic_pushd(self, parameter_s=''):
2666 def magic_pushd(self, parameter_s=''):
2667 """Place the current dir on stack and change directory.
2667 """Place the current dir on stack and change directory.
2668
2668
2669 Usage:\\
2669 Usage:\\
2670 %pushd ['dirname']
2670 %pushd ['dirname']
2671
2671
2672 %pushd with no arguments does a %pushd to your home directory.
2672 %pushd with no arguments does a %pushd to your home directory.
2673 """
2673 """
2674 if parameter_s == '': parameter_s = '~'
2674 if parameter_s == '': parameter_s = '~'
2675 dir_s = self.shell.dir_stack
2675 dir_s = self.shell.dir_stack
2676 if len(dir_s)>0 and os.path.expanduser(parameter_s) != \
2676 if len(dir_s)>0 and os.path.expanduser(parameter_s) != \
2677 os.path.expanduser(self.shell.dir_stack[0]):
2677 os.path.expanduser(self.shell.dir_stack[0]):
2678 try:
2678 try:
2679 cwd = os.getcwd().replace(self.home_dir,'~')
2679 self.magic_cd(parameter_s)
2680 self.magic_cd(parameter_s)
2680 dir_s.insert(0,os.getcwd().replace(self.home_dir,'~'))
2681 # print "Pushed:",cwd #dbg
2681 self.magic_dirs()
2682 dir_s.insert(0,cwd)
2683 return self.magic_dirs()
2682 except:
2684 except:
2683 print 'Invalid directory'
2685 print 'Invalid directory'
2684 else:
2686 else:
2685 print 'You are already there!'
2687 print 'You are already there!'
2686
2688
2687 def magic_popd(self, parameter_s=''):
2689 def magic_popd(self, parameter_s=''):
2688 """Change to directory popped off the top of the stack.
2690 """Change to directory popped off the top of the stack.
2689 """
2691 """
2690 if len (self.shell.dir_stack) > 1:
2692 if len (self.shell.dir_stack) > 1:
2691 self.shell.dir_stack.pop(0)
2693 top = self.shell.dir_stack.pop(0)
2692 self.magic_cd(self.shell.dir_stack[0])
2694 self.magic_cd(top)
2693 print self.shell.dir_stack[0]
2695 print "popd ->",top
2694 else:
2696 else:
2695 print "You can't remove the starting directory from the stack:",\
2697 print "You can't remove the starting directory from the stack:",\
2696 self.shell.dir_stack
2698 self.shell.dir_stack
2697
2699
2698 def magic_dirs(self, parameter_s=''):
2700 def magic_dirs(self, parameter_s=''):
2699 """Return the current directory stack."""
2701 """Return the current directory stack."""
2700
2702
2701 return self.shell.dir_stack[:]
2703 return self.shell.dir_stack
2702
2704
2703 def magic_dhist(self, parameter_s=''):
2705 def magic_dhist(self, parameter_s=''):
2704 """Print your history of visited directories.
2706 """Print your history of visited directories.
2705
2707
2706 %dhist -> print full history\\
2708 %dhist -> print full history\\
2707 %dhist n -> print last n entries only\\
2709 %dhist n -> print last n entries only\\
2708 %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\\
2710 %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\\
2709
2711
2710 This history is automatically maintained by the %cd command, and
2712 This history is automatically maintained by the %cd command, and
2711 always available as the global list variable _dh. You can use %cd -<n>
2713 always available as the global list variable _dh. You can use %cd -<n>
2712 to go to directory number <n>.
2714 to go to directory number <n>.
2713
2715
2714 Note that most of time, you should view directory history by entering
2716 Note that most of time, you should view directory history by entering
2715 cd -<TAB>.
2717 cd -<TAB>.
2716
2718
2717 """
2719 """
2718
2720
2719 dh = self.shell.user_ns['_dh']
2721 dh = self.shell.user_ns['_dh']
2720 if parameter_s:
2722 if parameter_s:
2721 try:
2723 try:
2722 args = map(int,parameter_s.split())
2724 args = map(int,parameter_s.split())
2723 except:
2725 except:
2724 self.arg_err(Magic.magic_dhist)
2726 self.arg_err(Magic.magic_dhist)
2725 return
2727 return
2726 if len(args) == 1:
2728 if len(args) == 1:
2727 ini,fin = max(len(dh)-(args[0]),0),len(dh)
2729 ini,fin = max(len(dh)-(args[0]),0),len(dh)
2728 elif len(args) == 2:
2730 elif len(args) == 2:
2729 ini,fin = args
2731 ini,fin = args
2730 else:
2732 else:
2731 self.arg_err(Magic.magic_dhist)
2733 self.arg_err(Magic.magic_dhist)
2732 return
2734 return
2733 else:
2735 else:
2734 ini,fin = 0,len(dh)
2736 ini,fin = 0,len(dh)
2735 nlprint(dh,
2737 nlprint(dh,
2736 header = 'Directory history (kept in _dh)',
2738 header = 'Directory history (kept in _dh)',
2737 start=ini,stop=fin)
2739 start=ini,stop=fin)
2738
2740
2739
2741
2740 def magic_sc(self, parameter_s=''):
2742 def magic_sc(self, parameter_s=''):
2741 """Shell capture - execute a shell command and capture its output.
2743 """Shell capture - execute a shell command and capture its output.
2742
2744
2743 DEPRECATED. Suboptimal, retained for backwards compatibility.
2745 DEPRECATED. Suboptimal, retained for backwards compatibility.
2744
2746
2745 You should use the form 'var = !command' instead. Example:
2747 You should use the form 'var = !command' instead. Example:
2746
2748
2747 "%sc -l myfiles = ls ~" should now be written as
2749 "%sc -l myfiles = ls ~" should now be written as
2748
2750
2749 "myfiles = !ls ~"
2751 "myfiles = !ls ~"
2750
2752
2751 myfiles.s, myfiles.l and myfiles.n still apply as documented
2753 myfiles.s, myfiles.l and myfiles.n still apply as documented
2752 below.
2754 below.
2753
2755
2754 --
2756 --
2755 %sc [options] varname=command
2757 %sc [options] varname=command
2756
2758
2757 IPython will run the given command using commands.getoutput(), and
2759 IPython will run the given command using commands.getoutput(), and
2758 will then update the user's interactive namespace with a variable
2760 will then update the user's interactive namespace with a variable
2759 called varname, containing the value of the call. Your command can
2761 called varname, containing the value of the call. Your command can
2760 contain shell wildcards, pipes, etc.
2762 contain shell wildcards, pipes, etc.
2761
2763
2762 The '=' sign in the syntax is mandatory, and the variable name you
2764 The '=' sign in the syntax is mandatory, and the variable name you
2763 supply must follow Python's standard conventions for valid names.
2765 supply must follow Python's standard conventions for valid names.
2764
2766
2765 (A special format without variable name exists for internal use)
2767 (A special format without variable name exists for internal use)
2766
2768
2767 Options:
2769 Options:
2768
2770
2769 -l: list output. Split the output on newlines into a list before
2771 -l: list output. Split the output on newlines into a list before
2770 assigning it to the given variable. By default the output is stored
2772 assigning it to the given variable. By default the output is stored
2771 as a single string.
2773 as a single string.
2772
2774
2773 -v: verbose. Print the contents of the variable.
2775 -v: verbose. Print the contents of the variable.
2774
2776
2775 In most cases you should not need to split as a list, because the
2777 In most cases you should not need to split as a list, because the
2776 returned value is a special type of string which can automatically
2778 returned value is a special type of string which can automatically
2777 provide its contents either as a list (split on newlines) or as a
2779 provide its contents either as a list (split on newlines) or as a
2778 space-separated string. These are convenient, respectively, either
2780 space-separated string. These are convenient, respectively, either
2779 for sequential processing or to be passed to a shell command.
2781 for sequential processing or to be passed to a shell command.
2780
2782
2781 For example:
2783 For example:
2782
2784
2783 # Capture into variable a
2785 # Capture into variable a
2784 In [9]: sc a=ls *py
2786 In [9]: sc a=ls *py
2785
2787
2786 # a is a string with embedded newlines
2788 # a is a string with embedded newlines
2787 In [10]: a
2789 In [10]: a
2788 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2790 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2789
2791
2790 # which can be seen as a list:
2792 # which can be seen as a list:
2791 In [11]: a.l
2793 In [11]: a.l
2792 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2794 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2793
2795
2794 # or as a whitespace-separated string:
2796 # or as a whitespace-separated string:
2795 In [12]: a.s
2797 In [12]: a.s
2796 Out[12]: 'setup.py win32_manual_post_install.py'
2798 Out[12]: 'setup.py win32_manual_post_install.py'
2797
2799
2798 # a.s is useful to pass as a single command line:
2800 # a.s is useful to pass as a single command line:
2799 In [13]: !wc -l $a.s
2801 In [13]: !wc -l $a.s
2800 146 setup.py
2802 146 setup.py
2801 130 win32_manual_post_install.py
2803 130 win32_manual_post_install.py
2802 276 total
2804 276 total
2803
2805
2804 # while the list form is useful to loop over:
2806 # while the list form is useful to loop over:
2805 In [14]: for f in a.l:
2807 In [14]: for f in a.l:
2806 ....: !wc -l $f
2808 ....: !wc -l $f
2807 ....:
2809 ....:
2808 146 setup.py
2810 146 setup.py
2809 130 win32_manual_post_install.py
2811 130 win32_manual_post_install.py
2810
2812
2811 Similiarly, the lists returned by the -l option are also special, in
2813 Similiarly, the lists returned by the -l option are also special, in
2812 the sense that you can equally invoke the .s attribute on them to
2814 the sense that you can equally invoke the .s attribute on them to
2813 automatically get a whitespace-separated string from their contents:
2815 automatically get a whitespace-separated string from their contents:
2814
2816
2815 In [1]: sc -l b=ls *py
2817 In [1]: sc -l b=ls *py
2816
2818
2817 In [2]: b
2819 In [2]: b
2818 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2820 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2819
2821
2820 In [3]: b.s
2822 In [3]: b.s
2821 Out[3]: 'setup.py win32_manual_post_install.py'
2823 Out[3]: 'setup.py win32_manual_post_install.py'
2822
2824
2823 In summary, both the lists and strings used for ouptut capture have
2825 In summary, both the lists and strings used for ouptut capture have
2824 the following special attributes:
2826 the following special attributes:
2825
2827
2826 .l (or .list) : value as list.
2828 .l (or .list) : value as list.
2827 .n (or .nlstr): value as newline-separated string.
2829 .n (or .nlstr): value as newline-separated string.
2828 .s (or .spstr): value as space-separated string.
2830 .s (or .spstr): value as space-separated string.
2829 """
2831 """
2830
2832
2831 opts,args = self.parse_options(parameter_s,'lv')
2833 opts,args = self.parse_options(parameter_s,'lv')
2832 # Try to get a variable name and command to run
2834 # Try to get a variable name and command to run
2833 try:
2835 try:
2834 # the variable name must be obtained from the parse_options
2836 # the variable name must be obtained from the parse_options
2835 # output, which uses shlex.split to strip options out.
2837 # output, which uses shlex.split to strip options out.
2836 var,_ = args.split('=',1)
2838 var,_ = args.split('=',1)
2837 var = var.strip()
2839 var = var.strip()
2838 # But the the command has to be extracted from the original input
2840 # But the the command has to be extracted from the original input
2839 # parameter_s, not on what parse_options returns, to avoid the
2841 # parameter_s, not on what parse_options returns, to avoid the
2840 # quote stripping which shlex.split performs on it.
2842 # quote stripping which shlex.split performs on it.
2841 _,cmd = parameter_s.split('=',1)
2843 _,cmd = parameter_s.split('=',1)
2842 except ValueError:
2844 except ValueError:
2843 var,cmd = '',''
2845 var,cmd = '',''
2844 # If all looks ok, proceed
2846 # If all looks ok, proceed
2845 out,err = self.shell.getoutputerror(cmd)
2847 out,err = self.shell.getoutputerror(cmd)
2846 if err:
2848 if err:
2847 print >> Term.cerr,err
2849 print >> Term.cerr,err
2848 if opts.has_key('l'):
2850 if opts.has_key('l'):
2849 out = SList(out.split('\n'))
2851 out = SList(out.split('\n'))
2850 else:
2852 else:
2851 out = LSString(out)
2853 out = LSString(out)
2852 if opts.has_key('v'):
2854 if opts.has_key('v'):
2853 print '%s ==\n%s' % (var,pformat(out))
2855 print '%s ==\n%s' % (var,pformat(out))
2854 if var:
2856 if var:
2855 self.shell.user_ns.update({var:out})
2857 self.shell.user_ns.update({var:out})
2856 else:
2858 else:
2857 return out
2859 return out
2858
2860
2859 def magic_sx(self, parameter_s=''):
2861 def magic_sx(self, parameter_s=''):
2860 """Shell execute - run a shell command and capture its output.
2862 """Shell execute - run a shell command and capture its output.
2861
2863
2862 %sx command
2864 %sx command
2863
2865
2864 IPython will run the given command using commands.getoutput(), and
2866 IPython will run the given command using commands.getoutput(), and
2865 return the result formatted as a list (split on '\\n'). Since the
2867 return the result formatted as a list (split on '\\n'). Since the
2866 output is _returned_, it will be stored in ipython's regular output
2868 output is _returned_, it will be stored in ipython's regular output
2867 cache Out[N] and in the '_N' automatic variables.
2869 cache Out[N] and in the '_N' automatic variables.
2868
2870
2869 Notes:
2871 Notes:
2870
2872
2871 1) If an input line begins with '!!', then %sx is automatically
2873 1) If an input line begins with '!!', then %sx is automatically
2872 invoked. That is, while:
2874 invoked. That is, while:
2873 !ls
2875 !ls
2874 causes ipython to simply issue system('ls'), typing
2876 causes ipython to simply issue system('ls'), typing
2875 !!ls
2877 !!ls
2876 is a shorthand equivalent to:
2878 is a shorthand equivalent to:
2877 %sx ls
2879 %sx ls
2878
2880
2879 2) %sx differs from %sc in that %sx automatically splits into a list,
2881 2) %sx differs from %sc in that %sx automatically splits into a list,
2880 like '%sc -l'. The reason for this is to make it as easy as possible
2882 like '%sc -l'. The reason for this is to make it as easy as possible
2881 to process line-oriented shell output via further python commands.
2883 to process line-oriented shell output via further python commands.
2882 %sc is meant to provide much finer control, but requires more
2884 %sc is meant to provide much finer control, but requires more
2883 typing.
2885 typing.
2884
2886
2885 3) Just like %sc -l, this is a list with special attributes:
2887 3) Just like %sc -l, this is a list with special attributes:
2886
2888
2887 .l (or .list) : value as list.
2889 .l (or .list) : value as list.
2888 .n (or .nlstr): value as newline-separated string.
2890 .n (or .nlstr): value as newline-separated string.
2889 .s (or .spstr): value as whitespace-separated string.
2891 .s (or .spstr): value as whitespace-separated string.
2890
2892
2891 This is very useful when trying to use such lists as arguments to
2893 This is very useful when trying to use such lists as arguments to
2892 system commands."""
2894 system commands."""
2893
2895
2894 if parameter_s:
2896 if parameter_s:
2895 out,err = self.shell.getoutputerror(parameter_s)
2897 out,err = self.shell.getoutputerror(parameter_s)
2896 if err:
2898 if err:
2897 print >> Term.cerr,err
2899 print >> Term.cerr,err
2898 return SList(out.split('\n'))
2900 return SList(out.split('\n'))
2899
2901
2900 def magic_bg(self, parameter_s=''):
2902 def magic_bg(self, parameter_s=''):
2901 """Run a job in the background, in a separate thread.
2903 """Run a job in the background, in a separate thread.
2902
2904
2903 For example,
2905 For example,
2904
2906
2905 %bg myfunc(x,y,z=1)
2907 %bg myfunc(x,y,z=1)
2906
2908
2907 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2909 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2908 execution starts, a message will be printed indicating the job
2910 execution starts, a message will be printed indicating the job
2909 number. If your job number is 5, you can use
2911 number. If your job number is 5, you can use
2910
2912
2911 myvar = jobs.result(5) or myvar = jobs[5].result
2913 myvar = jobs.result(5) or myvar = jobs[5].result
2912
2914
2913 to assign this result to variable 'myvar'.
2915 to assign this result to variable 'myvar'.
2914
2916
2915 IPython has a job manager, accessible via the 'jobs' object. You can
2917 IPython has a job manager, accessible via the 'jobs' object. You can
2916 type jobs? to get more information about it, and use jobs.<TAB> to see
2918 type jobs? to get more information about it, and use jobs.<TAB> to see
2917 its attributes. All attributes not starting with an underscore are
2919 its attributes. All attributes not starting with an underscore are
2918 meant for public use.
2920 meant for public use.
2919
2921
2920 In particular, look at the jobs.new() method, which is used to create
2922 In particular, look at the jobs.new() method, which is used to create
2921 new jobs. This magic %bg function is just a convenience wrapper
2923 new jobs. This magic %bg function is just a convenience wrapper
2922 around jobs.new(), for expression-based jobs. If you want to create a
2924 around jobs.new(), for expression-based jobs. If you want to create a
2923 new job with an explicit function object and arguments, you must call
2925 new job with an explicit function object and arguments, you must call
2924 jobs.new() directly.
2926 jobs.new() directly.
2925
2927
2926 The jobs.new docstring also describes in detail several important
2928 The jobs.new docstring also describes in detail several important
2927 caveats associated with a thread-based model for background job
2929 caveats associated with a thread-based model for background job
2928 execution. Type jobs.new? for details.
2930 execution. Type jobs.new? for details.
2929
2931
2930 You can check the status of all jobs with jobs.status().
2932 You can check the status of all jobs with jobs.status().
2931
2933
2932 The jobs variable is set by IPython into the Python builtin namespace.
2934 The jobs variable is set by IPython into the Python builtin namespace.
2933 If you ever declare a variable named 'jobs', you will shadow this
2935 If you ever declare a variable named 'jobs', you will shadow this
2934 name. You can either delete your global jobs variable to regain
2936 name. You can either delete your global jobs variable to regain
2935 access to the job manager, or make a new name and assign it manually
2937 access to the job manager, or make a new name and assign it manually
2936 to the manager (stored in IPython's namespace). For example, to
2938 to the manager (stored in IPython's namespace). For example, to
2937 assign the job manager to the Jobs name, use:
2939 assign the job manager to the Jobs name, use:
2938
2940
2939 Jobs = __builtins__.jobs"""
2941 Jobs = __builtins__.jobs"""
2940
2942
2941 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2943 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2942
2944
2943 def magic_r(self, parameter_s=''):
2945 def magic_r(self, parameter_s=''):
2944 """Repeat previous input.
2946 """Repeat previous input.
2945
2947
2946 Note: Consider using the more powerfull %rep instead!
2948 Note: Consider using the more powerfull %rep instead!
2947
2949
2948 If given an argument, repeats the previous command which starts with
2950 If given an argument, repeats the previous command which starts with
2949 the same string, otherwise it just repeats the previous input.
2951 the same string, otherwise it just repeats the previous input.
2950
2952
2951 Shell escaped commands (with ! as first character) are not recognized
2953 Shell escaped commands (with ! as first character) are not recognized
2952 by this system, only pure python code and magic commands.
2954 by this system, only pure python code and magic commands.
2953 """
2955 """
2954
2956
2955 start = parameter_s.strip()
2957 start = parameter_s.strip()
2956 esc_magic = self.shell.ESC_MAGIC
2958 esc_magic = self.shell.ESC_MAGIC
2957 # Identify magic commands even if automagic is on (which means
2959 # Identify magic commands even if automagic is on (which means
2958 # the in-memory version is different from that typed by the user).
2960 # the in-memory version is different from that typed by the user).
2959 if self.shell.rc.automagic:
2961 if self.shell.rc.automagic:
2960 start_magic = esc_magic+start
2962 start_magic = esc_magic+start
2961 else:
2963 else:
2962 start_magic = start
2964 start_magic = start
2963 # Look through the input history in reverse
2965 # Look through the input history in reverse
2964 for n in range(len(self.shell.input_hist)-2,0,-1):
2966 for n in range(len(self.shell.input_hist)-2,0,-1):
2965 input = self.shell.input_hist[n]
2967 input = self.shell.input_hist[n]
2966 # skip plain 'r' lines so we don't recurse to infinity
2968 # skip plain 'r' lines so we don't recurse to infinity
2967 if input != '_ip.magic("r")\n' and \
2969 if input != '_ip.magic("r")\n' and \
2968 (input.startswith(start) or input.startswith(start_magic)):
2970 (input.startswith(start) or input.startswith(start_magic)):
2969 #print 'match',`input` # dbg
2971 #print 'match',`input` # dbg
2970 print 'Executing:',input,
2972 print 'Executing:',input,
2971 self.shell.runlines(input)
2973 self.shell.runlines(input)
2972 return
2974 return
2973 print 'No previous input matching `%s` found.' % start
2975 print 'No previous input matching `%s` found.' % start
2974
2976
2975
2977
2976 def magic_bookmark(self, parameter_s=''):
2978 def magic_bookmark(self, parameter_s=''):
2977 """Manage IPython's bookmark system.
2979 """Manage IPython's bookmark system.
2978
2980
2979 %bookmark <name> - set bookmark to current dir
2981 %bookmark <name> - set bookmark to current dir
2980 %bookmark <name> <dir> - set bookmark to <dir>
2982 %bookmark <name> <dir> - set bookmark to <dir>
2981 %bookmark -l - list all bookmarks
2983 %bookmark -l - list all bookmarks
2982 %bookmark -d <name> - remove bookmark
2984 %bookmark -d <name> - remove bookmark
2983 %bookmark -r - remove all bookmarks
2985 %bookmark -r - remove all bookmarks
2984
2986
2985 You can later on access a bookmarked folder with:
2987 You can later on access a bookmarked folder with:
2986 %cd -b <name>
2988 %cd -b <name>
2987 or simply '%cd <name>' if there is no directory called <name> AND
2989 or simply '%cd <name>' if there is no directory called <name> AND
2988 there is such a bookmark defined.
2990 there is such a bookmark defined.
2989
2991
2990 Your bookmarks persist through IPython sessions, but they are
2992 Your bookmarks persist through IPython sessions, but they are
2991 associated with each profile."""
2993 associated with each profile."""
2992
2994
2993 opts,args = self.parse_options(parameter_s,'drl',mode='list')
2995 opts,args = self.parse_options(parameter_s,'drl',mode='list')
2994 if len(args) > 2:
2996 if len(args) > 2:
2995 error('You can only give at most two arguments')
2997 error('You can only give at most two arguments')
2996 return
2998 return
2997
2999
2998 bkms = self.db.get('bookmarks',{})
3000 bkms = self.db.get('bookmarks',{})
2999
3001
3000 if opts.has_key('d'):
3002 if opts.has_key('d'):
3001 try:
3003 try:
3002 todel = args[0]
3004 todel = args[0]
3003 except IndexError:
3005 except IndexError:
3004 error('You must provide a bookmark to delete')
3006 error('You must provide a bookmark to delete')
3005 else:
3007 else:
3006 try:
3008 try:
3007 del bkms[todel]
3009 del bkms[todel]
3008 except:
3010 except:
3009 error("Can't delete bookmark '%s'" % todel)
3011 error("Can't delete bookmark '%s'" % todel)
3010 elif opts.has_key('r'):
3012 elif opts.has_key('r'):
3011 bkms = {}
3013 bkms = {}
3012 elif opts.has_key('l'):
3014 elif opts.has_key('l'):
3013 bks = bkms.keys()
3015 bks = bkms.keys()
3014 bks.sort()
3016 bks.sort()
3015 if bks:
3017 if bks:
3016 size = max(map(len,bks))
3018 size = max(map(len,bks))
3017 else:
3019 else:
3018 size = 0
3020 size = 0
3019 fmt = '%-'+str(size)+'s -> %s'
3021 fmt = '%-'+str(size)+'s -> %s'
3020 print 'Current bookmarks:'
3022 print 'Current bookmarks:'
3021 for bk in bks:
3023 for bk in bks:
3022 print fmt % (bk,bkms[bk])
3024 print fmt % (bk,bkms[bk])
3023 else:
3025 else:
3024 if not args:
3026 if not args:
3025 error("You must specify the bookmark name")
3027 error("You must specify the bookmark name")
3026 elif len(args)==1:
3028 elif len(args)==1:
3027 bkms[args[0]] = os.getcwd()
3029 bkms[args[0]] = os.getcwd()
3028 elif len(args)==2:
3030 elif len(args)==2:
3029 bkms[args[0]] = args[1]
3031 bkms[args[0]] = args[1]
3030 self.db['bookmarks'] = bkms
3032 self.db['bookmarks'] = bkms
3031
3033
3032 def magic_pycat(self, parameter_s=''):
3034 def magic_pycat(self, parameter_s=''):
3033 """Show a syntax-highlighted file through a pager.
3035 """Show a syntax-highlighted file through a pager.
3034
3036
3035 This magic is similar to the cat utility, but it will assume the file
3037 This magic is similar to the cat utility, but it will assume the file
3036 to be Python source and will show it with syntax highlighting. """
3038 to be Python source and will show it with syntax highlighting. """
3037
3039
3038 try:
3040 try:
3039 filename = get_py_filename(parameter_s)
3041 filename = get_py_filename(parameter_s)
3040 cont = file_read(filename)
3042 cont = file_read(filename)
3041 except IOError:
3043 except IOError:
3042 try:
3044 try:
3043 cont = eval(parameter_s,self.user_ns)
3045 cont = eval(parameter_s,self.user_ns)
3044 except NameError:
3046 except NameError:
3045 cont = None
3047 cont = None
3046 if cont is None:
3048 if cont is None:
3047 print "Error: no such file or variable"
3049 print "Error: no such file or variable"
3048 return
3050 return
3049
3051
3050 page(self.shell.pycolorize(cont),
3052 page(self.shell.pycolorize(cont),
3051 screen_lines=self.shell.rc.screen_length)
3053 screen_lines=self.shell.rc.screen_length)
3052
3054
3053 def magic_cpaste(self, parameter_s=''):
3055 def magic_cpaste(self, parameter_s=''):
3054 """Allows you to paste & execute a pre-formatted code block from clipboard
3056 """Allows you to paste & execute a pre-formatted code block from clipboard
3055
3057
3056 You must terminate the block with '--' (two minus-signs) alone on the
3058 You must terminate the block with '--' (two minus-signs) alone on the
3057 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
3059 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
3058 is the new sentinel for this operation)
3060 is the new sentinel for this operation)
3059
3061
3060 The block is dedented prior to execution to enable execution of method
3062 The block is dedented prior to execution to enable execution of method
3061 definitions. '>' and '+' characters at the beginning of a line are
3063 definitions. '>' and '+' characters at the beginning of a line are
3062 ignored, to allow pasting directly from e-mails or diff files. The
3064 ignored, to allow pasting directly from e-mails or diff files. The
3063 executed block is also assigned to variable named 'pasted_block' for
3065 executed block is also assigned to variable named 'pasted_block' for
3064 later editing with '%edit pasted_block'.
3066 later editing with '%edit pasted_block'.
3065
3067
3066 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
3068 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
3067 This assigns the pasted block to variable 'foo' as string, without
3069 This assigns the pasted block to variable 'foo' as string, without
3068 dedenting or executing it.
3070 dedenting or executing it.
3069
3071
3070 Do not be alarmed by garbled output on Windows (it's a readline bug).
3072 Do not be alarmed by garbled output on Windows (it's a readline bug).
3071 Just press enter and type -- (and press enter again) and the block
3073 Just press enter and type -- (and press enter again) and the block
3072 will be what was just pasted.
3074 will be what was just pasted.
3073
3075
3074 IPython statements (magics, shell escapes) are not supported (yet).
3076 IPython statements (magics, shell escapes) are not supported (yet).
3075 """
3077 """
3076 opts,args = self.parse_options(parameter_s,'s:',mode='string')
3078 opts,args = self.parse_options(parameter_s,'s:',mode='string')
3077 par = args.strip()
3079 par = args.strip()
3078 sentinel = opts.get('s','--')
3080 sentinel = opts.get('s','--')
3079
3081
3080 from IPython import iplib
3082 from IPython import iplib
3081 lines = []
3083 lines = []
3082 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3084 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3083 while 1:
3085 while 1:
3084 l = iplib.raw_input_original(':')
3086 l = iplib.raw_input_original(':')
3085 if l ==sentinel:
3087 if l ==sentinel:
3086 break
3088 break
3087 lines.append(l.lstrip('>').lstrip('+'))
3089 lines.append(l.lstrip('>').lstrip('+'))
3088 block = "\n".join(lines) + '\n'
3090 block = "\n".join(lines) + '\n'
3089 #print "block:\n",block
3091 #print "block:\n",block
3090 if not par:
3092 if not par:
3091 b = textwrap.dedent(block)
3093 b = textwrap.dedent(block)
3092 exec b in self.user_ns
3094 exec b in self.user_ns
3093 self.user_ns['pasted_block'] = b
3095 self.user_ns['pasted_block'] = b
3094 else:
3096 else:
3095 self.user_ns[par] = block
3097 self.user_ns[par] = block
3096 print "Block assigned to '%s'" % par
3098 print "Block assigned to '%s'" % par
3097
3099
3098 def magic_quickref(self,arg):
3100 def magic_quickref(self,arg):
3099 """ Show a quick reference sheet """
3101 """ Show a quick reference sheet """
3100 import IPython.usage
3102 import IPython.usage
3101 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
3103 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
3102
3104
3103 page(qr)
3105 page(qr)
3104
3106
3105 def magic_upgrade(self,arg):
3107 def magic_upgrade(self,arg):
3106 """ Upgrade your IPython installation
3108 """ Upgrade your IPython installation
3107
3109
3108 This will copy the config files that don't yet exist in your
3110 This will copy the config files that don't yet exist in your
3109 ipython dir from the system config dir. Use this after upgrading
3111 ipython dir from the system config dir. Use this after upgrading
3110 IPython if you don't wish to delete your .ipython dir.
3112 IPython if you don't wish to delete your .ipython dir.
3111
3113
3112 Call with -nolegacy to get rid of ipythonrc* files (recommended for
3114 Call with -nolegacy to get rid of ipythonrc* files (recommended for
3113 new users)
3115 new users)
3114
3116
3115 """
3117 """
3116 ip = self.getapi()
3118 ip = self.getapi()
3117 ipinstallation = path(IPython.__file__).dirname()
3119 ipinstallation = path(IPython.__file__).dirname()
3118 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
3120 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
3119 src_config = ipinstallation / 'UserConfig'
3121 src_config = ipinstallation / 'UserConfig'
3120 userdir = path(ip.options.ipythondir)
3122 userdir = path(ip.options.ipythondir)
3121 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
3123 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
3122 print ">",cmd
3124 print ">",cmd
3123 shell(cmd)
3125 shell(cmd)
3124 if arg == '-nolegacy':
3126 if arg == '-nolegacy':
3125 legacy = userdir.files('ipythonrc*')
3127 legacy = userdir.files('ipythonrc*')
3126 print "Nuking legacy files:",legacy
3128 print "Nuking legacy files:",legacy
3127
3129
3128 [p.remove() for p in legacy]
3130 [p.remove() for p in legacy]
3129 suffix = (sys.platform == 'win32' and '.ini' or '')
3131 suffix = (sys.platform == 'win32' and '.ini' or '')
3130 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
3132 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
3131
3133
3132
3134
3133 def magic_doctest_mode(self,parameter_s=''):
3135 def magic_doctest_mode(self,parameter_s=''):
3134 """Toggle doctest mode on and off.
3136 """Toggle doctest mode on and off.
3135
3137
3136 This mode allows you to toggle the prompt behavior between normal
3138 This mode allows you to toggle the prompt behavior between normal
3137 IPython prompts and ones that are as similar to the default IPython
3139 IPython prompts and ones that are as similar to the default IPython
3138 interpreter as possible.
3140 interpreter as possible.
3139
3141
3140 It also supports the pasting of code snippets that have leading '>>>'
3142 It also supports the pasting of code snippets that have leading '>>>'
3141 and '...' prompts in them. This means that you can paste doctests from
3143 and '...' prompts in them. This means that you can paste doctests from
3142 files or docstrings (even if they have leading whitespace), and the
3144 files or docstrings (even if they have leading whitespace), and the
3143 code will execute correctly. You can then use '%history -tn' to see
3145 code will execute correctly. You can then use '%history -tn' to see
3144 the translated history without line numbers; this will give you the
3146 the translated history without line numbers; this will give you the
3145 input after removal of all the leading prompts and whitespace, which
3147 input after removal of all the leading prompts and whitespace, which
3146 can be pasted back into an editor.
3148 can be pasted back into an editor.
3147
3149
3148 With these features, you can switch into this mode easily whenever you
3150 With these features, you can switch into this mode easily whenever you
3149 need to do testing and changes to doctests, without having to leave
3151 need to do testing and changes to doctests, without having to leave
3150 your existing IPython session.
3152 your existing IPython session.
3151 """
3153 """
3152
3154
3153 # XXX - Fix this to have cleaner activate/deactivate calls.
3155 # XXX - Fix this to have cleaner activate/deactivate calls.
3154 from IPython.Extensions import InterpreterPasteInput as ipaste
3156 from IPython.Extensions import InterpreterPasteInput as ipaste
3155 from IPython.ipstruct import Struct
3157 from IPython.ipstruct import Struct
3156
3158
3157 # Shorthands
3159 # Shorthands
3158 shell = self.shell
3160 shell = self.shell
3159 oc = shell.outputcache
3161 oc = shell.outputcache
3160 rc = shell.rc
3162 rc = shell.rc
3161 meta = shell.meta
3163 meta = shell.meta
3162 # dstore is a data store kept in the instance metadata bag to track any
3164 # dstore is a data store kept in the instance metadata bag to track any
3163 # changes we make, so we can undo them later.
3165 # changes we make, so we can undo them later.
3164 dstore = meta.setdefault('doctest_mode',Struct())
3166 dstore = meta.setdefault('doctest_mode',Struct())
3165 save_dstore = dstore.setdefault
3167 save_dstore = dstore.setdefault
3166
3168
3167 # save a few values we'll need to recover later
3169 # save a few values we'll need to recover later
3168 mode = save_dstore('mode',False)
3170 mode = save_dstore('mode',False)
3169 save_dstore('rc_pprint',rc.pprint)
3171 save_dstore('rc_pprint',rc.pprint)
3170 save_dstore('xmode',shell.InteractiveTB.mode)
3172 save_dstore('xmode',shell.InteractiveTB.mode)
3171 save_dstore('rc_separate_in',rc.separate_in)
3173 save_dstore('rc_separate_in',rc.separate_in)
3172 save_dstore('rc_separate_out',rc.separate_out)
3174 save_dstore('rc_separate_out',rc.separate_out)
3173 save_dstore('rc_separate_out2',rc.separate_out2)
3175 save_dstore('rc_separate_out2',rc.separate_out2)
3174 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
3176 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
3175
3177
3176 if mode == False:
3178 if mode == False:
3177 # turn on
3179 # turn on
3178 ipaste.activate_prefilter()
3180 ipaste.activate_prefilter()
3179
3181
3180 oc.prompt1.p_template = '>>> '
3182 oc.prompt1.p_template = '>>> '
3181 oc.prompt2.p_template = '... '
3183 oc.prompt2.p_template = '... '
3182 oc.prompt_out.p_template = ''
3184 oc.prompt_out.p_template = ''
3183
3185
3184 oc.prompt1.sep = '\n'
3186 oc.prompt1.sep = '\n'
3185 oc.output_sep = ''
3187 oc.output_sep = ''
3186 oc.output_sep2 = ''
3188 oc.output_sep2 = ''
3187
3189
3188 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3190 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3189 oc.prompt_out.pad_left = False
3191 oc.prompt_out.pad_left = False
3190
3192
3191 rc.pprint = False
3193 rc.pprint = False
3192
3194
3193 shell.magic_xmode('Plain')
3195 shell.magic_xmode('Plain')
3194
3196
3195 else:
3197 else:
3196 # turn off
3198 # turn off
3197 ipaste.deactivate_prefilter()
3199 ipaste.deactivate_prefilter()
3198
3200
3199 oc.prompt1.p_template = rc.prompt_in1
3201 oc.prompt1.p_template = rc.prompt_in1
3200 oc.prompt2.p_template = rc.prompt_in2
3202 oc.prompt2.p_template = rc.prompt_in2
3201 oc.prompt_out.p_template = rc.prompt_out
3203 oc.prompt_out.p_template = rc.prompt_out
3202
3204
3203 oc.prompt1.sep = dstore.rc_separate_in
3205 oc.prompt1.sep = dstore.rc_separate_in
3204 oc.output_sep = dstore.rc_separate_out
3206 oc.output_sep = dstore.rc_separate_out
3205 oc.output_sep2 = dstore.rc_separate_out2
3207 oc.output_sep2 = dstore.rc_separate_out2
3206
3208
3207 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3209 oc.prompt1.pad_left = oc.prompt2.pad_left = \
3208 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
3210 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
3209
3211
3210 rc.pprint = dstore.rc_pprint
3212 rc.pprint = dstore.rc_pprint
3211
3213
3212 shell.magic_xmode(dstore.xmode)
3214 shell.magic_xmode(dstore.xmode)
3213
3215
3214 # Store new mode and inform
3216 # Store new mode and inform
3215 dstore.mode = bool(1-int(mode))
3217 dstore.mode = bool(1-int(mode))
3216 print 'Doctest mode is:',
3218 print 'Doctest mode is:',
3217 print ['OFF','ON'][dstore.mode]
3219 print ['OFF','ON'][dstore.mode]
3218
3220
3219 # end Magic
3221 # end Magic
@@ -1,7152 +1,7157 b''
1 2007-09-08 Ville Vainio <vivainio@gmail.com>
2
3 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
4 directory, not the target directory.
5
1 2007-09-07 Ville Vainio <vivainio@gmail.com>
6 2007-09-07 Ville Vainio <vivainio@gmail.com>
2
7
3 * iplib.py: do not auto-alias "dir", it screws up other dir auto
8 * iplib.py: do not auto-alias "dir", it screws up other dir auto
4 aliases.
9 aliases.
5
10
6 * genutils.py: SList.grep() implemented.
11 * genutils.py: SList.grep() implemented.
7
12
8 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
13 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
9 for easy "out of the box" setup of several common editors, so that
14 for easy "out of the box" setup of several common editors, so that
10 e.g. '%edit os.path.isfile' will jump to the correct line
15 e.g. '%edit os.path.isfile' will jump to the correct line
11 automatically. Contributions for command lines of your favourite
16 automatically. Contributions for command lines of your favourite
12 editors welcome.
17 editors welcome.
13
18
14 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
19 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
15
20
16 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
21 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
17 preventing source display in certain cases. In reality I think
22 preventing source display in certain cases. In reality I think
18 the problem is with Ubuntu's Python build, but this change works
23 the problem is with Ubuntu's Python build, but this change works
19 around the issue in some cases (not in all, unfortunately). I'd
24 around the issue in some cases (not in all, unfortunately). I'd
20 filed a Python bug on this with more details, but in the change of
25 filed a Python bug on this with more details, but in the change of
21 bug trackers it seems to have been lost.
26 bug trackers it seems to have been lost.
22
27
23 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
28 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
24 not the same, it's not self-documenting, doesn't allow range
29 not the same, it's not self-documenting, doesn't allow range
25 selection, and sorts alphabetically instead of numerically.
30 selection, and sorts alphabetically instead of numerically.
26 (magic_r): restore %r. No, "up + enter. One char magic" is not
31 (magic_r): restore %r. No, "up + enter. One char magic" is not
27 the same thing, since %r takes parameters to allow fast retrieval
32 the same thing, since %r takes parameters to allow fast retrieval
28 of old commands. I've received emails from users who use this a
33 of old commands. I've received emails from users who use this a
29 LOT, so it stays.
34 LOT, so it stays.
30 (magic_automagic): restore %automagic. "use _ip.option.automagic"
35 (magic_automagic): restore %automagic. "use _ip.option.automagic"
31 is not a valid replacement b/c it doesn't provide an complete
36 is not a valid replacement b/c it doesn't provide an complete
32 explanation (which the automagic docstring does).
37 explanation (which the automagic docstring does).
33 (magic_autocall): restore %autocall, with improved docstring.
38 (magic_autocall): restore %autocall, with improved docstring.
34 Same argument as for others, "use _ip.options.autocall" is not a
39 Same argument as for others, "use _ip.options.autocall" is not a
35 valid replacement.
40 valid replacement.
36 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
41 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
37 tutorials and online docs.
42 tutorials and online docs.
38
43
39 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
44 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
40
45
41 * IPython/usage.py (quick_reference): mention magics in quickref,
46 * IPython/usage.py (quick_reference): mention magics in quickref,
42 modified main banner to mention %quickref.
47 modified main banner to mention %quickref.
43
48
44 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
49 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
45
50
46 2007-09-06 Ville Vainio <vivainio@gmail.com>
51 2007-09-06 Ville Vainio <vivainio@gmail.com>
47
52
48 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
53 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
49 Callable aliases now pass the _ip as first arg. This breaks
54 Callable aliases now pass the _ip as first arg. This breaks
50 compatibility with earlier 0.8.2.svn series! (though they should
55 compatibility with earlier 0.8.2.svn series! (though they should
51 not have been in use yet outside these few extensions)
56 not have been in use yet outside these few extensions)
52
57
53 2007-09-05 Ville Vainio <vivainio@gmail.com>
58 2007-09-05 Ville Vainio <vivainio@gmail.com>
54
59
55 * external/mglob.py: expand('dirname') => ['dirname'], instead
60 * external/mglob.py: expand('dirname') => ['dirname'], instead
56 of ['dirname/foo','dirname/bar', ...].
61 of ['dirname/foo','dirname/bar', ...].
57
62
58 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
63 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
59 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
64 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
60 is useful for others as well).
65 is useful for others as well).
61
66
62 * iplib.py: on callable aliases (as opposed to old style aliases),
67 * iplib.py: on callable aliases (as opposed to old style aliases),
63 do var_expand() immediately, and use make_quoted_expr instead
68 do var_expand() immediately, and use make_quoted_expr instead
64 of hardcoded r"""
69 of hardcoded r"""
65
70
66 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
71 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
67 if not available load ipy_fsops.py for cp, mv, etc. replacements
72 if not available load ipy_fsops.py for cp, mv, etc. replacements
68
73
69 * OInspect.py, ipy_which.py: improve %which and obj? for callable
74 * OInspect.py, ipy_which.py: improve %which and obj? for callable
70 aliases
75 aliases
71
76
72 2007-09-04 Ville Vainio <vivainio@gmail.com>
77 2007-09-04 Ville Vainio <vivainio@gmail.com>
73
78
74 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
79 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
75 Relicensed under BSD with the authors approval.
80 Relicensed under BSD with the authors approval.
76
81
77 * ipmaker.py, usage.py: Remove %magic from default banner, improve
82 * ipmaker.py, usage.py: Remove %magic from default banner, improve
78 %quickref
83 %quickref
79
84
80 2007-09-03 Ville Vainio <vivainio@gmail.com>
85 2007-09-03 Ville Vainio <vivainio@gmail.com>
81
86
82 * Magic.py: %time now passes expression through prefilter,
87 * Magic.py: %time now passes expression through prefilter,
83 allowing IPython syntax.
88 allowing IPython syntax.
84
89
85 2007-09-01 Ville Vainio <vivainio@gmail.com>
90 2007-09-01 Ville Vainio <vivainio@gmail.com>
86
91
87 * ipmaker.py: Always show full traceback when newstyle config fails
92 * ipmaker.py: Always show full traceback when newstyle config fails
88
93
89 2007-08-27 Ville Vainio <vivainio@gmail.com>
94 2007-08-27 Ville Vainio <vivainio@gmail.com>
90
95
91 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
96 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
92
97
93 2007-08-26 Ville Vainio <vivainio@gmail.com>
98 2007-08-26 Ville Vainio <vivainio@gmail.com>
94
99
95 * ipmaker.py: Command line args have the highest priority again
100 * ipmaker.py: Command line args have the highest priority again
96
101
97 * iplib.py, ipmaker.py: -i command line argument now behaves as in
102 * iplib.py, ipmaker.py: -i command line argument now behaves as in
98 normal python, i.e. leaves the IPython session running after -c
103 normal python, i.e. leaves the IPython session running after -c
99 command or running a batch file from command line.
104 command or running a batch file from command line.
100
105
101 2007-08-22 Ville Vainio <vivainio@gmail.com>
106 2007-08-22 Ville Vainio <vivainio@gmail.com>
102
107
103 * iplib.py: no extra empty (last) line in raw hist w/ multiline
108 * iplib.py: no extra empty (last) line in raw hist w/ multiline
104 statements
109 statements
105
110
106 * logger.py: Fix bug where blank lines in history were not
111 * logger.py: Fix bug where blank lines in history were not
107 added until AFTER adding the current line; translated and raw
112 added until AFTER adding the current line; translated and raw
108 history should finally be in sync with prompt now.
113 history should finally be in sync with prompt now.
109
114
110 * ipy_completers.py: quick_completer now makes it easy to create
115 * ipy_completers.py: quick_completer now makes it easy to create
111 trivial custom completers
116 trivial custom completers
112
117
113 * clearcmd.py: shadow history compression & erasing, fixed input hist
118 * clearcmd.py: shadow history compression & erasing, fixed input hist
114 clearing.
119 clearing.
115
120
116 * envpersist.py, history.py: %env (sh profile only), %hist completers
121 * envpersist.py, history.py: %env (sh profile only), %hist completers
117
122
118 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
123 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
119 term title now include the drive letter, and always use / instead of
124 term title now include the drive letter, and always use / instead of
120 os.sep (as per recommended approach for win32 ipython in general).
125 os.sep (as per recommended approach for win32 ipython in general).
121
126
122 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
127 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
123 plain python scripts from ipykit command line by running
128 plain python scripts from ipykit command line by running
124 "py myscript.py", even w/o installed python.
129 "py myscript.py", even w/o installed python.
125
130
126 2007-08-21 Ville Vainio <vivainio@gmail.com>
131 2007-08-21 Ville Vainio <vivainio@gmail.com>
127
132
128 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
133 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
129 (for backwards compatibility)
134 (for backwards compatibility)
130
135
131 * history.py: switch back to %hist -t from %hist -r as default.
136 * history.py: switch back to %hist -t from %hist -r as default.
132 At least until raw history is fixed for good.
137 At least until raw history is fixed for good.
133
138
134 2007-08-20 Ville Vainio <vivainio@gmail.com>
139 2007-08-20 Ville Vainio <vivainio@gmail.com>
135
140
136 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
141 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
137 locate alias redeclarations etc. Also, avoid handling
142 locate alias redeclarations etc. Also, avoid handling
138 _ip.IP.alias_table directly, prefer using _ip.defalias.
143 _ip.IP.alias_table directly, prefer using _ip.defalias.
139
144
140
145
141 2007-08-15 Ville Vainio <vivainio@gmail.com>
146 2007-08-15 Ville Vainio <vivainio@gmail.com>
142
147
143 * prefilter.py: ! is now always served first
148 * prefilter.py: ! is now always served first
144
149
145 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
150 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
146
151
147 * IPython/iplib.py (safe_execfile): fix the SystemExit
152 * IPython/iplib.py (safe_execfile): fix the SystemExit
148 auto-suppression code to work in Python2.4 (the internal structure
153 auto-suppression code to work in Python2.4 (the internal structure
149 of that exception changed and I'd only tested the code with 2.5).
154 of that exception changed and I'd only tested the code with 2.5).
150 Bug reported by a SciPy attendee.
155 Bug reported by a SciPy attendee.
151
156
152 2007-08-13 Ville Vainio <vivainio@gmail.com>
157 2007-08-13 Ville Vainio <vivainio@gmail.com>
153
158
154 * prefilter.py: reverted !c:/bin/foo fix, made % in
159 * prefilter.py: reverted !c:/bin/foo fix, made % in
155 multiline specials work again
160 multiline specials work again
156
161
157 2007-08-13 Ville Vainio <vivainio@gmail.com>
162 2007-08-13 Ville Vainio <vivainio@gmail.com>
158
163
159 * prefilter.py: Take more care to special-case !, so that
164 * prefilter.py: Take more care to special-case !, so that
160 !c:/bin/foo.exe works.
165 !c:/bin/foo.exe works.
161
166
162 * setup.py: if we are building eggs, strip all docs and
167 * setup.py: if we are building eggs, strip all docs and
163 examples (it doesn't make sense to bytecompile examples,
168 examples (it doesn't make sense to bytecompile examples,
164 and docs would be in an awkward place anyway).
169 and docs would be in an awkward place anyway).
165
170
166 * Ryan Krauss' patch fixes start menu shortcuts when IPython
171 * Ryan Krauss' patch fixes start menu shortcuts when IPython
167 is installed into a directory that has spaces in the name.
172 is installed into a directory that has spaces in the name.
168
173
169 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
174 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
170
175
171 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
176 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
172 doctest profile and %doctest_mode, so they actually generate the
177 doctest profile and %doctest_mode, so they actually generate the
173 blank lines needed by doctest to separate individual tests.
178 blank lines needed by doctest to separate individual tests.
174
179
175 * IPython/iplib.py (safe_execfile): modify so that running code
180 * IPython/iplib.py (safe_execfile): modify so that running code
176 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
181 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
177 doesn't get a printed traceback. Any other value in sys.exit(),
182 doesn't get a printed traceback. Any other value in sys.exit(),
178 including the empty call, still generates a traceback. This
183 including the empty call, still generates a traceback. This
179 enables use of %run without having to pass '-e' for codes that
184 enables use of %run without having to pass '-e' for codes that
180 correctly set the exit status flag.
185 correctly set the exit status flag.
181
186
182 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
187 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
183
188
184 * IPython/iplib.py (InteractiveShell.post_config_initialization):
189 * IPython/iplib.py (InteractiveShell.post_config_initialization):
185 fix problems with doctests failing when run inside IPython due to
190 fix problems with doctests failing when run inside IPython due to
186 IPython's modifications of sys.displayhook.
191 IPython's modifications of sys.displayhook.
187
192
188 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
193 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
189
194
190 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
195 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
191 a string with names.
196 a string with names.
192
197
193 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
198 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
194
199
195 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
200 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
196 magic to toggle on/off the doctest pasting support without having
201 magic to toggle on/off the doctest pasting support without having
197 to leave a session to switch to a separate profile.
202 to leave a session to switch to a separate profile.
198
203
199 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
204 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
200
205
201 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
206 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
202 introduce a blank line between inputs, to conform to doctest
207 introduce a blank line between inputs, to conform to doctest
203 requirements.
208 requirements.
204
209
205 * IPython/OInspect.py (Inspector.pinfo): fix another part where
210 * IPython/OInspect.py (Inspector.pinfo): fix another part where
206 auto-generated docstrings for new-style classes were showing up.
211 auto-generated docstrings for new-style classes were showing up.
207
212
208 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
213 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
209
214
210 * api_changes: Add new file to track backward-incompatible
215 * api_changes: Add new file to track backward-incompatible
211 user-visible changes.
216 user-visible changes.
212
217
213 2007-08-06 Ville Vainio <vivainio@gmail.com>
218 2007-08-06 Ville Vainio <vivainio@gmail.com>
214
219
215 * ipmaker.py: fix bug where user_config_ns didn't exist at all
220 * ipmaker.py: fix bug where user_config_ns didn't exist at all
216 before all the config files were handled.
221 before all the config files were handled.
217
222
218 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
223 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
219
224
220 * IPython/irunner.py (RunnerFactory): Add new factory class for
225 * IPython/irunner.py (RunnerFactory): Add new factory class for
221 creating reusable runners based on filenames.
226 creating reusable runners based on filenames.
222
227
223 * IPython/Extensions/ipy_profile_doctest.py: New profile for
228 * IPython/Extensions/ipy_profile_doctest.py: New profile for
224 doctest support. It sets prompts/exceptions as similar to
229 doctest support. It sets prompts/exceptions as similar to
225 standard Python as possible, so that ipython sessions in this
230 standard Python as possible, so that ipython sessions in this
226 profile can be easily pasted as doctests with minimal
231 profile can be easily pasted as doctests with minimal
227 modifications. It also enables pasting of doctests from external
232 modifications. It also enables pasting of doctests from external
228 sources (even if they have leading whitespace), so that you can
233 sources (even if they have leading whitespace), so that you can
229 rerun doctests from existing sources.
234 rerun doctests from existing sources.
230
235
231 * IPython/iplib.py (_prefilter): fix a buglet where after entering
236 * IPython/iplib.py (_prefilter): fix a buglet where after entering
232 some whitespace, the prompt would become a continuation prompt
237 some whitespace, the prompt would become a continuation prompt
233 with no way of exiting it other than Ctrl-C. This fix brings us
238 with no way of exiting it other than Ctrl-C. This fix brings us
234 into conformity with how the default python prompt works.
239 into conformity with how the default python prompt works.
235
240
236 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
241 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
237 Add support for pasting not only lines that start with '>>>', but
242 Add support for pasting not only lines that start with '>>>', but
238 also with ' >>>'. That is, arbitrary whitespace can now precede
243 also with ' >>>'. That is, arbitrary whitespace can now precede
239 the prompts. This makes the system useful for pasting doctests
244 the prompts. This makes the system useful for pasting doctests
240 from docstrings back into a normal session.
245 from docstrings back into a normal session.
241
246
242 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
247 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
243
248
244 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
249 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
245 r1357, which had killed multiple invocations of an embedded
250 r1357, which had killed multiple invocations of an embedded
246 ipython (this means that example-embed has been broken for over 1
251 ipython (this means that example-embed has been broken for over 1
247 year!!!). Rather than possibly breaking the batch stuff for which
252 year!!!). Rather than possibly breaking the batch stuff for which
248 the code in iplib.py/interact was introduced, I worked around the
253 the code in iplib.py/interact was introduced, I worked around the
249 problem in the embedding class in Shell.py. We really need a
254 problem in the embedding class in Shell.py. We really need a
250 bloody test suite for this code, I'm sick of finding stuff that
255 bloody test suite for this code, I'm sick of finding stuff that
251 used to work breaking left and right every time I use an old
256 used to work breaking left and right every time I use an old
252 feature I hadn't touched in a few months.
257 feature I hadn't touched in a few months.
253 (kill_embedded): Add a new magic that only shows up in embedded
258 (kill_embedded): Add a new magic that only shows up in embedded
254 mode, to allow users to permanently deactivate an embedded instance.
259 mode, to allow users to permanently deactivate an embedded instance.
255
260
256 2007-08-01 Ville Vainio <vivainio@gmail.com>
261 2007-08-01 Ville Vainio <vivainio@gmail.com>
257
262
258 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
263 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
259 history gets out of sync on runlines (e.g. when running macros).
264 history gets out of sync on runlines (e.g. when running macros).
260
265
261 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
266 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
262
267
263 * IPython/Magic.py (magic_colors): fix win32-related error message
268 * IPython/Magic.py (magic_colors): fix win32-related error message
264 that could appear under *nix when readline was missing. Patch by
269 that could appear under *nix when readline was missing. Patch by
265 Scott Jackson, closes #175.
270 Scott Jackson, closes #175.
266
271
267 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
272 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
268
273
269 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
274 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
270 completer that it traits-aware, so that traits objects don't show
275 completer that it traits-aware, so that traits objects don't show
271 all of their internal attributes all the time.
276 all of their internal attributes all the time.
272
277
273 * IPython/genutils.py (dir2): moved this code from inside
278 * IPython/genutils.py (dir2): moved this code from inside
274 completer.py to expose it publicly, so I could use it in the
279 completer.py to expose it publicly, so I could use it in the
275 wildcards bugfix.
280 wildcards bugfix.
276
281
277 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
282 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
278 Stefan with Traits.
283 Stefan with Traits.
279
284
280 * IPython/completer.py (Completer.attr_matches): change internal
285 * IPython/completer.py (Completer.attr_matches): change internal
281 var name from 'object' to 'obj', since 'object' is now a builtin
286 var name from 'object' to 'obj', since 'object' is now a builtin
282 and this can lead to weird bugs if reusing this code elsewhere.
287 and this can lead to weird bugs if reusing this code elsewhere.
283
288
284 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
289 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
285
290
286 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
291 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
287 'foo?' and update the code to prevent printing of default
292 'foo?' and update the code to prevent printing of default
288 docstrings that started appearing after I added support for
293 docstrings that started appearing after I added support for
289 new-style classes. The approach I'm using isn't ideal (I just
294 new-style classes. The approach I'm using isn't ideal (I just
290 special-case those strings) but I'm not sure how to more robustly
295 special-case those strings) but I'm not sure how to more robustly
291 differentiate between truly user-written strings and Python's
296 differentiate between truly user-written strings and Python's
292 automatic ones.
297 automatic ones.
293
298
294 2007-07-09 Ville Vainio <vivainio@gmail.com>
299 2007-07-09 Ville Vainio <vivainio@gmail.com>
295
300
296 * completer.py: Applied Matthew Neeley's patch:
301 * completer.py: Applied Matthew Neeley's patch:
297 Dynamic attributes from trait_names and _getAttributeNames are added
302 Dynamic attributes from trait_names and _getAttributeNames are added
298 to the list of tab completions, but when this happens, the attribute
303 to the list of tab completions, but when this happens, the attribute
299 list is turned into a set, so the attributes are unordered when
304 list is turned into a set, so the attributes are unordered when
300 printed, which makes it hard to find the right completion. This patch
305 printed, which makes it hard to find the right completion. This patch
301 turns this set back into a list and sort it.
306 turns this set back into a list and sort it.
302
307
303 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
308 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
304
309
305 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
310 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
306 classes in various inspector functions.
311 classes in various inspector functions.
307
312
308 2007-06-28 Ville Vainio <vivainio@gmail.com>
313 2007-06-28 Ville Vainio <vivainio@gmail.com>
309
314
310 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
315 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
311 Implement "shadow" namespace, and callable aliases that reside there.
316 Implement "shadow" namespace, and callable aliases that reside there.
312 Use them by:
317 Use them by:
313
318
314 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
319 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
315
320
316 foo hello world
321 foo hello world
317 (gets translated to:)
322 (gets translated to:)
318 _sh.foo(r"""hello world""")
323 _sh.foo(r"""hello world""")
319
324
320 In practice, this kind of alias can take the role of a magic function
325 In practice, this kind of alias can take the role of a magic function
321
326
322 * New generic inspect_object, called on obj? and obj??
327 * New generic inspect_object, called on obj? and obj??
323
328
324 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
329 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
325
330
326 * IPython/ultraTB.py (findsource): fix a problem with
331 * IPython/ultraTB.py (findsource): fix a problem with
327 inspect.getfile that can cause crashes during traceback construction.
332 inspect.getfile that can cause crashes during traceback construction.
328
333
329 2007-06-14 Ville Vainio <vivainio@gmail.com>
334 2007-06-14 Ville Vainio <vivainio@gmail.com>
330
335
331 * iplib.py (handle_auto): Try to use ascii for printing "--->"
336 * iplib.py (handle_auto): Try to use ascii for printing "--->"
332 autocall rewrite indication, becausesometimes unicode fails to print
337 autocall rewrite indication, becausesometimes unicode fails to print
333 properly (and you get ' - - - '). Use plain uncoloured ---> for
338 properly (and you get ' - - - '). Use plain uncoloured ---> for
334 unicode.
339 unicode.
335
340
336 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
341 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
337
342
338 . pickleshare 'hash' commands (hget, hset, hcompress,
343 . pickleshare 'hash' commands (hget, hset, hcompress,
339 hdict) for efficient shadow history storage.
344 hdict) for efficient shadow history storage.
340
345
341 2007-06-13 Ville Vainio <vivainio@gmail.com>
346 2007-06-13 Ville Vainio <vivainio@gmail.com>
342
347
343 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
348 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
344 Added kw arg 'interactive', tell whether vars should be visible
349 Added kw arg 'interactive', tell whether vars should be visible
345 with %whos.
350 with %whos.
346
351
347 2007-06-11 Ville Vainio <vivainio@gmail.com>
352 2007-06-11 Ville Vainio <vivainio@gmail.com>
348
353
349 * pspersistence.py, Magic.py, iplib.py: directory history now saved
354 * pspersistence.py, Magic.py, iplib.py: directory history now saved
350 to db
355 to db
351
356
352 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
357 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
353 Also, it exits IPython immediately after evaluating the command (just like
358 Also, it exits IPython immediately after evaluating the command (just like
354 std python)
359 std python)
355
360
356 2007-06-05 Walter Doerwald <walter@livinglogic.de>
361 2007-06-05 Walter Doerwald <walter@livinglogic.de>
357
362
358 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
363 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
359 Python string and captures the output. (Idea and original patch by
364 Python string and captures the output. (Idea and original patch by
360 Stefan van der Walt)
365 Stefan van der Walt)
361
366
362 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
367 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
363
368
364 * IPython/ultraTB.py (VerboseTB.text): update printing of
369 * IPython/ultraTB.py (VerboseTB.text): update printing of
365 exception types for Python 2.5 (now all exceptions in the stdlib
370 exception types for Python 2.5 (now all exceptions in the stdlib
366 are new-style classes).
371 are new-style classes).
367
372
368 2007-05-31 Walter Doerwald <walter@livinglogic.de>
373 2007-05-31 Walter Doerwald <walter@livinglogic.de>
369
374
370 * IPython/Extensions/igrid.py: Add new commands refresh and
375 * IPython/Extensions/igrid.py: Add new commands refresh and
371 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
376 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
372 the iterator once (refresh) or after every x seconds (refresh_timer).
377 the iterator once (refresh) or after every x seconds (refresh_timer).
373 Add a working implementation of "searchexpression", where the text
378 Add a working implementation of "searchexpression", where the text
374 entered is not the text to search for, but an expression that must
379 entered is not the text to search for, but an expression that must
375 be true. Added display of shortcuts to the menu. Added commands "pickinput"
380 be true. Added display of shortcuts to the menu. Added commands "pickinput"
376 and "pickinputattr" that put the object or attribute under the cursor
381 and "pickinputattr" that put the object or attribute under the cursor
377 in the input line. Split the statusbar to be able to display the currently
382 in the input line. Split the statusbar to be able to display the currently
378 active refresh interval. (Patch by Nik Tautenhahn)
383 active refresh interval. (Patch by Nik Tautenhahn)
379
384
380 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
385 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
381
386
382 * fixing set_term_title to use ctypes as default
387 * fixing set_term_title to use ctypes as default
383
388
384 * fixing set_term_title fallback to work when curent dir
389 * fixing set_term_title fallback to work when curent dir
385 is on a windows network share
390 is on a windows network share
386
391
387 2007-05-28 Ville Vainio <vivainio@gmail.com>
392 2007-05-28 Ville Vainio <vivainio@gmail.com>
388
393
389 * %cpaste: strip + with > from left (diffs).
394 * %cpaste: strip + with > from left (diffs).
390
395
391 * iplib.py: Fix crash when readline not installed
396 * iplib.py: Fix crash when readline not installed
392
397
393 2007-05-26 Ville Vainio <vivainio@gmail.com>
398 2007-05-26 Ville Vainio <vivainio@gmail.com>
394
399
395 * generics.py: intruduce easy to extend result_display generic
400 * generics.py: intruduce easy to extend result_display generic
396 function (using simplegeneric.py).
401 function (using simplegeneric.py).
397
402
398 * Fixed the append functionality of %set.
403 * Fixed the append functionality of %set.
399
404
400 2007-05-25 Ville Vainio <vivainio@gmail.com>
405 2007-05-25 Ville Vainio <vivainio@gmail.com>
401
406
402 * New magic: %rep (fetch / run old commands from history)
407 * New magic: %rep (fetch / run old commands from history)
403
408
404 * New extension: mglob (%mglob magic), for powerful glob / find /filter
409 * New extension: mglob (%mglob magic), for powerful glob / find /filter
405 like functionality
410 like functionality
406
411
407 % maghistory.py: %hist -g PATTERM greps the history for pattern
412 % maghistory.py: %hist -g PATTERM greps the history for pattern
408
413
409 2007-05-24 Walter Doerwald <walter@livinglogic.de>
414 2007-05-24 Walter Doerwald <walter@livinglogic.de>
410
415
411 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
416 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
412 browse the IPython input history
417 browse the IPython input history
413
418
414 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
419 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
415 (mapped to "i") can be used to put the object under the curser in the input
420 (mapped to "i") can be used to put the object under the curser in the input
416 line. pickinputattr (mapped to "I") does the same for the attribute under
421 line. pickinputattr (mapped to "I") does the same for the attribute under
417 the cursor.
422 the cursor.
418
423
419 2007-05-24 Ville Vainio <vivainio@gmail.com>
424 2007-05-24 Ville Vainio <vivainio@gmail.com>
420
425
421 * Grand magic cleansing (changeset [2380]):
426 * Grand magic cleansing (changeset [2380]):
422
427
423 * Introduce ipy_legacy.py where the following magics were
428 * Introduce ipy_legacy.py where the following magics were
424 moved:
429 moved:
425
430
426 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
431 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
427
432
428 If you need them, either use default profile or "import ipy_legacy"
433 If you need them, either use default profile or "import ipy_legacy"
429 in your ipy_user_conf.py
434 in your ipy_user_conf.py
430
435
431 * Move sh and scipy profile to Extensions from UserConfig. this implies
436 * Move sh and scipy profile to Extensions from UserConfig. this implies
432 you should not edit them, but you don't need to run %upgrade when
437 you should not edit them, but you don't need to run %upgrade when
433 upgrading IPython anymore.
438 upgrading IPython anymore.
434
439
435 * %hist/%history now operates in "raw" mode by default. To get the old
440 * %hist/%history now operates in "raw" mode by default. To get the old
436 behaviour, run '%hist -n' (native mode).
441 behaviour, run '%hist -n' (native mode).
437
442
438 * split ipy_stock_completers.py to ipy_stock_completers.py and
443 * split ipy_stock_completers.py to ipy_stock_completers.py and
439 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
444 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
440 installed as default.
445 installed as default.
441
446
442 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
447 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
443 handling.
448 handling.
444
449
445 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
450 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
446 input if readline is available.
451 input if readline is available.
447
452
448 2007-05-23 Ville Vainio <vivainio@gmail.com>
453 2007-05-23 Ville Vainio <vivainio@gmail.com>
449
454
450 * macro.py: %store uses __getstate__ properly
455 * macro.py: %store uses __getstate__ properly
451
456
452 * exesetup.py: added new setup script for creating
457 * exesetup.py: added new setup script for creating
453 standalone IPython executables with py2exe (i.e.
458 standalone IPython executables with py2exe (i.e.
454 no python installation required).
459 no python installation required).
455
460
456 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
461 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
457 its place.
462 its place.
458
463
459 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
464 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
460
465
461 2007-05-21 Ville Vainio <vivainio@gmail.com>
466 2007-05-21 Ville Vainio <vivainio@gmail.com>
462
467
463 * platutil_win32.py (set_term_title): handle
468 * platutil_win32.py (set_term_title): handle
464 failure of 'title' system call properly.
469 failure of 'title' system call properly.
465
470
466 2007-05-17 Walter Doerwald <walter@livinglogic.de>
471 2007-05-17 Walter Doerwald <walter@livinglogic.de>
467
472
468 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
473 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
469 (Bug detected by Paul Mueller).
474 (Bug detected by Paul Mueller).
470
475
471 2007-05-16 Ville Vainio <vivainio@gmail.com>
476 2007-05-16 Ville Vainio <vivainio@gmail.com>
472
477
473 * ipy_profile_sci.py, ipython_win_post_install.py: Create
478 * ipy_profile_sci.py, ipython_win_post_install.py: Create
474 new "sci" profile, effectively a modern version of the old
479 new "sci" profile, effectively a modern version of the old
475 "scipy" profile (which is now slated for deprecation).
480 "scipy" profile (which is now slated for deprecation).
476
481
477 2007-05-15 Ville Vainio <vivainio@gmail.com>
482 2007-05-15 Ville Vainio <vivainio@gmail.com>
478
483
479 * pycolorize.py, pycolor.1: Paul Mueller's patches that
484 * pycolorize.py, pycolor.1: Paul Mueller's patches that
480 make pycolorize read input from stdin when run without arguments.
485 make pycolorize read input from stdin when run without arguments.
481
486
482 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
487 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
483
488
484 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
489 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
485 it in sh profile (instead of ipy_system_conf.py).
490 it in sh profile (instead of ipy_system_conf.py).
486
491
487 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
492 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
488 aliases are now lower case on windows (MyCommand.exe => mycommand).
493 aliases are now lower case on windows (MyCommand.exe => mycommand).
489
494
490 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
495 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
491 Macros are now callable objects that inherit from ipapi.IPyAutocall,
496 Macros are now callable objects that inherit from ipapi.IPyAutocall,
492 i.e. get autocalled regardless of system autocall setting.
497 i.e. get autocalled regardless of system autocall setting.
493
498
494 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
499 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
495
500
496 * IPython/rlineimpl.py: check for clear_history in readline and
501 * IPython/rlineimpl.py: check for clear_history in readline and
497 make it a dummy no-op if not available. This function isn't
502 make it a dummy no-op if not available. This function isn't
498 guaranteed to be in the API and appeared in Python 2.4, so we need
503 guaranteed to be in the API and appeared in Python 2.4, so we need
499 to check it ourselves. Also, clean up this file quite a bit.
504 to check it ourselves. Also, clean up this file quite a bit.
500
505
501 * ipython.1: update man page and full manual with information
506 * ipython.1: update man page and full manual with information
502 about threads (remove outdated warning). Closes #151.
507 about threads (remove outdated warning). Closes #151.
503
508
504 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
509 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
505
510
506 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
511 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
507 in trunk (note that this made it into the 0.8.1 release already,
512 in trunk (note that this made it into the 0.8.1 release already,
508 but the changelogs didn't get coordinated). Many thanks to Gael
513 but the changelogs didn't get coordinated). Many thanks to Gael
509 Varoquaux <gael.varoquaux-AT-normalesup.org>
514 Varoquaux <gael.varoquaux-AT-normalesup.org>
510
515
511 2007-05-09 *** Released version 0.8.1
516 2007-05-09 *** Released version 0.8.1
512
517
513 2007-05-10 Walter Doerwald <walter@livinglogic.de>
518 2007-05-10 Walter Doerwald <walter@livinglogic.de>
514
519
515 * IPython/Extensions/igrid.py: Incorporate html help into
520 * IPython/Extensions/igrid.py: Incorporate html help into
516 the module, so we don't have to search for the file.
521 the module, so we don't have to search for the file.
517
522
518 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
523 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
519
524
520 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
525 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
521
526
522 2007-04-30 Ville Vainio <vivainio@gmail.com>
527 2007-04-30 Ville Vainio <vivainio@gmail.com>
523
528
524 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
529 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
525 user has illegal (non-ascii) home directory name
530 user has illegal (non-ascii) home directory name
526
531
527 2007-04-27 Ville Vainio <vivainio@gmail.com>
532 2007-04-27 Ville Vainio <vivainio@gmail.com>
528
533
529 * platutils_win32.py: implement set_term_title for windows
534 * platutils_win32.py: implement set_term_title for windows
530
535
531 * Update version number
536 * Update version number
532
537
533 * ipy_profile_sh.py: more informative prompt (2 dir levels)
538 * ipy_profile_sh.py: more informative prompt (2 dir levels)
534
539
535 2007-04-26 Walter Doerwald <walter@livinglogic.de>
540 2007-04-26 Walter Doerwald <walter@livinglogic.de>
536
541
537 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
542 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
538 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
543 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
539 bug discovered by Ville).
544 bug discovered by Ville).
540
545
541 2007-04-26 Ville Vainio <vivainio@gmail.com>
546 2007-04-26 Ville Vainio <vivainio@gmail.com>
542
547
543 * Extensions/ipy_completers.py: Olivier's module completer now
548 * Extensions/ipy_completers.py: Olivier's module completer now
544 saves the list of root modules if it takes > 4 secs on the first run.
549 saves the list of root modules if it takes > 4 secs on the first run.
545
550
546 * Magic.py (%rehashx): %rehashx now clears the completer cache
551 * Magic.py (%rehashx): %rehashx now clears the completer cache
547
552
548
553
549 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
554 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
550
555
551 * ipython.el: fix incorrect color scheme, reported by Stefan.
556 * ipython.el: fix incorrect color scheme, reported by Stefan.
552 Closes #149.
557 Closes #149.
553
558
554 * IPython/PyColorize.py (Parser.format2): fix state-handling
559 * IPython/PyColorize.py (Parser.format2): fix state-handling
555 logic. I still don't like how that code handles state, but at
560 logic. I still don't like how that code handles state, but at
556 least now it should be correct, if inelegant. Closes #146.
561 least now it should be correct, if inelegant. Closes #146.
557
562
558 2007-04-25 Ville Vainio <vivainio@gmail.com>
563 2007-04-25 Ville Vainio <vivainio@gmail.com>
559
564
560 * Extensions/ipy_which.py: added extension for %which magic, works
565 * Extensions/ipy_which.py: added extension for %which magic, works
561 a lot like unix 'which' but also finds and expands aliases, and
566 a lot like unix 'which' but also finds and expands aliases, and
562 allows wildcards.
567 allows wildcards.
563
568
564 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
569 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
565 as opposed to returning nothing.
570 as opposed to returning nothing.
566
571
567 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
572 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
568 ipy_stock_completers on default profile, do import on sh profile.
573 ipy_stock_completers on default profile, do import on sh profile.
569
574
570 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
575 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
571
576
572 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
577 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
573 like ipython.py foo.py which raised a IndexError.
578 like ipython.py foo.py which raised a IndexError.
574
579
575 2007-04-21 Ville Vainio <vivainio@gmail.com>
580 2007-04-21 Ville Vainio <vivainio@gmail.com>
576
581
577 * Extensions/ipy_extutil.py: added extension to manage other ipython
582 * Extensions/ipy_extutil.py: added extension to manage other ipython
578 extensions. Now only supports 'ls' == list extensions.
583 extensions. Now only supports 'ls' == list extensions.
579
584
580 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
585 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
581
586
582 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
587 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
583 would prevent use of the exception system outside of a running
588 would prevent use of the exception system outside of a running
584 IPython instance.
589 IPython instance.
585
590
586 2007-04-20 Ville Vainio <vivainio@gmail.com>
591 2007-04-20 Ville Vainio <vivainio@gmail.com>
587
592
588 * Extensions/ipy_render.py: added extension for easy
593 * Extensions/ipy_render.py: added extension for easy
589 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
594 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
590 'Iptl' template notation,
595 'Iptl' template notation,
591
596
592 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
597 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
593 safer & faster 'import' completer.
598 safer & faster 'import' completer.
594
599
595 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
600 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
596 and _ip.defalias(name, command).
601 and _ip.defalias(name, command).
597
602
598 * Extensions/ipy_exportdb.py: New extension for exporting all the
603 * Extensions/ipy_exportdb.py: New extension for exporting all the
599 %store'd data in a portable format (normal ipapi calls like
604 %store'd data in a portable format (normal ipapi calls like
600 defmacro() etc.)
605 defmacro() etc.)
601
606
602 2007-04-19 Ville Vainio <vivainio@gmail.com>
607 2007-04-19 Ville Vainio <vivainio@gmail.com>
603
608
604 * upgrade_dir.py: skip junk files like *.pyc
609 * upgrade_dir.py: skip junk files like *.pyc
605
610
606 * Release.py: version number to 0.8.1
611 * Release.py: version number to 0.8.1
607
612
608 2007-04-18 Ville Vainio <vivainio@gmail.com>
613 2007-04-18 Ville Vainio <vivainio@gmail.com>
609
614
610 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
615 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
611 and later on win32.
616 and later on win32.
612
617
613 2007-04-16 Ville Vainio <vivainio@gmail.com>
618 2007-04-16 Ville Vainio <vivainio@gmail.com>
614
619
615 * iplib.py (showtraceback): Do not crash when running w/o readline.
620 * iplib.py (showtraceback): Do not crash when running w/o readline.
616
621
617 2007-04-12 Walter Doerwald <walter@livinglogic.de>
622 2007-04-12 Walter Doerwald <walter@livinglogic.de>
618
623
619 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
624 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
620 sorted (case sensitive with files and dirs mixed).
625 sorted (case sensitive with files and dirs mixed).
621
626
622 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
627 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
623
628
624 * IPython/Release.py (version): Open trunk for 0.8.1 development.
629 * IPython/Release.py (version): Open trunk for 0.8.1 development.
625
630
626 2007-04-10 *** Released version 0.8.0
631 2007-04-10 *** Released version 0.8.0
627
632
628 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
633 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
629
634
630 * Tag 0.8.0 for release.
635 * Tag 0.8.0 for release.
631
636
632 * IPython/iplib.py (reloadhist): add API function to cleanly
637 * IPython/iplib.py (reloadhist): add API function to cleanly
633 reload the readline history, which was growing inappropriately on
638 reload the readline history, which was growing inappropriately on
634 every %run call.
639 every %run call.
635
640
636 * win32_manual_post_install.py (run): apply last part of Nicolas
641 * win32_manual_post_install.py (run): apply last part of Nicolas
637 Pernetty's patch (I'd accidentally applied it in a different
642 Pernetty's patch (I'd accidentally applied it in a different
638 directory and this particular file didn't get patched).
643 directory and this particular file didn't get patched).
639
644
640 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
645 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
641
646
642 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
647 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
643 find the main thread id and use the proper API call. Thanks to
648 find the main thread id and use the proper API call. Thanks to
644 Stefan for the fix.
649 Stefan for the fix.
645
650
646 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
651 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
647 unit tests to reflect fixed ticket #52, and add more tests sent by
652 unit tests to reflect fixed ticket #52, and add more tests sent by
648 him.
653 him.
649
654
650 * IPython/iplib.py (raw_input): restore the readline completer
655 * IPython/iplib.py (raw_input): restore the readline completer
651 state on every input, in case third-party code messed it up.
656 state on every input, in case third-party code messed it up.
652 (_prefilter): revert recent addition of early-escape checks which
657 (_prefilter): revert recent addition of early-escape checks which
653 prevent many valid alias calls from working.
658 prevent many valid alias calls from working.
654
659
655 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
660 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
656 flag for sigint handler so we don't run a full signal() call on
661 flag for sigint handler so we don't run a full signal() call on
657 each runcode access.
662 each runcode access.
658
663
659 * IPython/Magic.py (magic_whos): small improvement to diagnostic
664 * IPython/Magic.py (magic_whos): small improvement to diagnostic
660 message.
665 message.
661
666
662 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
667 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
663
668
664 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
669 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
665 asynchronous exceptions working, i.e., Ctrl-C can actually
670 asynchronous exceptions working, i.e., Ctrl-C can actually
666 interrupt long-running code in the multithreaded shells.
671 interrupt long-running code in the multithreaded shells.
667
672
668 This is using Tomer Filiba's great ctypes-based trick:
673 This is using Tomer Filiba's great ctypes-based trick:
669 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
674 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
670 this in the past, but hadn't been able to make it work before. So
675 this in the past, but hadn't been able to make it work before. So
671 far it looks like it's actually running, but this needs more
676 far it looks like it's actually running, but this needs more
672 testing. If it really works, I'll be *very* happy, and we'll owe
677 testing. If it really works, I'll be *very* happy, and we'll owe
673 a huge thank you to Tomer. My current implementation is ugly,
678 a huge thank you to Tomer. My current implementation is ugly,
674 hackish and uses nasty globals, but I don't want to try and clean
679 hackish and uses nasty globals, but I don't want to try and clean
675 anything up until we know if it actually works.
680 anything up until we know if it actually works.
676
681
677 NOTE: this feature needs ctypes to work. ctypes is included in
682 NOTE: this feature needs ctypes to work. ctypes is included in
678 Python2.5, but 2.4 users will need to manually install it. This
683 Python2.5, but 2.4 users will need to manually install it. This
679 feature makes multi-threaded shells so much more usable that it's
684 feature makes multi-threaded shells so much more usable that it's
680 a minor price to pay (ctypes is very easy to install, already a
685 a minor price to pay (ctypes is very easy to install, already a
681 requirement for win32 and available in major linux distros).
686 requirement for win32 and available in major linux distros).
682
687
683 2007-04-04 Ville Vainio <vivainio@gmail.com>
688 2007-04-04 Ville Vainio <vivainio@gmail.com>
684
689
685 * Extensions/ipy_completers.py, ipy_stock_completers.py:
690 * Extensions/ipy_completers.py, ipy_stock_completers.py:
686 Moved implementations of 'bundled' completers to ipy_completers.py,
691 Moved implementations of 'bundled' completers to ipy_completers.py,
687 they are only enabled in ipy_stock_completers.py.
692 they are only enabled in ipy_stock_completers.py.
688
693
689 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
694 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
690
695
691 * IPython/PyColorize.py (Parser.format2): Fix identation of
696 * IPython/PyColorize.py (Parser.format2): Fix identation of
692 colorzied output and return early if color scheme is NoColor, to
697 colorzied output and return early if color scheme is NoColor, to
693 avoid unnecessary and expensive tokenization. Closes #131.
698 avoid unnecessary and expensive tokenization. Closes #131.
694
699
695 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
700 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
696
701
697 * IPython/Debugger.py: disable the use of pydb version 1.17. It
702 * IPython/Debugger.py: disable the use of pydb version 1.17. It
698 has a critical bug (a missing import that makes post-mortem not
703 has a critical bug (a missing import that makes post-mortem not
699 work at all). Unfortunately as of this time, this is the version
704 work at all). Unfortunately as of this time, this is the version
700 shipped with Ubuntu Edgy, so quite a few people have this one. I
705 shipped with Ubuntu Edgy, so quite a few people have this one. I
701 hope Edgy will update to a more recent package.
706 hope Edgy will update to a more recent package.
702
707
703 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
708 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
704
709
705 * IPython/iplib.py (_prefilter): close #52, second part of a patch
710 * IPython/iplib.py (_prefilter): close #52, second part of a patch
706 set by Stefan (only the first part had been applied before).
711 set by Stefan (only the first part had been applied before).
707
712
708 * IPython/Extensions/ipy_stock_completers.py (module_completer):
713 * IPython/Extensions/ipy_stock_completers.py (module_completer):
709 remove usage of the dangerous pkgutil.walk_packages(). See
714 remove usage of the dangerous pkgutil.walk_packages(). See
710 details in comments left in the code.
715 details in comments left in the code.
711
716
712 * IPython/Magic.py (magic_whos): add support for numpy arrays
717 * IPython/Magic.py (magic_whos): add support for numpy arrays
713 similar to what we had for Numeric.
718 similar to what we had for Numeric.
714
719
715 * IPython/completer.py (IPCompleter.complete): extend the
720 * IPython/completer.py (IPCompleter.complete): extend the
716 complete() call API to support completions by other mechanisms
721 complete() call API to support completions by other mechanisms
717 than readline. Closes #109.
722 than readline. Closes #109.
718
723
719 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
724 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
720 protect against a bug in Python's execfile(). Closes #123.
725 protect against a bug in Python's execfile(). Closes #123.
721
726
722 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
727 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
723
728
724 * IPython/iplib.py (split_user_input): ensure that when splitting
729 * IPython/iplib.py (split_user_input): ensure that when splitting
725 user input, the part that can be treated as a python name is pure
730 user input, the part that can be treated as a python name is pure
726 ascii (Python identifiers MUST be pure ascii). Part of the
731 ascii (Python identifiers MUST be pure ascii). Part of the
727 ongoing Unicode support work.
732 ongoing Unicode support work.
728
733
729 * IPython/Prompts.py (prompt_specials_color): Add \N for the
734 * IPython/Prompts.py (prompt_specials_color): Add \N for the
730 actual prompt number, without any coloring. This allows users to
735 actual prompt number, without any coloring. This allows users to
731 produce numbered prompts with their own colors. Added after a
736 produce numbered prompts with their own colors. Added after a
732 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
737 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
733
738
734 2007-03-31 Walter Doerwald <walter@livinglogic.de>
739 2007-03-31 Walter Doerwald <walter@livinglogic.de>
735
740
736 * IPython/Extensions/igrid.py: Map the return key
741 * IPython/Extensions/igrid.py: Map the return key
737 to enter() and shift-return to enterattr().
742 to enter() and shift-return to enterattr().
738
743
739 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
744 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
740
745
741 * IPython/Magic.py (magic_psearch): add unicode support by
746 * IPython/Magic.py (magic_psearch): add unicode support by
742 encoding to ascii the input, since this routine also only deals
747 encoding to ascii the input, since this routine also only deals
743 with valid Python names. Fixes a bug reported by Stefan.
748 with valid Python names. Fixes a bug reported by Stefan.
744
749
745 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
750 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
746
751
747 * IPython/Magic.py (_inspect): convert unicode input into ascii
752 * IPython/Magic.py (_inspect): convert unicode input into ascii
748 before trying to evaluate it as a Python identifier. This fixes a
753 before trying to evaluate it as a Python identifier. This fixes a
749 problem that the new unicode support had introduced when analyzing
754 problem that the new unicode support had introduced when analyzing
750 long definition lines for functions.
755 long definition lines for functions.
751
756
752 2007-03-24 Walter Doerwald <walter@livinglogic.de>
757 2007-03-24 Walter Doerwald <walter@livinglogic.de>
753
758
754 * IPython/Extensions/igrid.py: Fix picking. Using
759 * IPython/Extensions/igrid.py: Fix picking. Using
755 igrid with wxPython 2.6 and -wthread should work now.
760 igrid with wxPython 2.6 and -wthread should work now.
756 igrid.display() simply tries to create a frame without
761 igrid.display() simply tries to create a frame without
757 an application. Only if this fails an application is created.
762 an application. Only if this fails an application is created.
758
763
759 2007-03-23 Walter Doerwald <walter@livinglogic.de>
764 2007-03-23 Walter Doerwald <walter@livinglogic.de>
760
765
761 * IPython/Extensions/path.py: Updated to version 2.2.
766 * IPython/Extensions/path.py: Updated to version 2.2.
762
767
763 2007-03-23 Ville Vainio <vivainio@gmail.com>
768 2007-03-23 Ville Vainio <vivainio@gmail.com>
764
769
765 * iplib.py: recursive alias expansion now works better, so that
770 * iplib.py: recursive alias expansion now works better, so that
766 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
771 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
767 doesn't trip up the process, if 'd' has been aliased to 'ls'.
772 doesn't trip up the process, if 'd' has been aliased to 'ls'.
768
773
769 * Extensions/ipy_gnuglobal.py added, provides %global magic
774 * Extensions/ipy_gnuglobal.py added, provides %global magic
770 for users of http://www.gnu.org/software/global
775 for users of http://www.gnu.org/software/global
771
776
772 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
777 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
773 Closes #52. Patch by Stefan van der Walt.
778 Closes #52. Patch by Stefan van der Walt.
774
779
775 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
780 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
776
781
777 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
782 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
778 respect the __file__ attribute when using %run. Thanks to a bug
783 respect the __file__ attribute when using %run. Thanks to a bug
779 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
784 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
780
785
781 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
786 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
782
787
783 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
788 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
784 input. Patch sent by Stefan.
789 input. Patch sent by Stefan.
785
790
786 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
791 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
787 * IPython/Extensions/ipy_stock_completer.py
792 * IPython/Extensions/ipy_stock_completer.py
788 shlex_split, fix bug in shlex_split. len function
793 shlex_split, fix bug in shlex_split. len function
789 call was missing an if statement. Caused shlex_split to
794 call was missing an if statement. Caused shlex_split to
790 sometimes return "" as last element.
795 sometimes return "" as last element.
791
796
792 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
797 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
793
798
794 * IPython/completer.py
799 * IPython/completer.py
795 (IPCompleter.file_matches.single_dir_expand): fix a problem
800 (IPCompleter.file_matches.single_dir_expand): fix a problem
796 reported by Stefan, where directories containign a single subdir
801 reported by Stefan, where directories containign a single subdir
797 would be completed too early.
802 would be completed too early.
798
803
799 * IPython/Shell.py (_load_pylab): Make the execution of 'from
804 * IPython/Shell.py (_load_pylab): Make the execution of 'from
800 pylab import *' when -pylab is given be optional. A new flag,
805 pylab import *' when -pylab is given be optional. A new flag,
801 pylab_import_all controls this behavior, the default is True for
806 pylab_import_all controls this behavior, the default is True for
802 backwards compatibility.
807 backwards compatibility.
803
808
804 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
809 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
805 modified) R. Bernstein's patch for fully syntax highlighted
810 modified) R. Bernstein's patch for fully syntax highlighted
806 tracebacks. The functionality is also available under ultraTB for
811 tracebacks. The functionality is also available under ultraTB for
807 non-ipython users (someone using ultraTB but outside an ipython
812 non-ipython users (someone using ultraTB but outside an ipython
808 session). They can select the color scheme by setting the
813 session). They can select the color scheme by setting the
809 module-level global DEFAULT_SCHEME. The highlight functionality
814 module-level global DEFAULT_SCHEME. The highlight functionality
810 also works when debugging.
815 also works when debugging.
811
816
812 * IPython/genutils.py (IOStream.close): small patch by
817 * IPython/genutils.py (IOStream.close): small patch by
813 R. Bernstein for improved pydb support.
818 R. Bernstein for improved pydb support.
814
819
815 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
820 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
816 DaveS <davls@telus.net> to improve support of debugging under
821 DaveS <davls@telus.net> to improve support of debugging under
817 NTEmacs, including improved pydb behavior.
822 NTEmacs, including improved pydb behavior.
818
823
819 * IPython/Magic.py (magic_prun): Fix saving of profile info for
824 * IPython/Magic.py (magic_prun): Fix saving of profile info for
820 Python 2.5, where the stats object API changed a little. Thanks
825 Python 2.5, where the stats object API changed a little. Thanks
821 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
826 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
822
827
823 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
828 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
824 Pernetty's patch to improve support for (X)Emacs under Win32.
829 Pernetty's patch to improve support for (X)Emacs under Win32.
825
830
826 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
831 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
827
832
828 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
833 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
829 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
834 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
830 a report by Nik Tautenhahn.
835 a report by Nik Tautenhahn.
831
836
832 2007-03-16 Walter Doerwald <walter@livinglogic.de>
837 2007-03-16 Walter Doerwald <walter@livinglogic.de>
833
838
834 * setup.py: Add the igrid help files to the list of data files
839 * setup.py: Add the igrid help files to the list of data files
835 to be installed alongside igrid.
840 to be installed alongside igrid.
836 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
841 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
837 Show the input object of the igrid browser as the window tile.
842 Show the input object of the igrid browser as the window tile.
838 Show the object the cursor is on in the statusbar.
843 Show the object the cursor is on in the statusbar.
839
844
840 2007-03-15 Ville Vainio <vivainio@gmail.com>
845 2007-03-15 Ville Vainio <vivainio@gmail.com>
841
846
842 * Extensions/ipy_stock_completers.py: Fixed exception
847 * Extensions/ipy_stock_completers.py: Fixed exception
843 on mismatching quotes in %run completer. Patch by
848 on mismatching quotes in %run completer. Patch by
844 Jorgen Stenarson. Closes #127.
849 Jorgen Stenarson. Closes #127.
845
850
846 2007-03-14 Ville Vainio <vivainio@gmail.com>
851 2007-03-14 Ville Vainio <vivainio@gmail.com>
847
852
848 * Extensions/ext_rehashdir.py: Do not do auto_alias
853 * Extensions/ext_rehashdir.py: Do not do auto_alias
849 in %rehashdir, it clobbers %store'd aliases.
854 in %rehashdir, it clobbers %store'd aliases.
850
855
851 * UserConfig/ipy_profile_sh.py: envpersist.py extension
856 * UserConfig/ipy_profile_sh.py: envpersist.py extension
852 (beefed up %env) imported for sh profile.
857 (beefed up %env) imported for sh profile.
853
858
854 2007-03-10 Walter Doerwald <walter@livinglogic.de>
859 2007-03-10 Walter Doerwald <walter@livinglogic.de>
855
860
856 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
861 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
857 as the default browser.
862 as the default browser.
858 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
863 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
859 As igrid displays all attributes it ever encounters, fetch() (which has
864 As igrid displays all attributes it ever encounters, fetch() (which has
860 been renamed to _fetch()) doesn't have to recalculate the display attributes
865 been renamed to _fetch()) doesn't have to recalculate the display attributes
861 every time a new item is fetched. This should speed up scrolling.
866 every time a new item is fetched. This should speed up scrolling.
862
867
863 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
868 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
864
869
865 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
870 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
866 Schmolck's recently reported tab-completion bug (my previous one
871 Schmolck's recently reported tab-completion bug (my previous one
867 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
872 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
868
873
869 2007-03-09 Walter Doerwald <walter@livinglogic.de>
874 2007-03-09 Walter Doerwald <walter@livinglogic.de>
870
875
871 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
876 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
872 Close help window if exiting igrid.
877 Close help window if exiting igrid.
873
878
874 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
879 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
875
880
876 * IPython/Extensions/ipy_defaults.py: Check if readline is available
881 * IPython/Extensions/ipy_defaults.py: Check if readline is available
877 before calling functions from readline.
882 before calling functions from readline.
878
883
879 2007-03-02 Walter Doerwald <walter@livinglogic.de>
884 2007-03-02 Walter Doerwald <walter@livinglogic.de>
880
885
881 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
886 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
882 igrid is a wxPython-based display object for ipipe. If your system has
887 igrid is a wxPython-based display object for ipipe. If your system has
883 wx installed igrid will be the default display. Without wx ipipe falls
888 wx installed igrid will be the default display. Without wx ipipe falls
884 back to ibrowse (which needs curses). If no curses is installed ipipe
889 back to ibrowse (which needs curses). If no curses is installed ipipe
885 falls back to idump.
890 falls back to idump.
886
891
887 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
892 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
888
893
889 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
894 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
890 my changes from yesterday, they introduced bugs. Will reactivate
895 my changes from yesterday, they introduced bugs. Will reactivate
891 once I get a correct solution, which will be much easier thanks to
896 once I get a correct solution, which will be much easier thanks to
892 Dan Milstein's new prefilter test suite.
897 Dan Milstein's new prefilter test suite.
893
898
894 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
899 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
895
900
896 * IPython/iplib.py (split_user_input): fix input splitting so we
901 * IPython/iplib.py (split_user_input): fix input splitting so we
897 don't attempt attribute accesses on things that can't possibly be
902 don't attempt attribute accesses on things that can't possibly be
898 valid Python attributes. After a bug report by Alex Schmolck.
903 valid Python attributes. After a bug report by Alex Schmolck.
899 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
904 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
900 %magic with explicit % prefix.
905 %magic with explicit % prefix.
901
906
902 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
907 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
903
908
904 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
909 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
905 avoid a DeprecationWarning from GTK.
910 avoid a DeprecationWarning from GTK.
906
911
907 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
912 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
908
913
909 * IPython/genutils.py (clock): I modified clock() to return total
914 * IPython/genutils.py (clock): I modified clock() to return total
910 time, user+system. This is a more commonly needed metric. I also
915 time, user+system. This is a more commonly needed metric. I also
911 introduced the new clocku/clocks to get only user/system time if
916 introduced the new clocku/clocks to get only user/system time if
912 one wants those instead.
917 one wants those instead.
913
918
914 ***WARNING: API CHANGE*** clock() used to return only user time,
919 ***WARNING: API CHANGE*** clock() used to return only user time,
915 so if you want exactly the same results as before, use clocku
920 so if you want exactly the same results as before, use clocku
916 instead.
921 instead.
917
922
918 2007-02-22 Ville Vainio <vivainio@gmail.com>
923 2007-02-22 Ville Vainio <vivainio@gmail.com>
919
924
920 * IPython/Extensions/ipy_p4.py: Extension for improved
925 * IPython/Extensions/ipy_p4.py: Extension for improved
921 p4 (perforce version control system) experience.
926 p4 (perforce version control system) experience.
922 Adds %p4 magic with p4 command completion and
927 Adds %p4 magic with p4 command completion and
923 automatic -G argument (marshall output as python dict)
928 automatic -G argument (marshall output as python dict)
924
929
925 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
930 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
926
931
927 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
932 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
928 stop marks.
933 stop marks.
929 (ClearingMixin): a simple mixin to easily make a Demo class clear
934 (ClearingMixin): a simple mixin to easily make a Demo class clear
930 the screen in between blocks and have empty marquees. The
935 the screen in between blocks and have empty marquees. The
931 ClearDemo and ClearIPDemo classes that use it are included.
936 ClearDemo and ClearIPDemo classes that use it are included.
932
937
933 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
938 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
934
939
935 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
940 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
936 protect against exceptions at Python shutdown time. Patch
941 protect against exceptions at Python shutdown time. Patch
937 sumbmitted to upstream.
942 sumbmitted to upstream.
938
943
939 2007-02-14 Walter Doerwald <walter@livinglogic.de>
944 2007-02-14 Walter Doerwald <walter@livinglogic.de>
940
945
941 * IPython/Extensions/ibrowse.py: If entering the first object level
946 * IPython/Extensions/ibrowse.py: If entering the first object level
942 (i.e. the object for which the browser has been started) fails,
947 (i.e. the object for which the browser has been started) fails,
943 now the error is raised directly (aborting the browser) instead of
948 now the error is raised directly (aborting the browser) instead of
944 running into an empty levels list later.
949 running into an empty levels list later.
945
950
946 2007-02-03 Walter Doerwald <walter@livinglogic.de>
951 2007-02-03 Walter Doerwald <walter@livinglogic.de>
947
952
948 * IPython/Extensions/ipipe.py: Add an xrepr implementation
953 * IPython/Extensions/ipipe.py: Add an xrepr implementation
949 for the noitem object.
954 for the noitem object.
950
955
951 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
956 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
952
957
953 * IPython/completer.py (Completer.attr_matches): Fix small
958 * IPython/completer.py (Completer.attr_matches): Fix small
954 tab-completion bug with Enthought Traits objects with units.
959 tab-completion bug with Enthought Traits objects with units.
955 Thanks to a bug report by Tom Denniston
960 Thanks to a bug report by Tom Denniston
956 <tom.denniston-AT-alum.dartmouth.org>.
961 <tom.denniston-AT-alum.dartmouth.org>.
957
962
958 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
963 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
959
964
960 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
965 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
961 bug where only .ipy or .py would be completed. Once the first
966 bug where only .ipy or .py would be completed. Once the first
962 argument to %run has been given, all completions are valid because
967 argument to %run has been given, all completions are valid because
963 they are the arguments to the script, which may well be non-python
968 they are the arguments to the script, which may well be non-python
964 filenames.
969 filenames.
965
970
966 * IPython/irunner.py (InteractiveRunner.run_source): major updates
971 * IPython/irunner.py (InteractiveRunner.run_source): major updates
967 to irunner to allow it to correctly support real doctesting of
972 to irunner to allow it to correctly support real doctesting of
968 out-of-process ipython code.
973 out-of-process ipython code.
969
974
970 * IPython/Magic.py (magic_cd): Make the setting of the terminal
975 * IPython/Magic.py (magic_cd): Make the setting of the terminal
971 title an option (-noterm_title) because it completely breaks
976 title an option (-noterm_title) because it completely breaks
972 doctesting.
977 doctesting.
973
978
974 * IPython/demo.py: fix IPythonDemo class that was not actually working.
979 * IPython/demo.py: fix IPythonDemo class that was not actually working.
975
980
976 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
981 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
977
982
978 * IPython/irunner.py (main): fix small bug where extensions were
983 * IPython/irunner.py (main): fix small bug where extensions were
979 not being correctly recognized.
984 not being correctly recognized.
980
985
981 2007-01-23 Walter Doerwald <walter@livinglogic.de>
986 2007-01-23 Walter Doerwald <walter@livinglogic.de>
982
987
983 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
988 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
984 a string containing a single line yields the string itself as the
989 a string containing a single line yields the string itself as the
985 only item.
990 only item.
986
991
987 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
992 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
988 object if it's the same as the one on the last level (This avoids
993 object if it's the same as the one on the last level (This avoids
989 infinite recursion for one line strings).
994 infinite recursion for one line strings).
990
995
991 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
996 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
992
997
993 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
998 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
994 all output streams before printing tracebacks. This ensures that
999 all output streams before printing tracebacks. This ensures that
995 user output doesn't end up interleaved with traceback output.
1000 user output doesn't end up interleaved with traceback output.
996
1001
997 2007-01-10 Ville Vainio <vivainio@gmail.com>
1002 2007-01-10 Ville Vainio <vivainio@gmail.com>
998
1003
999 * Extensions/envpersist.py: Turbocharged %env that remembers
1004 * Extensions/envpersist.py: Turbocharged %env that remembers
1000 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1005 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1001 "%env VISUAL=jed".
1006 "%env VISUAL=jed".
1002
1007
1003 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1008 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1004
1009
1005 * IPython/iplib.py (showtraceback): ensure that we correctly call
1010 * IPython/iplib.py (showtraceback): ensure that we correctly call
1006 custom handlers in all cases (some with pdb were slipping through,
1011 custom handlers in all cases (some with pdb were slipping through,
1007 but I'm not exactly sure why).
1012 but I'm not exactly sure why).
1008
1013
1009 * IPython/Debugger.py (Tracer.__init__): added new class to
1014 * IPython/Debugger.py (Tracer.__init__): added new class to
1010 support set_trace-like usage of IPython's enhanced debugger.
1015 support set_trace-like usage of IPython's enhanced debugger.
1011
1016
1012 2006-12-24 Ville Vainio <vivainio@gmail.com>
1017 2006-12-24 Ville Vainio <vivainio@gmail.com>
1013
1018
1014 * ipmaker.py: more informative message when ipy_user_conf
1019 * ipmaker.py: more informative message when ipy_user_conf
1015 import fails (suggest running %upgrade).
1020 import fails (suggest running %upgrade).
1016
1021
1017 * tools/run_ipy_in_profiler.py: Utility to see where
1022 * tools/run_ipy_in_profiler.py: Utility to see where
1018 the time during IPython startup is spent.
1023 the time during IPython startup is spent.
1019
1024
1020 2006-12-20 Ville Vainio <vivainio@gmail.com>
1025 2006-12-20 Ville Vainio <vivainio@gmail.com>
1021
1026
1022 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1027 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1023
1028
1024 * ipapi.py: Add new ipapi method, expand_alias.
1029 * ipapi.py: Add new ipapi method, expand_alias.
1025
1030
1026 * Release.py: Bump up version to 0.7.4.svn
1031 * Release.py: Bump up version to 0.7.4.svn
1027
1032
1028 2006-12-17 Ville Vainio <vivainio@gmail.com>
1033 2006-12-17 Ville Vainio <vivainio@gmail.com>
1029
1034
1030 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1035 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1031 to work properly on posix too
1036 to work properly on posix too
1032
1037
1033 * Release.py: Update revnum (version is still just 0.7.3).
1038 * Release.py: Update revnum (version is still just 0.7.3).
1034
1039
1035 2006-12-15 Ville Vainio <vivainio@gmail.com>
1040 2006-12-15 Ville Vainio <vivainio@gmail.com>
1036
1041
1037 * scripts/ipython_win_post_install: create ipython.py in
1042 * scripts/ipython_win_post_install: create ipython.py in
1038 prefix + "/scripts".
1043 prefix + "/scripts".
1039
1044
1040 * Release.py: Update version to 0.7.3.
1045 * Release.py: Update version to 0.7.3.
1041
1046
1042 2006-12-14 Ville Vainio <vivainio@gmail.com>
1047 2006-12-14 Ville Vainio <vivainio@gmail.com>
1043
1048
1044 * scripts/ipython_win_post_install: Overwrite old shortcuts
1049 * scripts/ipython_win_post_install: Overwrite old shortcuts
1045 if they already exist
1050 if they already exist
1046
1051
1047 * Release.py: release 0.7.3rc2
1052 * Release.py: release 0.7.3rc2
1048
1053
1049 2006-12-13 Ville Vainio <vivainio@gmail.com>
1054 2006-12-13 Ville Vainio <vivainio@gmail.com>
1050
1055
1051 * Branch and update Release.py for 0.7.3rc1
1056 * Branch and update Release.py for 0.7.3rc1
1052
1057
1053 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1058 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1054
1059
1055 * IPython/Shell.py (IPShellWX): update for current WX naming
1060 * IPython/Shell.py (IPShellWX): update for current WX naming
1056 conventions, to avoid a deprecation warning with current WX
1061 conventions, to avoid a deprecation warning with current WX
1057 versions. Thanks to a report by Danny Shevitz.
1062 versions. Thanks to a report by Danny Shevitz.
1058
1063
1059 2006-12-12 Ville Vainio <vivainio@gmail.com>
1064 2006-12-12 Ville Vainio <vivainio@gmail.com>
1060
1065
1061 * ipmaker.py: apply david cournapeau's patch to make
1066 * ipmaker.py: apply david cournapeau's patch to make
1062 import_some work properly even when ipythonrc does
1067 import_some work properly even when ipythonrc does
1063 import_some on empty list (it was an old bug!).
1068 import_some on empty list (it was an old bug!).
1064
1069
1065 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1070 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1066 Add deprecation note to ipythonrc and a url to wiki
1071 Add deprecation note to ipythonrc and a url to wiki
1067 in ipy_user_conf.py
1072 in ipy_user_conf.py
1068
1073
1069
1074
1070 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1075 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1071 as if it was typed on IPython command prompt, i.e.
1076 as if it was typed on IPython command prompt, i.e.
1072 as IPython script.
1077 as IPython script.
1073
1078
1074 * example-magic.py, magic_grepl.py: remove outdated examples
1079 * example-magic.py, magic_grepl.py: remove outdated examples
1075
1080
1076 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1081 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1077
1082
1078 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1083 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1079 is called before any exception has occurred.
1084 is called before any exception has occurred.
1080
1085
1081 2006-12-08 Ville Vainio <vivainio@gmail.com>
1086 2006-12-08 Ville Vainio <vivainio@gmail.com>
1082
1087
1083 * Extensions/ipy_stock_completers.py: fix cd completer
1088 * Extensions/ipy_stock_completers.py: fix cd completer
1084 to translate /'s to \'s again.
1089 to translate /'s to \'s again.
1085
1090
1086 * completer.py: prevent traceback on file completions w/
1091 * completer.py: prevent traceback on file completions w/
1087 backslash.
1092 backslash.
1088
1093
1089 * Release.py: Update release number to 0.7.3b3 for release
1094 * Release.py: Update release number to 0.7.3b3 for release
1090
1095
1091 2006-12-07 Ville Vainio <vivainio@gmail.com>
1096 2006-12-07 Ville Vainio <vivainio@gmail.com>
1092
1097
1093 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1098 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1094 while executing external code. Provides more shell-like behaviour
1099 while executing external code. Provides more shell-like behaviour
1095 and overall better response to ctrl + C / ctrl + break.
1100 and overall better response to ctrl + C / ctrl + break.
1096
1101
1097 * tools/make_tarball.py: new script to create tarball straight from svn
1102 * tools/make_tarball.py: new script to create tarball straight from svn
1098 (setup.py sdist doesn't work on win32).
1103 (setup.py sdist doesn't work on win32).
1099
1104
1100 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1105 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1101 on dirnames with spaces and use the default completer instead.
1106 on dirnames with spaces and use the default completer instead.
1102
1107
1103 * Revision.py: Change version to 0.7.3b2 for release.
1108 * Revision.py: Change version to 0.7.3b2 for release.
1104
1109
1105 2006-12-05 Ville Vainio <vivainio@gmail.com>
1110 2006-12-05 Ville Vainio <vivainio@gmail.com>
1106
1111
1107 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1112 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1108 pydb patch 4 (rm debug printing, py 2.5 checking)
1113 pydb patch 4 (rm debug printing, py 2.5 checking)
1109
1114
1110 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1115 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1111 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1116 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1112 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1117 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1113 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1118 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1114 object the cursor was on before the refresh. The command "markrange" is
1119 object the cursor was on before the refresh. The command "markrange" is
1115 mapped to "%" now.
1120 mapped to "%" now.
1116 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1121 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1117
1122
1118 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1123 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1119
1124
1120 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1125 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1121 interactive debugger on the last traceback, without having to call
1126 interactive debugger on the last traceback, without having to call
1122 %pdb and rerun your code. Made minor changes in various modules,
1127 %pdb and rerun your code. Made minor changes in various modules,
1123 should automatically recognize pydb if available.
1128 should automatically recognize pydb if available.
1124
1129
1125 2006-11-28 Ville Vainio <vivainio@gmail.com>
1130 2006-11-28 Ville Vainio <vivainio@gmail.com>
1126
1131
1127 * completer.py: If the text start with !, show file completions
1132 * completer.py: If the text start with !, show file completions
1128 properly. This helps when trying to complete command name
1133 properly. This helps when trying to complete command name
1129 for shell escapes.
1134 for shell escapes.
1130
1135
1131 2006-11-27 Ville Vainio <vivainio@gmail.com>
1136 2006-11-27 Ville Vainio <vivainio@gmail.com>
1132
1137
1133 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1138 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1134 der Walt. Clean up svn and hg completers by using a common
1139 der Walt. Clean up svn and hg completers by using a common
1135 vcs_completer.
1140 vcs_completer.
1136
1141
1137 2006-11-26 Ville Vainio <vivainio@gmail.com>
1142 2006-11-26 Ville Vainio <vivainio@gmail.com>
1138
1143
1139 * Remove ipconfig and %config; you should use _ip.options structure
1144 * Remove ipconfig and %config; you should use _ip.options structure
1140 directly instead!
1145 directly instead!
1141
1146
1142 * genutils.py: add wrap_deprecated function for deprecating callables
1147 * genutils.py: add wrap_deprecated function for deprecating callables
1143
1148
1144 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1149 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1145 _ip.system instead. ipalias is redundant.
1150 _ip.system instead. ipalias is redundant.
1146
1151
1147 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1152 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1148 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1153 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1149 explicit.
1154 explicit.
1150
1155
1151 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1156 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1152 completer. Try it by entering 'hg ' and pressing tab.
1157 completer. Try it by entering 'hg ' and pressing tab.
1153
1158
1154 * macro.py: Give Macro a useful __repr__ method
1159 * macro.py: Give Macro a useful __repr__ method
1155
1160
1156 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1161 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1157
1162
1158 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1163 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1159 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1164 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1160 we don't get a duplicate ipipe module, where registration of the xrepr
1165 we don't get a duplicate ipipe module, where registration of the xrepr
1161 implementation for Text is useless.
1166 implementation for Text is useless.
1162
1167
1163 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1168 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1164
1169
1165 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1170 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1166
1171
1167 2006-11-24 Ville Vainio <vivainio@gmail.com>
1172 2006-11-24 Ville Vainio <vivainio@gmail.com>
1168
1173
1169 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1174 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1170 try to use "cProfile" instead of the slower pure python
1175 try to use "cProfile" instead of the slower pure python
1171 "profile"
1176 "profile"
1172
1177
1173 2006-11-23 Ville Vainio <vivainio@gmail.com>
1178 2006-11-23 Ville Vainio <vivainio@gmail.com>
1174
1179
1175 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1180 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1176 Qt+IPython+Designer link in documentation.
1181 Qt+IPython+Designer link in documentation.
1177
1182
1178 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1183 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1179 correct Pdb object to %pydb.
1184 correct Pdb object to %pydb.
1180
1185
1181
1186
1182 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1187 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1183 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1188 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1184 generic xrepr(), otherwise the list implementation would kick in.
1189 generic xrepr(), otherwise the list implementation would kick in.
1185
1190
1186 2006-11-21 Ville Vainio <vivainio@gmail.com>
1191 2006-11-21 Ville Vainio <vivainio@gmail.com>
1187
1192
1188 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1193 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1189 with one from UserConfig.
1194 with one from UserConfig.
1190
1195
1191 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1196 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1192 it was missing which broke the sh profile.
1197 it was missing which broke the sh profile.
1193
1198
1194 * completer.py: file completer now uses explicit '/' instead
1199 * completer.py: file completer now uses explicit '/' instead
1195 of os.path.join, expansion of 'foo' was broken on win32
1200 of os.path.join, expansion of 'foo' was broken on win32
1196 if there was one directory with name 'foobar'.
1201 if there was one directory with name 'foobar'.
1197
1202
1198 * A bunch of patches from Kirill Smelkov:
1203 * A bunch of patches from Kirill Smelkov:
1199
1204
1200 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1205 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1201
1206
1202 * [patch 7/9] Implement %page -r (page in raw mode) -
1207 * [patch 7/9] Implement %page -r (page in raw mode) -
1203
1208
1204 * [patch 5/9] ScientificPython webpage has moved
1209 * [patch 5/9] ScientificPython webpage has moved
1205
1210
1206 * [patch 4/9] The manual mentions %ds, should be %dhist
1211 * [patch 4/9] The manual mentions %ds, should be %dhist
1207
1212
1208 * [patch 3/9] Kill old bits from %prun doc.
1213 * [patch 3/9] Kill old bits from %prun doc.
1209
1214
1210 * [patch 1/9] Fix typos here and there.
1215 * [patch 1/9] Fix typos here and there.
1211
1216
1212 2006-11-08 Ville Vainio <vivainio@gmail.com>
1217 2006-11-08 Ville Vainio <vivainio@gmail.com>
1213
1218
1214 * completer.py (attr_matches): catch all exceptions raised
1219 * completer.py (attr_matches): catch all exceptions raised
1215 by eval of expr with dots.
1220 by eval of expr with dots.
1216
1221
1217 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1222 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1218
1223
1219 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1224 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1220 input if it starts with whitespace. This allows you to paste
1225 input if it starts with whitespace. This allows you to paste
1221 indented input from any editor without manually having to type in
1226 indented input from any editor without manually having to type in
1222 the 'if 1:', which is convenient when working interactively.
1227 the 'if 1:', which is convenient when working interactively.
1223 Slightly modifed version of a patch by Bo Peng
1228 Slightly modifed version of a patch by Bo Peng
1224 <bpeng-AT-rice.edu>.
1229 <bpeng-AT-rice.edu>.
1225
1230
1226 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1231 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1227
1232
1228 * IPython/irunner.py (main): modified irunner so it automatically
1233 * IPython/irunner.py (main): modified irunner so it automatically
1229 recognizes the right runner to use based on the extension (.py for
1234 recognizes the right runner to use based on the extension (.py for
1230 python, .ipy for ipython and .sage for sage).
1235 python, .ipy for ipython and .sage for sage).
1231
1236
1232 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1237 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1233 visible in ipapi as ip.config(), to programatically control the
1238 visible in ipapi as ip.config(), to programatically control the
1234 internal rc object. There's an accompanying %config magic for
1239 internal rc object. There's an accompanying %config magic for
1235 interactive use, which has been enhanced to match the
1240 interactive use, which has been enhanced to match the
1236 funtionality in ipconfig.
1241 funtionality in ipconfig.
1237
1242
1238 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1243 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1239 so it's not just a toggle, it now takes an argument. Add support
1244 so it's not just a toggle, it now takes an argument. Add support
1240 for a customizable header when making system calls, as the new
1245 for a customizable header when making system calls, as the new
1241 system_header variable in the ipythonrc file.
1246 system_header variable in the ipythonrc file.
1242
1247
1243 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1248 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1244
1249
1245 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1250 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1246 generic functions (using Philip J. Eby's simplegeneric package).
1251 generic functions (using Philip J. Eby's simplegeneric package).
1247 This makes it possible to customize the display of third-party classes
1252 This makes it possible to customize the display of third-party classes
1248 without having to monkeypatch them. xiter() no longer supports a mode
1253 without having to monkeypatch them. xiter() no longer supports a mode
1249 argument and the XMode class has been removed. The same functionality can
1254 argument and the XMode class has been removed. The same functionality can
1250 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1255 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1251 One consequence of the switch to generic functions is that xrepr() and
1256 One consequence of the switch to generic functions is that xrepr() and
1252 xattrs() implementation must define the default value for the mode
1257 xattrs() implementation must define the default value for the mode
1253 argument themselves and xattrs() implementations must return real
1258 argument themselves and xattrs() implementations must return real
1254 descriptors.
1259 descriptors.
1255
1260
1256 * IPython/external: This new subpackage will contain all third-party
1261 * IPython/external: This new subpackage will contain all third-party
1257 packages that are bundled with IPython. (The first one is simplegeneric).
1262 packages that are bundled with IPython. (The first one is simplegeneric).
1258
1263
1259 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1264 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1260 directory which as been dropped in r1703.
1265 directory which as been dropped in r1703.
1261
1266
1262 * IPython/Extensions/ipipe.py (iless): Fixed.
1267 * IPython/Extensions/ipipe.py (iless): Fixed.
1263
1268
1264 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1269 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1265
1270
1266 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1271 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1267
1272
1268 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1273 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1269 handling in variable expansion so that shells and magics recognize
1274 handling in variable expansion so that shells and magics recognize
1270 function local scopes correctly. Bug reported by Brian.
1275 function local scopes correctly. Bug reported by Brian.
1271
1276
1272 * scripts/ipython: remove the very first entry in sys.path which
1277 * scripts/ipython: remove the very first entry in sys.path which
1273 Python auto-inserts for scripts, so that sys.path under IPython is
1278 Python auto-inserts for scripts, so that sys.path under IPython is
1274 as similar as possible to that under plain Python.
1279 as similar as possible to that under plain Python.
1275
1280
1276 * IPython/completer.py (IPCompleter.file_matches): Fix
1281 * IPython/completer.py (IPCompleter.file_matches): Fix
1277 tab-completion so that quotes are not closed unless the completion
1282 tab-completion so that quotes are not closed unless the completion
1278 is unambiguous. After a request by Stefan. Minor cleanups in
1283 is unambiguous. After a request by Stefan. Minor cleanups in
1279 ipy_stock_completers.
1284 ipy_stock_completers.
1280
1285
1281 2006-11-02 Ville Vainio <vivainio@gmail.com>
1286 2006-11-02 Ville Vainio <vivainio@gmail.com>
1282
1287
1283 * ipy_stock_completers.py: Add %run and %cd completers.
1288 * ipy_stock_completers.py: Add %run and %cd completers.
1284
1289
1285 * completer.py: Try running custom completer for both
1290 * completer.py: Try running custom completer for both
1286 "foo" and "%foo" if the command is just "foo". Ignore case
1291 "foo" and "%foo" if the command is just "foo". Ignore case
1287 when filtering possible completions.
1292 when filtering possible completions.
1288
1293
1289 * UserConfig/ipy_user_conf.py: install stock completers as default
1294 * UserConfig/ipy_user_conf.py: install stock completers as default
1290
1295
1291 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1296 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1292 simplified readline history save / restore through a wrapper
1297 simplified readline history save / restore through a wrapper
1293 function
1298 function
1294
1299
1295
1300
1296 2006-10-31 Ville Vainio <vivainio@gmail.com>
1301 2006-10-31 Ville Vainio <vivainio@gmail.com>
1297
1302
1298 * strdispatch.py, completer.py, ipy_stock_completers.py:
1303 * strdispatch.py, completer.py, ipy_stock_completers.py:
1299 Allow str_key ("command") in completer hooks. Implement
1304 Allow str_key ("command") in completer hooks. Implement
1300 trivial completer for 'import' (stdlib modules only). Rename
1305 trivial completer for 'import' (stdlib modules only). Rename
1301 ipy_linux_package_managers.py to ipy_stock_completers.py.
1306 ipy_linux_package_managers.py to ipy_stock_completers.py.
1302 SVN completer.
1307 SVN completer.
1303
1308
1304 * Extensions/ledit.py: %magic line editor for easily and
1309 * Extensions/ledit.py: %magic line editor for easily and
1305 incrementally manipulating lists of strings. The magic command
1310 incrementally manipulating lists of strings. The magic command
1306 name is %led.
1311 name is %led.
1307
1312
1308 2006-10-30 Ville Vainio <vivainio@gmail.com>
1313 2006-10-30 Ville Vainio <vivainio@gmail.com>
1309
1314
1310 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1315 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1311 Bernsteins's patches for pydb integration.
1316 Bernsteins's patches for pydb integration.
1312 http://bashdb.sourceforge.net/pydb/
1317 http://bashdb.sourceforge.net/pydb/
1313
1318
1314 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1319 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1315 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1320 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1316 custom completer hook to allow the users to implement their own
1321 custom completer hook to allow the users to implement their own
1317 completers. See ipy_linux_package_managers.py for example. The
1322 completers. See ipy_linux_package_managers.py for example. The
1318 hook name is 'complete_command'.
1323 hook name is 'complete_command'.
1319
1324
1320 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1325 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1321
1326
1322 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1327 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1323 Numeric leftovers.
1328 Numeric leftovers.
1324
1329
1325 * ipython.el (py-execute-region): apply Stefan's patch to fix
1330 * ipython.el (py-execute-region): apply Stefan's patch to fix
1326 garbled results if the python shell hasn't been previously started.
1331 garbled results if the python shell hasn't been previously started.
1327
1332
1328 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1333 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1329 pretty generic function and useful for other things.
1334 pretty generic function and useful for other things.
1330
1335
1331 * IPython/OInspect.py (getsource): Add customizable source
1336 * IPython/OInspect.py (getsource): Add customizable source
1332 extractor. After a request/patch form W. Stein (SAGE).
1337 extractor. After a request/patch form W. Stein (SAGE).
1333
1338
1334 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1339 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1335 window size to a more reasonable value from what pexpect does,
1340 window size to a more reasonable value from what pexpect does,
1336 since their choice causes wrapping bugs with long input lines.
1341 since their choice causes wrapping bugs with long input lines.
1337
1342
1338 2006-10-28 Ville Vainio <vivainio@gmail.com>
1343 2006-10-28 Ville Vainio <vivainio@gmail.com>
1339
1344
1340 * Magic.py (%run): Save and restore the readline history from
1345 * Magic.py (%run): Save and restore the readline history from
1341 file around %run commands to prevent side effects from
1346 file around %run commands to prevent side effects from
1342 %runned programs that might use readline (e.g. pydb).
1347 %runned programs that might use readline (e.g. pydb).
1343
1348
1344 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1349 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1345 invoking the pydb enhanced debugger.
1350 invoking the pydb enhanced debugger.
1346
1351
1347 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1352 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1348
1353
1349 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1354 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1350 call the base class method and propagate the return value to
1355 call the base class method and propagate the return value to
1351 ifile. This is now done by path itself.
1356 ifile. This is now done by path itself.
1352
1357
1353 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1358 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1354
1359
1355 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1360 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1356 api: set_crash_handler(), to expose the ability to change the
1361 api: set_crash_handler(), to expose the ability to change the
1357 internal crash handler.
1362 internal crash handler.
1358
1363
1359 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1364 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1360 the various parameters of the crash handler so that apps using
1365 the various parameters of the crash handler so that apps using
1361 IPython as their engine can customize crash handling. Ipmlemented
1366 IPython as their engine can customize crash handling. Ipmlemented
1362 at the request of SAGE.
1367 at the request of SAGE.
1363
1368
1364 2006-10-14 Ville Vainio <vivainio@gmail.com>
1369 2006-10-14 Ville Vainio <vivainio@gmail.com>
1365
1370
1366 * Magic.py, ipython.el: applied first "safe" part of Rocky
1371 * Magic.py, ipython.el: applied first "safe" part of Rocky
1367 Bernstein's patch set for pydb integration.
1372 Bernstein's patch set for pydb integration.
1368
1373
1369 * Magic.py (%unalias, %alias): %store'd aliases can now be
1374 * Magic.py (%unalias, %alias): %store'd aliases can now be
1370 removed with '%unalias'. %alias w/o args now shows most
1375 removed with '%unalias'. %alias w/o args now shows most
1371 interesting (stored / manually defined) aliases last
1376 interesting (stored / manually defined) aliases last
1372 where they catch the eye w/o scrolling.
1377 where they catch the eye w/o scrolling.
1373
1378
1374 * Magic.py (%rehashx), ext_rehashdir.py: files with
1379 * Magic.py (%rehashx), ext_rehashdir.py: files with
1375 'py' extension are always considered executable, even
1380 'py' extension are always considered executable, even
1376 when not in PATHEXT environment variable.
1381 when not in PATHEXT environment variable.
1377
1382
1378 2006-10-12 Ville Vainio <vivainio@gmail.com>
1383 2006-10-12 Ville Vainio <vivainio@gmail.com>
1379
1384
1380 * jobctrl.py: Add new "jobctrl" extension for spawning background
1385 * jobctrl.py: Add new "jobctrl" extension for spawning background
1381 processes with "&find /". 'import jobctrl' to try it out. Requires
1386 processes with "&find /". 'import jobctrl' to try it out. Requires
1382 'subprocess' module, standard in python 2.4+.
1387 'subprocess' module, standard in python 2.4+.
1383
1388
1384 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1389 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1385 so if foo -> bar and bar -> baz, then foo -> baz.
1390 so if foo -> bar and bar -> baz, then foo -> baz.
1386
1391
1387 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1392 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1388
1393
1389 * IPython/Magic.py (Magic.parse_options): add a new posix option
1394 * IPython/Magic.py (Magic.parse_options): add a new posix option
1390 to allow parsing of input args in magics that doesn't strip quotes
1395 to allow parsing of input args in magics that doesn't strip quotes
1391 (if posix=False). This also closes %timeit bug reported by
1396 (if posix=False). This also closes %timeit bug reported by
1392 Stefan.
1397 Stefan.
1393
1398
1394 2006-10-03 Ville Vainio <vivainio@gmail.com>
1399 2006-10-03 Ville Vainio <vivainio@gmail.com>
1395
1400
1396 * iplib.py (raw_input, interact): Return ValueError catching for
1401 * iplib.py (raw_input, interact): Return ValueError catching for
1397 raw_input. Fixes infinite loop for sys.stdin.close() or
1402 raw_input. Fixes infinite loop for sys.stdin.close() or
1398 sys.stdout.close().
1403 sys.stdout.close().
1399
1404
1400 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1405 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1401
1406
1402 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1407 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1403 to help in handling doctests. irunner is now pretty useful for
1408 to help in handling doctests. irunner is now pretty useful for
1404 running standalone scripts and simulate a full interactive session
1409 running standalone scripts and simulate a full interactive session
1405 in a format that can be then pasted as a doctest.
1410 in a format that can be then pasted as a doctest.
1406
1411
1407 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1412 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1408 on top of the default (useless) ones. This also fixes the nasty
1413 on top of the default (useless) ones. This also fixes the nasty
1409 way in which 2.5's Quitter() exits (reverted [1785]).
1414 way in which 2.5's Quitter() exits (reverted [1785]).
1410
1415
1411 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1416 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1412 2.5.
1417 2.5.
1413
1418
1414 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1419 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1415 color scheme is updated as well when color scheme is changed
1420 color scheme is updated as well when color scheme is changed
1416 interactively.
1421 interactively.
1417
1422
1418 2006-09-27 Ville Vainio <vivainio@gmail.com>
1423 2006-09-27 Ville Vainio <vivainio@gmail.com>
1419
1424
1420 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1425 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1421 infinite loop and just exit. It's a hack, but will do for a while.
1426 infinite loop and just exit. It's a hack, but will do for a while.
1422
1427
1423 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1428 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1424
1429
1425 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1430 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1426 the constructor, this makes it possible to get a list of only directories
1431 the constructor, this makes it possible to get a list of only directories
1427 or only files.
1432 or only files.
1428
1433
1429 2006-08-12 Ville Vainio <vivainio@gmail.com>
1434 2006-08-12 Ville Vainio <vivainio@gmail.com>
1430
1435
1431 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1436 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1432 they broke unittest
1437 they broke unittest
1433
1438
1434 2006-08-11 Ville Vainio <vivainio@gmail.com>
1439 2006-08-11 Ville Vainio <vivainio@gmail.com>
1435
1440
1436 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1441 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1437 by resolving issue properly, i.e. by inheriting FakeModule
1442 by resolving issue properly, i.e. by inheriting FakeModule
1438 from types.ModuleType. Pickling ipython interactive data
1443 from types.ModuleType. Pickling ipython interactive data
1439 should still work as usual (testing appreciated).
1444 should still work as usual (testing appreciated).
1440
1445
1441 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1446 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1442
1447
1443 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1448 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1444 running under python 2.3 with code from 2.4 to fix a bug with
1449 running under python 2.3 with code from 2.4 to fix a bug with
1445 help(). Reported by the Debian maintainers, Norbert Tretkowski
1450 help(). Reported by the Debian maintainers, Norbert Tretkowski
1446 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1451 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1447 <afayolle-AT-debian.org>.
1452 <afayolle-AT-debian.org>.
1448
1453
1449 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1454 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1450
1455
1451 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1456 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1452 (which was displaying "quit" twice).
1457 (which was displaying "quit" twice).
1453
1458
1454 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1459 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1455
1460
1456 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1461 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1457 the mode argument).
1462 the mode argument).
1458
1463
1459 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1464 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1460
1465
1461 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1466 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1462 not running under IPython.
1467 not running under IPython.
1463
1468
1464 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1469 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1465 and make it iterable (iterating over the attribute itself). Add two new
1470 and make it iterable (iterating over the attribute itself). Add two new
1466 magic strings for __xattrs__(): If the string starts with "-", the attribute
1471 magic strings for __xattrs__(): If the string starts with "-", the attribute
1467 will not be displayed in ibrowse's detail view (but it can still be
1472 will not be displayed in ibrowse's detail view (but it can still be
1468 iterated over). This makes it possible to add attributes that are large
1473 iterated over). This makes it possible to add attributes that are large
1469 lists or generator methods to the detail view. Replace magic attribute names
1474 lists or generator methods to the detail view. Replace magic attribute names
1470 and _attrname() and _getattr() with "descriptors": For each type of magic
1475 and _attrname() and _getattr() with "descriptors": For each type of magic
1471 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1476 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1472 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1477 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1473 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1478 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1474 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1479 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1475 are still supported.
1480 are still supported.
1476
1481
1477 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1482 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1478 fails in ibrowse.fetch(), the exception object is added as the last item
1483 fails in ibrowse.fetch(), the exception object is added as the last item
1479 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1484 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1480 a generator throws an exception midway through execution.
1485 a generator throws an exception midway through execution.
1481
1486
1482 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1487 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1483 encoding into methods.
1488 encoding into methods.
1484
1489
1485 2006-07-26 Ville Vainio <vivainio@gmail.com>
1490 2006-07-26 Ville Vainio <vivainio@gmail.com>
1486
1491
1487 * iplib.py: history now stores multiline input as single
1492 * iplib.py: history now stores multiline input as single
1488 history entries. Patch by Jorgen Cederlof.
1493 history entries. Patch by Jorgen Cederlof.
1489
1494
1490 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1495 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1491
1496
1492 * IPython/Extensions/ibrowse.py: Make cursor visible over
1497 * IPython/Extensions/ibrowse.py: Make cursor visible over
1493 non existing attributes.
1498 non existing attributes.
1494
1499
1495 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1500 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1496
1501
1497 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1502 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1498 error output of the running command doesn't mess up the screen.
1503 error output of the running command doesn't mess up the screen.
1499
1504
1500 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1505 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1501
1506
1502 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1507 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1503 argument. This sorts the items themselves.
1508 argument. This sorts the items themselves.
1504
1509
1505 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1510 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1506
1511
1507 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1512 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1508 Compile expression strings into code objects. This should speed
1513 Compile expression strings into code objects. This should speed
1509 up ifilter and friends somewhat.
1514 up ifilter and friends somewhat.
1510
1515
1511 2006-07-08 Ville Vainio <vivainio@gmail.com>
1516 2006-07-08 Ville Vainio <vivainio@gmail.com>
1512
1517
1513 * Magic.py: %cpaste now strips > from the beginning of lines
1518 * Magic.py: %cpaste now strips > from the beginning of lines
1514 to ease pasting quoted code from emails. Contributed by
1519 to ease pasting quoted code from emails. Contributed by
1515 Stefan van der Walt.
1520 Stefan van der Walt.
1516
1521
1517 2006-06-29 Ville Vainio <vivainio@gmail.com>
1522 2006-06-29 Ville Vainio <vivainio@gmail.com>
1518
1523
1519 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1524 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1520 mode, patch contributed by Darren Dale. NEEDS TESTING!
1525 mode, patch contributed by Darren Dale. NEEDS TESTING!
1521
1526
1522 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1527 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1523
1528
1524 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1529 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1525 a blue background. Fix fetching new display rows when the browser
1530 a blue background. Fix fetching new display rows when the browser
1526 scrolls more than a screenful (e.g. by using the goto command).
1531 scrolls more than a screenful (e.g. by using the goto command).
1527
1532
1528 2006-06-27 Ville Vainio <vivainio@gmail.com>
1533 2006-06-27 Ville Vainio <vivainio@gmail.com>
1529
1534
1530 * Magic.py (_inspect, _ofind) Apply David Huard's
1535 * Magic.py (_inspect, _ofind) Apply David Huard's
1531 patch for displaying the correct docstring for 'property'
1536 patch for displaying the correct docstring for 'property'
1532 attributes.
1537 attributes.
1533
1538
1534 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1539 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1535
1540
1536 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1541 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1537 commands into the methods implementing them.
1542 commands into the methods implementing them.
1538
1543
1539 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1544 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1540
1545
1541 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1546 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1542 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1547 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1543 autoindent support was authored by Jin Liu.
1548 autoindent support was authored by Jin Liu.
1544
1549
1545 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1550 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1546
1551
1547 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1552 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1548 for keymaps with a custom class that simplifies handling.
1553 for keymaps with a custom class that simplifies handling.
1549
1554
1550 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1555 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1551
1556
1552 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1557 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1553 resizing. This requires Python 2.5 to work.
1558 resizing. This requires Python 2.5 to work.
1554
1559
1555 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1560 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1556
1561
1557 * IPython/Extensions/ibrowse.py: Add two new commands to
1562 * IPython/Extensions/ibrowse.py: Add two new commands to
1558 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1563 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1559 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1564 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1560 attributes again. Remapped the help command to "?". Display
1565 attributes again. Remapped the help command to "?". Display
1561 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1566 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1562 as keys for the "home" and "end" commands. Add three new commands
1567 as keys for the "home" and "end" commands. Add three new commands
1563 to the input mode for "find" and friends: "delend" (CTRL-K)
1568 to the input mode for "find" and friends: "delend" (CTRL-K)
1564 deletes to the end of line. "incsearchup" searches upwards in the
1569 deletes to the end of line. "incsearchup" searches upwards in the
1565 command history for an input that starts with the text before the cursor.
1570 command history for an input that starts with the text before the cursor.
1566 "incsearchdown" does the same downwards. Removed a bogus mapping of
1571 "incsearchdown" does the same downwards. Removed a bogus mapping of
1567 the x key to "delete".
1572 the x key to "delete".
1568
1573
1569 2006-06-15 Ville Vainio <vivainio@gmail.com>
1574 2006-06-15 Ville Vainio <vivainio@gmail.com>
1570
1575
1571 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1576 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1572 used to create prompts dynamically, instead of the "old" way of
1577 used to create prompts dynamically, instead of the "old" way of
1573 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1578 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1574 way still works (it's invoked by the default hook), of course.
1579 way still works (it's invoked by the default hook), of course.
1575
1580
1576 * Prompts.py: added generate_output_prompt hook for altering output
1581 * Prompts.py: added generate_output_prompt hook for altering output
1577 prompt
1582 prompt
1578
1583
1579 * Release.py: Changed version string to 0.7.3.svn.
1584 * Release.py: Changed version string to 0.7.3.svn.
1580
1585
1581 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1586 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1582
1587
1583 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1588 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1584 the call to fetch() always tries to fetch enough data for at least one
1589 the call to fetch() always tries to fetch enough data for at least one
1585 full screen. This makes it possible to simply call moveto(0,0,True) in
1590 full screen. This makes it possible to simply call moveto(0,0,True) in
1586 the constructor. Fix typos and removed the obsolete goto attribute.
1591 the constructor. Fix typos and removed the obsolete goto attribute.
1587
1592
1588 2006-06-12 Ville Vainio <vivainio@gmail.com>
1593 2006-06-12 Ville Vainio <vivainio@gmail.com>
1589
1594
1590 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1595 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1591 allowing $variable interpolation within multiline statements,
1596 allowing $variable interpolation within multiline statements,
1592 though so far only with "sh" profile for a testing period.
1597 though so far only with "sh" profile for a testing period.
1593 The patch also enables splitting long commands with \ but it
1598 The patch also enables splitting long commands with \ but it
1594 doesn't work properly yet.
1599 doesn't work properly yet.
1595
1600
1596 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1601 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1597
1602
1598 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1603 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1599 input history and the position of the cursor in the input history for
1604 input history and the position of the cursor in the input history for
1600 the find, findbackwards and goto command.
1605 the find, findbackwards and goto command.
1601
1606
1602 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1607 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1603
1608
1604 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1609 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1605 implements the basic functionality of browser commands that require
1610 implements the basic functionality of browser commands that require
1606 input. Reimplement the goto, find and findbackwards commands as
1611 input. Reimplement the goto, find and findbackwards commands as
1607 subclasses of _CommandInput. Add an input history and keymaps to those
1612 subclasses of _CommandInput. Add an input history and keymaps to those
1608 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1613 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1609 execute commands.
1614 execute commands.
1610
1615
1611 2006-06-07 Ville Vainio <vivainio@gmail.com>
1616 2006-06-07 Ville Vainio <vivainio@gmail.com>
1612
1617
1613 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1618 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1614 running the batch files instead of leaving the session open.
1619 running the batch files instead of leaving the session open.
1615
1620
1616 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1621 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1617
1622
1618 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1623 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1619 the original fix was incomplete. Patch submitted by W. Maier.
1624 the original fix was incomplete. Patch submitted by W. Maier.
1620
1625
1621 2006-06-07 Ville Vainio <vivainio@gmail.com>
1626 2006-06-07 Ville Vainio <vivainio@gmail.com>
1622
1627
1623 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1628 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1624 Confirmation prompts can be supressed by 'quiet' option.
1629 Confirmation prompts can be supressed by 'quiet' option.
1625 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1630 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1626
1631
1627 2006-06-06 *** Released version 0.7.2
1632 2006-06-06 *** Released version 0.7.2
1628
1633
1629 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1634 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1630
1635
1631 * IPython/Release.py (version): Made 0.7.2 final for release.
1636 * IPython/Release.py (version): Made 0.7.2 final for release.
1632 Repo tagged and release cut.
1637 Repo tagged and release cut.
1633
1638
1634 2006-06-05 Ville Vainio <vivainio@gmail.com>
1639 2006-06-05 Ville Vainio <vivainio@gmail.com>
1635
1640
1636 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1641 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1637 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1642 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1638
1643
1639 * upgrade_dir.py: try import 'path' module a bit harder
1644 * upgrade_dir.py: try import 'path' module a bit harder
1640 (for %upgrade)
1645 (for %upgrade)
1641
1646
1642 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1647 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1643
1648
1644 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1649 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1645 instead of looping 20 times.
1650 instead of looping 20 times.
1646
1651
1647 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1652 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1648 correctly at initialization time. Bug reported by Krishna Mohan
1653 correctly at initialization time. Bug reported by Krishna Mohan
1649 Gundu <gkmohan-AT-gmail.com> on the user list.
1654 Gundu <gkmohan-AT-gmail.com> on the user list.
1650
1655
1651 * IPython/Release.py (version): Mark 0.7.2 version to start
1656 * IPython/Release.py (version): Mark 0.7.2 version to start
1652 testing for release on 06/06.
1657 testing for release on 06/06.
1653
1658
1654 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1659 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1655
1660
1656 * scripts/irunner: thin script interface so users don't have to
1661 * scripts/irunner: thin script interface so users don't have to
1657 find the module and call it as an executable, since modules rarely
1662 find the module and call it as an executable, since modules rarely
1658 live in people's PATH.
1663 live in people's PATH.
1659
1664
1660 * IPython/irunner.py (InteractiveRunner.__init__): added
1665 * IPython/irunner.py (InteractiveRunner.__init__): added
1661 delaybeforesend attribute to control delays with newer versions of
1666 delaybeforesend attribute to control delays with newer versions of
1662 pexpect. Thanks to detailed help from pexpect's author, Noah
1667 pexpect. Thanks to detailed help from pexpect's author, Noah
1663 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1668 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1664 correctly (it works in NoColor mode).
1669 correctly (it works in NoColor mode).
1665
1670
1666 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1671 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1667 SAGE list, from improper log() calls.
1672 SAGE list, from improper log() calls.
1668
1673
1669 2006-05-31 Ville Vainio <vivainio@gmail.com>
1674 2006-05-31 Ville Vainio <vivainio@gmail.com>
1670
1675
1671 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1676 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1672 with args in parens to work correctly with dirs that have spaces.
1677 with args in parens to work correctly with dirs that have spaces.
1673
1678
1674 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1679 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1675
1680
1676 * IPython/Logger.py (Logger.logstart): add option to log raw input
1681 * IPython/Logger.py (Logger.logstart): add option to log raw input
1677 instead of the processed one. A -r flag was added to the
1682 instead of the processed one. A -r flag was added to the
1678 %logstart magic used for controlling logging.
1683 %logstart magic used for controlling logging.
1679
1684
1680 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1685 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1681
1686
1682 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1687 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1683 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1688 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1684 recognize the option. After a bug report by Will Maier. This
1689 recognize the option. After a bug report by Will Maier. This
1685 closes #64 (will do it after confirmation from W. Maier).
1690 closes #64 (will do it after confirmation from W. Maier).
1686
1691
1687 * IPython/irunner.py: New module to run scripts as if manually
1692 * IPython/irunner.py: New module to run scripts as if manually
1688 typed into an interactive environment, based on pexpect. After a
1693 typed into an interactive environment, based on pexpect. After a
1689 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1694 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1690 ipython-user list. Simple unittests in the tests/ directory.
1695 ipython-user list. Simple unittests in the tests/ directory.
1691
1696
1692 * tools/release: add Will Maier, OpenBSD port maintainer, to
1697 * tools/release: add Will Maier, OpenBSD port maintainer, to
1693 recepients list. We are now officially part of the OpenBSD ports:
1698 recepients list. We are now officially part of the OpenBSD ports:
1694 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1699 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1695 work.
1700 work.
1696
1701
1697 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1702 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1698
1703
1699 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1704 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1700 so that it doesn't break tkinter apps.
1705 so that it doesn't break tkinter apps.
1701
1706
1702 * IPython/iplib.py (_prefilter): fix bug where aliases would
1707 * IPython/iplib.py (_prefilter): fix bug where aliases would
1703 shadow variables when autocall was fully off. Reported by SAGE
1708 shadow variables when autocall was fully off. Reported by SAGE
1704 author William Stein.
1709 author William Stein.
1705
1710
1706 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1711 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1707 at what detail level strings are computed when foo? is requested.
1712 at what detail level strings are computed when foo? is requested.
1708 This allows users to ask for example that the string form of an
1713 This allows users to ask for example that the string form of an
1709 object is only computed when foo?? is called, or even never, by
1714 object is only computed when foo?? is called, or even never, by
1710 setting the object_info_string_level >= 2 in the configuration
1715 setting the object_info_string_level >= 2 in the configuration
1711 file. This new option has been added and documented. After a
1716 file. This new option has been added and documented. After a
1712 request by SAGE to be able to control the printing of very large
1717 request by SAGE to be able to control the printing of very large
1713 objects more easily.
1718 objects more easily.
1714
1719
1715 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1720 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1716
1721
1717 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1722 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1718 from sys.argv, to be 100% consistent with how Python itself works
1723 from sys.argv, to be 100% consistent with how Python itself works
1719 (as seen for example with python -i file.py). After a bug report
1724 (as seen for example with python -i file.py). After a bug report
1720 by Jeffrey Collins.
1725 by Jeffrey Collins.
1721
1726
1722 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1727 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1723 nasty bug which was preventing custom namespaces with -pylab,
1728 nasty bug which was preventing custom namespaces with -pylab,
1724 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1729 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1725 compatibility (long gone from mpl).
1730 compatibility (long gone from mpl).
1726
1731
1727 * IPython/ipapi.py (make_session): name change: create->make. We
1732 * IPython/ipapi.py (make_session): name change: create->make. We
1728 use make in other places (ipmaker,...), it's shorter and easier to
1733 use make in other places (ipmaker,...), it's shorter and easier to
1729 type and say, etc. I'm trying to clean things before 0.7.2 so
1734 type and say, etc. I'm trying to clean things before 0.7.2 so
1730 that I can keep things stable wrt to ipapi in the chainsaw branch.
1735 that I can keep things stable wrt to ipapi in the chainsaw branch.
1731
1736
1732 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1737 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1733 python-mode recognizes our debugger mode. Add support for
1738 python-mode recognizes our debugger mode. Add support for
1734 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1739 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1735 <m.liu.jin-AT-gmail.com> originally written by
1740 <m.liu.jin-AT-gmail.com> originally written by
1736 doxgen-AT-newsmth.net (with minor modifications for xemacs
1741 doxgen-AT-newsmth.net (with minor modifications for xemacs
1737 compatibility)
1742 compatibility)
1738
1743
1739 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1744 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1740 tracebacks when walking the stack so that the stack tracking system
1745 tracebacks when walking the stack so that the stack tracking system
1741 in emacs' python-mode can identify the frames correctly.
1746 in emacs' python-mode can identify the frames correctly.
1742
1747
1743 * IPython/ipmaker.py (make_IPython): make the internal (and
1748 * IPython/ipmaker.py (make_IPython): make the internal (and
1744 default config) autoedit_syntax value false by default. Too many
1749 default config) autoedit_syntax value false by default. Too many
1745 users have complained to me (both on and off-list) about problems
1750 users have complained to me (both on and off-list) about problems
1746 with this option being on by default, so I'm making it default to
1751 with this option being on by default, so I'm making it default to
1747 off. It can still be enabled by anyone via the usual mechanisms.
1752 off. It can still be enabled by anyone via the usual mechanisms.
1748
1753
1749 * IPython/completer.py (Completer.attr_matches): add support for
1754 * IPython/completer.py (Completer.attr_matches): add support for
1750 PyCrust-style _getAttributeNames magic method. Patch contributed
1755 PyCrust-style _getAttributeNames magic method. Patch contributed
1751 by <mscott-AT-goldenspud.com>. Closes #50.
1756 by <mscott-AT-goldenspud.com>. Closes #50.
1752
1757
1753 * IPython/iplib.py (InteractiveShell.__init__): remove the
1758 * IPython/iplib.py (InteractiveShell.__init__): remove the
1754 deletion of exit/quit from __builtin__, which can break
1759 deletion of exit/quit from __builtin__, which can break
1755 third-party tools like the Zope debugging console. The
1760 third-party tools like the Zope debugging console. The
1756 %exit/%quit magics remain. In general, it's probably a good idea
1761 %exit/%quit magics remain. In general, it's probably a good idea
1757 not to delete anything from __builtin__, since we never know what
1762 not to delete anything from __builtin__, since we never know what
1758 that will break. In any case, python now (for 2.5) will support
1763 that will break. In any case, python now (for 2.5) will support
1759 'real' exit/quit, so this issue is moot. Closes #55.
1764 'real' exit/quit, so this issue is moot. Closes #55.
1760
1765
1761 * IPython/genutils.py (with_obj): rename the 'with' function to
1766 * IPython/genutils.py (with_obj): rename the 'with' function to
1762 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1767 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1763 becomes a language keyword. Closes #53.
1768 becomes a language keyword. Closes #53.
1764
1769
1765 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1770 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1766 __file__ attribute to this so it fools more things into thinking
1771 __file__ attribute to this so it fools more things into thinking
1767 it is a real module. Closes #59.
1772 it is a real module. Closes #59.
1768
1773
1769 * IPython/Magic.py (magic_edit): add -n option to open the editor
1774 * IPython/Magic.py (magic_edit): add -n option to open the editor
1770 at a specific line number. After a patch by Stefan van der Walt.
1775 at a specific line number. After a patch by Stefan van der Walt.
1771
1776
1772 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1777 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1773
1778
1774 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1779 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1775 reason the file could not be opened. After automatic crash
1780 reason the file could not be opened. After automatic crash
1776 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1781 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1777 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1782 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1778 (_should_recompile): Don't fire editor if using %bg, since there
1783 (_should_recompile): Don't fire editor if using %bg, since there
1779 is no file in the first place. From the same report as above.
1784 is no file in the first place. From the same report as above.
1780 (raw_input): protect against faulty third-party prefilters. After
1785 (raw_input): protect against faulty third-party prefilters. After
1781 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1786 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1782 while running under SAGE.
1787 while running under SAGE.
1783
1788
1784 2006-05-23 Ville Vainio <vivainio@gmail.com>
1789 2006-05-23 Ville Vainio <vivainio@gmail.com>
1785
1790
1786 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1791 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1787 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1792 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1788 now returns None (again), unless dummy is specifically allowed by
1793 now returns None (again), unless dummy is specifically allowed by
1789 ipapi.get(allow_dummy=True).
1794 ipapi.get(allow_dummy=True).
1790
1795
1791 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1796 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1792
1797
1793 * IPython: remove all 2.2-compatibility objects and hacks from
1798 * IPython: remove all 2.2-compatibility objects and hacks from
1794 everywhere, since we only support 2.3 at this point. Docs
1799 everywhere, since we only support 2.3 at this point. Docs
1795 updated.
1800 updated.
1796
1801
1797 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1802 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1798 Anything requiring extra validation can be turned into a Python
1803 Anything requiring extra validation can be turned into a Python
1799 property in the future. I used a property for the db one b/c
1804 property in the future. I used a property for the db one b/c
1800 there was a nasty circularity problem with the initialization
1805 there was a nasty circularity problem with the initialization
1801 order, which right now I don't have time to clean up.
1806 order, which right now I don't have time to clean up.
1802
1807
1803 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1808 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1804 another locking bug reported by Jorgen. I'm not 100% sure though,
1809 another locking bug reported by Jorgen. I'm not 100% sure though,
1805 so more testing is needed...
1810 so more testing is needed...
1806
1811
1807 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1812 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1808
1813
1809 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1814 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1810 local variables from any routine in user code (typically executed
1815 local variables from any routine in user code (typically executed
1811 with %run) directly into the interactive namespace. Very useful
1816 with %run) directly into the interactive namespace. Very useful
1812 when doing complex debugging.
1817 when doing complex debugging.
1813 (IPythonNotRunning): Changed the default None object to a dummy
1818 (IPythonNotRunning): Changed the default None object to a dummy
1814 whose attributes can be queried as well as called without
1819 whose attributes can be queried as well as called without
1815 exploding, to ease writing code which works transparently both in
1820 exploding, to ease writing code which works transparently both in
1816 and out of ipython and uses some of this API.
1821 and out of ipython and uses some of this API.
1817
1822
1818 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1823 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1819
1824
1820 * IPython/hooks.py (result_display): Fix the fact that our display
1825 * IPython/hooks.py (result_display): Fix the fact that our display
1821 hook was using str() instead of repr(), as the default python
1826 hook was using str() instead of repr(), as the default python
1822 console does. This had gone unnoticed b/c it only happened if
1827 console does. This had gone unnoticed b/c it only happened if
1823 %Pprint was off, but the inconsistency was there.
1828 %Pprint was off, but the inconsistency was there.
1824
1829
1825 2006-05-15 Ville Vainio <vivainio@gmail.com>
1830 2006-05-15 Ville Vainio <vivainio@gmail.com>
1826
1831
1827 * Oinspect.py: Only show docstring for nonexisting/binary files
1832 * Oinspect.py: Only show docstring for nonexisting/binary files
1828 when doing object??, closing ticket #62
1833 when doing object??, closing ticket #62
1829
1834
1830 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1835 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1831
1836
1832 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1837 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1833 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1838 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1834 was being released in a routine which hadn't checked if it had
1839 was being released in a routine which hadn't checked if it had
1835 been the one to acquire it.
1840 been the one to acquire it.
1836
1841
1837 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1842 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1838
1843
1839 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1844 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1840
1845
1841 2006-04-11 Ville Vainio <vivainio@gmail.com>
1846 2006-04-11 Ville Vainio <vivainio@gmail.com>
1842
1847
1843 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1848 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1844 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1849 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1845 prefilters, allowing stuff like magics and aliases in the file.
1850 prefilters, allowing stuff like magics and aliases in the file.
1846
1851
1847 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1852 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1848 added. Supported now are "%clear in" and "%clear out" (clear input and
1853 added. Supported now are "%clear in" and "%clear out" (clear input and
1849 output history, respectively). Also fixed CachedOutput.flush to
1854 output history, respectively). Also fixed CachedOutput.flush to
1850 properly flush the output cache.
1855 properly flush the output cache.
1851
1856
1852 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1857 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1853 half-success (and fail explicitly).
1858 half-success (and fail explicitly).
1854
1859
1855 2006-03-28 Ville Vainio <vivainio@gmail.com>
1860 2006-03-28 Ville Vainio <vivainio@gmail.com>
1856
1861
1857 * iplib.py: Fix quoting of aliases so that only argless ones
1862 * iplib.py: Fix quoting of aliases so that only argless ones
1858 are quoted
1863 are quoted
1859
1864
1860 2006-03-28 Ville Vainio <vivainio@gmail.com>
1865 2006-03-28 Ville Vainio <vivainio@gmail.com>
1861
1866
1862 * iplib.py: Quote aliases with spaces in the name.
1867 * iplib.py: Quote aliases with spaces in the name.
1863 "c:\program files\blah\bin" is now legal alias target.
1868 "c:\program files\blah\bin" is now legal alias target.
1864
1869
1865 * ext_rehashdir.py: Space no longer allowed as arg
1870 * ext_rehashdir.py: Space no longer allowed as arg
1866 separator, since space is legal in path names.
1871 separator, since space is legal in path names.
1867
1872
1868 2006-03-16 Ville Vainio <vivainio@gmail.com>
1873 2006-03-16 Ville Vainio <vivainio@gmail.com>
1869
1874
1870 * upgrade_dir.py: Take path.py from Extensions, correcting
1875 * upgrade_dir.py: Take path.py from Extensions, correcting
1871 %upgrade magic
1876 %upgrade magic
1872
1877
1873 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1878 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1874
1879
1875 * hooks.py: Only enclose editor binary in quotes if legal and
1880 * hooks.py: Only enclose editor binary in quotes if legal and
1876 necessary (space in the name, and is an existing file). Fixes a bug
1881 necessary (space in the name, and is an existing file). Fixes a bug
1877 reported by Zachary Pincus.
1882 reported by Zachary Pincus.
1878
1883
1879 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1884 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1880
1885
1881 * Manual: thanks to a tip on proper color handling for Emacs, by
1886 * Manual: thanks to a tip on proper color handling for Emacs, by
1882 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1887 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1883
1888
1884 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1889 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1885 by applying the provided patch. Thanks to Liu Jin
1890 by applying the provided patch. Thanks to Liu Jin
1886 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1891 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1887 XEmacs/Linux, I'm trusting the submitter that it actually helps
1892 XEmacs/Linux, I'm trusting the submitter that it actually helps
1888 under win32/GNU Emacs. Will revisit if any problems are reported.
1893 under win32/GNU Emacs. Will revisit if any problems are reported.
1889
1894
1890 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1895 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1891
1896
1892 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1897 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1893 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1898 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1894
1899
1895 2006-03-12 Ville Vainio <vivainio@gmail.com>
1900 2006-03-12 Ville Vainio <vivainio@gmail.com>
1896
1901
1897 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1902 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1898 Torsten Marek.
1903 Torsten Marek.
1899
1904
1900 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1905 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1901
1906
1902 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1907 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1903 line ranges works again.
1908 line ranges works again.
1904
1909
1905 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1910 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1906
1911
1907 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1912 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1908 and friends, after a discussion with Zach Pincus on ipython-user.
1913 and friends, after a discussion with Zach Pincus on ipython-user.
1909 I'm not 100% sure, but after thinking about it quite a bit, it may
1914 I'm not 100% sure, but after thinking about it quite a bit, it may
1910 be OK. Testing with the multithreaded shells didn't reveal any
1915 be OK. Testing with the multithreaded shells didn't reveal any
1911 problems, but let's keep an eye out.
1916 problems, but let's keep an eye out.
1912
1917
1913 In the process, I fixed a few things which were calling
1918 In the process, I fixed a few things which were calling
1914 self.InteractiveTB() directly (like safe_execfile), which is a
1919 self.InteractiveTB() directly (like safe_execfile), which is a
1915 mistake: ALL exception reporting should be done by calling
1920 mistake: ALL exception reporting should be done by calling
1916 self.showtraceback(), which handles state and tab-completion and
1921 self.showtraceback(), which handles state and tab-completion and
1917 more.
1922 more.
1918
1923
1919 2006-03-01 Ville Vainio <vivainio@gmail.com>
1924 2006-03-01 Ville Vainio <vivainio@gmail.com>
1920
1925
1921 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1926 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1922 To use, do "from ipipe import *".
1927 To use, do "from ipipe import *".
1923
1928
1924 2006-02-24 Ville Vainio <vivainio@gmail.com>
1929 2006-02-24 Ville Vainio <vivainio@gmail.com>
1925
1930
1926 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1931 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1927 "cleanly" and safely than the older upgrade mechanism.
1932 "cleanly" and safely than the older upgrade mechanism.
1928
1933
1929 2006-02-21 Ville Vainio <vivainio@gmail.com>
1934 2006-02-21 Ville Vainio <vivainio@gmail.com>
1930
1935
1931 * Magic.py: %save works again.
1936 * Magic.py: %save works again.
1932
1937
1933 2006-02-15 Ville Vainio <vivainio@gmail.com>
1938 2006-02-15 Ville Vainio <vivainio@gmail.com>
1934
1939
1935 * Magic.py: %Pprint works again
1940 * Magic.py: %Pprint works again
1936
1941
1937 * Extensions/ipy_sane_defaults.py: Provide everything provided
1942 * Extensions/ipy_sane_defaults.py: Provide everything provided
1938 in default ipythonrc, to make it possible to have a completely empty
1943 in default ipythonrc, to make it possible to have a completely empty
1939 ipythonrc (and thus completely rc-file free configuration)
1944 ipythonrc (and thus completely rc-file free configuration)
1940
1945
1941 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1946 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1942
1947
1943 * IPython/hooks.py (editor): quote the call to the editor command,
1948 * IPython/hooks.py (editor): quote the call to the editor command,
1944 to allow commands with spaces in them. Problem noted by watching
1949 to allow commands with spaces in them. Problem noted by watching
1945 Ian Oswald's video about textpad under win32 at
1950 Ian Oswald's video about textpad under win32 at
1946 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1951 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1947
1952
1948 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1953 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1949 describing magics (we haven't used @ for a loong time).
1954 describing magics (we haven't used @ for a loong time).
1950
1955
1951 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1956 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1952 contributed by marienz to close
1957 contributed by marienz to close
1953 http://www.scipy.net/roundup/ipython/issue53.
1958 http://www.scipy.net/roundup/ipython/issue53.
1954
1959
1955 2006-02-10 Ville Vainio <vivainio@gmail.com>
1960 2006-02-10 Ville Vainio <vivainio@gmail.com>
1956
1961
1957 * genutils.py: getoutput now works in win32 too
1962 * genutils.py: getoutput now works in win32 too
1958
1963
1959 * completer.py: alias and magic completion only invoked
1964 * completer.py: alias and magic completion only invoked
1960 at the first "item" in the line, to avoid "cd %store"
1965 at the first "item" in the line, to avoid "cd %store"
1961 nonsense.
1966 nonsense.
1962
1967
1963 2006-02-09 Ville Vainio <vivainio@gmail.com>
1968 2006-02-09 Ville Vainio <vivainio@gmail.com>
1964
1969
1965 * test/*: Added a unit testing framework (finally).
1970 * test/*: Added a unit testing framework (finally).
1966 '%run runtests.py' to run test_*.
1971 '%run runtests.py' to run test_*.
1967
1972
1968 * ipapi.py: Exposed runlines and set_custom_exc
1973 * ipapi.py: Exposed runlines and set_custom_exc
1969
1974
1970 2006-02-07 Ville Vainio <vivainio@gmail.com>
1975 2006-02-07 Ville Vainio <vivainio@gmail.com>
1971
1976
1972 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1977 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1973 instead use "f(1 2)" as before.
1978 instead use "f(1 2)" as before.
1974
1979
1975 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1980 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1976
1981
1977 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1982 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1978 facilities, for demos processed by the IPython input filter
1983 facilities, for demos processed by the IPython input filter
1979 (IPythonDemo), and for running a script one-line-at-a-time as a
1984 (IPythonDemo), and for running a script one-line-at-a-time as a
1980 demo, both for pure Python (LineDemo) and for IPython-processed
1985 demo, both for pure Python (LineDemo) and for IPython-processed
1981 input (IPythonLineDemo). After a request by Dave Kohel, from the
1986 input (IPythonLineDemo). After a request by Dave Kohel, from the
1982 SAGE team.
1987 SAGE team.
1983 (Demo.edit): added an edit() method to the demo objects, to edit
1988 (Demo.edit): added an edit() method to the demo objects, to edit
1984 the in-memory copy of the last executed block.
1989 the in-memory copy of the last executed block.
1985
1990
1986 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1991 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1987 processing to %edit, %macro and %save. These commands can now be
1992 processing to %edit, %macro and %save. These commands can now be
1988 invoked on the unprocessed input as it was typed by the user
1993 invoked on the unprocessed input as it was typed by the user
1989 (without any prefilters applied). After requests by the SAGE team
1994 (without any prefilters applied). After requests by the SAGE team
1990 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1995 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1991
1996
1992 2006-02-01 Ville Vainio <vivainio@gmail.com>
1997 2006-02-01 Ville Vainio <vivainio@gmail.com>
1993
1998
1994 * setup.py, eggsetup.py: easy_install ipython==dev works
1999 * setup.py, eggsetup.py: easy_install ipython==dev works
1995 correctly now (on Linux)
2000 correctly now (on Linux)
1996
2001
1997 * ipy_user_conf,ipmaker: user config changes, removed spurious
2002 * ipy_user_conf,ipmaker: user config changes, removed spurious
1998 warnings
2003 warnings
1999
2004
2000 * iplib: if rc.banner is string, use it as is.
2005 * iplib: if rc.banner is string, use it as is.
2001
2006
2002 * Magic: %pycat accepts a string argument and pages it's contents.
2007 * Magic: %pycat accepts a string argument and pages it's contents.
2003
2008
2004
2009
2005 2006-01-30 Ville Vainio <vivainio@gmail.com>
2010 2006-01-30 Ville Vainio <vivainio@gmail.com>
2006
2011
2007 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2012 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2008 Now %store and bookmarks work through PickleShare, meaning that
2013 Now %store and bookmarks work through PickleShare, meaning that
2009 concurrent access is possible and all ipython sessions see the
2014 concurrent access is possible and all ipython sessions see the
2010 same database situation all the time, instead of snapshot of
2015 same database situation all the time, instead of snapshot of
2011 the situation when the session was started. Hence, %bookmark
2016 the situation when the session was started. Hence, %bookmark
2012 results are immediately accessible from othes sessions. The database
2017 results are immediately accessible from othes sessions. The database
2013 is also available for use by user extensions. See:
2018 is also available for use by user extensions. See:
2014 http://www.python.org/pypi/pickleshare
2019 http://www.python.org/pypi/pickleshare
2015
2020
2016 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2021 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2017
2022
2018 * aliases can now be %store'd
2023 * aliases can now be %store'd
2019
2024
2020 * path.py moved to Extensions so that pickleshare does not need
2025 * path.py moved to Extensions so that pickleshare does not need
2021 IPython-specific import. Extensions added to pythonpath right
2026 IPython-specific import. Extensions added to pythonpath right
2022 at __init__.
2027 at __init__.
2023
2028
2024 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2029 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2025 called with _ip.system and the pre-transformed command string.
2030 called with _ip.system and the pre-transformed command string.
2026
2031
2027 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2032 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2028
2033
2029 * IPython/iplib.py (interact): Fix that we were not catching
2034 * IPython/iplib.py (interact): Fix that we were not catching
2030 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2035 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2031 logic here had to change, but it's fixed now.
2036 logic here had to change, but it's fixed now.
2032
2037
2033 2006-01-29 Ville Vainio <vivainio@gmail.com>
2038 2006-01-29 Ville Vainio <vivainio@gmail.com>
2034
2039
2035 * iplib.py: Try to import pyreadline on Windows.
2040 * iplib.py: Try to import pyreadline on Windows.
2036
2041
2037 2006-01-27 Ville Vainio <vivainio@gmail.com>
2042 2006-01-27 Ville Vainio <vivainio@gmail.com>
2038
2043
2039 * iplib.py: Expose ipapi as _ip in builtin namespace.
2044 * iplib.py: Expose ipapi as _ip in builtin namespace.
2040 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2045 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2041 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2046 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2042 syntax now produce _ip.* variant of the commands.
2047 syntax now produce _ip.* variant of the commands.
2043
2048
2044 * "_ip.options().autoedit_syntax = 2" automatically throws
2049 * "_ip.options().autoedit_syntax = 2" automatically throws
2045 user to editor for syntax error correction without prompting.
2050 user to editor for syntax error correction without prompting.
2046
2051
2047 2006-01-27 Ville Vainio <vivainio@gmail.com>
2052 2006-01-27 Ville Vainio <vivainio@gmail.com>
2048
2053
2049 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2054 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2050 'ipython' at argv[0]) executed through command line.
2055 'ipython' at argv[0]) executed through command line.
2051 NOTE: this DEPRECATES calling ipython with multiple scripts
2056 NOTE: this DEPRECATES calling ipython with multiple scripts
2052 ("ipython a.py b.py c.py")
2057 ("ipython a.py b.py c.py")
2053
2058
2054 * iplib.py, hooks.py: Added configurable input prefilter,
2059 * iplib.py, hooks.py: Added configurable input prefilter,
2055 named 'input_prefilter'. See ext_rescapture.py for example
2060 named 'input_prefilter'. See ext_rescapture.py for example
2056 usage.
2061 usage.
2057
2062
2058 * ext_rescapture.py, Magic.py: Better system command output capture
2063 * ext_rescapture.py, Magic.py: Better system command output capture
2059 through 'var = !ls' (deprecates user-visible %sc). Same notation
2064 through 'var = !ls' (deprecates user-visible %sc). Same notation
2060 applies for magics, 'var = %alias' assigns alias list to var.
2065 applies for magics, 'var = %alias' assigns alias list to var.
2061
2066
2062 * ipapi.py: added meta() for accessing extension-usable data store.
2067 * ipapi.py: added meta() for accessing extension-usable data store.
2063
2068
2064 * iplib.py: added InteractiveShell.getapi(). New magics should be
2069 * iplib.py: added InteractiveShell.getapi(). New magics should be
2065 written doing self.getapi() instead of using the shell directly.
2070 written doing self.getapi() instead of using the shell directly.
2066
2071
2067 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2072 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2068 %store foo >> ~/myfoo.txt to store variables to files (in clean
2073 %store foo >> ~/myfoo.txt to store variables to files (in clean
2069 textual form, not a restorable pickle).
2074 textual form, not a restorable pickle).
2070
2075
2071 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2076 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2072
2077
2073 * usage.py, Magic.py: added %quickref
2078 * usage.py, Magic.py: added %quickref
2074
2079
2075 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2080 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2076
2081
2077 * GetoptErrors when invoking magics etc. with wrong args
2082 * GetoptErrors when invoking magics etc. with wrong args
2078 are now more helpful:
2083 are now more helpful:
2079 GetoptError: option -l not recognized (allowed: "qb" )
2084 GetoptError: option -l not recognized (allowed: "qb" )
2080
2085
2081 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2086 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2082
2087
2083 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2088 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2084 computationally intensive blocks don't appear to stall the demo.
2089 computationally intensive blocks don't appear to stall the demo.
2085
2090
2086 2006-01-24 Ville Vainio <vivainio@gmail.com>
2091 2006-01-24 Ville Vainio <vivainio@gmail.com>
2087
2092
2088 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2093 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2089 value to manipulate resulting history entry.
2094 value to manipulate resulting history entry.
2090
2095
2091 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2096 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2092 to instance methods of IPApi class, to make extending an embedded
2097 to instance methods of IPApi class, to make extending an embedded
2093 IPython feasible. See ext_rehashdir.py for example usage.
2098 IPython feasible. See ext_rehashdir.py for example usage.
2094
2099
2095 * Merged 1071-1076 from branches/0.7.1
2100 * Merged 1071-1076 from branches/0.7.1
2096
2101
2097
2102
2098 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2103 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2099
2104
2100 * tools/release (daystamp): Fix build tools to use the new
2105 * tools/release (daystamp): Fix build tools to use the new
2101 eggsetup.py script to build lightweight eggs.
2106 eggsetup.py script to build lightweight eggs.
2102
2107
2103 * Applied changesets 1062 and 1064 before 0.7.1 release.
2108 * Applied changesets 1062 and 1064 before 0.7.1 release.
2104
2109
2105 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2110 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2106 see the raw input history (without conversions like %ls ->
2111 see the raw input history (without conversions like %ls ->
2107 ipmagic("ls")). After a request from W. Stein, SAGE
2112 ipmagic("ls")). After a request from W. Stein, SAGE
2108 (http://modular.ucsd.edu/sage) developer. This information is
2113 (http://modular.ucsd.edu/sage) developer. This information is
2109 stored in the input_hist_raw attribute of the IPython instance, so
2114 stored in the input_hist_raw attribute of the IPython instance, so
2110 developers can access it if needed (it's an InputList instance).
2115 developers can access it if needed (it's an InputList instance).
2111
2116
2112 * Versionstring = 0.7.2.svn
2117 * Versionstring = 0.7.2.svn
2113
2118
2114 * eggsetup.py: A separate script for constructing eggs, creates
2119 * eggsetup.py: A separate script for constructing eggs, creates
2115 proper launch scripts even on Windows (an .exe file in
2120 proper launch scripts even on Windows (an .exe file in
2116 \python24\scripts).
2121 \python24\scripts).
2117
2122
2118 * ipapi.py: launch_new_instance, launch entry point needed for the
2123 * ipapi.py: launch_new_instance, launch entry point needed for the
2119 egg.
2124 egg.
2120
2125
2121 2006-01-23 Ville Vainio <vivainio@gmail.com>
2126 2006-01-23 Ville Vainio <vivainio@gmail.com>
2122
2127
2123 * Added %cpaste magic for pasting python code
2128 * Added %cpaste magic for pasting python code
2124
2129
2125 2006-01-22 Ville Vainio <vivainio@gmail.com>
2130 2006-01-22 Ville Vainio <vivainio@gmail.com>
2126
2131
2127 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2132 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2128
2133
2129 * Versionstring = 0.7.2.svn
2134 * Versionstring = 0.7.2.svn
2130
2135
2131 * eggsetup.py: A separate script for constructing eggs, creates
2136 * eggsetup.py: A separate script for constructing eggs, creates
2132 proper launch scripts even on Windows (an .exe file in
2137 proper launch scripts even on Windows (an .exe file in
2133 \python24\scripts).
2138 \python24\scripts).
2134
2139
2135 * ipapi.py: launch_new_instance, launch entry point needed for the
2140 * ipapi.py: launch_new_instance, launch entry point needed for the
2136 egg.
2141 egg.
2137
2142
2138 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2143 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2139
2144
2140 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2145 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2141 %pfile foo would print the file for foo even if it was a binary.
2146 %pfile foo would print the file for foo even if it was a binary.
2142 Now, extensions '.so' and '.dll' are skipped.
2147 Now, extensions '.so' and '.dll' are skipped.
2143
2148
2144 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2149 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2145 bug, where macros would fail in all threaded modes. I'm not 100%
2150 bug, where macros would fail in all threaded modes. I'm not 100%
2146 sure, so I'm going to put out an rc instead of making a release
2151 sure, so I'm going to put out an rc instead of making a release
2147 today, and wait for feedback for at least a few days.
2152 today, and wait for feedback for at least a few days.
2148
2153
2149 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2154 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2150 it...) the handling of pasting external code with autoindent on.
2155 it...) the handling of pasting external code with autoindent on.
2151 To get out of a multiline input, the rule will appear for most
2156 To get out of a multiline input, the rule will appear for most
2152 users unchanged: two blank lines or change the indent level
2157 users unchanged: two blank lines or change the indent level
2153 proposed by IPython. But there is a twist now: you can
2158 proposed by IPython. But there is a twist now: you can
2154 add/subtract only *one or two spaces*. If you add/subtract three
2159 add/subtract only *one or two spaces*. If you add/subtract three
2155 or more (unless you completely delete the line), IPython will
2160 or more (unless you completely delete the line), IPython will
2156 accept that line, and you'll need to enter a second one of pure
2161 accept that line, and you'll need to enter a second one of pure
2157 whitespace. I know it sounds complicated, but I can't find a
2162 whitespace. I know it sounds complicated, but I can't find a
2158 different solution that covers all the cases, with the right
2163 different solution that covers all the cases, with the right
2159 heuristics. Hopefully in actual use, nobody will really notice
2164 heuristics. Hopefully in actual use, nobody will really notice
2160 all these strange rules and things will 'just work'.
2165 all these strange rules and things will 'just work'.
2161
2166
2162 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2167 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2163
2168
2164 * IPython/iplib.py (interact): catch exceptions which can be
2169 * IPython/iplib.py (interact): catch exceptions which can be
2165 triggered asynchronously by signal handlers. Thanks to an
2170 triggered asynchronously by signal handlers. Thanks to an
2166 automatic crash report, submitted by Colin Kingsley
2171 automatic crash report, submitted by Colin Kingsley
2167 <tercel-AT-gentoo.org>.
2172 <tercel-AT-gentoo.org>.
2168
2173
2169 2006-01-20 Ville Vainio <vivainio@gmail.com>
2174 2006-01-20 Ville Vainio <vivainio@gmail.com>
2170
2175
2171 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2176 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2172 (%rehashdir, very useful, try it out) of how to extend ipython
2177 (%rehashdir, very useful, try it out) of how to extend ipython
2173 with new magics. Also added Extensions dir to pythonpath to make
2178 with new magics. Also added Extensions dir to pythonpath to make
2174 importing extensions easy.
2179 importing extensions easy.
2175
2180
2176 * %store now complains when trying to store interactively declared
2181 * %store now complains when trying to store interactively declared
2177 classes / instances of those classes.
2182 classes / instances of those classes.
2178
2183
2179 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2184 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2180 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2185 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2181 if they exist, and ipy_user_conf.py with some defaults is created for
2186 if they exist, and ipy_user_conf.py with some defaults is created for
2182 the user.
2187 the user.
2183
2188
2184 * Startup rehashing done by the config file, not InterpreterExec.
2189 * Startup rehashing done by the config file, not InterpreterExec.
2185 This means system commands are available even without selecting the
2190 This means system commands are available even without selecting the
2186 pysh profile. It's the sensible default after all.
2191 pysh profile. It's the sensible default after all.
2187
2192
2188 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2193 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2189
2194
2190 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2195 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2191 multiline code with autoindent on working. But I am really not
2196 multiline code with autoindent on working. But I am really not
2192 sure, so this needs more testing. Will commit a debug-enabled
2197 sure, so this needs more testing. Will commit a debug-enabled
2193 version for now, while I test it some more, so that Ville and
2198 version for now, while I test it some more, so that Ville and
2194 others may also catch any problems. Also made
2199 others may also catch any problems. Also made
2195 self.indent_current_str() a method, to ensure that there's no
2200 self.indent_current_str() a method, to ensure that there's no
2196 chance of the indent space count and the corresponding string
2201 chance of the indent space count and the corresponding string
2197 falling out of sync. All code needing the string should just call
2202 falling out of sync. All code needing the string should just call
2198 the method.
2203 the method.
2199
2204
2200 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2205 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2201
2206
2202 * IPython/Magic.py (magic_edit): fix check for when users don't
2207 * IPython/Magic.py (magic_edit): fix check for when users don't
2203 save their output files, the try/except was in the wrong section.
2208 save their output files, the try/except was in the wrong section.
2204
2209
2205 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2210 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2206
2211
2207 * IPython/Magic.py (magic_run): fix __file__ global missing from
2212 * IPython/Magic.py (magic_run): fix __file__ global missing from
2208 script's namespace when executed via %run. After a report by
2213 script's namespace when executed via %run. After a report by
2209 Vivian.
2214 Vivian.
2210
2215
2211 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2216 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2212 when using python 2.4. The parent constructor changed in 2.4, and
2217 when using python 2.4. The parent constructor changed in 2.4, and
2213 we need to track it directly (we can't call it, as it messes up
2218 we need to track it directly (we can't call it, as it messes up
2214 readline and tab-completion inside our pdb would stop working).
2219 readline and tab-completion inside our pdb would stop working).
2215 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2220 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2216
2221
2217 2006-01-16 Ville Vainio <vivainio@gmail.com>
2222 2006-01-16 Ville Vainio <vivainio@gmail.com>
2218
2223
2219 * Ipython/magic.py: Reverted back to old %edit functionality
2224 * Ipython/magic.py: Reverted back to old %edit functionality
2220 that returns file contents on exit.
2225 that returns file contents on exit.
2221
2226
2222 * IPython/path.py: Added Jason Orendorff's "path" module to
2227 * IPython/path.py: Added Jason Orendorff's "path" module to
2223 IPython tree, http://www.jorendorff.com/articles/python/path/.
2228 IPython tree, http://www.jorendorff.com/articles/python/path/.
2224 You can get path objects conveniently through %sc, and !!, e.g.:
2229 You can get path objects conveniently through %sc, and !!, e.g.:
2225 sc files=ls
2230 sc files=ls
2226 for p in files.paths: # or files.p
2231 for p in files.paths: # or files.p
2227 print p,p.mtime
2232 print p,p.mtime
2228
2233
2229 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2234 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2230 now work again without considering the exclusion regexp -
2235 now work again without considering the exclusion regexp -
2231 hence, things like ',foo my/path' turn to 'foo("my/path")'
2236 hence, things like ',foo my/path' turn to 'foo("my/path")'
2232 instead of syntax error.
2237 instead of syntax error.
2233
2238
2234
2239
2235 2006-01-14 Ville Vainio <vivainio@gmail.com>
2240 2006-01-14 Ville Vainio <vivainio@gmail.com>
2236
2241
2237 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2242 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2238 ipapi decorators for python 2.4 users, options() provides access to rc
2243 ipapi decorators for python 2.4 users, options() provides access to rc
2239 data.
2244 data.
2240
2245
2241 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2246 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2242 as path separators (even on Linux ;-). Space character after
2247 as path separators (even on Linux ;-). Space character after
2243 backslash (as yielded by tab completer) is still space;
2248 backslash (as yielded by tab completer) is still space;
2244 "%cd long\ name" works as expected.
2249 "%cd long\ name" works as expected.
2245
2250
2246 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2251 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2247 as "chain of command", with priority. API stays the same,
2252 as "chain of command", with priority. API stays the same,
2248 TryNext exception raised by a hook function signals that
2253 TryNext exception raised by a hook function signals that
2249 current hook failed and next hook should try handling it, as
2254 current hook failed and next hook should try handling it, as
2250 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2255 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2251 requested configurable display hook, which is now implemented.
2256 requested configurable display hook, which is now implemented.
2252
2257
2253 2006-01-13 Ville Vainio <vivainio@gmail.com>
2258 2006-01-13 Ville Vainio <vivainio@gmail.com>
2254
2259
2255 * IPython/platutils*.py: platform specific utility functions,
2260 * IPython/platutils*.py: platform specific utility functions,
2256 so far only set_term_title is implemented (change terminal
2261 so far only set_term_title is implemented (change terminal
2257 label in windowing systems). %cd now changes the title to
2262 label in windowing systems). %cd now changes the title to
2258 current dir.
2263 current dir.
2259
2264
2260 * IPython/Release.py: Added myself to "authors" list,
2265 * IPython/Release.py: Added myself to "authors" list,
2261 had to create new files.
2266 had to create new files.
2262
2267
2263 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2268 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2264 shell escape; not a known bug but had potential to be one in the
2269 shell escape; not a known bug but had potential to be one in the
2265 future.
2270 future.
2266
2271
2267 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2272 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2268 extension API for IPython! See the module for usage example. Fix
2273 extension API for IPython! See the module for usage example. Fix
2269 OInspect for docstring-less magic functions.
2274 OInspect for docstring-less magic functions.
2270
2275
2271
2276
2272 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2277 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2273
2278
2274 * IPython/iplib.py (raw_input): temporarily deactivate all
2279 * IPython/iplib.py (raw_input): temporarily deactivate all
2275 attempts at allowing pasting of code with autoindent on. It
2280 attempts at allowing pasting of code with autoindent on. It
2276 introduced bugs (reported by Prabhu) and I can't seem to find a
2281 introduced bugs (reported by Prabhu) and I can't seem to find a
2277 robust combination which works in all cases. Will have to revisit
2282 robust combination which works in all cases. Will have to revisit
2278 later.
2283 later.
2279
2284
2280 * IPython/genutils.py: remove isspace() function. We've dropped
2285 * IPython/genutils.py: remove isspace() function. We've dropped
2281 2.2 compatibility, so it's OK to use the string method.
2286 2.2 compatibility, so it's OK to use the string method.
2282
2287
2283 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2288 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2284
2289
2285 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2290 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2286 matching what NOT to autocall on, to include all python binary
2291 matching what NOT to autocall on, to include all python binary
2287 operators (including things like 'and', 'or', 'is' and 'in').
2292 operators (including things like 'and', 'or', 'is' and 'in').
2288 Prompted by a bug report on 'foo & bar', but I realized we had
2293 Prompted by a bug report on 'foo & bar', but I realized we had
2289 many more potential bug cases with other operators. The regexp is
2294 many more potential bug cases with other operators. The regexp is
2290 self.re_exclude_auto, it's fairly commented.
2295 self.re_exclude_auto, it's fairly commented.
2291
2296
2292 2006-01-12 Ville Vainio <vivainio@gmail.com>
2297 2006-01-12 Ville Vainio <vivainio@gmail.com>
2293
2298
2294 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2299 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2295 Prettified and hardened string/backslash quoting with ipsystem(),
2300 Prettified and hardened string/backslash quoting with ipsystem(),
2296 ipalias() and ipmagic(). Now even \ characters are passed to
2301 ipalias() and ipmagic(). Now even \ characters are passed to
2297 %magics, !shell escapes and aliases exactly as they are in the
2302 %magics, !shell escapes and aliases exactly as they are in the
2298 ipython command line. Should improve backslash experience,
2303 ipython command line. Should improve backslash experience,
2299 particularly in Windows (path delimiter for some commands that
2304 particularly in Windows (path delimiter for some commands that
2300 won't understand '/'), but Unix benefits as well (regexps). %cd
2305 won't understand '/'), but Unix benefits as well (regexps). %cd
2301 magic still doesn't support backslash path delimiters, though. Also
2306 magic still doesn't support backslash path delimiters, though. Also
2302 deleted all pretense of supporting multiline command strings in
2307 deleted all pretense of supporting multiline command strings in
2303 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2308 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2304
2309
2305 * doc/build_doc_instructions.txt added. Documentation on how to
2310 * doc/build_doc_instructions.txt added. Documentation on how to
2306 use doc/update_manual.py, added yesterday. Both files contributed
2311 use doc/update_manual.py, added yesterday. Both files contributed
2307 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2312 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2308 doc/*.sh for deprecation at a later date.
2313 doc/*.sh for deprecation at a later date.
2309
2314
2310 * /ipython.py Added ipython.py to root directory for
2315 * /ipython.py Added ipython.py to root directory for
2311 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2316 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2312 ipython.py) and development convenience (no need to keep doing
2317 ipython.py) and development convenience (no need to keep doing
2313 "setup.py install" between changes).
2318 "setup.py install" between changes).
2314
2319
2315 * Made ! and !! shell escapes work (again) in multiline expressions:
2320 * Made ! and !! shell escapes work (again) in multiline expressions:
2316 if 1:
2321 if 1:
2317 !ls
2322 !ls
2318 !!ls
2323 !!ls
2319
2324
2320 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2325 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2321
2326
2322 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2327 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2323 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2328 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2324 module in case-insensitive installation. Was causing crashes
2329 module in case-insensitive installation. Was causing crashes
2325 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2330 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2326
2331
2327 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2332 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2328 <marienz-AT-gentoo.org>, closes
2333 <marienz-AT-gentoo.org>, closes
2329 http://www.scipy.net/roundup/ipython/issue51.
2334 http://www.scipy.net/roundup/ipython/issue51.
2330
2335
2331 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2336 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2332
2337
2333 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2338 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2334 problem of excessive CPU usage under *nix and keyboard lag under
2339 problem of excessive CPU usage under *nix and keyboard lag under
2335 win32.
2340 win32.
2336
2341
2337 2006-01-10 *** Released version 0.7.0
2342 2006-01-10 *** Released version 0.7.0
2338
2343
2339 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2344 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2340
2345
2341 * IPython/Release.py (revision): tag version number to 0.7.0,
2346 * IPython/Release.py (revision): tag version number to 0.7.0,
2342 ready for release.
2347 ready for release.
2343
2348
2344 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2349 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2345 it informs the user of the name of the temp. file used. This can
2350 it informs the user of the name of the temp. file used. This can
2346 help if you decide later to reuse that same file, so you know
2351 help if you decide later to reuse that same file, so you know
2347 where to copy the info from.
2352 where to copy the info from.
2348
2353
2349 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2354 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2350
2355
2351 * setup_bdist_egg.py: little script to build an egg. Added
2356 * setup_bdist_egg.py: little script to build an egg. Added
2352 support in the release tools as well.
2357 support in the release tools as well.
2353
2358
2354 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2359 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2355
2360
2356 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2361 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2357 version selection (new -wxversion command line and ipythonrc
2362 version selection (new -wxversion command line and ipythonrc
2358 parameter). Patch contributed by Arnd Baecker
2363 parameter). Patch contributed by Arnd Baecker
2359 <arnd.baecker-AT-web.de>.
2364 <arnd.baecker-AT-web.de>.
2360
2365
2361 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2366 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2362 embedded instances, for variables defined at the interactive
2367 embedded instances, for variables defined at the interactive
2363 prompt of the embedded ipython. Reported by Arnd.
2368 prompt of the embedded ipython. Reported by Arnd.
2364
2369
2365 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2370 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2366 it can be used as a (stateful) toggle, or with a direct parameter.
2371 it can be used as a (stateful) toggle, or with a direct parameter.
2367
2372
2368 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2373 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2369 could be triggered in certain cases and cause the traceback
2374 could be triggered in certain cases and cause the traceback
2370 printer not to work.
2375 printer not to work.
2371
2376
2372 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2377 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2373
2378
2374 * IPython/iplib.py (_should_recompile): Small fix, closes
2379 * IPython/iplib.py (_should_recompile): Small fix, closes
2375 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2380 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2376
2381
2377 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2382 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2378
2383
2379 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2384 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2380 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2385 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2381 Moad for help with tracking it down.
2386 Moad for help with tracking it down.
2382
2387
2383 * IPython/iplib.py (handle_auto): fix autocall handling for
2388 * IPython/iplib.py (handle_auto): fix autocall handling for
2384 objects which support BOTH __getitem__ and __call__ (so that f [x]
2389 objects which support BOTH __getitem__ and __call__ (so that f [x]
2385 is left alone, instead of becoming f([x]) automatically).
2390 is left alone, instead of becoming f([x]) automatically).
2386
2391
2387 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2392 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2388 Ville's patch.
2393 Ville's patch.
2389
2394
2390 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2395 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2391
2396
2392 * IPython/iplib.py (handle_auto): changed autocall semantics to
2397 * IPython/iplib.py (handle_auto): changed autocall semantics to
2393 include 'smart' mode, where the autocall transformation is NOT
2398 include 'smart' mode, where the autocall transformation is NOT
2394 applied if there are no arguments on the line. This allows you to
2399 applied if there are no arguments on the line. This allows you to
2395 just type 'foo' if foo is a callable to see its internal form,
2400 just type 'foo' if foo is a callable to see its internal form,
2396 instead of having it called with no arguments (typically a
2401 instead of having it called with no arguments (typically a
2397 mistake). The old 'full' autocall still exists: for that, you
2402 mistake). The old 'full' autocall still exists: for that, you
2398 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2403 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2399
2404
2400 * IPython/completer.py (Completer.attr_matches): add
2405 * IPython/completer.py (Completer.attr_matches): add
2401 tab-completion support for Enthoughts' traits. After a report by
2406 tab-completion support for Enthoughts' traits. After a report by
2402 Arnd and a patch by Prabhu.
2407 Arnd and a patch by Prabhu.
2403
2408
2404 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2409 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2405
2410
2406 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2411 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2407 Schmolck's patch to fix inspect.getinnerframes().
2412 Schmolck's patch to fix inspect.getinnerframes().
2408
2413
2409 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2414 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2410 for embedded instances, regarding handling of namespaces and items
2415 for embedded instances, regarding handling of namespaces and items
2411 added to the __builtin__ one. Multiple embedded instances and
2416 added to the __builtin__ one. Multiple embedded instances and
2412 recursive embeddings should work better now (though I'm not sure
2417 recursive embeddings should work better now (though I'm not sure
2413 I've got all the corner cases fixed, that code is a bit of a brain
2418 I've got all the corner cases fixed, that code is a bit of a brain
2414 twister).
2419 twister).
2415
2420
2416 * IPython/Magic.py (magic_edit): added support to edit in-memory
2421 * IPython/Magic.py (magic_edit): added support to edit in-memory
2417 macros (automatically creates the necessary temp files). %edit
2422 macros (automatically creates the necessary temp files). %edit
2418 also doesn't return the file contents anymore, it's just noise.
2423 also doesn't return the file contents anymore, it's just noise.
2419
2424
2420 * IPython/completer.py (Completer.attr_matches): revert change to
2425 * IPython/completer.py (Completer.attr_matches): revert change to
2421 complete only on attributes listed in __all__. I realized it
2426 complete only on attributes listed in __all__. I realized it
2422 cripples the tab-completion system as a tool for exploring the
2427 cripples the tab-completion system as a tool for exploring the
2423 internals of unknown libraries (it renders any non-__all__
2428 internals of unknown libraries (it renders any non-__all__
2424 attribute off-limits). I got bit by this when trying to see
2429 attribute off-limits). I got bit by this when trying to see
2425 something inside the dis module.
2430 something inside the dis module.
2426
2431
2427 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2432 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2428
2433
2429 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2434 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2430 namespace for users and extension writers to hold data in. This
2435 namespace for users and extension writers to hold data in. This
2431 follows the discussion in
2436 follows the discussion in
2432 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2437 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2433
2438
2434 * IPython/completer.py (IPCompleter.complete): small patch to help
2439 * IPython/completer.py (IPCompleter.complete): small patch to help
2435 tab-completion under Emacs, after a suggestion by John Barnard
2440 tab-completion under Emacs, after a suggestion by John Barnard
2436 <barnarj-AT-ccf.org>.
2441 <barnarj-AT-ccf.org>.
2437
2442
2438 * IPython/Magic.py (Magic.extract_input_slices): added support for
2443 * IPython/Magic.py (Magic.extract_input_slices): added support for
2439 the slice notation in magics to use N-M to represent numbers N...M
2444 the slice notation in magics to use N-M to represent numbers N...M
2440 (closed endpoints). This is used by %macro and %save.
2445 (closed endpoints). This is used by %macro and %save.
2441
2446
2442 * IPython/completer.py (Completer.attr_matches): for modules which
2447 * IPython/completer.py (Completer.attr_matches): for modules which
2443 define __all__, complete only on those. After a patch by Jeffrey
2448 define __all__, complete only on those. After a patch by Jeffrey
2444 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2449 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2445 speed up this routine.
2450 speed up this routine.
2446
2451
2447 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2452 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2448 don't know if this is the end of it, but the behavior now is
2453 don't know if this is the end of it, but the behavior now is
2449 certainly much more correct. Note that coupled with macros,
2454 certainly much more correct. Note that coupled with macros,
2450 slightly surprising (at first) behavior may occur: a macro will in
2455 slightly surprising (at first) behavior may occur: a macro will in
2451 general expand to multiple lines of input, so upon exiting, the
2456 general expand to multiple lines of input, so upon exiting, the
2452 in/out counters will both be bumped by the corresponding amount
2457 in/out counters will both be bumped by the corresponding amount
2453 (as if the macro's contents had been typed interactively). Typing
2458 (as if the macro's contents had been typed interactively). Typing
2454 %hist will reveal the intermediate (silently processed) lines.
2459 %hist will reveal the intermediate (silently processed) lines.
2455
2460
2456 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2461 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2457 pickle to fail (%run was overwriting __main__ and not restoring
2462 pickle to fail (%run was overwriting __main__ and not restoring
2458 it, but pickle relies on __main__ to operate).
2463 it, but pickle relies on __main__ to operate).
2459
2464
2460 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2465 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2461 using properties, but forgot to make the main InteractiveShell
2466 using properties, but forgot to make the main InteractiveShell
2462 class a new-style class. Properties fail silently, and
2467 class a new-style class. Properties fail silently, and
2463 mysteriously, with old-style class (getters work, but
2468 mysteriously, with old-style class (getters work, but
2464 setters don't do anything).
2469 setters don't do anything).
2465
2470
2466 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2471 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2467
2472
2468 * IPython/Magic.py (magic_history): fix history reporting bug (I
2473 * IPython/Magic.py (magic_history): fix history reporting bug (I
2469 know some nasties are still there, I just can't seem to find a
2474 know some nasties are still there, I just can't seem to find a
2470 reproducible test case to track them down; the input history is
2475 reproducible test case to track them down; the input history is
2471 falling out of sync...)
2476 falling out of sync...)
2472
2477
2473 * IPython/iplib.py (handle_shell_escape): fix bug where both
2478 * IPython/iplib.py (handle_shell_escape): fix bug where both
2474 aliases and system accesses where broken for indented code (such
2479 aliases and system accesses where broken for indented code (such
2475 as loops).
2480 as loops).
2476
2481
2477 * IPython/genutils.py (shell): fix small but critical bug for
2482 * IPython/genutils.py (shell): fix small but critical bug for
2478 win32 system access.
2483 win32 system access.
2479
2484
2480 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2485 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2481
2486
2482 * IPython/iplib.py (showtraceback): remove use of the
2487 * IPython/iplib.py (showtraceback): remove use of the
2483 sys.last_{type/value/traceback} structures, which are non
2488 sys.last_{type/value/traceback} structures, which are non
2484 thread-safe.
2489 thread-safe.
2485 (_prefilter): change control flow to ensure that we NEVER
2490 (_prefilter): change control flow to ensure that we NEVER
2486 introspect objects when autocall is off. This will guarantee that
2491 introspect objects when autocall is off. This will guarantee that
2487 having an input line of the form 'x.y', where access to attribute
2492 having an input line of the form 'x.y', where access to attribute
2488 'y' has side effects, doesn't trigger the side effect TWICE. It
2493 'y' has side effects, doesn't trigger the side effect TWICE. It
2489 is important to note that, with autocall on, these side effects
2494 is important to note that, with autocall on, these side effects
2490 can still happen.
2495 can still happen.
2491 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2496 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2492 trio. IPython offers these three kinds of special calls which are
2497 trio. IPython offers these three kinds of special calls which are
2493 not python code, and it's a good thing to have their call method
2498 not python code, and it's a good thing to have their call method
2494 be accessible as pure python functions (not just special syntax at
2499 be accessible as pure python functions (not just special syntax at
2495 the command line). It gives us a better internal implementation
2500 the command line). It gives us a better internal implementation
2496 structure, as well as exposing these for user scripting more
2501 structure, as well as exposing these for user scripting more
2497 cleanly.
2502 cleanly.
2498
2503
2499 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2504 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2500 file. Now that they'll be more likely to be used with the
2505 file. Now that they'll be more likely to be used with the
2501 persistance system (%store), I want to make sure their module path
2506 persistance system (%store), I want to make sure their module path
2502 doesn't change in the future, so that we don't break things for
2507 doesn't change in the future, so that we don't break things for
2503 users' persisted data.
2508 users' persisted data.
2504
2509
2505 * IPython/iplib.py (autoindent_update): move indentation
2510 * IPython/iplib.py (autoindent_update): move indentation
2506 management into the _text_ processing loop, not the keyboard
2511 management into the _text_ processing loop, not the keyboard
2507 interactive one. This is necessary to correctly process non-typed
2512 interactive one. This is necessary to correctly process non-typed
2508 multiline input (such as macros).
2513 multiline input (such as macros).
2509
2514
2510 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2515 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2511 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2516 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2512 which was producing problems in the resulting manual.
2517 which was producing problems in the resulting manual.
2513 (magic_whos): improve reporting of instances (show their class,
2518 (magic_whos): improve reporting of instances (show their class,
2514 instead of simply printing 'instance' which isn't terribly
2519 instead of simply printing 'instance' which isn't terribly
2515 informative).
2520 informative).
2516
2521
2517 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2522 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2518 (minor mods) to support network shares under win32.
2523 (minor mods) to support network shares under win32.
2519
2524
2520 * IPython/winconsole.py (get_console_size): add new winconsole
2525 * IPython/winconsole.py (get_console_size): add new winconsole
2521 module and fixes to page_dumb() to improve its behavior under
2526 module and fixes to page_dumb() to improve its behavior under
2522 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2527 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2523
2528
2524 * IPython/Magic.py (Macro): simplified Macro class to just
2529 * IPython/Magic.py (Macro): simplified Macro class to just
2525 subclass list. We've had only 2.2 compatibility for a very long
2530 subclass list. We've had only 2.2 compatibility for a very long
2526 time, yet I was still avoiding subclassing the builtin types. No
2531 time, yet I was still avoiding subclassing the builtin types. No
2527 more (I'm also starting to use properties, though I won't shift to
2532 more (I'm also starting to use properties, though I won't shift to
2528 2.3-specific features quite yet).
2533 2.3-specific features quite yet).
2529 (magic_store): added Ville's patch for lightweight variable
2534 (magic_store): added Ville's patch for lightweight variable
2530 persistence, after a request on the user list by Matt Wilkie
2535 persistence, after a request on the user list by Matt Wilkie
2531 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2536 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2532 details.
2537 details.
2533
2538
2534 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2539 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2535 changed the default logfile name from 'ipython.log' to
2540 changed the default logfile name from 'ipython.log' to
2536 'ipython_log.py'. These logs are real python files, and now that
2541 'ipython_log.py'. These logs are real python files, and now that
2537 we have much better multiline support, people are more likely to
2542 we have much better multiline support, people are more likely to
2538 want to use them as such. Might as well name them correctly.
2543 want to use them as such. Might as well name them correctly.
2539
2544
2540 * IPython/Magic.py: substantial cleanup. While we can't stop
2545 * IPython/Magic.py: substantial cleanup. While we can't stop
2541 using magics as mixins, due to the existing customizations 'out
2546 using magics as mixins, due to the existing customizations 'out
2542 there' which rely on the mixin naming conventions, at least I
2547 there' which rely on the mixin naming conventions, at least I
2543 cleaned out all cross-class name usage. So once we are OK with
2548 cleaned out all cross-class name usage. So once we are OK with
2544 breaking compatibility, the two systems can be separated.
2549 breaking compatibility, the two systems can be separated.
2545
2550
2546 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2551 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2547 anymore, and the class is a fair bit less hideous as well. New
2552 anymore, and the class is a fair bit less hideous as well. New
2548 features were also introduced: timestamping of input, and logging
2553 features were also introduced: timestamping of input, and logging
2549 of output results. These are user-visible with the -t and -o
2554 of output results. These are user-visible with the -t and -o
2550 options to %logstart. Closes
2555 options to %logstart. Closes
2551 http://www.scipy.net/roundup/ipython/issue11 and a request by
2556 http://www.scipy.net/roundup/ipython/issue11 and a request by
2552 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2557 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2553
2558
2554 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2559 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2555
2560
2556 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2561 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2557 better handle backslashes in paths. See the thread 'More Windows
2562 better handle backslashes in paths. See the thread 'More Windows
2558 questions part 2 - \/ characters revisited' on the iypthon user
2563 questions part 2 - \/ characters revisited' on the iypthon user
2559 list:
2564 list:
2560 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2565 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2561
2566
2562 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2567 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2563
2568
2564 (InteractiveShell.__init__): change threaded shells to not use the
2569 (InteractiveShell.__init__): change threaded shells to not use the
2565 ipython crash handler. This was causing more problems than not,
2570 ipython crash handler. This was causing more problems than not,
2566 as exceptions in the main thread (GUI code, typically) would
2571 as exceptions in the main thread (GUI code, typically) would
2567 always show up as a 'crash', when they really weren't.
2572 always show up as a 'crash', when they really weren't.
2568
2573
2569 The colors and exception mode commands (%colors/%xmode) have been
2574 The colors and exception mode commands (%colors/%xmode) have been
2570 synchronized to also take this into account, so users can get
2575 synchronized to also take this into account, so users can get
2571 verbose exceptions for their threaded code as well. I also added
2576 verbose exceptions for their threaded code as well. I also added
2572 support for activating pdb inside this exception handler as well,
2577 support for activating pdb inside this exception handler as well,
2573 so now GUI authors can use IPython's enhanced pdb at runtime.
2578 so now GUI authors can use IPython's enhanced pdb at runtime.
2574
2579
2575 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2580 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2576 true by default, and add it to the shipped ipythonrc file. Since
2581 true by default, and add it to the shipped ipythonrc file. Since
2577 this asks the user before proceeding, I think it's OK to make it
2582 this asks the user before proceeding, I think it's OK to make it
2578 true by default.
2583 true by default.
2579
2584
2580 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2585 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2581 of the previous special-casing of input in the eval loop. I think
2586 of the previous special-casing of input in the eval loop. I think
2582 this is cleaner, as they really are commands and shouldn't have
2587 this is cleaner, as they really are commands and shouldn't have
2583 a special role in the middle of the core code.
2588 a special role in the middle of the core code.
2584
2589
2585 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2590 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2586
2591
2587 * IPython/iplib.py (edit_syntax_error): added support for
2592 * IPython/iplib.py (edit_syntax_error): added support for
2588 automatically reopening the editor if the file had a syntax error
2593 automatically reopening the editor if the file had a syntax error
2589 in it. Thanks to scottt who provided the patch at:
2594 in it. Thanks to scottt who provided the patch at:
2590 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2595 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2591 version committed).
2596 version committed).
2592
2597
2593 * IPython/iplib.py (handle_normal): add suport for multi-line
2598 * IPython/iplib.py (handle_normal): add suport for multi-line
2594 input with emtpy lines. This fixes
2599 input with emtpy lines. This fixes
2595 http://www.scipy.net/roundup/ipython/issue43 and a similar
2600 http://www.scipy.net/roundup/ipython/issue43 and a similar
2596 discussion on the user list.
2601 discussion on the user list.
2597
2602
2598 WARNING: a behavior change is necessarily introduced to support
2603 WARNING: a behavior change is necessarily introduced to support
2599 blank lines: now a single blank line with whitespace does NOT
2604 blank lines: now a single blank line with whitespace does NOT
2600 break the input loop, which means that when autoindent is on, by
2605 break the input loop, which means that when autoindent is on, by
2601 default hitting return on the next (indented) line does NOT exit.
2606 default hitting return on the next (indented) line does NOT exit.
2602
2607
2603 Instead, to exit a multiline input you can either have:
2608 Instead, to exit a multiline input you can either have:
2604
2609
2605 - TWO whitespace lines (just hit return again), or
2610 - TWO whitespace lines (just hit return again), or
2606 - a single whitespace line of a different length than provided
2611 - a single whitespace line of a different length than provided
2607 by the autoindent (add or remove a space).
2612 by the autoindent (add or remove a space).
2608
2613
2609 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2614 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2610 module to better organize all readline-related functionality.
2615 module to better organize all readline-related functionality.
2611 I've deleted FlexCompleter and put all completion clases here.
2616 I've deleted FlexCompleter and put all completion clases here.
2612
2617
2613 * IPython/iplib.py (raw_input): improve indentation management.
2618 * IPython/iplib.py (raw_input): improve indentation management.
2614 It is now possible to paste indented code with autoindent on, and
2619 It is now possible to paste indented code with autoindent on, and
2615 the code is interpreted correctly (though it still looks bad on
2620 the code is interpreted correctly (though it still looks bad on
2616 screen, due to the line-oriented nature of ipython).
2621 screen, due to the line-oriented nature of ipython).
2617 (MagicCompleter.complete): change behavior so that a TAB key on an
2622 (MagicCompleter.complete): change behavior so that a TAB key on an
2618 otherwise empty line actually inserts a tab, instead of completing
2623 otherwise empty line actually inserts a tab, instead of completing
2619 on the entire global namespace. This makes it easier to use the
2624 on the entire global namespace. This makes it easier to use the
2620 TAB key for indentation. After a request by Hans Meine
2625 TAB key for indentation. After a request by Hans Meine
2621 <hans_meine-AT-gmx.net>
2626 <hans_meine-AT-gmx.net>
2622 (_prefilter): add support so that typing plain 'exit' or 'quit'
2627 (_prefilter): add support so that typing plain 'exit' or 'quit'
2623 does a sensible thing. Originally I tried to deviate as little as
2628 does a sensible thing. Originally I tried to deviate as little as
2624 possible from the default python behavior, but even that one may
2629 possible from the default python behavior, but even that one may
2625 change in this direction (thread on python-dev to that effect).
2630 change in this direction (thread on python-dev to that effect).
2626 Regardless, ipython should do the right thing even if CPython's
2631 Regardless, ipython should do the right thing even if CPython's
2627 '>>>' prompt doesn't.
2632 '>>>' prompt doesn't.
2628 (InteractiveShell): removed subclassing code.InteractiveConsole
2633 (InteractiveShell): removed subclassing code.InteractiveConsole
2629 class. By now we'd overridden just about all of its methods: I've
2634 class. By now we'd overridden just about all of its methods: I've
2630 copied the remaining two over, and now ipython is a standalone
2635 copied the remaining two over, and now ipython is a standalone
2631 class. This will provide a clearer picture for the chainsaw
2636 class. This will provide a clearer picture for the chainsaw
2632 branch refactoring.
2637 branch refactoring.
2633
2638
2634 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2639 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2635
2640
2636 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2641 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2637 failures for objects which break when dir() is called on them.
2642 failures for objects which break when dir() is called on them.
2638
2643
2639 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2644 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2640 distinct local and global namespaces in the completer API. This
2645 distinct local and global namespaces in the completer API. This
2641 change allows us to properly handle completion with distinct
2646 change allows us to properly handle completion with distinct
2642 scopes, including in embedded instances (this had never really
2647 scopes, including in embedded instances (this had never really
2643 worked correctly).
2648 worked correctly).
2644
2649
2645 Note: this introduces a change in the constructor for
2650 Note: this introduces a change in the constructor for
2646 MagicCompleter, as a new global_namespace parameter is now the
2651 MagicCompleter, as a new global_namespace parameter is now the
2647 second argument (the others were bumped one position).
2652 second argument (the others were bumped one position).
2648
2653
2649 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2654 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2650
2655
2651 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2656 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2652 embedded instances (which can be done now thanks to Vivian's
2657 embedded instances (which can be done now thanks to Vivian's
2653 frame-handling fixes for pdb).
2658 frame-handling fixes for pdb).
2654 (InteractiveShell.__init__): Fix namespace handling problem in
2659 (InteractiveShell.__init__): Fix namespace handling problem in
2655 embedded instances. We were overwriting __main__ unconditionally,
2660 embedded instances. We were overwriting __main__ unconditionally,
2656 and this should only be done for 'full' (non-embedded) IPython;
2661 and this should only be done for 'full' (non-embedded) IPython;
2657 embedded instances must respect the caller's __main__. Thanks to
2662 embedded instances must respect the caller's __main__. Thanks to
2658 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2663 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2659
2664
2660 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2665 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2661
2666
2662 * setup.py: added download_url to setup(). This registers the
2667 * setup.py: added download_url to setup(). This registers the
2663 download address at PyPI, which is not only useful to humans
2668 download address at PyPI, which is not only useful to humans
2664 browsing the site, but is also picked up by setuptools (the Eggs
2669 browsing the site, but is also picked up by setuptools (the Eggs
2665 machinery). Thanks to Ville and R. Kern for the info/discussion
2670 machinery). Thanks to Ville and R. Kern for the info/discussion
2666 on this.
2671 on this.
2667
2672
2668 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2673 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2669
2674
2670 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2675 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2671 This brings a lot of nice functionality to the pdb mode, which now
2676 This brings a lot of nice functionality to the pdb mode, which now
2672 has tab-completion, syntax highlighting, and better stack handling
2677 has tab-completion, syntax highlighting, and better stack handling
2673 than before. Many thanks to Vivian De Smedt
2678 than before. Many thanks to Vivian De Smedt
2674 <vivian-AT-vdesmedt.com> for the original patches.
2679 <vivian-AT-vdesmedt.com> for the original patches.
2675
2680
2676 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2681 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2677
2682
2678 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2683 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2679 sequence to consistently accept the banner argument. The
2684 sequence to consistently accept the banner argument. The
2680 inconsistency was tripping SAGE, thanks to Gary Zablackis
2685 inconsistency was tripping SAGE, thanks to Gary Zablackis
2681 <gzabl-AT-yahoo.com> for the report.
2686 <gzabl-AT-yahoo.com> for the report.
2682
2687
2683 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2688 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2684
2689
2685 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2690 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2686 Fix bug where a naked 'alias' call in the ipythonrc file would
2691 Fix bug where a naked 'alias' call in the ipythonrc file would
2687 cause a crash. Bug reported by Jorgen Stenarson.
2692 cause a crash. Bug reported by Jorgen Stenarson.
2688
2693
2689 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2694 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2690
2695
2691 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2696 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2692 startup time.
2697 startup time.
2693
2698
2694 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2699 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2695 instances had introduced a bug with globals in normal code. Now
2700 instances had introduced a bug with globals in normal code. Now
2696 it's working in all cases.
2701 it's working in all cases.
2697
2702
2698 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2703 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2699 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2704 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2700 has been introduced to set the default case sensitivity of the
2705 has been introduced to set the default case sensitivity of the
2701 searches. Users can still select either mode at runtime on a
2706 searches. Users can still select either mode at runtime on a
2702 per-search basis.
2707 per-search basis.
2703
2708
2704 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2709 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2705
2710
2706 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2711 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2707 attributes in wildcard searches for subclasses. Modified version
2712 attributes in wildcard searches for subclasses. Modified version
2708 of a patch by Jorgen.
2713 of a patch by Jorgen.
2709
2714
2710 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2715 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2711
2716
2712 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2717 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2713 embedded instances. I added a user_global_ns attribute to the
2718 embedded instances. I added a user_global_ns attribute to the
2714 InteractiveShell class to handle this.
2719 InteractiveShell class to handle this.
2715
2720
2716 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2721 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2717
2722
2718 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2723 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2719 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2724 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2720 (reported under win32, but may happen also in other platforms).
2725 (reported under win32, but may happen also in other platforms).
2721 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2726 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2722
2727
2723 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2728 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2724
2729
2725 * IPython/Magic.py (magic_psearch): new support for wildcard
2730 * IPython/Magic.py (magic_psearch): new support for wildcard
2726 patterns. Now, typing ?a*b will list all names which begin with a
2731 patterns. Now, typing ?a*b will list all names which begin with a
2727 and end in b, for example. The %psearch magic has full
2732 and end in b, for example. The %psearch magic has full
2728 docstrings. Many thanks to JΓΆrgen Stenarson
2733 docstrings. Many thanks to JΓΆrgen Stenarson
2729 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2734 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2730 implementing this functionality.
2735 implementing this functionality.
2731
2736
2732 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2737 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2733
2738
2734 * Manual: fixed long-standing annoyance of double-dashes (as in
2739 * Manual: fixed long-standing annoyance of double-dashes (as in
2735 --prefix=~, for example) being stripped in the HTML version. This
2740 --prefix=~, for example) being stripped in the HTML version. This
2736 is a latex2html bug, but a workaround was provided. Many thanks
2741 is a latex2html bug, but a workaround was provided. Many thanks
2737 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2742 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2738 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2743 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2739 rolling. This seemingly small issue had tripped a number of users
2744 rolling. This seemingly small issue had tripped a number of users
2740 when first installing, so I'm glad to see it gone.
2745 when first installing, so I'm glad to see it gone.
2741
2746
2742 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2747 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2743
2748
2744 * IPython/Extensions/numeric_formats.py: fix missing import,
2749 * IPython/Extensions/numeric_formats.py: fix missing import,
2745 reported by Stephen Walton.
2750 reported by Stephen Walton.
2746
2751
2747 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2752 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2748
2753
2749 * IPython/demo.py: finish demo module, fully documented now.
2754 * IPython/demo.py: finish demo module, fully documented now.
2750
2755
2751 * IPython/genutils.py (file_read): simple little utility to read a
2756 * IPython/genutils.py (file_read): simple little utility to read a
2752 file and ensure it's closed afterwards.
2757 file and ensure it's closed afterwards.
2753
2758
2754 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2759 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2755
2760
2756 * IPython/demo.py (Demo.__init__): added support for individually
2761 * IPython/demo.py (Demo.__init__): added support for individually
2757 tagging blocks for automatic execution.
2762 tagging blocks for automatic execution.
2758
2763
2759 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2764 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2760 syntax-highlighted python sources, requested by John.
2765 syntax-highlighted python sources, requested by John.
2761
2766
2762 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2767 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2763
2768
2764 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2769 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2765 finishing.
2770 finishing.
2766
2771
2767 * IPython/genutils.py (shlex_split): moved from Magic to here,
2772 * IPython/genutils.py (shlex_split): moved from Magic to here,
2768 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2773 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2769
2774
2770 * IPython/demo.py (Demo.__init__): added support for silent
2775 * IPython/demo.py (Demo.__init__): added support for silent
2771 blocks, improved marks as regexps, docstrings written.
2776 blocks, improved marks as regexps, docstrings written.
2772 (Demo.__init__): better docstring, added support for sys.argv.
2777 (Demo.__init__): better docstring, added support for sys.argv.
2773
2778
2774 * IPython/genutils.py (marquee): little utility used by the demo
2779 * IPython/genutils.py (marquee): little utility used by the demo
2775 code, handy in general.
2780 code, handy in general.
2776
2781
2777 * IPython/demo.py (Demo.__init__): new class for interactive
2782 * IPython/demo.py (Demo.__init__): new class for interactive
2778 demos. Not documented yet, I just wrote it in a hurry for
2783 demos. Not documented yet, I just wrote it in a hurry for
2779 scipy'05. Will docstring later.
2784 scipy'05. Will docstring later.
2780
2785
2781 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2786 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2782
2787
2783 * IPython/Shell.py (sigint_handler): Drastic simplification which
2788 * IPython/Shell.py (sigint_handler): Drastic simplification which
2784 also seems to make Ctrl-C work correctly across threads! This is
2789 also seems to make Ctrl-C work correctly across threads! This is
2785 so simple, that I can't beleive I'd missed it before. Needs more
2790 so simple, that I can't beleive I'd missed it before. Needs more
2786 testing, though.
2791 testing, though.
2787 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2792 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2788 like this before...
2793 like this before...
2789
2794
2790 * IPython/genutils.py (get_home_dir): add protection against
2795 * IPython/genutils.py (get_home_dir): add protection against
2791 non-dirs in win32 registry.
2796 non-dirs in win32 registry.
2792
2797
2793 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2798 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2794 bug where dict was mutated while iterating (pysh crash).
2799 bug where dict was mutated while iterating (pysh crash).
2795
2800
2796 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2801 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2797
2802
2798 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2803 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2799 spurious newlines added by this routine. After a report by
2804 spurious newlines added by this routine. After a report by
2800 F. Mantegazza.
2805 F. Mantegazza.
2801
2806
2802 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2807 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2803
2808
2804 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2809 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2805 calls. These were a leftover from the GTK 1.x days, and can cause
2810 calls. These were a leftover from the GTK 1.x days, and can cause
2806 problems in certain cases (after a report by John Hunter).
2811 problems in certain cases (after a report by John Hunter).
2807
2812
2808 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2813 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2809 os.getcwd() fails at init time. Thanks to patch from David Remahl
2814 os.getcwd() fails at init time. Thanks to patch from David Remahl
2810 <chmod007-AT-mac.com>.
2815 <chmod007-AT-mac.com>.
2811 (InteractiveShell.__init__): prevent certain special magics from
2816 (InteractiveShell.__init__): prevent certain special magics from
2812 being shadowed by aliases. Closes
2817 being shadowed by aliases. Closes
2813 http://www.scipy.net/roundup/ipython/issue41.
2818 http://www.scipy.net/roundup/ipython/issue41.
2814
2819
2815 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2820 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2816
2821
2817 * IPython/iplib.py (InteractiveShell.complete): Added new
2822 * IPython/iplib.py (InteractiveShell.complete): Added new
2818 top-level completion method to expose the completion mechanism
2823 top-level completion method to expose the completion mechanism
2819 beyond readline-based environments.
2824 beyond readline-based environments.
2820
2825
2821 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2826 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2822
2827
2823 * tools/ipsvnc (svnversion): fix svnversion capture.
2828 * tools/ipsvnc (svnversion): fix svnversion capture.
2824
2829
2825 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2830 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2826 attribute to self, which was missing. Before, it was set by a
2831 attribute to self, which was missing. Before, it was set by a
2827 routine which in certain cases wasn't being called, so the
2832 routine which in certain cases wasn't being called, so the
2828 instance could end up missing the attribute. This caused a crash.
2833 instance could end up missing the attribute. This caused a crash.
2829 Closes http://www.scipy.net/roundup/ipython/issue40.
2834 Closes http://www.scipy.net/roundup/ipython/issue40.
2830
2835
2831 2005-08-16 Fernando Perez <fperez@colorado.edu>
2836 2005-08-16 Fernando Perez <fperez@colorado.edu>
2832
2837
2833 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2838 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2834 contains non-string attribute. Closes
2839 contains non-string attribute. Closes
2835 http://www.scipy.net/roundup/ipython/issue38.
2840 http://www.scipy.net/roundup/ipython/issue38.
2836
2841
2837 2005-08-14 Fernando Perez <fperez@colorado.edu>
2842 2005-08-14 Fernando Perez <fperez@colorado.edu>
2838
2843
2839 * tools/ipsvnc: Minor improvements, to add changeset info.
2844 * tools/ipsvnc: Minor improvements, to add changeset info.
2840
2845
2841 2005-08-12 Fernando Perez <fperez@colorado.edu>
2846 2005-08-12 Fernando Perez <fperez@colorado.edu>
2842
2847
2843 * IPython/iplib.py (runsource): remove self.code_to_run_src
2848 * IPython/iplib.py (runsource): remove self.code_to_run_src
2844 attribute. I realized this is nothing more than
2849 attribute. I realized this is nothing more than
2845 '\n'.join(self.buffer), and having the same data in two different
2850 '\n'.join(self.buffer), and having the same data in two different
2846 places is just asking for synchronization bugs. This may impact
2851 places is just asking for synchronization bugs. This may impact
2847 people who have custom exception handlers, so I need to warn
2852 people who have custom exception handlers, so I need to warn
2848 ipython-dev about it (F. Mantegazza may use them).
2853 ipython-dev about it (F. Mantegazza may use them).
2849
2854
2850 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2855 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2851
2856
2852 * IPython/genutils.py: fix 2.2 compatibility (generators)
2857 * IPython/genutils.py: fix 2.2 compatibility (generators)
2853
2858
2854 2005-07-18 Fernando Perez <fperez@colorado.edu>
2859 2005-07-18 Fernando Perez <fperez@colorado.edu>
2855
2860
2856 * IPython/genutils.py (get_home_dir): fix to help users with
2861 * IPython/genutils.py (get_home_dir): fix to help users with
2857 invalid $HOME under win32.
2862 invalid $HOME under win32.
2858
2863
2859 2005-07-17 Fernando Perez <fperez@colorado.edu>
2864 2005-07-17 Fernando Perez <fperez@colorado.edu>
2860
2865
2861 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2866 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2862 some old hacks and clean up a bit other routines; code should be
2867 some old hacks and clean up a bit other routines; code should be
2863 simpler and a bit faster.
2868 simpler and a bit faster.
2864
2869
2865 * IPython/iplib.py (interact): removed some last-resort attempts
2870 * IPython/iplib.py (interact): removed some last-resort attempts
2866 to survive broken stdout/stderr. That code was only making it
2871 to survive broken stdout/stderr. That code was only making it
2867 harder to abstract out the i/o (necessary for gui integration),
2872 harder to abstract out the i/o (necessary for gui integration),
2868 and the crashes it could prevent were extremely rare in practice
2873 and the crashes it could prevent were extremely rare in practice
2869 (besides being fully user-induced in a pretty violent manner).
2874 (besides being fully user-induced in a pretty violent manner).
2870
2875
2871 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2876 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2872 Nothing major yet, but the code is simpler to read; this should
2877 Nothing major yet, but the code is simpler to read; this should
2873 make it easier to do more serious modifications in the future.
2878 make it easier to do more serious modifications in the future.
2874
2879
2875 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2880 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2876 which broke in .15 (thanks to a report by Ville).
2881 which broke in .15 (thanks to a report by Ville).
2877
2882
2878 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2883 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2879 be quite correct, I know next to nothing about unicode). This
2884 be quite correct, I know next to nothing about unicode). This
2880 will allow unicode strings to be used in prompts, amongst other
2885 will allow unicode strings to be used in prompts, amongst other
2881 cases. It also will prevent ipython from crashing when unicode
2886 cases. It also will prevent ipython from crashing when unicode
2882 shows up unexpectedly in many places. If ascii encoding fails, we
2887 shows up unexpectedly in many places. If ascii encoding fails, we
2883 assume utf_8. Currently the encoding is not a user-visible
2888 assume utf_8. Currently the encoding is not a user-visible
2884 setting, though it could be made so if there is demand for it.
2889 setting, though it could be made so if there is demand for it.
2885
2890
2886 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2891 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2887
2892
2888 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2893 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2889
2894
2890 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2895 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2891
2896
2892 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2897 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2893 code can work transparently for 2.2/2.3.
2898 code can work transparently for 2.2/2.3.
2894
2899
2895 2005-07-16 Fernando Perez <fperez@colorado.edu>
2900 2005-07-16 Fernando Perez <fperez@colorado.edu>
2896
2901
2897 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2902 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2898 out of the color scheme table used for coloring exception
2903 out of the color scheme table used for coloring exception
2899 tracebacks. This allows user code to add new schemes at runtime.
2904 tracebacks. This allows user code to add new schemes at runtime.
2900 This is a minimally modified version of the patch at
2905 This is a minimally modified version of the patch at
2901 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2906 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2902 for the contribution.
2907 for the contribution.
2903
2908
2904 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2909 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2905 slightly modified version of the patch in
2910 slightly modified version of the patch in
2906 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2911 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2907 to remove the previous try/except solution (which was costlier).
2912 to remove the previous try/except solution (which was costlier).
2908 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2913 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2909
2914
2910 2005-06-08 Fernando Perez <fperez@colorado.edu>
2915 2005-06-08 Fernando Perez <fperez@colorado.edu>
2911
2916
2912 * IPython/iplib.py (write/write_err): Add methods to abstract all
2917 * IPython/iplib.py (write/write_err): Add methods to abstract all
2913 I/O a bit more.
2918 I/O a bit more.
2914
2919
2915 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2920 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2916 warning, reported by Aric Hagberg, fix by JD Hunter.
2921 warning, reported by Aric Hagberg, fix by JD Hunter.
2917
2922
2918 2005-06-02 *** Released version 0.6.15
2923 2005-06-02 *** Released version 0.6.15
2919
2924
2920 2005-06-01 Fernando Perez <fperez@colorado.edu>
2925 2005-06-01 Fernando Perez <fperez@colorado.edu>
2921
2926
2922 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2927 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2923 tab-completion of filenames within open-quoted strings. Note that
2928 tab-completion of filenames within open-quoted strings. Note that
2924 this requires that in ~/.ipython/ipythonrc, users change the
2929 this requires that in ~/.ipython/ipythonrc, users change the
2925 readline delimiters configuration to read:
2930 readline delimiters configuration to read:
2926
2931
2927 readline_remove_delims -/~
2932 readline_remove_delims -/~
2928
2933
2929
2934
2930 2005-05-31 *** Released version 0.6.14
2935 2005-05-31 *** Released version 0.6.14
2931
2936
2932 2005-05-29 Fernando Perez <fperez@colorado.edu>
2937 2005-05-29 Fernando Perez <fperez@colorado.edu>
2933
2938
2934 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2939 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2935 with files not on the filesystem. Reported by Eliyahu Sandler
2940 with files not on the filesystem. Reported by Eliyahu Sandler
2936 <eli@gondolin.net>
2941 <eli@gondolin.net>
2937
2942
2938 2005-05-22 Fernando Perez <fperez@colorado.edu>
2943 2005-05-22 Fernando Perez <fperez@colorado.edu>
2939
2944
2940 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2945 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2941 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2946 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2942
2947
2943 2005-05-19 Fernando Perez <fperez@colorado.edu>
2948 2005-05-19 Fernando Perez <fperez@colorado.edu>
2944
2949
2945 * IPython/iplib.py (safe_execfile): close a file which could be
2950 * IPython/iplib.py (safe_execfile): close a file which could be
2946 left open (causing problems in win32, which locks open files).
2951 left open (causing problems in win32, which locks open files).
2947 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2952 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2948
2953
2949 2005-05-18 Fernando Perez <fperez@colorado.edu>
2954 2005-05-18 Fernando Perez <fperez@colorado.edu>
2950
2955
2951 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2956 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2952 keyword arguments correctly to safe_execfile().
2957 keyword arguments correctly to safe_execfile().
2953
2958
2954 2005-05-13 Fernando Perez <fperez@colorado.edu>
2959 2005-05-13 Fernando Perez <fperez@colorado.edu>
2955
2960
2956 * ipython.1: Added info about Qt to manpage, and threads warning
2961 * ipython.1: Added info about Qt to manpage, and threads warning
2957 to usage page (invoked with --help).
2962 to usage page (invoked with --help).
2958
2963
2959 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2964 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2960 new matcher (it goes at the end of the priority list) to do
2965 new matcher (it goes at the end of the priority list) to do
2961 tab-completion on named function arguments. Submitted by George
2966 tab-completion on named function arguments. Submitted by George
2962 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2967 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2963 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2968 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2964 for more details.
2969 for more details.
2965
2970
2966 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2971 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2967 SystemExit exceptions in the script being run. Thanks to a report
2972 SystemExit exceptions in the script being run. Thanks to a report
2968 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2973 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2969 producing very annoying behavior when running unit tests.
2974 producing very annoying behavior when running unit tests.
2970
2975
2971 2005-05-12 Fernando Perez <fperez@colorado.edu>
2976 2005-05-12 Fernando Perez <fperez@colorado.edu>
2972
2977
2973 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2978 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2974 which I'd broken (again) due to a changed regexp. In the process,
2979 which I'd broken (again) due to a changed regexp. In the process,
2975 added ';' as an escape to auto-quote the whole line without
2980 added ';' as an escape to auto-quote the whole line without
2976 splitting its arguments. Thanks to a report by Jerry McRae
2981 splitting its arguments. Thanks to a report by Jerry McRae
2977 <qrs0xyc02-AT-sneakemail.com>.
2982 <qrs0xyc02-AT-sneakemail.com>.
2978
2983
2979 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2984 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2980 possible crashes caused by a TokenError. Reported by Ed Schofield
2985 possible crashes caused by a TokenError. Reported by Ed Schofield
2981 <schofield-AT-ftw.at>.
2986 <schofield-AT-ftw.at>.
2982
2987
2983 2005-05-06 Fernando Perez <fperez@colorado.edu>
2988 2005-05-06 Fernando Perez <fperez@colorado.edu>
2984
2989
2985 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2990 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2986
2991
2987 2005-04-29 Fernando Perez <fperez@colorado.edu>
2992 2005-04-29 Fernando Perez <fperez@colorado.edu>
2988
2993
2989 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2994 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2990 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2995 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2991 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2996 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2992 which provides support for Qt interactive usage (similar to the
2997 which provides support for Qt interactive usage (similar to the
2993 existing one for WX and GTK). This had been often requested.
2998 existing one for WX and GTK). This had been often requested.
2994
2999
2995 2005-04-14 *** Released version 0.6.13
3000 2005-04-14 *** Released version 0.6.13
2996
3001
2997 2005-04-08 Fernando Perez <fperez@colorado.edu>
3002 2005-04-08 Fernando Perez <fperez@colorado.edu>
2998
3003
2999 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3004 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3000 from _ofind, which gets called on almost every input line. Now,
3005 from _ofind, which gets called on almost every input line. Now,
3001 we only try to get docstrings if they are actually going to be
3006 we only try to get docstrings if they are actually going to be
3002 used (the overhead of fetching unnecessary docstrings can be
3007 used (the overhead of fetching unnecessary docstrings can be
3003 noticeable for certain objects, such as Pyro proxies).
3008 noticeable for certain objects, such as Pyro proxies).
3004
3009
3005 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3010 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3006 for completers. For some reason I had been passing them the state
3011 for completers. For some reason I had been passing them the state
3007 variable, which completers never actually need, and was in
3012 variable, which completers never actually need, and was in
3008 conflict with the rlcompleter API. Custom completers ONLY need to
3013 conflict with the rlcompleter API. Custom completers ONLY need to
3009 take the text parameter.
3014 take the text parameter.
3010
3015
3011 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3016 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3012 work correctly in pysh. I've also moved all the logic which used
3017 work correctly in pysh. I've also moved all the logic which used
3013 to be in pysh.py here, which will prevent problems with future
3018 to be in pysh.py here, which will prevent problems with future
3014 upgrades. However, this time I must warn users to update their
3019 upgrades. However, this time I must warn users to update their
3015 pysh profile to include the line
3020 pysh profile to include the line
3016
3021
3017 import_all IPython.Extensions.InterpreterExec
3022 import_all IPython.Extensions.InterpreterExec
3018
3023
3019 because otherwise things won't work for them. They MUST also
3024 because otherwise things won't work for them. They MUST also
3020 delete pysh.py and the line
3025 delete pysh.py and the line
3021
3026
3022 execfile pysh.py
3027 execfile pysh.py
3023
3028
3024 from their ipythonrc-pysh.
3029 from their ipythonrc-pysh.
3025
3030
3026 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3031 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3027 robust in the face of objects whose dir() returns non-strings
3032 robust in the face of objects whose dir() returns non-strings
3028 (which it shouldn't, but some broken libs like ITK do). Thanks to
3033 (which it shouldn't, but some broken libs like ITK do). Thanks to
3029 a patch by John Hunter (implemented differently, though). Also
3034 a patch by John Hunter (implemented differently, though). Also
3030 minor improvements by using .extend instead of + on lists.
3035 minor improvements by using .extend instead of + on lists.
3031
3036
3032 * pysh.py:
3037 * pysh.py:
3033
3038
3034 2005-04-06 Fernando Perez <fperez@colorado.edu>
3039 2005-04-06 Fernando Perez <fperez@colorado.edu>
3035
3040
3036 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3041 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3037 by default, so that all users benefit from it. Those who don't
3042 by default, so that all users benefit from it. Those who don't
3038 want it can still turn it off.
3043 want it can still turn it off.
3039
3044
3040 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3045 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3041 config file, I'd forgotten about this, so users were getting it
3046 config file, I'd forgotten about this, so users were getting it
3042 off by default.
3047 off by default.
3043
3048
3044 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3049 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3045 consistency. Now magics can be called in multiline statements,
3050 consistency. Now magics can be called in multiline statements,
3046 and python variables can be expanded in magic calls via $var.
3051 and python variables can be expanded in magic calls via $var.
3047 This makes the magic system behave just like aliases or !system
3052 This makes the magic system behave just like aliases or !system
3048 calls.
3053 calls.
3049
3054
3050 2005-03-28 Fernando Perez <fperez@colorado.edu>
3055 2005-03-28 Fernando Perez <fperez@colorado.edu>
3051
3056
3052 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3057 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3053 expensive string additions for building command. Add support for
3058 expensive string additions for building command. Add support for
3054 trailing ';' when autocall is used.
3059 trailing ';' when autocall is used.
3055
3060
3056 2005-03-26 Fernando Perez <fperez@colorado.edu>
3061 2005-03-26 Fernando Perez <fperez@colorado.edu>
3057
3062
3058 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3063 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3059 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3064 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3060 ipython.el robust against prompts with any number of spaces
3065 ipython.el robust against prompts with any number of spaces
3061 (including 0) after the ':' character.
3066 (including 0) after the ':' character.
3062
3067
3063 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3068 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3064 continuation prompt, which misled users to think the line was
3069 continuation prompt, which misled users to think the line was
3065 already indented. Closes debian Bug#300847, reported to me by
3070 already indented. Closes debian Bug#300847, reported to me by
3066 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3071 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3067
3072
3068 2005-03-23 Fernando Perez <fperez@colorado.edu>
3073 2005-03-23 Fernando Perez <fperez@colorado.edu>
3069
3074
3070 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3075 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3071 properly aligned if they have embedded newlines.
3076 properly aligned if they have embedded newlines.
3072
3077
3073 * IPython/iplib.py (runlines): Add a public method to expose
3078 * IPython/iplib.py (runlines): Add a public method to expose
3074 IPython's code execution machinery, so that users can run strings
3079 IPython's code execution machinery, so that users can run strings
3075 as if they had been typed at the prompt interactively.
3080 as if they had been typed at the prompt interactively.
3076 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3081 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3077 methods which can call the system shell, but with python variable
3082 methods which can call the system shell, but with python variable
3078 expansion. The three such methods are: __IPYTHON__.system,
3083 expansion. The three such methods are: __IPYTHON__.system,
3079 .getoutput and .getoutputerror. These need to be documented in a
3084 .getoutput and .getoutputerror. These need to be documented in a
3080 'public API' section (to be written) of the manual.
3085 'public API' section (to be written) of the manual.
3081
3086
3082 2005-03-20 Fernando Perez <fperez@colorado.edu>
3087 2005-03-20 Fernando Perez <fperez@colorado.edu>
3083
3088
3084 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3089 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3085 for custom exception handling. This is quite powerful, and it
3090 for custom exception handling. This is quite powerful, and it
3086 allows for user-installable exception handlers which can trap
3091 allows for user-installable exception handlers which can trap
3087 custom exceptions at runtime and treat them separately from
3092 custom exceptions at runtime and treat them separately from
3088 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3093 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3089 Mantegazza <mantegazza-AT-ill.fr>.
3094 Mantegazza <mantegazza-AT-ill.fr>.
3090 (InteractiveShell.set_custom_completer): public API function to
3095 (InteractiveShell.set_custom_completer): public API function to
3091 add new completers at runtime.
3096 add new completers at runtime.
3092
3097
3093 2005-03-19 Fernando Perez <fperez@colorado.edu>
3098 2005-03-19 Fernando Perez <fperez@colorado.edu>
3094
3099
3095 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3100 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3096 allow objects which provide their docstrings via non-standard
3101 allow objects which provide their docstrings via non-standard
3097 mechanisms (like Pyro proxies) to still be inspected by ipython's
3102 mechanisms (like Pyro proxies) to still be inspected by ipython's
3098 ? system.
3103 ? system.
3099
3104
3100 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3105 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3101 automatic capture system. I tried quite hard to make it work
3106 automatic capture system. I tried quite hard to make it work
3102 reliably, and simply failed. I tried many combinations with the
3107 reliably, and simply failed. I tried many combinations with the
3103 subprocess module, but eventually nothing worked in all needed
3108 subprocess module, but eventually nothing worked in all needed
3104 cases (not blocking stdin for the child, duplicating stdout
3109 cases (not blocking stdin for the child, duplicating stdout
3105 without blocking, etc). The new %sc/%sx still do capture to these
3110 without blocking, etc). The new %sc/%sx still do capture to these
3106 magical list/string objects which make shell use much more
3111 magical list/string objects which make shell use much more
3107 conveninent, so not all is lost.
3112 conveninent, so not all is lost.
3108
3113
3109 XXX - FIX MANUAL for the change above!
3114 XXX - FIX MANUAL for the change above!
3110
3115
3111 (runsource): I copied code.py's runsource() into ipython to modify
3116 (runsource): I copied code.py's runsource() into ipython to modify
3112 it a bit. Now the code object and source to be executed are
3117 it a bit. Now the code object and source to be executed are
3113 stored in ipython. This makes this info accessible to third-party
3118 stored in ipython. This makes this info accessible to third-party
3114 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3119 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3115 Mantegazza <mantegazza-AT-ill.fr>.
3120 Mantegazza <mantegazza-AT-ill.fr>.
3116
3121
3117 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3122 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3118 history-search via readline (like C-p/C-n). I'd wanted this for a
3123 history-search via readline (like C-p/C-n). I'd wanted this for a
3119 long time, but only recently found out how to do it. For users
3124 long time, but only recently found out how to do it. For users
3120 who already have their ipythonrc files made and want this, just
3125 who already have their ipythonrc files made and want this, just
3121 add:
3126 add:
3122
3127
3123 readline_parse_and_bind "\e[A": history-search-backward
3128 readline_parse_and_bind "\e[A": history-search-backward
3124 readline_parse_and_bind "\e[B": history-search-forward
3129 readline_parse_and_bind "\e[B": history-search-forward
3125
3130
3126 2005-03-18 Fernando Perez <fperez@colorado.edu>
3131 2005-03-18 Fernando Perez <fperez@colorado.edu>
3127
3132
3128 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3133 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3129 LSString and SList classes which allow transparent conversions
3134 LSString and SList classes which allow transparent conversions
3130 between list mode and whitespace-separated string.
3135 between list mode and whitespace-separated string.
3131 (magic_r): Fix recursion problem in %r.
3136 (magic_r): Fix recursion problem in %r.
3132
3137
3133 * IPython/genutils.py (LSString): New class to be used for
3138 * IPython/genutils.py (LSString): New class to be used for
3134 automatic storage of the results of all alias/system calls in _o
3139 automatic storage of the results of all alias/system calls in _o
3135 and _e (stdout/err). These provide a .l/.list attribute which
3140 and _e (stdout/err). These provide a .l/.list attribute which
3136 does automatic splitting on newlines. This means that for most
3141 does automatic splitting on newlines. This means that for most
3137 uses, you'll never need to do capturing of output with %sc/%sx
3142 uses, you'll never need to do capturing of output with %sc/%sx
3138 anymore, since ipython keeps this always done for you. Note that
3143 anymore, since ipython keeps this always done for you. Note that
3139 only the LAST results are stored, the _o/e variables are
3144 only the LAST results are stored, the _o/e variables are
3140 overwritten on each call. If you need to save their contents
3145 overwritten on each call. If you need to save their contents
3141 further, simply bind them to any other name.
3146 further, simply bind them to any other name.
3142
3147
3143 2005-03-17 Fernando Perez <fperez@colorado.edu>
3148 2005-03-17 Fernando Perez <fperez@colorado.edu>
3144
3149
3145 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3150 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3146 prompt namespace handling.
3151 prompt namespace handling.
3147
3152
3148 2005-03-16 Fernando Perez <fperez@colorado.edu>
3153 2005-03-16 Fernando Perez <fperez@colorado.edu>
3149
3154
3150 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3155 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3151 classic prompts to be '>>> ' (final space was missing, and it
3156 classic prompts to be '>>> ' (final space was missing, and it
3152 trips the emacs python mode).
3157 trips the emacs python mode).
3153 (BasePrompt.__str__): Added safe support for dynamic prompt
3158 (BasePrompt.__str__): Added safe support for dynamic prompt
3154 strings. Now you can set your prompt string to be '$x', and the
3159 strings. Now you can set your prompt string to be '$x', and the
3155 value of x will be printed from your interactive namespace. The
3160 value of x will be printed from your interactive namespace. The
3156 interpolation syntax includes the full Itpl support, so
3161 interpolation syntax includes the full Itpl support, so
3157 ${foo()+x+bar()} is a valid prompt string now, and the function
3162 ${foo()+x+bar()} is a valid prompt string now, and the function
3158 calls will be made at runtime.
3163 calls will be made at runtime.
3159
3164
3160 2005-03-15 Fernando Perez <fperez@colorado.edu>
3165 2005-03-15 Fernando Perez <fperez@colorado.edu>
3161
3166
3162 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3167 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3163 avoid name clashes in pylab. %hist still works, it just forwards
3168 avoid name clashes in pylab. %hist still works, it just forwards
3164 the call to %history.
3169 the call to %history.
3165
3170
3166 2005-03-02 *** Released version 0.6.12
3171 2005-03-02 *** Released version 0.6.12
3167
3172
3168 2005-03-02 Fernando Perez <fperez@colorado.edu>
3173 2005-03-02 Fernando Perez <fperez@colorado.edu>
3169
3174
3170 * IPython/iplib.py (handle_magic): log magic calls properly as
3175 * IPython/iplib.py (handle_magic): log magic calls properly as
3171 ipmagic() function calls.
3176 ipmagic() function calls.
3172
3177
3173 * IPython/Magic.py (magic_time): Improved %time to support
3178 * IPython/Magic.py (magic_time): Improved %time to support
3174 statements and provide wall-clock as well as CPU time.
3179 statements and provide wall-clock as well as CPU time.
3175
3180
3176 2005-02-27 Fernando Perez <fperez@colorado.edu>
3181 2005-02-27 Fernando Perez <fperez@colorado.edu>
3177
3182
3178 * IPython/hooks.py: New hooks module, to expose user-modifiable
3183 * IPython/hooks.py: New hooks module, to expose user-modifiable
3179 IPython functionality in a clean manner. For now only the editor
3184 IPython functionality in a clean manner. For now only the editor
3180 hook is actually written, and other thigns which I intend to turn
3185 hook is actually written, and other thigns which I intend to turn
3181 into proper hooks aren't yet there. The display and prefilter
3186 into proper hooks aren't yet there. The display and prefilter
3182 stuff, for example, should be hooks. But at least now the
3187 stuff, for example, should be hooks. But at least now the
3183 framework is in place, and the rest can be moved here with more
3188 framework is in place, and the rest can be moved here with more
3184 time later. IPython had had a .hooks variable for a long time for
3189 time later. IPython had had a .hooks variable for a long time for
3185 this purpose, but I'd never actually used it for anything.
3190 this purpose, but I'd never actually used it for anything.
3186
3191
3187 2005-02-26 Fernando Perez <fperez@colorado.edu>
3192 2005-02-26 Fernando Perez <fperez@colorado.edu>
3188
3193
3189 * IPython/ipmaker.py (make_IPython): make the default ipython
3194 * IPython/ipmaker.py (make_IPython): make the default ipython
3190 directory be called _ipython under win32, to follow more the
3195 directory be called _ipython under win32, to follow more the
3191 naming peculiarities of that platform (where buggy software like
3196 naming peculiarities of that platform (where buggy software like
3192 Visual Sourcesafe breaks with .named directories). Reported by
3197 Visual Sourcesafe breaks with .named directories). Reported by
3193 Ville Vainio.
3198 Ville Vainio.
3194
3199
3195 2005-02-23 Fernando Perez <fperez@colorado.edu>
3200 2005-02-23 Fernando Perez <fperez@colorado.edu>
3196
3201
3197 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3202 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3198 auto_aliases for win32 which were causing problems. Users can
3203 auto_aliases for win32 which were causing problems. Users can
3199 define the ones they personally like.
3204 define the ones they personally like.
3200
3205
3201 2005-02-21 Fernando Perez <fperez@colorado.edu>
3206 2005-02-21 Fernando Perez <fperez@colorado.edu>
3202
3207
3203 * IPython/Magic.py (magic_time): new magic to time execution of
3208 * IPython/Magic.py (magic_time): new magic to time execution of
3204 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3209 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3205
3210
3206 2005-02-19 Fernando Perez <fperez@colorado.edu>
3211 2005-02-19 Fernando Perez <fperez@colorado.edu>
3207
3212
3208 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3213 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3209 into keys (for prompts, for example).
3214 into keys (for prompts, for example).
3210
3215
3211 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3216 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3212 prompts in case users want them. This introduces a small behavior
3217 prompts in case users want them. This introduces a small behavior
3213 change: ipython does not automatically add a space to all prompts
3218 change: ipython does not automatically add a space to all prompts
3214 anymore. To get the old prompts with a space, users should add it
3219 anymore. To get the old prompts with a space, users should add it
3215 manually to their ipythonrc file, so for example prompt_in1 should
3220 manually to their ipythonrc file, so for example prompt_in1 should
3216 now read 'In [\#]: ' instead of 'In [\#]:'.
3221 now read 'In [\#]: ' instead of 'In [\#]:'.
3217 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3222 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3218 file) to control left-padding of secondary prompts.
3223 file) to control left-padding of secondary prompts.
3219
3224
3220 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3225 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3221 the profiler can't be imported. Fix for Debian, which removed
3226 the profiler can't be imported. Fix for Debian, which removed
3222 profile.py because of License issues. I applied a slightly
3227 profile.py because of License issues. I applied a slightly
3223 modified version of the original Debian patch at
3228 modified version of the original Debian patch at
3224 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3229 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3225
3230
3226 2005-02-17 Fernando Perez <fperez@colorado.edu>
3231 2005-02-17 Fernando Perez <fperez@colorado.edu>
3227
3232
3228 * IPython/genutils.py (native_line_ends): Fix bug which would
3233 * IPython/genutils.py (native_line_ends): Fix bug which would
3229 cause improper line-ends under win32 b/c I was not opening files
3234 cause improper line-ends under win32 b/c I was not opening files
3230 in binary mode. Bug report and fix thanks to Ville.
3235 in binary mode. Bug report and fix thanks to Ville.
3231
3236
3232 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3237 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3233 trying to catch spurious foo[1] autocalls. My fix actually broke
3238 trying to catch spurious foo[1] autocalls. My fix actually broke
3234 ',/' autoquote/call with explicit escape (bad regexp).
3239 ',/' autoquote/call with explicit escape (bad regexp).
3235
3240
3236 2005-02-15 *** Released version 0.6.11
3241 2005-02-15 *** Released version 0.6.11
3237
3242
3238 2005-02-14 Fernando Perez <fperez@colorado.edu>
3243 2005-02-14 Fernando Perez <fperez@colorado.edu>
3239
3244
3240 * IPython/background_jobs.py: New background job management
3245 * IPython/background_jobs.py: New background job management
3241 subsystem. This is implemented via a new set of classes, and
3246 subsystem. This is implemented via a new set of classes, and
3242 IPython now provides a builtin 'jobs' object for background job
3247 IPython now provides a builtin 'jobs' object for background job
3243 execution. A convenience %bg magic serves as a lightweight
3248 execution. A convenience %bg magic serves as a lightweight
3244 frontend for starting the more common type of calls. This was
3249 frontend for starting the more common type of calls. This was
3245 inspired by discussions with B. Granger and the BackgroundCommand
3250 inspired by discussions with B. Granger and the BackgroundCommand
3246 class described in the book Python Scripting for Computational
3251 class described in the book Python Scripting for Computational
3247 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3252 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3248 (although ultimately no code from this text was used, as IPython's
3253 (although ultimately no code from this text was used, as IPython's
3249 system is a separate implementation).
3254 system is a separate implementation).
3250
3255
3251 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3256 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3252 to control the completion of single/double underscore names
3257 to control the completion of single/double underscore names
3253 separately. As documented in the example ipytonrc file, the
3258 separately. As documented in the example ipytonrc file, the
3254 readline_omit__names variable can now be set to 2, to omit even
3259 readline_omit__names variable can now be set to 2, to omit even
3255 single underscore names. Thanks to a patch by Brian Wong
3260 single underscore names. Thanks to a patch by Brian Wong
3256 <BrianWong-AT-AirgoNetworks.Com>.
3261 <BrianWong-AT-AirgoNetworks.Com>.
3257 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3262 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3258 be autocalled as foo([1]) if foo were callable. A problem for
3263 be autocalled as foo([1]) if foo were callable. A problem for
3259 things which are both callable and implement __getitem__.
3264 things which are both callable and implement __getitem__.
3260 (init_readline): Fix autoindentation for win32. Thanks to a patch
3265 (init_readline): Fix autoindentation for win32. Thanks to a patch
3261 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3266 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3262
3267
3263 2005-02-12 Fernando Perez <fperez@colorado.edu>
3268 2005-02-12 Fernando Perez <fperez@colorado.edu>
3264
3269
3265 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3270 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3266 which I had written long ago to sort out user error messages which
3271 which I had written long ago to sort out user error messages which
3267 may occur during startup. This seemed like a good idea initially,
3272 may occur during startup. This seemed like a good idea initially,
3268 but it has proven a disaster in retrospect. I don't want to
3273 but it has proven a disaster in retrospect. I don't want to
3269 change much code for now, so my fix is to set the internal 'debug'
3274 change much code for now, so my fix is to set the internal 'debug'
3270 flag to true everywhere, whose only job was precisely to control
3275 flag to true everywhere, whose only job was precisely to control
3271 this subsystem. This closes issue 28 (as well as avoiding all
3276 this subsystem. This closes issue 28 (as well as avoiding all
3272 sorts of strange hangups which occur from time to time).
3277 sorts of strange hangups which occur from time to time).
3273
3278
3274 2005-02-07 Fernando Perez <fperez@colorado.edu>
3279 2005-02-07 Fernando Perez <fperez@colorado.edu>
3275
3280
3276 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3281 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3277 previous call produced a syntax error.
3282 previous call produced a syntax error.
3278
3283
3279 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3284 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3280 classes without constructor.
3285 classes without constructor.
3281
3286
3282 2005-02-06 Fernando Perez <fperez@colorado.edu>
3287 2005-02-06 Fernando Perez <fperez@colorado.edu>
3283
3288
3284 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3289 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3285 completions with the results of each matcher, so we return results
3290 completions with the results of each matcher, so we return results
3286 to the user from all namespaces. This breaks with ipython
3291 to the user from all namespaces. This breaks with ipython
3287 tradition, but I think it's a nicer behavior. Now you get all
3292 tradition, but I think it's a nicer behavior. Now you get all
3288 possible completions listed, from all possible namespaces (python,
3293 possible completions listed, from all possible namespaces (python,
3289 filesystem, magics...) After a request by John Hunter
3294 filesystem, magics...) After a request by John Hunter
3290 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3295 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3291
3296
3292 2005-02-05 Fernando Perez <fperez@colorado.edu>
3297 2005-02-05 Fernando Perez <fperez@colorado.edu>
3293
3298
3294 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3299 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3295 the call had quote characters in it (the quotes were stripped).
3300 the call had quote characters in it (the quotes were stripped).
3296
3301
3297 2005-01-31 Fernando Perez <fperez@colorado.edu>
3302 2005-01-31 Fernando Perez <fperez@colorado.edu>
3298
3303
3299 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3304 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3300 Itpl.itpl() to make the code more robust against psyco
3305 Itpl.itpl() to make the code more robust against psyco
3301 optimizations.
3306 optimizations.
3302
3307
3303 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3308 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3304 of causing an exception. Quicker, cleaner.
3309 of causing an exception. Quicker, cleaner.
3305
3310
3306 2005-01-28 Fernando Perez <fperez@colorado.edu>
3311 2005-01-28 Fernando Perez <fperez@colorado.edu>
3307
3312
3308 * scripts/ipython_win_post_install.py (install): hardcode
3313 * scripts/ipython_win_post_install.py (install): hardcode
3309 sys.prefix+'python.exe' as the executable path. It turns out that
3314 sys.prefix+'python.exe' as the executable path. It turns out that
3310 during the post-installation run, sys.executable resolves to the
3315 during the post-installation run, sys.executable resolves to the
3311 name of the binary installer! I should report this as a distutils
3316 name of the binary installer! I should report this as a distutils
3312 bug, I think. I updated the .10 release with this tiny fix, to
3317 bug, I think. I updated the .10 release with this tiny fix, to
3313 avoid annoying the lists further.
3318 avoid annoying the lists further.
3314
3319
3315 2005-01-27 *** Released version 0.6.10
3320 2005-01-27 *** Released version 0.6.10
3316
3321
3317 2005-01-27 Fernando Perez <fperez@colorado.edu>
3322 2005-01-27 Fernando Perez <fperez@colorado.edu>
3318
3323
3319 * IPython/numutils.py (norm): Added 'inf' as optional name for
3324 * IPython/numutils.py (norm): Added 'inf' as optional name for
3320 L-infinity norm, included references to mathworld.com for vector
3325 L-infinity norm, included references to mathworld.com for vector
3321 norm definitions.
3326 norm definitions.
3322 (amin/amax): added amin/amax for array min/max. Similar to what
3327 (amin/amax): added amin/amax for array min/max. Similar to what
3323 pylab ships with after the recent reorganization of names.
3328 pylab ships with after the recent reorganization of names.
3324 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3329 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3325
3330
3326 * ipython.el: committed Alex's recent fixes and improvements.
3331 * ipython.el: committed Alex's recent fixes and improvements.
3327 Tested with python-mode from CVS, and it looks excellent. Since
3332 Tested with python-mode from CVS, and it looks excellent. Since
3328 python-mode hasn't released anything in a while, I'm temporarily
3333 python-mode hasn't released anything in a while, I'm temporarily
3329 putting a copy of today's CVS (v 4.70) of python-mode in:
3334 putting a copy of today's CVS (v 4.70) of python-mode in:
3330 http://ipython.scipy.org/tmp/python-mode.el
3335 http://ipython.scipy.org/tmp/python-mode.el
3331
3336
3332 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3337 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3333 sys.executable for the executable name, instead of assuming it's
3338 sys.executable for the executable name, instead of assuming it's
3334 called 'python.exe' (the post-installer would have produced broken
3339 called 'python.exe' (the post-installer would have produced broken
3335 setups on systems with a differently named python binary).
3340 setups on systems with a differently named python binary).
3336
3341
3337 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3342 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3338 references to os.linesep, to make the code more
3343 references to os.linesep, to make the code more
3339 platform-independent. This is also part of the win32 coloring
3344 platform-independent. This is also part of the win32 coloring
3340 fixes.
3345 fixes.
3341
3346
3342 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3347 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3343 lines, which actually cause coloring bugs because the length of
3348 lines, which actually cause coloring bugs because the length of
3344 the line is very difficult to correctly compute with embedded
3349 the line is very difficult to correctly compute with embedded
3345 escapes. This was the source of all the coloring problems under
3350 escapes. This was the source of all the coloring problems under
3346 Win32. I think that _finally_, Win32 users have a properly
3351 Win32. I think that _finally_, Win32 users have a properly
3347 working ipython in all respects. This would never have happened
3352 working ipython in all respects. This would never have happened
3348 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3353 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3349
3354
3350 2005-01-26 *** Released version 0.6.9
3355 2005-01-26 *** Released version 0.6.9
3351
3356
3352 2005-01-25 Fernando Perez <fperez@colorado.edu>
3357 2005-01-25 Fernando Perez <fperez@colorado.edu>
3353
3358
3354 * setup.py: finally, we have a true Windows installer, thanks to
3359 * setup.py: finally, we have a true Windows installer, thanks to
3355 the excellent work of Viktor Ransmayr
3360 the excellent work of Viktor Ransmayr
3356 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3361 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3357 Windows users. The setup routine is quite a bit cleaner thanks to
3362 Windows users. The setup routine is quite a bit cleaner thanks to
3358 this, and the post-install script uses the proper functions to
3363 this, and the post-install script uses the proper functions to
3359 allow a clean de-installation using the standard Windows Control
3364 allow a clean de-installation using the standard Windows Control
3360 Panel.
3365 Panel.
3361
3366
3362 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3367 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3363 environment variable under all OSes (including win32) if
3368 environment variable under all OSes (including win32) if
3364 available. This will give consistency to win32 users who have set
3369 available. This will give consistency to win32 users who have set
3365 this variable for any reason. If os.environ['HOME'] fails, the
3370 this variable for any reason. If os.environ['HOME'] fails, the
3366 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3371 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3367
3372
3368 2005-01-24 Fernando Perez <fperez@colorado.edu>
3373 2005-01-24 Fernando Perez <fperez@colorado.edu>
3369
3374
3370 * IPython/numutils.py (empty_like): add empty_like(), similar to
3375 * IPython/numutils.py (empty_like): add empty_like(), similar to
3371 zeros_like() but taking advantage of the new empty() Numeric routine.
3376 zeros_like() but taking advantage of the new empty() Numeric routine.
3372
3377
3373 2005-01-23 *** Released version 0.6.8
3378 2005-01-23 *** Released version 0.6.8
3374
3379
3375 2005-01-22 Fernando Perez <fperez@colorado.edu>
3380 2005-01-22 Fernando Perez <fperez@colorado.edu>
3376
3381
3377 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3382 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3378 automatic show() calls. After discussing things with JDH, it
3383 automatic show() calls. After discussing things with JDH, it
3379 turns out there are too many corner cases where this can go wrong.
3384 turns out there are too many corner cases where this can go wrong.
3380 It's best not to try to be 'too smart', and simply have ipython
3385 It's best not to try to be 'too smart', and simply have ipython
3381 reproduce as much as possible the default behavior of a normal
3386 reproduce as much as possible the default behavior of a normal
3382 python shell.
3387 python shell.
3383
3388
3384 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3389 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3385 line-splitting regexp and _prefilter() to avoid calling getattr()
3390 line-splitting regexp and _prefilter() to avoid calling getattr()
3386 on assignments. This closes
3391 on assignments. This closes
3387 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3392 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3388 readline uses getattr(), so a simple <TAB> keypress is still
3393 readline uses getattr(), so a simple <TAB> keypress is still
3389 enough to trigger getattr() calls on an object.
3394 enough to trigger getattr() calls on an object.
3390
3395
3391 2005-01-21 Fernando Perez <fperez@colorado.edu>
3396 2005-01-21 Fernando Perez <fperez@colorado.edu>
3392
3397
3393 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3398 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3394 docstring under pylab so it doesn't mask the original.
3399 docstring under pylab so it doesn't mask the original.
3395
3400
3396 2005-01-21 *** Released version 0.6.7
3401 2005-01-21 *** Released version 0.6.7
3397
3402
3398 2005-01-21 Fernando Perez <fperez@colorado.edu>
3403 2005-01-21 Fernando Perez <fperez@colorado.edu>
3399
3404
3400 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3405 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3401 signal handling for win32 users in multithreaded mode.
3406 signal handling for win32 users in multithreaded mode.
3402
3407
3403 2005-01-17 Fernando Perez <fperez@colorado.edu>
3408 2005-01-17 Fernando Perez <fperez@colorado.edu>
3404
3409
3405 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3410 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3406 instances with no __init__. After a crash report by Norbert Nemec
3411 instances with no __init__. After a crash report by Norbert Nemec
3407 <Norbert-AT-nemec-online.de>.
3412 <Norbert-AT-nemec-online.de>.
3408
3413
3409 2005-01-14 Fernando Perez <fperez@colorado.edu>
3414 2005-01-14 Fernando Perez <fperez@colorado.edu>
3410
3415
3411 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3416 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3412 names for verbose exceptions, when multiple dotted names and the
3417 names for verbose exceptions, when multiple dotted names and the
3413 'parent' object were present on the same line.
3418 'parent' object were present on the same line.
3414
3419
3415 2005-01-11 Fernando Perez <fperez@colorado.edu>
3420 2005-01-11 Fernando Perez <fperez@colorado.edu>
3416
3421
3417 * IPython/genutils.py (flag_calls): new utility to trap and flag
3422 * IPython/genutils.py (flag_calls): new utility to trap and flag
3418 calls in functions. I need it to clean up matplotlib support.
3423 calls in functions. I need it to clean up matplotlib support.
3419 Also removed some deprecated code in genutils.
3424 Also removed some deprecated code in genutils.
3420
3425
3421 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3426 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3422 that matplotlib scripts called with %run, which don't call show()
3427 that matplotlib scripts called with %run, which don't call show()
3423 themselves, still have their plotting windows open.
3428 themselves, still have their plotting windows open.
3424
3429
3425 2005-01-05 Fernando Perez <fperez@colorado.edu>
3430 2005-01-05 Fernando Perez <fperez@colorado.edu>
3426
3431
3427 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3432 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3428 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3433 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3429
3434
3430 2004-12-19 Fernando Perez <fperez@colorado.edu>
3435 2004-12-19 Fernando Perez <fperez@colorado.edu>
3431
3436
3432 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3437 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3433 parent_runcode, which was an eyesore. The same result can be
3438 parent_runcode, which was an eyesore. The same result can be
3434 obtained with Python's regular superclass mechanisms.
3439 obtained with Python's regular superclass mechanisms.
3435
3440
3436 2004-12-17 Fernando Perez <fperez@colorado.edu>
3441 2004-12-17 Fernando Perez <fperez@colorado.edu>
3437
3442
3438 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3443 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3439 reported by Prabhu.
3444 reported by Prabhu.
3440 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3445 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3441 sys.stderr) instead of explicitly calling sys.stderr. This helps
3446 sys.stderr) instead of explicitly calling sys.stderr. This helps
3442 maintain our I/O abstractions clean, for future GUI embeddings.
3447 maintain our I/O abstractions clean, for future GUI embeddings.
3443
3448
3444 * IPython/genutils.py (info): added new utility for sys.stderr
3449 * IPython/genutils.py (info): added new utility for sys.stderr
3445 unified info message handling (thin wrapper around warn()).
3450 unified info message handling (thin wrapper around warn()).
3446
3451
3447 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3452 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3448 composite (dotted) names on verbose exceptions.
3453 composite (dotted) names on verbose exceptions.
3449 (VerboseTB.nullrepr): harden against another kind of errors which
3454 (VerboseTB.nullrepr): harden against another kind of errors which
3450 Python's inspect module can trigger, and which were crashing
3455 Python's inspect module can trigger, and which were crashing
3451 IPython. Thanks to a report by Marco Lombardi
3456 IPython. Thanks to a report by Marco Lombardi
3452 <mlombard-AT-ma010192.hq.eso.org>.
3457 <mlombard-AT-ma010192.hq.eso.org>.
3453
3458
3454 2004-12-13 *** Released version 0.6.6
3459 2004-12-13 *** Released version 0.6.6
3455
3460
3456 2004-12-12 Fernando Perez <fperez@colorado.edu>
3461 2004-12-12 Fernando Perez <fperez@colorado.edu>
3457
3462
3458 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3463 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3459 generated by pygtk upon initialization if it was built without
3464 generated by pygtk upon initialization if it was built without
3460 threads (for matplotlib users). After a crash reported by
3465 threads (for matplotlib users). After a crash reported by
3461 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3466 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3462
3467
3463 * IPython/ipmaker.py (make_IPython): fix small bug in the
3468 * IPython/ipmaker.py (make_IPython): fix small bug in the
3464 import_some parameter for multiple imports.
3469 import_some parameter for multiple imports.
3465
3470
3466 * IPython/iplib.py (ipmagic): simplified the interface of
3471 * IPython/iplib.py (ipmagic): simplified the interface of
3467 ipmagic() to take a single string argument, just as it would be
3472 ipmagic() to take a single string argument, just as it would be
3468 typed at the IPython cmd line.
3473 typed at the IPython cmd line.
3469 (ipalias): Added new ipalias() with an interface identical to
3474 (ipalias): Added new ipalias() with an interface identical to
3470 ipmagic(). This completes exposing a pure python interface to the
3475 ipmagic(). This completes exposing a pure python interface to the
3471 alias and magic system, which can be used in loops or more complex
3476 alias and magic system, which can be used in loops or more complex
3472 code where IPython's automatic line mangling is not active.
3477 code where IPython's automatic line mangling is not active.
3473
3478
3474 * IPython/genutils.py (timing): changed interface of timing to
3479 * IPython/genutils.py (timing): changed interface of timing to
3475 simply run code once, which is the most common case. timings()
3480 simply run code once, which is the most common case. timings()
3476 remains unchanged, for the cases where you want multiple runs.
3481 remains unchanged, for the cases where you want multiple runs.
3477
3482
3478 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3483 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3479 bug where Python2.2 crashes with exec'ing code which does not end
3484 bug where Python2.2 crashes with exec'ing code which does not end
3480 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3485 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3481 before.
3486 before.
3482
3487
3483 2004-12-10 Fernando Perez <fperez@colorado.edu>
3488 2004-12-10 Fernando Perez <fperez@colorado.edu>
3484
3489
3485 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3490 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3486 -t to -T, to accomodate the new -t flag in %run (the %run and
3491 -t to -T, to accomodate the new -t flag in %run (the %run and
3487 %prun options are kind of intermixed, and it's not easy to change
3492 %prun options are kind of intermixed, and it's not easy to change
3488 this with the limitations of python's getopt).
3493 this with the limitations of python's getopt).
3489
3494
3490 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3495 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3491 the execution of scripts. It's not as fine-tuned as timeit.py,
3496 the execution of scripts. It's not as fine-tuned as timeit.py,
3492 but it works from inside ipython (and under 2.2, which lacks
3497 but it works from inside ipython (and under 2.2, which lacks
3493 timeit.py). Optionally a number of runs > 1 can be given for
3498 timeit.py). Optionally a number of runs > 1 can be given for
3494 timing very short-running code.
3499 timing very short-running code.
3495
3500
3496 * IPython/genutils.py (uniq_stable): new routine which returns a
3501 * IPython/genutils.py (uniq_stable): new routine which returns a
3497 list of unique elements in any iterable, but in stable order of
3502 list of unique elements in any iterable, but in stable order of
3498 appearance. I needed this for the ultraTB fixes, and it's a handy
3503 appearance. I needed this for the ultraTB fixes, and it's a handy
3499 utility.
3504 utility.
3500
3505
3501 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3506 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3502 dotted names in Verbose exceptions. This had been broken since
3507 dotted names in Verbose exceptions. This had been broken since
3503 the very start, now x.y will properly be printed in a Verbose
3508 the very start, now x.y will properly be printed in a Verbose
3504 traceback, instead of x being shown and y appearing always as an
3509 traceback, instead of x being shown and y appearing always as an
3505 'undefined global'. Getting this to work was a bit tricky,
3510 'undefined global'. Getting this to work was a bit tricky,
3506 because by default python tokenizers are stateless. Saved by
3511 because by default python tokenizers are stateless. Saved by
3507 python's ability to easily add a bit of state to an arbitrary
3512 python's ability to easily add a bit of state to an arbitrary
3508 function (without needing to build a full-blown callable object).
3513 function (without needing to build a full-blown callable object).
3509
3514
3510 Also big cleanup of this code, which had horrendous runtime
3515 Also big cleanup of this code, which had horrendous runtime
3511 lookups of zillions of attributes for colorization. Moved all
3516 lookups of zillions of attributes for colorization. Moved all
3512 this code into a few templates, which make it cleaner and quicker.
3517 this code into a few templates, which make it cleaner and quicker.
3513
3518
3514 Printout quality was also improved for Verbose exceptions: one
3519 Printout quality was also improved for Verbose exceptions: one
3515 variable per line, and memory addresses are printed (this can be
3520 variable per line, and memory addresses are printed (this can be
3516 quite handy in nasty debugging situations, which is what Verbose
3521 quite handy in nasty debugging situations, which is what Verbose
3517 is for).
3522 is for).
3518
3523
3519 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3524 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3520 the command line as scripts to be loaded by embedded instances.
3525 the command line as scripts to be loaded by embedded instances.
3521 Doing so has the potential for an infinite recursion if there are
3526 Doing so has the potential for an infinite recursion if there are
3522 exceptions thrown in the process. This fixes a strange crash
3527 exceptions thrown in the process. This fixes a strange crash
3523 reported by Philippe MULLER <muller-AT-irit.fr>.
3528 reported by Philippe MULLER <muller-AT-irit.fr>.
3524
3529
3525 2004-12-09 Fernando Perez <fperez@colorado.edu>
3530 2004-12-09 Fernando Perez <fperez@colorado.edu>
3526
3531
3527 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3532 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3528 to reflect new names in matplotlib, which now expose the
3533 to reflect new names in matplotlib, which now expose the
3529 matlab-compatible interface via a pylab module instead of the
3534 matlab-compatible interface via a pylab module instead of the
3530 'matlab' name. The new code is backwards compatible, so users of
3535 'matlab' name. The new code is backwards compatible, so users of
3531 all matplotlib versions are OK. Patch by J. Hunter.
3536 all matplotlib versions are OK. Patch by J. Hunter.
3532
3537
3533 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3538 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3534 of __init__ docstrings for instances (class docstrings are already
3539 of __init__ docstrings for instances (class docstrings are already
3535 automatically printed). Instances with customized docstrings
3540 automatically printed). Instances with customized docstrings
3536 (indep. of the class) are also recognized and all 3 separate
3541 (indep. of the class) are also recognized and all 3 separate
3537 docstrings are printed (instance, class, constructor). After some
3542 docstrings are printed (instance, class, constructor). After some
3538 comments/suggestions by J. Hunter.
3543 comments/suggestions by J. Hunter.
3539
3544
3540 2004-12-05 Fernando Perez <fperez@colorado.edu>
3545 2004-12-05 Fernando Perez <fperez@colorado.edu>
3541
3546
3542 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3547 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3543 warnings when tab-completion fails and triggers an exception.
3548 warnings when tab-completion fails and triggers an exception.
3544
3549
3545 2004-12-03 Fernando Perez <fperez@colorado.edu>
3550 2004-12-03 Fernando Perez <fperez@colorado.edu>
3546
3551
3547 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3552 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3548 be triggered when using 'run -p'. An incorrect option flag was
3553 be triggered when using 'run -p'. An incorrect option flag was
3549 being set ('d' instead of 'D').
3554 being set ('d' instead of 'D').
3550 (manpage): fix missing escaped \- sign.
3555 (manpage): fix missing escaped \- sign.
3551
3556
3552 2004-11-30 *** Released version 0.6.5
3557 2004-11-30 *** Released version 0.6.5
3553
3558
3554 2004-11-30 Fernando Perez <fperez@colorado.edu>
3559 2004-11-30 Fernando Perez <fperez@colorado.edu>
3555
3560
3556 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3561 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3557 setting with -d option.
3562 setting with -d option.
3558
3563
3559 * setup.py (docfiles): Fix problem where the doc glob I was using
3564 * setup.py (docfiles): Fix problem where the doc glob I was using
3560 was COMPLETELY BROKEN. It was giving the right files by pure
3565 was COMPLETELY BROKEN. It was giving the right files by pure
3561 accident, but failed once I tried to include ipython.el. Note:
3566 accident, but failed once I tried to include ipython.el. Note:
3562 glob() does NOT allow you to do exclusion on multiple endings!
3567 glob() does NOT allow you to do exclusion on multiple endings!
3563
3568
3564 2004-11-29 Fernando Perez <fperez@colorado.edu>
3569 2004-11-29 Fernando Perez <fperez@colorado.edu>
3565
3570
3566 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3571 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3567 the manpage as the source. Better formatting & consistency.
3572 the manpage as the source. Better formatting & consistency.
3568
3573
3569 * IPython/Magic.py (magic_run): Added new -d option, to run
3574 * IPython/Magic.py (magic_run): Added new -d option, to run
3570 scripts under the control of the python pdb debugger. Note that
3575 scripts under the control of the python pdb debugger. Note that
3571 this required changing the %prun option -d to -D, to avoid a clash
3576 this required changing the %prun option -d to -D, to avoid a clash
3572 (since %run must pass options to %prun, and getopt is too dumb to
3577 (since %run must pass options to %prun, and getopt is too dumb to
3573 handle options with string values with embedded spaces). Thanks
3578 handle options with string values with embedded spaces). Thanks
3574 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3579 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3575 (magic_who_ls): added type matching to %who and %whos, so that one
3580 (magic_who_ls): added type matching to %who and %whos, so that one
3576 can filter their output to only include variables of certain
3581 can filter their output to only include variables of certain
3577 types. Another suggestion by Matthew.
3582 types. Another suggestion by Matthew.
3578 (magic_whos): Added memory summaries in kb and Mb for arrays.
3583 (magic_whos): Added memory summaries in kb and Mb for arrays.
3579 (magic_who): Improve formatting (break lines every 9 vars).
3584 (magic_who): Improve formatting (break lines every 9 vars).
3580
3585
3581 2004-11-28 Fernando Perez <fperez@colorado.edu>
3586 2004-11-28 Fernando Perez <fperez@colorado.edu>
3582
3587
3583 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3588 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3584 cache when empty lines were present.
3589 cache when empty lines were present.
3585
3590
3586 2004-11-24 Fernando Perez <fperez@colorado.edu>
3591 2004-11-24 Fernando Perez <fperez@colorado.edu>
3587
3592
3588 * IPython/usage.py (__doc__): document the re-activated threading
3593 * IPython/usage.py (__doc__): document the re-activated threading
3589 options for WX and GTK.
3594 options for WX and GTK.
3590
3595
3591 2004-11-23 Fernando Perez <fperez@colorado.edu>
3596 2004-11-23 Fernando Perez <fperez@colorado.edu>
3592
3597
3593 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3598 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3594 the -wthread and -gthread options, along with a new -tk one to try
3599 the -wthread and -gthread options, along with a new -tk one to try
3595 and coordinate Tk threading with wx/gtk. The tk support is very
3600 and coordinate Tk threading with wx/gtk. The tk support is very
3596 platform dependent, since it seems to require Tcl and Tk to be
3601 platform dependent, since it seems to require Tcl and Tk to be
3597 built with threads (Fedora1/2 appears NOT to have it, but in
3602 built with threads (Fedora1/2 appears NOT to have it, but in
3598 Prabhu's Debian boxes it works OK). But even with some Tk
3603 Prabhu's Debian boxes it works OK). But even with some Tk
3599 limitations, this is a great improvement.
3604 limitations, this is a great improvement.
3600
3605
3601 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3606 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3602 info in user prompts. Patch by Prabhu.
3607 info in user prompts. Patch by Prabhu.
3603
3608
3604 2004-11-18 Fernando Perez <fperez@colorado.edu>
3609 2004-11-18 Fernando Perez <fperez@colorado.edu>
3605
3610
3606 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3611 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3607 EOFErrors and bail, to avoid infinite loops if a non-terminating
3612 EOFErrors and bail, to avoid infinite loops if a non-terminating
3608 file is fed into ipython. Patch submitted in issue 19 by user,
3613 file is fed into ipython. Patch submitted in issue 19 by user,
3609 many thanks.
3614 many thanks.
3610
3615
3611 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3616 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3612 autoquote/parens in continuation prompts, which can cause lots of
3617 autoquote/parens in continuation prompts, which can cause lots of
3613 problems. Closes roundup issue 20.
3618 problems. Closes roundup issue 20.
3614
3619
3615 2004-11-17 Fernando Perez <fperez@colorado.edu>
3620 2004-11-17 Fernando Perez <fperez@colorado.edu>
3616
3621
3617 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3622 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3618 reported as debian bug #280505. I'm not sure my local changelog
3623 reported as debian bug #280505. I'm not sure my local changelog
3619 entry has the proper debian format (Jack?).
3624 entry has the proper debian format (Jack?).
3620
3625
3621 2004-11-08 *** Released version 0.6.4
3626 2004-11-08 *** Released version 0.6.4
3622
3627
3623 2004-11-08 Fernando Perez <fperez@colorado.edu>
3628 2004-11-08 Fernando Perez <fperez@colorado.edu>
3624
3629
3625 * IPython/iplib.py (init_readline): Fix exit message for Windows
3630 * IPython/iplib.py (init_readline): Fix exit message for Windows
3626 when readline is active. Thanks to a report by Eric Jones
3631 when readline is active. Thanks to a report by Eric Jones
3627 <eric-AT-enthought.com>.
3632 <eric-AT-enthought.com>.
3628
3633
3629 2004-11-07 Fernando Perez <fperez@colorado.edu>
3634 2004-11-07 Fernando Perez <fperez@colorado.edu>
3630
3635
3631 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3636 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3632 sometimes seen by win2k/cygwin users.
3637 sometimes seen by win2k/cygwin users.
3633
3638
3634 2004-11-06 Fernando Perez <fperez@colorado.edu>
3639 2004-11-06 Fernando Perez <fperez@colorado.edu>
3635
3640
3636 * IPython/iplib.py (interact): Change the handling of %Exit from
3641 * IPython/iplib.py (interact): Change the handling of %Exit from
3637 trying to propagate a SystemExit to an internal ipython flag.
3642 trying to propagate a SystemExit to an internal ipython flag.
3638 This is less elegant than using Python's exception mechanism, but
3643 This is less elegant than using Python's exception mechanism, but
3639 I can't get that to work reliably with threads, so under -pylab
3644 I can't get that to work reliably with threads, so under -pylab
3640 %Exit was hanging IPython. Cross-thread exception handling is
3645 %Exit was hanging IPython. Cross-thread exception handling is
3641 really a bitch. Thaks to a bug report by Stephen Walton
3646 really a bitch. Thaks to a bug report by Stephen Walton
3642 <stephen.walton-AT-csun.edu>.
3647 <stephen.walton-AT-csun.edu>.
3643
3648
3644 2004-11-04 Fernando Perez <fperez@colorado.edu>
3649 2004-11-04 Fernando Perez <fperez@colorado.edu>
3645
3650
3646 * IPython/iplib.py (raw_input_original): store a pointer to the
3651 * IPython/iplib.py (raw_input_original): store a pointer to the
3647 true raw_input to harden against code which can modify it
3652 true raw_input to harden against code which can modify it
3648 (wx.py.PyShell does this and would otherwise crash ipython).
3653 (wx.py.PyShell does this and would otherwise crash ipython).
3649 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3654 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3650
3655
3651 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3656 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3652 Ctrl-C problem, which does not mess up the input line.
3657 Ctrl-C problem, which does not mess up the input line.
3653
3658
3654 2004-11-03 Fernando Perez <fperez@colorado.edu>
3659 2004-11-03 Fernando Perez <fperez@colorado.edu>
3655
3660
3656 * IPython/Release.py: Changed licensing to BSD, in all files.
3661 * IPython/Release.py: Changed licensing to BSD, in all files.
3657 (name): lowercase name for tarball/RPM release.
3662 (name): lowercase name for tarball/RPM release.
3658
3663
3659 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3664 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3660 use throughout ipython.
3665 use throughout ipython.
3661
3666
3662 * IPython/Magic.py (Magic._ofind): Switch to using the new
3667 * IPython/Magic.py (Magic._ofind): Switch to using the new
3663 OInspect.getdoc() function.
3668 OInspect.getdoc() function.
3664
3669
3665 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3670 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3666 of the line currently being canceled via Ctrl-C. It's extremely
3671 of the line currently being canceled via Ctrl-C. It's extremely
3667 ugly, but I don't know how to do it better (the problem is one of
3672 ugly, but I don't know how to do it better (the problem is one of
3668 handling cross-thread exceptions).
3673 handling cross-thread exceptions).
3669
3674
3670 2004-10-28 Fernando Perez <fperez@colorado.edu>
3675 2004-10-28 Fernando Perez <fperez@colorado.edu>
3671
3676
3672 * IPython/Shell.py (signal_handler): add signal handlers to trap
3677 * IPython/Shell.py (signal_handler): add signal handlers to trap
3673 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3678 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3674 report by Francesc Alted.
3679 report by Francesc Alted.
3675
3680
3676 2004-10-21 Fernando Perez <fperez@colorado.edu>
3681 2004-10-21 Fernando Perez <fperez@colorado.edu>
3677
3682
3678 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3683 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3679 to % for pysh syntax extensions.
3684 to % for pysh syntax extensions.
3680
3685
3681 2004-10-09 Fernando Perez <fperez@colorado.edu>
3686 2004-10-09 Fernando Perez <fperez@colorado.edu>
3682
3687
3683 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3688 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3684 arrays to print a more useful summary, without calling str(arr).
3689 arrays to print a more useful summary, without calling str(arr).
3685 This avoids the problem of extremely lengthy computations which
3690 This avoids the problem of extremely lengthy computations which
3686 occur if arr is large, and appear to the user as a system lockup
3691 occur if arr is large, and appear to the user as a system lockup
3687 with 100% cpu activity. After a suggestion by Kristian Sandberg
3692 with 100% cpu activity. After a suggestion by Kristian Sandberg
3688 <Kristian.Sandberg@colorado.edu>.
3693 <Kristian.Sandberg@colorado.edu>.
3689 (Magic.__init__): fix bug in global magic escapes not being
3694 (Magic.__init__): fix bug in global magic escapes not being
3690 correctly set.
3695 correctly set.
3691
3696
3692 2004-10-08 Fernando Perez <fperez@colorado.edu>
3697 2004-10-08 Fernando Perez <fperez@colorado.edu>
3693
3698
3694 * IPython/Magic.py (__license__): change to absolute imports of
3699 * IPython/Magic.py (__license__): change to absolute imports of
3695 ipython's own internal packages, to start adapting to the absolute
3700 ipython's own internal packages, to start adapting to the absolute
3696 import requirement of PEP-328.
3701 import requirement of PEP-328.
3697
3702
3698 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3703 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3699 files, and standardize author/license marks through the Release
3704 files, and standardize author/license marks through the Release
3700 module instead of having per/file stuff (except for files with
3705 module instead of having per/file stuff (except for files with
3701 particular licenses, like the MIT/PSF-licensed codes).
3706 particular licenses, like the MIT/PSF-licensed codes).
3702
3707
3703 * IPython/Debugger.py: remove dead code for python 2.1
3708 * IPython/Debugger.py: remove dead code for python 2.1
3704
3709
3705 2004-10-04 Fernando Perez <fperez@colorado.edu>
3710 2004-10-04 Fernando Perez <fperez@colorado.edu>
3706
3711
3707 * IPython/iplib.py (ipmagic): New function for accessing magics
3712 * IPython/iplib.py (ipmagic): New function for accessing magics
3708 via a normal python function call.
3713 via a normal python function call.
3709
3714
3710 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3715 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3711 from '@' to '%', to accomodate the new @decorator syntax of python
3716 from '@' to '%', to accomodate the new @decorator syntax of python
3712 2.4.
3717 2.4.
3713
3718
3714 2004-09-29 Fernando Perez <fperez@colorado.edu>
3719 2004-09-29 Fernando Perez <fperez@colorado.edu>
3715
3720
3716 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3721 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3717 matplotlib.use to prevent running scripts which try to switch
3722 matplotlib.use to prevent running scripts which try to switch
3718 interactive backends from within ipython. This will just crash
3723 interactive backends from within ipython. This will just crash
3719 the python interpreter, so we can't allow it (but a detailed error
3724 the python interpreter, so we can't allow it (but a detailed error
3720 is given to the user).
3725 is given to the user).
3721
3726
3722 2004-09-28 Fernando Perez <fperez@colorado.edu>
3727 2004-09-28 Fernando Perez <fperez@colorado.edu>
3723
3728
3724 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3729 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3725 matplotlib-related fixes so that using @run with non-matplotlib
3730 matplotlib-related fixes so that using @run with non-matplotlib
3726 scripts doesn't pop up spurious plot windows. This requires
3731 scripts doesn't pop up spurious plot windows. This requires
3727 matplotlib >= 0.63, where I had to make some changes as well.
3732 matplotlib >= 0.63, where I had to make some changes as well.
3728
3733
3729 * IPython/ipmaker.py (make_IPython): update version requirement to
3734 * IPython/ipmaker.py (make_IPython): update version requirement to
3730 python 2.2.
3735 python 2.2.
3731
3736
3732 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3737 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3733 banner arg for embedded customization.
3738 banner arg for embedded customization.
3734
3739
3735 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3740 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3736 explicit uses of __IP as the IPython's instance name. Now things
3741 explicit uses of __IP as the IPython's instance name. Now things
3737 are properly handled via the shell.name value. The actual code
3742 are properly handled via the shell.name value. The actual code
3738 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3743 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3739 is much better than before. I'll clean things completely when the
3744 is much better than before. I'll clean things completely when the
3740 magic stuff gets a real overhaul.
3745 magic stuff gets a real overhaul.
3741
3746
3742 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3747 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3743 minor changes to debian dir.
3748 minor changes to debian dir.
3744
3749
3745 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3750 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3746 pointer to the shell itself in the interactive namespace even when
3751 pointer to the shell itself in the interactive namespace even when
3747 a user-supplied dict is provided. This is needed for embedding
3752 a user-supplied dict is provided. This is needed for embedding
3748 purposes (found by tests with Michel Sanner).
3753 purposes (found by tests with Michel Sanner).
3749
3754
3750 2004-09-27 Fernando Perez <fperez@colorado.edu>
3755 2004-09-27 Fernando Perez <fperez@colorado.edu>
3751
3756
3752 * IPython/UserConfig/ipythonrc: remove []{} from
3757 * IPython/UserConfig/ipythonrc: remove []{} from
3753 readline_remove_delims, so that things like [modname.<TAB> do
3758 readline_remove_delims, so that things like [modname.<TAB> do
3754 proper completion. This disables [].TAB, but that's a less common
3759 proper completion. This disables [].TAB, but that's a less common
3755 case than module names in list comprehensions, for example.
3760 case than module names in list comprehensions, for example.
3756 Thanks to a report by Andrea Riciputi.
3761 Thanks to a report by Andrea Riciputi.
3757
3762
3758 2004-09-09 Fernando Perez <fperez@colorado.edu>
3763 2004-09-09 Fernando Perez <fperez@colorado.edu>
3759
3764
3760 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3765 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3761 blocking problems in win32 and osx. Fix by John.
3766 blocking problems in win32 and osx. Fix by John.
3762
3767
3763 2004-09-08 Fernando Perez <fperez@colorado.edu>
3768 2004-09-08 Fernando Perez <fperez@colorado.edu>
3764
3769
3765 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3770 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3766 for Win32 and OSX. Fix by John Hunter.
3771 for Win32 and OSX. Fix by John Hunter.
3767
3772
3768 2004-08-30 *** Released version 0.6.3
3773 2004-08-30 *** Released version 0.6.3
3769
3774
3770 2004-08-30 Fernando Perez <fperez@colorado.edu>
3775 2004-08-30 Fernando Perez <fperez@colorado.edu>
3771
3776
3772 * setup.py (isfile): Add manpages to list of dependent files to be
3777 * setup.py (isfile): Add manpages to list of dependent files to be
3773 updated.
3778 updated.
3774
3779
3775 2004-08-27 Fernando Perez <fperez@colorado.edu>
3780 2004-08-27 Fernando Perez <fperez@colorado.edu>
3776
3781
3777 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3782 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3778 for now. They don't really work with standalone WX/GTK code
3783 for now. They don't really work with standalone WX/GTK code
3779 (though matplotlib IS working fine with both of those backends).
3784 (though matplotlib IS working fine with both of those backends).
3780 This will neeed much more testing. I disabled most things with
3785 This will neeed much more testing. I disabled most things with
3781 comments, so turning it back on later should be pretty easy.
3786 comments, so turning it back on later should be pretty easy.
3782
3787
3783 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3788 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3784 autocalling of expressions like r'foo', by modifying the line
3789 autocalling of expressions like r'foo', by modifying the line
3785 split regexp. Closes
3790 split regexp. Closes
3786 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3791 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3787 Riley <ipythonbugs-AT-sabi.net>.
3792 Riley <ipythonbugs-AT-sabi.net>.
3788 (InteractiveShell.mainloop): honor --nobanner with banner
3793 (InteractiveShell.mainloop): honor --nobanner with banner
3789 extensions.
3794 extensions.
3790
3795
3791 * IPython/Shell.py: Significant refactoring of all classes, so
3796 * IPython/Shell.py: Significant refactoring of all classes, so
3792 that we can really support ALL matplotlib backends and threading
3797 that we can really support ALL matplotlib backends and threading
3793 models (John spotted a bug with Tk which required this). Now we
3798 models (John spotted a bug with Tk which required this). Now we
3794 should support single-threaded, WX-threads and GTK-threads, both
3799 should support single-threaded, WX-threads and GTK-threads, both
3795 for generic code and for matplotlib.
3800 for generic code and for matplotlib.
3796
3801
3797 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3802 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3798 -pylab, to simplify things for users. Will also remove the pylab
3803 -pylab, to simplify things for users. Will also remove the pylab
3799 profile, since now all of matplotlib configuration is directly
3804 profile, since now all of matplotlib configuration is directly
3800 handled here. This also reduces startup time.
3805 handled here. This also reduces startup time.
3801
3806
3802 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3807 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3803 shell wasn't being correctly called. Also in IPShellWX.
3808 shell wasn't being correctly called. Also in IPShellWX.
3804
3809
3805 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3810 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3806 fine-tune banner.
3811 fine-tune banner.
3807
3812
3808 * IPython/numutils.py (spike): Deprecate these spike functions,
3813 * IPython/numutils.py (spike): Deprecate these spike functions,
3809 delete (long deprecated) gnuplot_exec handler.
3814 delete (long deprecated) gnuplot_exec handler.
3810
3815
3811 2004-08-26 Fernando Perez <fperez@colorado.edu>
3816 2004-08-26 Fernando Perez <fperez@colorado.edu>
3812
3817
3813 * ipython.1: Update for threading options, plus some others which
3818 * ipython.1: Update for threading options, plus some others which
3814 were missing.
3819 were missing.
3815
3820
3816 * IPython/ipmaker.py (__call__): Added -wthread option for
3821 * IPython/ipmaker.py (__call__): Added -wthread option for
3817 wxpython thread handling. Make sure threading options are only
3822 wxpython thread handling. Make sure threading options are only
3818 valid at the command line.
3823 valid at the command line.
3819
3824
3820 * scripts/ipython: moved shell selection into a factory function
3825 * scripts/ipython: moved shell selection into a factory function
3821 in Shell.py, to keep the starter script to a minimum.
3826 in Shell.py, to keep the starter script to a minimum.
3822
3827
3823 2004-08-25 Fernando Perez <fperez@colorado.edu>
3828 2004-08-25 Fernando Perez <fperez@colorado.edu>
3824
3829
3825 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3830 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3826 John. Along with some recent changes he made to matplotlib, the
3831 John. Along with some recent changes he made to matplotlib, the
3827 next versions of both systems should work very well together.
3832 next versions of both systems should work very well together.
3828
3833
3829 2004-08-24 Fernando Perez <fperez@colorado.edu>
3834 2004-08-24 Fernando Perez <fperez@colorado.edu>
3830
3835
3831 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3836 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3832 tried to switch the profiling to using hotshot, but I'm getting
3837 tried to switch the profiling to using hotshot, but I'm getting
3833 strange errors from prof.runctx() there. I may be misreading the
3838 strange errors from prof.runctx() there. I may be misreading the
3834 docs, but it looks weird. For now the profiling code will
3839 docs, but it looks weird. For now the profiling code will
3835 continue to use the standard profiler.
3840 continue to use the standard profiler.
3836
3841
3837 2004-08-23 Fernando Perez <fperez@colorado.edu>
3842 2004-08-23 Fernando Perez <fperez@colorado.edu>
3838
3843
3839 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3844 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3840 threaded shell, by John Hunter. It's not quite ready yet, but
3845 threaded shell, by John Hunter. It's not quite ready yet, but
3841 close.
3846 close.
3842
3847
3843 2004-08-22 Fernando Perez <fperez@colorado.edu>
3848 2004-08-22 Fernando Perez <fperez@colorado.edu>
3844
3849
3845 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3850 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3846 in Magic and ultraTB.
3851 in Magic and ultraTB.
3847
3852
3848 * ipython.1: document threading options in manpage.
3853 * ipython.1: document threading options in manpage.
3849
3854
3850 * scripts/ipython: Changed name of -thread option to -gthread,
3855 * scripts/ipython: Changed name of -thread option to -gthread,
3851 since this is GTK specific. I want to leave the door open for a
3856 since this is GTK specific. I want to leave the door open for a
3852 -wthread option for WX, which will most likely be necessary. This
3857 -wthread option for WX, which will most likely be necessary. This
3853 change affects usage and ipmaker as well.
3858 change affects usage and ipmaker as well.
3854
3859
3855 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3860 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3856 handle the matplotlib shell issues. Code by John Hunter
3861 handle the matplotlib shell issues. Code by John Hunter
3857 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3862 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3858 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3863 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3859 broken (and disabled for end users) for now, but it puts the
3864 broken (and disabled for end users) for now, but it puts the
3860 infrastructure in place.
3865 infrastructure in place.
3861
3866
3862 2004-08-21 Fernando Perez <fperez@colorado.edu>
3867 2004-08-21 Fernando Perez <fperez@colorado.edu>
3863
3868
3864 * ipythonrc-pylab: Add matplotlib support.
3869 * ipythonrc-pylab: Add matplotlib support.
3865
3870
3866 * matplotlib_config.py: new files for matplotlib support, part of
3871 * matplotlib_config.py: new files for matplotlib support, part of
3867 the pylab profile.
3872 the pylab profile.
3868
3873
3869 * IPython/usage.py (__doc__): documented the threading options.
3874 * IPython/usage.py (__doc__): documented the threading options.
3870
3875
3871 2004-08-20 Fernando Perez <fperez@colorado.edu>
3876 2004-08-20 Fernando Perez <fperez@colorado.edu>
3872
3877
3873 * ipython: Modified the main calling routine to handle the -thread
3878 * ipython: Modified the main calling routine to handle the -thread
3874 and -mpthread options. This needs to be done as a top-level hack,
3879 and -mpthread options. This needs to be done as a top-level hack,
3875 because it determines which class to instantiate for IPython
3880 because it determines which class to instantiate for IPython
3876 itself.
3881 itself.
3877
3882
3878 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3883 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3879 classes to support multithreaded GTK operation without blocking,
3884 classes to support multithreaded GTK operation without blocking,
3880 and matplotlib with all backends. This is a lot of still very
3885 and matplotlib with all backends. This is a lot of still very
3881 experimental code, and threads are tricky. So it may still have a
3886 experimental code, and threads are tricky. So it may still have a
3882 few rough edges... This code owes a lot to
3887 few rough edges... This code owes a lot to
3883 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3888 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3884 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3889 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3885 to John Hunter for all the matplotlib work.
3890 to John Hunter for all the matplotlib work.
3886
3891
3887 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3892 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3888 options for gtk thread and matplotlib support.
3893 options for gtk thread and matplotlib support.
3889
3894
3890 2004-08-16 Fernando Perez <fperez@colorado.edu>
3895 2004-08-16 Fernando Perez <fperez@colorado.edu>
3891
3896
3892 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3897 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3893 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3898 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3894 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3899 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3895
3900
3896 2004-08-11 Fernando Perez <fperez@colorado.edu>
3901 2004-08-11 Fernando Perez <fperez@colorado.edu>
3897
3902
3898 * setup.py (isfile): Fix build so documentation gets updated for
3903 * setup.py (isfile): Fix build so documentation gets updated for
3899 rpms (it was only done for .tgz builds).
3904 rpms (it was only done for .tgz builds).
3900
3905
3901 2004-08-10 Fernando Perez <fperez@colorado.edu>
3906 2004-08-10 Fernando Perez <fperez@colorado.edu>
3902
3907
3903 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3908 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3904
3909
3905 * iplib.py : Silence syntax error exceptions in tab-completion.
3910 * iplib.py : Silence syntax error exceptions in tab-completion.
3906
3911
3907 2004-08-05 Fernando Perez <fperez@colorado.edu>
3912 2004-08-05 Fernando Perez <fperez@colorado.edu>
3908
3913
3909 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3914 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3910 'color off' mark for continuation prompts. This was causing long
3915 'color off' mark for continuation prompts. This was causing long
3911 continuation lines to mis-wrap.
3916 continuation lines to mis-wrap.
3912
3917
3913 2004-08-01 Fernando Perez <fperez@colorado.edu>
3918 2004-08-01 Fernando Perez <fperez@colorado.edu>
3914
3919
3915 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3920 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3916 for building ipython to be a parameter. All this is necessary
3921 for building ipython to be a parameter. All this is necessary
3917 right now to have a multithreaded version, but this insane
3922 right now to have a multithreaded version, but this insane
3918 non-design will be cleaned up soon. For now, it's a hack that
3923 non-design will be cleaned up soon. For now, it's a hack that
3919 works.
3924 works.
3920
3925
3921 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3926 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3922 args in various places. No bugs so far, but it's a dangerous
3927 args in various places. No bugs so far, but it's a dangerous
3923 practice.
3928 practice.
3924
3929
3925 2004-07-31 Fernando Perez <fperez@colorado.edu>
3930 2004-07-31 Fernando Perez <fperez@colorado.edu>
3926
3931
3927 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3932 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3928 fix completion of files with dots in their names under most
3933 fix completion of files with dots in their names under most
3929 profiles (pysh was OK because the completion order is different).
3934 profiles (pysh was OK because the completion order is different).
3930
3935
3931 2004-07-27 Fernando Perez <fperez@colorado.edu>
3936 2004-07-27 Fernando Perez <fperez@colorado.edu>
3932
3937
3933 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3938 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3934 keywords manually, b/c the one in keyword.py was removed in python
3939 keywords manually, b/c the one in keyword.py was removed in python
3935 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3940 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3936 This is NOT a bug under python 2.3 and earlier.
3941 This is NOT a bug under python 2.3 and earlier.
3937
3942
3938 2004-07-26 Fernando Perez <fperez@colorado.edu>
3943 2004-07-26 Fernando Perez <fperez@colorado.edu>
3939
3944
3940 * IPython/ultraTB.py (VerboseTB.text): Add another
3945 * IPython/ultraTB.py (VerboseTB.text): Add another
3941 linecache.checkcache() call to try to prevent inspect.py from
3946 linecache.checkcache() call to try to prevent inspect.py from
3942 crashing under python 2.3. I think this fixes
3947 crashing under python 2.3. I think this fixes
3943 http://www.scipy.net/roundup/ipython/issue17.
3948 http://www.scipy.net/roundup/ipython/issue17.
3944
3949
3945 2004-07-26 *** Released version 0.6.2
3950 2004-07-26 *** Released version 0.6.2
3946
3951
3947 2004-07-26 Fernando Perez <fperez@colorado.edu>
3952 2004-07-26 Fernando Perez <fperez@colorado.edu>
3948
3953
3949 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3954 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3950 fail for any number.
3955 fail for any number.
3951 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3956 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3952 empty bookmarks.
3957 empty bookmarks.
3953
3958
3954 2004-07-26 *** Released version 0.6.1
3959 2004-07-26 *** Released version 0.6.1
3955
3960
3956 2004-07-26 Fernando Perez <fperez@colorado.edu>
3961 2004-07-26 Fernando Perez <fperez@colorado.edu>
3957
3962
3958 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3963 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3959
3964
3960 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3965 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3961 escaping '()[]{}' in filenames.
3966 escaping '()[]{}' in filenames.
3962
3967
3963 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3968 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3964 Python 2.2 users who lack a proper shlex.split.
3969 Python 2.2 users who lack a proper shlex.split.
3965
3970
3966 2004-07-19 Fernando Perez <fperez@colorado.edu>
3971 2004-07-19 Fernando Perez <fperez@colorado.edu>
3967
3972
3968 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3973 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3969 for reading readline's init file. I follow the normal chain:
3974 for reading readline's init file. I follow the normal chain:
3970 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3975 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3971 report by Mike Heeter. This closes
3976 report by Mike Heeter. This closes
3972 http://www.scipy.net/roundup/ipython/issue16.
3977 http://www.scipy.net/roundup/ipython/issue16.
3973
3978
3974 2004-07-18 Fernando Perez <fperez@colorado.edu>
3979 2004-07-18 Fernando Perez <fperez@colorado.edu>
3975
3980
3976 * IPython/iplib.py (__init__): Add better handling of '\' under
3981 * IPython/iplib.py (__init__): Add better handling of '\' under
3977 Win32 for filenames. After a patch by Ville.
3982 Win32 for filenames. After a patch by Ville.
3978
3983
3979 2004-07-17 Fernando Perez <fperez@colorado.edu>
3984 2004-07-17 Fernando Perez <fperez@colorado.edu>
3980
3985
3981 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3986 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3982 autocalling would be triggered for 'foo is bar' if foo is
3987 autocalling would be triggered for 'foo is bar' if foo is
3983 callable. I also cleaned up the autocall detection code to use a
3988 callable. I also cleaned up the autocall detection code to use a
3984 regexp, which is faster. Bug reported by Alexander Schmolck.
3989 regexp, which is faster. Bug reported by Alexander Schmolck.
3985
3990
3986 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3991 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3987 '?' in them would confuse the help system. Reported by Alex
3992 '?' in them would confuse the help system. Reported by Alex
3988 Schmolck.
3993 Schmolck.
3989
3994
3990 2004-07-16 Fernando Perez <fperez@colorado.edu>
3995 2004-07-16 Fernando Perez <fperez@colorado.edu>
3991
3996
3992 * IPython/GnuplotInteractive.py (__all__): added plot2.
3997 * IPython/GnuplotInteractive.py (__all__): added plot2.
3993
3998
3994 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3999 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3995 plotting dictionaries, lists or tuples of 1d arrays.
4000 plotting dictionaries, lists or tuples of 1d arrays.
3996
4001
3997 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4002 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3998 optimizations.
4003 optimizations.
3999
4004
4000 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4005 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4001 the information which was there from Janko's original IPP code:
4006 the information which was there from Janko's original IPP code:
4002
4007
4003 03.05.99 20:53 porto.ifm.uni-kiel.de
4008 03.05.99 20:53 porto.ifm.uni-kiel.de
4004 --Started changelog.
4009 --Started changelog.
4005 --make clear do what it say it does
4010 --make clear do what it say it does
4006 --added pretty output of lines from inputcache
4011 --added pretty output of lines from inputcache
4007 --Made Logger a mixin class, simplifies handling of switches
4012 --Made Logger a mixin class, simplifies handling of switches
4008 --Added own completer class. .string<TAB> expands to last history
4013 --Added own completer class. .string<TAB> expands to last history
4009 line which starts with string. The new expansion is also present
4014 line which starts with string. The new expansion is also present
4010 with Ctrl-r from the readline library. But this shows, who this
4015 with Ctrl-r from the readline library. But this shows, who this
4011 can be done for other cases.
4016 can be done for other cases.
4012 --Added convention that all shell functions should accept a
4017 --Added convention that all shell functions should accept a
4013 parameter_string This opens the door for different behaviour for
4018 parameter_string This opens the door for different behaviour for
4014 each function. @cd is a good example of this.
4019 each function. @cd is a good example of this.
4015
4020
4016 04.05.99 12:12 porto.ifm.uni-kiel.de
4021 04.05.99 12:12 porto.ifm.uni-kiel.de
4017 --added logfile rotation
4022 --added logfile rotation
4018 --added new mainloop method which freezes first the namespace
4023 --added new mainloop method which freezes first the namespace
4019
4024
4020 07.05.99 21:24 porto.ifm.uni-kiel.de
4025 07.05.99 21:24 porto.ifm.uni-kiel.de
4021 --added the docreader classes. Now there is a help system.
4026 --added the docreader classes. Now there is a help system.
4022 -This is only a first try. Currently it's not easy to put new
4027 -This is only a first try. Currently it's not easy to put new
4023 stuff in the indices. But this is the way to go. Info would be
4028 stuff in the indices. But this is the way to go. Info would be
4024 better, but HTML is every where and not everybody has an info
4029 better, but HTML is every where and not everybody has an info
4025 system installed and it's not so easy to change html-docs to info.
4030 system installed and it's not so easy to change html-docs to info.
4026 --added global logfile option
4031 --added global logfile option
4027 --there is now a hook for object inspection method pinfo needs to
4032 --there is now a hook for object inspection method pinfo needs to
4028 be provided for this. Can be reached by two '??'.
4033 be provided for this. Can be reached by two '??'.
4029
4034
4030 08.05.99 20:51 porto.ifm.uni-kiel.de
4035 08.05.99 20:51 porto.ifm.uni-kiel.de
4031 --added a README
4036 --added a README
4032 --bug in rc file. Something has changed so functions in the rc
4037 --bug in rc file. Something has changed so functions in the rc
4033 file need to reference the shell and not self. Not clear if it's a
4038 file need to reference the shell and not self. Not clear if it's a
4034 bug or feature.
4039 bug or feature.
4035 --changed rc file for new behavior
4040 --changed rc file for new behavior
4036
4041
4037 2004-07-15 Fernando Perez <fperez@colorado.edu>
4042 2004-07-15 Fernando Perez <fperez@colorado.edu>
4038
4043
4039 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4044 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4040 cache was falling out of sync in bizarre manners when multi-line
4045 cache was falling out of sync in bizarre manners when multi-line
4041 input was present. Minor optimizations and cleanup.
4046 input was present. Minor optimizations and cleanup.
4042
4047
4043 (Logger): Remove old Changelog info for cleanup. This is the
4048 (Logger): Remove old Changelog info for cleanup. This is the
4044 information which was there from Janko's original code:
4049 information which was there from Janko's original code:
4045
4050
4046 Changes to Logger: - made the default log filename a parameter
4051 Changes to Logger: - made the default log filename a parameter
4047
4052
4048 - put a check for lines beginning with !@? in log(). Needed
4053 - put a check for lines beginning with !@? in log(). Needed
4049 (even if the handlers properly log their lines) for mid-session
4054 (even if the handlers properly log their lines) for mid-session
4050 logging activation to work properly. Without this, lines logged
4055 logging activation to work properly. Without this, lines logged
4051 in mid session, which get read from the cache, would end up
4056 in mid session, which get read from the cache, would end up
4052 'bare' (with !@? in the open) in the log. Now they are caught
4057 'bare' (with !@? in the open) in the log. Now they are caught
4053 and prepended with a #.
4058 and prepended with a #.
4054
4059
4055 * IPython/iplib.py (InteractiveShell.init_readline): added check
4060 * IPython/iplib.py (InteractiveShell.init_readline): added check
4056 in case MagicCompleter fails to be defined, so we don't crash.
4061 in case MagicCompleter fails to be defined, so we don't crash.
4057
4062
4058 2004-07-13 Fernando Perez <fperez@colorado.edu>
4063 2004-07-13 Fernando Perez <fperez@colorado.edu>
4059
4064
4060 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4065 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4061 of EPS if the requested filename ends in '.eps'.
4066 of EPS if the requested filename ends in '.eps'.
4062
4067
4063 2004-07-04 Fernando Perez <fperez@colorado.edu>
4068 2004-07-04 Fernando Perez <fperez@colorado.edu>
4064
4069
4065 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4070 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4066 escaping of quotes when calling the shell.
4071 escaping of quotes when calling the shell.
4067
4072
4068 2004-07-02 Fernando Perez <fperez@colorado.edu>
4073 2004-07-02 Fernando Perez <fperez@colorado.edu>
4069
4074
4070 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4075 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4071 gettext not working because we were clobbering '_'. Fixes
4076 gettext not working because we were clobbering '_'. Fixes
4072 http://www.scipy.net/roundup/ipython/issue6.
4077 http://www.scipy.net/roundup/ipython/issue6.
4073
4078
4074 2004-07-01 Fernando Perez <fperez@colorado.edu>
4079 2004-07-01 Fernando Perez <fperez@colorado.edu>
4075
4080
4076 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4081 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4077 into @cd. Patch by Ville.
4082 into @cd. Patch by Ville.
4078
4083
4079 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4084 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4080 new function to store things after ipmaker runs. Patch by Ville.
4085 new function to store things after ipmaker runs. Patch by Ville.
4081 Eventually this will go away once ipmaker is removed and the class
4086 Eventually this will go away once ipmaker is removed and the class
4082 gets cleaned up, but for now it's ok. Key functionality here is
4087 gets cleaned up, but for now it's ok. Key functionality here is
4083 the addition of the persistent storage mechanism, a dict for
4088 the addition of the persistent storage mechanism, a dict for
4084 keeping data across sessions (for now just bookmarks, but more can
4089 keeping data across sessions (for now just bookmarks, but more can
4085 be implemented later).
4090 be implemented later).
4086
4091
4087 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4092 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4088 persistent across sections. Patch by Ville, I modified it
4093 persistent across sections. Patch by Ville, I modified it
4089 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4094 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4090 added a '-l' option to list all bookmarks.
4095 added a '-l' option to list all bookmarks.
4091
4096
4092 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4097 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4093 center for cleanup. Registered with atexit.register(). I moved
4098 center for cleanup. Registered with atexit.register(). I moved
4094 here the old exit_cleanup(). After a patch by Ville.
4099 here the old exit_cleanup(). After a patch by Ville.
4095
4100
4096 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4101 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4097 characters in the hacked shlex_split for python 2.2.
4102 characters in the hacked shlex_split for python 2.2.
4098
4103
4099 * IPython/iplib.py (file_matches): more fixes to filenames with
4104 * IPython/iplib.py (file_matches): more fixes to filenames with
4100 whitespace in them. It's not perfect, but limitations in python's
4105 whitespace in them. It's not perfect, but limitations in python's
4101 readline make it impossible to go further.
4106 readline make it impossible to go further.
4102
4107
4103 2004-06-29 Fernando Perez <fperez@colorado.edu>
4108 2004-06-29 Fernando Perez <fperez@colorado.edu>
4104
4109
4105 * IPython/iplib.py (file_matches): escape whitespace correctly in
4110 * IPython/iplib.py (file_matches): escape whitespace correctly in
4106 filename completions. Bug reported by Ville.
4111 filename completions. Bug reported by Ville.
4107
4112
4108 2004-06-28 Fernando Perez <fperez@colorado.edu>
4113 2004-06-28 Fernando Perez <fperez@colorado.edu>
4109
4114
4110 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4115 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4111 the history file will be called 'history-PROFNAME' (or just
4116 the history file will be called 'history-PROFNAME' (or just
4112 'history' if no profile is loaded). I was getting annoyed at
4117 'history' if no profile is loaded). I was getting annoyed at
4113 getting my Numerical work history clobbered by pysh sessions.
4118 getting my Numerical work history clobbered by pysh sessions.
4114
4119
4115 * IPython/iplib.py (InteractiveShell.__init__): Internal
4120 * IPython/iplib.py (InteractiveShell.__init__): Internal
4116 getoutputerror() function so that we can honor the system_verbose
4121 getoutputerror() function so that we can honor the system_verbose
4117 flag for _all_ system calls. I also added escaping of #
4122 flag for _all_ system calls. I also added escaping of #
4118 characters here to avoid confusing Itpl.
4123 characters here to avoid confusing Itpl.
4119
4124
4120 * IPython/Magic.py (shlex_split): removed call to shell in
4125 * IPython/Magic.py (shlex_split): removed call to shell in
4121 parse_options and replaced it with shlex.split(). The annoying
4126 parse_options and replaced it with shlex.split(). The annoying
4122 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4127 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4123 to backport it from 2.3, with several frail hacks (the shlex
4128 to backport it from 2.3, with several frail hacks (the shlex
4124 module is rather limited in 2.2). Thanks to a suggestion by Ville
4129 module is rather limited in 2.2). Thanks to a suggestion by Ville
4125 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4130 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4126 problem.
4131 problem.
4127
4132
4128 (Magic.magic_system_verbose): new toggle to print the actual
4133 (Magic.magic_system_verbose): new toggle to print the actual
4129 system calls made by ipython. Mainly for debugging purposes.
4134 system calls made by ipython. Mainly for debugging purposes.
4130
4135
4131 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4136 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4132 doesn't support persistence. Reported (and fix suggested) by
4137 doesn't support persistence. Reported (and fix suggested) by
4133 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4138 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4134
4139
4135 2004-06-26 Fernando Perez <fperez@colorado.edu>
4140 2004-06-26 Fernando Perez <fperez@colorado.edu>
4136
4141
4137 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4142 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4138 continue prompts.
4143 continue prompts.
4139
4144
4140 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4145 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4141 function (basically a big docstring) and a few more things here to
4146 function (basically a big docstring) and a few more things here to
4142 speedup startup. pysh.py is now very lightweight. We want because
4147 speedup startup. pysh.py is now very lightweight. We want because
4143 it gets execfile'd, while InterpreterExec gets imported, so
4148 it gets execfile'd, while InterpreterExec gets imported, so
4144 byte-compilation saves time.
4149 byte-compilation saves time.
4145
4150
4146 2004-06-25 Fernando Perez <fperez@colorado.edu>
4151 2004-06-25 Fernando Perez <fperez@colorado.edu>
4147
4152
4148 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4153 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4149 -NUM', which was recently broken.
4154 -NUM', which was recently broken.
4150
4155
4151 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4156 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4152 in multi-line input (but not !!, which doesn't make sense there).
4157 in multi-line input (but not !!, which doesn't make sense there).
4153
4158
4154 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4159 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4155 It's just too useful, and people can turn it off in the less
4160 It's just too useful, and people can turn it off in the less
4156 common cases where it's a problem.
4161 common cases where it's a problem.
4157
4162
4158 2004-06-24 Fernando Perez <fperez@colorado.edu>
4163 2004-06-24 Fernando Perez <fperez@colorado.edu>
4159
4164
4160 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4165 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4161 special syntaxes (like alias calling) is now allied in multi-line
4166 special syntaxes (like alias calling) is now allied in multi-line
4162 input. This is still _very_ experimental, but it's necessary for
4167 input. This is still _very_ experimental, but it's necessary for
4163 efficient shell usage combining python looping syntax with system
4168 efficient shell usage combining python looping syntax with system
4164 calls. For now it's restricted to aliases, I don't think it
4169 calls. For now it's restricted to aliases, I don't think it
4165 really even makes sense to have this for magics.
4170 really even makes sense to have this for magics.
4166
4171
4167 2004-06-23 Fernando Perez <fperez@colorado.edu>
4172 2004-06-23 Fernando Perez <fperez@colorado.edu>
4168
4173
4169 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4174 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4170 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4175 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4171
4176
4172 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4177 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4173 extensions under Windows (after code sent by Gary Bishop). The
4178 extensions under Windows (after code sent by Gary Bishop). The
4174 extensions considered 'executable' are stored in IPython's rc
4179 extensions considered 'executable' are stored in IPython's rc
4175 structure as win_exec_ext.
4180 structure as win_exec_ext.
4176
4181
4177 * IPython/genutils.py (shell): new function, like system() but
4182 * IPython/genutils.py (shell): new function, like system() but
4178 without return value. Very useful for interactive shell work.
4183 without return value. Very useful for interactive shell work.
4179
4184
4180 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4185 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4181 delete aliases.
4186 delete aliases.
4182
4187
4183 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4188 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4184 sure that the alias table doesn't contain python keywords.
4189 sure that the alias table doesn't contain python keywords.
4185
4190
4186 2004-06-21 Fernando Perez <fperez@colorado.edu>
4191 2004-06-21 Fernando Perez <fperez@colorado.edu>
4187
4192
4188 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4193 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4189 non-existent items are found in $PATH. Reported by Thorsten.
4194 non-existent items are found in $PATH. Reported by Thorsten.
4190
4195
4191 2004-06-20 Fernando Perez <fperez@colorado.edu>
4196 2004-06-20 Fernando Perez <fperez@colorado.edu>
4192
4197
4193 * IPython/iplib.py (complete): modified the completer so that the
4198 * IPython/iplib.py (complete): modified the completer so that the
4194 order of priorities can be easily changed at runtime.
4199 order of priorities can be easily changed at runtime.
4195
4200
4196 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4201 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4197 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4202 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4198
4203
4199 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4204 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4200 expand Python variables prepended with $ in all system calls. The
4205 expand Python variables prepended with $ in all system calls. The
4201 same was done to InteractiveShell.handle_shell_escape. Now all
4206 same was done to InteractiveShell.handle_shell_escape. Now all
4202 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4207 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4203 expansion of python variables and expressions according to the
4208 expansion of python variables and expressions according to the
4204 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4209 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4205
4210
4206 Though PEP-215 has been rejected, a similar (but simpler) one
4211 Though PEP-215 has been rejected, a similar (but simpler) one
4207 seems like it will go into Python 2.4, PEP-292 -
4212 seems like it will go into Python 2.4, PEP-292 -
4208 http://www.python.org/peps/pep-0292.html.
4213 http://www.python.org/peps/pep-0292.html.
4209
4214
4210 I'll keep the full syntax of PEP-215, since IPython has since the
4215 I'll keep the full syntax of PEP-215, since IPython has since the
4211 start used Ka-Ping Yee's reference implementation discussed there
4216 start used Ka-Ping Yee's reference implementation discussed there
4212 (Itpl), and I actually like the powerful semantics it offers.
4217 (Itpl), and I actually like the powerful semantics it offers.
4213
4218
4214 In order to access normal shell variables, the $ has to be escaped
4219 In order to access normal shell variables, the $ has to be escaped
4215 via an extra $. For example:
4220 via an extra $. For example:
4216
4221
4217 In [7]: PATH='a python variable'
4222 In [7]: PATH='a python variable'
4218
4223
4219 In [8]: !echo $PATH
4224 In [8]: !echo $PATH
4220 a python variable
4225 a python variable
4221
4226
4222 In [9]: !echo $$PATH
4227 In [9]: !echo $$PATH
4223 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4228 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4224
4229
4225 (Magic.parse_options): escape $ so the shell doesn't evaluate
4230 (Magic.parse_options): escape $ so the shell doesn't evaluate
4226 things prematurely.
4231 things prematurely.
4227
4232
4228 * IPython/iplib.py (InteractiveShell.call_alias): added the
4233 * IPython/iplib.py (InteractiveShell.call_alias): added the
4229 ability for aliases to expand python variables via $.
4234 ability for aliases to expand python variables via $.
4230
4235
4231 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4236 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4232 system, now there's a @rehash/@rehashx pair of magics. These work
4237 system, now there's a @rehash/@rehashx pair of magics. These work
4233 like the csh rehash command, and can be invoked at any time. They
4238 like the csh rehash command, and can be invoked at any time. They
4234 build a table of aliases to everything in the user's $PATH
4239 build a table of aliases to everything in the user's $PATH
4235 (@rehash uses everything, @rehashx is slower but only adds
4240 (@rehash uses everything, @rehashx is slower but only adds
4236 executable files). With this, the pysh.py-based shell profile can
4241 executable files). With this, the pysh.py-based shell profile can
4237 now simply call rehash upon startup, and full access to all
4242 now simply call rehash upon startup, and full access to all
4238 programs in the user's path is obtained.
4243 programs in the user's path is obtained.
4239
4244
4240 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4245 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4241 functionality is now fully in place. I removed the old dynamic
4246 functionality is now fully in place. I removed the old dynamic
4242 code generation based approach, in favor of a much lighter one
4247 code generation based approach, in favor of a much lighter one
4243 based on a simple dict. The advantage is that this allows me to
4248 based on a simple dict. The advantage is that this allows me to
4244 now have thousands of aliases with negligible cost (unthinkable
4249 now have thousands of aliases with negligible cost (unthinkable
4245 with the old system).
4250 with the old system).
4246
4251
4247 2004-06-19 Fernando Perez <fperez@colorado.edu>
4252 2004-06-19 Fernando Perez <fperez@colorado.edu>
4248
4253
4249 * IPython/iplib.py (__init__): extended MagicCompleter class to
4254 * IPython/iplib.py (__init__): extended MagicCompleter class to
4250 also complete (last in priority) on user aliases.
4255 also complete (last in priority) on user aliases.
4251
4256
4252 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4257 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4253 call to eval.
4258 call to eval.
4254 (ItplNS.__init__): Added a new class which functions like Itpl,
4259 (ItplNS.__init__): Added a new class which functions like Itpl,
4255 but allows configuring the namespace for the evaluation to occur
4260 but allows configuring the namespace for the evaluation to occur
4256 in.
4261 in.
4257
4262
4258 2004-06-18 Fernando Perez <fperez@colorado.edu>
4263 2004-06-18 Fernando Perez <fperez@colorado.edu>
4259
4264
4260 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4265 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4261 better message when 'exit' or 'quit' are typed (a common newbie
4266 better message when 'exit' or 'quit' are typed (a common newbie
4262 confusion).
4267 confusion).
4263
4268
4264 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4269 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4265 check for Windows users.
4270 check for Windows users.
4266
4271
4267 * IPython/iplib.py (InteractiveShell.user_setup): removed
4272 * IPython/iplib.py (InteractiveShell.user_setup): removed
4268 disabling of colors for Windows. I'll test at runtime and issue a
4273 disabling of colors for Windows. I'll test at runtime and issue a
4269 warning if Gary's readline isn't found, as to nudge users to
4274 warning if Gary's readline isn't found, as to nudge users to
4270 download it.
4275 download it.
4271
4276
4272 2004-06-16 Fernando Perez <fperez@colorado.edu>
4277 2004-06-16 Fernando Perez <fperez@colorado.edu>
4273
4278
4274 * IPython/genutils.py (Stream.__init__): changed to print errors
4279 * IPython/genutils.py (Stream.__init__): changed to print errors
4275 to sys.stderr. I had a circular dependency here. Now it's
4280 to sys.stderr. I had a circular dependency here. Now it's
4276 possible to run ipython as IDLE's shell (consider this pre-alpha,
4281 possible to run ipython as IDLE's shell (consider this pre-alpha,
4277 since true stdout things end up in the starting terminal instead
4282 since true stdout things end up in the starting terminal instead
4278 of IDLE's out).
4283 of IDLE's out).
4279
4284
4280 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4285 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4281 users who haven't # updated their prompt_in2 definitions. Remove
4286 users who haven't # updated their prompt_in2 definitions. Remove
4282 eventually.
4287 eventually.
4283 (multiple_replace): added credit to original ASPN recipe.
4288 (multiple_replace): added credit to original ASPN recipe.
4284
4289
4285 2004-06-15 Fernando Perez <fperez@colorado.edu>
4290 2004-06-15 Fernando Perez <fperez@colorado.edu>
4286
4291
4287 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4292 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4288 list of auto-defined aliases.
4293 list of auto-defined aliases.
4289
4294
4290 2004-06-13 Fernando Perez <fperez@colorado.edu>
4295 2004-06-13 Fernando Perez <fperez@colorado.edu>
4291
4296
4292 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4297 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4293 install was really requested (so setup.py can be used for other
4298 install was really requested (so setup.py can be used for other
4294 things under Windows).
4299 things under Windows).
4295
4300
4296 2004-06-10 Fernando Perez <fperez@colorado.edu>
4301 2004-06-10 Fernando Perez <fperez@colorado.edu>
4297
4302
4298 * IPython/Logger.py (Logger.create_log): Manually remove any old
4303 * IPython/Logger.py (Logger.create_log): Manually remove any old
4299 backup, since os.remove may fail under Windows. Fixes bug
4304 backup, since os.remove may fail under Windows. Fixes bug
4300 reported by Thorsten.
4305 reported by Thorsten.
4301
4306
4302 2004-06-09 Fernando Perez <fperez@colorado.edu>
4307 2004-06-09 Fernando Perez <fperez@colorado.edu>
4303
4308
4304 * examples/example-embed.py: fixed all references to %n (replaced
4309 * examples/example-embed.py: fixed all references to %n (replaced
4305 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4310 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4306 for all examples and the manual as well.
4311 for all examples and the manual as well.
4307
4312
4308 2004-06-08 Fernando Perez <fperez@colorado.edu>
4313 2004-06-08 Fernando Perez <fperez@colorado.edu>
4309
4314
4310 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4315 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4311 alignment and color management. All 3 prompt subsystems now
4316 alignment and color management. All 3 prompt subsystems now
4312 inherit from BasePrompt.
4317 inherit from BasePrompt.
4313
4318
4314 * tools/release: updates for windows installer build and tag rpms
4319 * tools/release: updates for windows installer build and tag rpms
4315 with python version (since paths are fixed).
4320 with python version (since paths are fixed).
4316
4321
4317 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4322 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4318 which will become eventually obsolete. Also fixed the default
4323 which will become eventually obsolete. Also fixed the default
4319 prompt_in2 to use \D, so at least new users start with the correct
4324 prompt_in2 to use \D, so at least new users start with the correct
4320 defaults.
4325 defaults.
4321 WARNING: Users with existing ipythonrc files will need to apply
4326 WARNING: Users with existing ipythonrc files will need to apply
4322 this fix manually!
4327 this fix manually!
4323
4328
4324 * setup.py: make windows installer (.exe). This is finally the
4329 * setup.py: make windows installer (.exe). This is finally the
4325 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4330 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4326 which I hadn't included because it required Python 2.3 (or recent
4331 which I hadn't included because it required Python 2.3 (or recent
4327 distutils).
4332 distutils).
4328
4333
4329 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4334 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4330 usage of new '\D' escape.
4335 usage of new '\D' escape.
4331
4336
4332 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4337 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4333 lacks os.getuid())
4338 lacks os.getuid())
4334 (CachedOutput.set_colors): Added the ability to turn coloring
4339 (CachedOutput.set_colors): Added the ability to turn coloring
4335 on/off with @colors even for manually defined prompt colors. It
4340 on/off with @colors even for manually defined prompt colors. It
4336 uses a nasty global, but it works safely and via the generic color
4341 uses a nasty global, but it works safely and via the generic color
4337 handling mechanism.
4342 handling mechanism.
4338 (Prompt2.__init__): Introduced new escape '\D' for continuation
4343 (Prompt2.__init__): Introduced new escape '\D' for continuation
4339 prompts. It represents the counter ('\#') as dots.
4344 prompts. It represents the counter ('\#') as dots.
4340 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4345 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4341 need to update their ipythonrc files and replace '%n' with '\D' in
4346 need to update their ipythonrc files and replace '%n' with '\D' in
4342 their prompt_in2 settings everywhere. Sorry, but there's
4347 their prompt_in2 settings everywhere. Sorry, but there's
4343 otherwise no clean way to get all prompts to properly align. The
4348 otherwise no clean way to get all prompts to properly align. The
4344 ipythonrc shipped with IPython has been updated.
4349 ipythonrc shipped with IPython has been updated.
4345
4350
4346 2004-06-07 Fernando Perez <fperez@colorado.edu>
4351 2004-06-07 Fernando Perez <fperez@colorado.edu>
4347
4352
4348 * setup.py (isfile): Pass local_icons option to latex2html, so the
4353 * setup.py (isfile): Pass local_icons option to latex2html, so the
4349 resulting HTML file is self-contained. Thanks to
4354 resulting HTML file is self-contained. Thanks to
4350 dryice-AT-liu.com.cn for the tip.
4355 dryice-AT-liu.com.cn for the tip.
4351
4356
4352 * pysh.py: I created a new profile 'shell', which implements a
4357 * pysh.py: I created a new profile 'shell', which implements a
4353 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4358 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4354 system shell, nor will it become one anytime soon. It's mainly
4359 system shell, nor will it become one anytime soon. It's mainly
4355 meant to illustrate the use of the new flexible bash-like prompts.
4360 meant to illustrate the use of the new flexible bash-like prompts.
4356 I guess it could be used by hardy souls for true shell management,
4361 I guess it could be used by hardy souls for true shell management,
4357 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4362 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4358 profile. This uses the InterpreterExec extension provided by
4363 profile. This uses the InterpreterExec extension provided by
4359 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4364 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4360
4365
4361 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4366 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4362 auto-align itself with the length of the previous input prompt
4367 auto-align itself with the length of the previous input prompt
4363 (taking into account the invisible color escapes).
4368 (taking into account the invisible color escapes).
4364 (CachedOutput.__init__): Large restructuring of this class. Now
4369 (CachedOutput.__init__): Large restructuring of this class. Now
4365 all three prompts (primary1, primary2, output) are proper objects,
4370 all three prompts (primary1, primary2, output) are proper objects,
4366 managed by the 'parent' CachedOutput class. The code is still a
4371 managed by the 'parent' CachedOutput class. The code is still a
4367 bit hackish (all prompts share state via a pointer to the cache),
4372 bit hackish (all prompts share state via a pointer to the cache),
4368 but it's overall far cleaner than before.
4373 but it's overall far cleaner than before.
4369
4374
4370 * IPython/genutils.py (getoutputerror): modified to add verbose,
4375 * IPython/genutils.py (getoutputerror): modified to add verbose,
4371 debug and header options. This makes the interface of all getout*
4376 debug and header options. This makes the interface of all getout*
4372 functions uniform.
4377 functions uniform.
4373 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4378 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4374
4379
4375 * IPython/Magic.py (Magic.default_option): added a function to
4380 * IPython/Magic.py (Magic.default_option): added a function to
4376 allow registering default options for any magic command. This
4381 allow registering default options for any magic command. This
4377 makes it easy to have profiles which customize the magics globally
4382 makes it easy to have profiles which customize the magics globally
4378 for a certain use. The values set through this function are
4383 for a certain use. The values set through this function are
4379 picked up by the parse_options() method, which all magics should
4384 picked up by the parse_options() method, which all magics should
4380 use to parse their options.
4385 use to parse their options.
4381
4386
4382 * IPython/genutils.py (warn): modified the warnings framework to
4387 * IPython/genutils.py (warn): modified the warnings framework to
4383 use the Term I/O class. I'm trying to slowly unify all of
4388 use the Term I/O class. I'm trying to slowly unify all of
4384 IPython's I/O operations to pass through Term.
4389 IPython's I/O operations to pass through Term.
4385
4390
4386 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4391 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4387 the secondary prompt to correctly match the length of the primary
4392 the secondary prompt to correctly match the length of the primary
4388 one for any prompt. Now multi-line code will properly line up
4393 one for any prompt. Now multi-line code will properly line up
4389 even for path dependent prompts, such as the new ones available
4394 even for path dependent prompts, such as the new ones available
4390 via the prompt_specials.
4395 via the prompt_specials.
4391
4396
4392 2004-06-06 Fernando Perez <fperez@colorado.edu>
4397 2004-06-06 Fernando Perez <fperez@colorado.edu>
4393
4398
4394 * IPython/Prompts.py (prompt_specials): Added the ability to have
4399 * IPython/Prompts.py (prompt_specials): Added the ability to have
4395 bash-like special sequences in the prompts, which get
4400 bash-like special sequences in the prompts, which get
4396 automatically expanded. Things like hostname, current working
4401 automatically expanded. Things like hostname, current working
4397 directory and username are implemented already, but it's easy to
4402 directory and username are implemented already, but it's easy to
4398 add more in the future. Thanks to a patch by W.J. van der Laan
4403 add more in the future. Thanks to a patch by W.J. van der Laan
4399 <gnufnork-AT-hetdigitalegat.nl>
4404 <gnufnork-AT-hetdigitalegat.nl>
4400 (prompt_specials): Added color support for prompt strings, so
4405 (prompt_specials): Added color support for prompt strings, so
4401 users can define arbitrary color setups for their prompts.
4406 users can define arbitrary color setups for their prompts.
4402
4407
4403 2004-06-05 Fernando Perez <fperez@colorado.edu>
4408 2004-06-05 Fernando Perez <fperez@colorado.edu>
4404
4409
4405 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4410 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4406 code to load Gary Bishop's readline and configure it
4411 code to load Gary Bishop's readline and configure it
4407 automatically. Thanks to Gary for help on this.
4412 automatically. Thanks to Gary for help on this.
4408
4413
4409 2004-06-01 Fernando Perez <fperez@colorado.edu>
4414 2004-06-01 Fernando Perez <fperez@colorado.edu>
4410
4415
4411 * IPython/Logger.py (Logger.create_log): fix bug for logging
4416 * IPython/Logger.py (Logger.create_log): fix bug for logging
4412 with no filename (previous fix was incomplete).
4417 with no filename (previous fix was incomplete).
4413
4418
4414 2004-05-25 Fernando Perez <fperez@colorado.edu>
4419 2004-05-25 Fernando Perez <fperez@colorado.edu>
4415
4420
4416 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4421 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4417 parens would get passed to the shell.
4422 parens would get passed to the shell.
4418
4423
4419 2004-05-20 Fernando Perez <fperez@colorado.edu>
4424 2004-05-20 Fernando Perez <fperez@colorado.edu>
4420
4425
4421 * IPython/Magic.py (Magic.magic_prun): changed default profile
4426 * IPython/Magic.py (Magic.magic_prun): changed default profile
4422 sort order to 'time' (the more common profiling need).
4427 sort order to 'time' (the more common profiling need).
4423
4428
4424 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4429 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4425 so that source code shown is guaranteed in sync with the file on
4430 so that source code shown is guaranteed in sync with the file on
4426 disk (also changed in psource). Similar fix to the one for
4431 disk (also changed in psource). Similar fix to the one for
4427 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4432 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4428 <yann.ledu-AT-noos.fr>.
4433 <yann.ledu-AT-noos.fr>.
4429
4434
4430 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4435 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4431 with a single option would not be correctly parsed. Closes
4436 with a single option would not be correctly parsed. Closes
4432 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4437 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4433 introduced in 0.6.0 (on 2004-05-06).
4438 introduced in 0.6.0 (on 2004-05-06).
4434
4439
4435 2004-05-13 *** Released version 0.6.0
4440 2004-05-13 *** Released version 0.6.0
4436
4441
4437 2004-05-13 Fernando Perez <fperez@colorado.edu>
4442 2004-05-13 Fernando Perez <fperez@colorado.edu>
4438
4443
4439 * debian/: Added debian/ directory to CVS, so that debian support
4444 * debian/: Added debian/ directory to CVS, so that debian support
4440 is publicly accessible. The debian package is maintained by Jack
4445 is publicly accessible. The debian package is maintained by Jack
4441 Moffit <jack-AT-xiph.org>.
4446 Moffit <jack-AT-xiph.org>.
4442
4447
4443 * Documentation: included the notes about an ipython-based system
4448 * Documentation: included the notes about an ipython-based system
4444 shell (the hypothetical 'pysh') into the new_design.pdf document,
4449 shell (the hypothetical 'pysh') into the new_design.pdf document,
4445 so that these ideas get distributed to users along with the
4450 so that these ideas get distributed to users along with the
4446 official documentation.
4451 official documentation.
4447
4452
4448 2004-05-10 Fernando Perez <fperez@colorado.edu>
4453 2004-05-10 Fernando Perez <fperez@colorado.edu>
4449
4454
4450 * IPython/Logger.py (Logger.create_log): fix recently introduced
4455 * IPython/Logger.py (Logger.create_log): fix recently introduced
4451 bug (misindented line) where logstart would fail when not given an
4456 bug (misindented line) where logstart would fail when not given an
4452 explicit filename.
4457 explicit filename.
4453
4458
4454 2004-05-09 Fernando Perez <fperez@colorado.edu>
4459 2004-05-09 Fernando Perez <fperez@colorado.edu>
4455
4460
4456 * IPython/Magic.py (Magic.parse_options): skip system call when
4461 * IPython/Magic.py (Magic.parse_options): skip system call when
4457 there are no options to look for. Faster, cleaner for the common
4462 there are no options to look for. Faster, cleaner for the common
4458 case.
4463 case.
4459
4464
4460 * Documentation: many updates to the manual: describing Windows
4465 * Documentation: many updates to the manual: describing Windows
4461 support better, Gnuplot updates, credits, misc small stuff. Also
4466 support better, Gnuplot updates, credits, misc small stuff. Also
4462 updated the new_design doc a bit.
4467 updated the new_design doc a bit.
4463
4468
4464 2004-05-06 *** Released version 0.6.0.rc1
4469 2004-05-06 *** Released version 0.6.0.rc1
4465
4470
4466 2004-05-06 Fernando Perez <fperez@colorado.edu>
4471 2004-05-06 Fernando Perez <fperez@colorado.edu>
4467
4472
4468 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4473 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4469 operations to use the vastly more efficient list/''.join() method.
4474 operations to use the vastly more efficient list/''.join() method.
4470 (FormattedTB.text): Fix
4475 (FormattedTB.text): Fix
4471 http://www.scipy.net/roundup/ipython/issue12 - exception source
4476 http://www.scipy.net/roundup/ipython/issue12 - exception source
4472 extract not updated after reload. Thanks to Mike Salib
4477 extract not updated after reload. Thanks to Mike Salib
4473 <msalib-AT-mit.edu> for pinning the source of the problem.
4478 <msalib-AT-mit.edu> for pinning the source of the problem.
4474 Fortunately, the solution works inside ipython and doesn't require
4479 Fortunately, the solution works inside ipython and doesn't require
4475 any changes to python proper.
4480 any changes to python proper.
4476
4481
4477 * IPython/Magic.py (Magic.parse_options): Improved to process the
4482 * IPython/Magic.py (Magic.parse_options): Improved to process the
4478 argument list as a true shell would (by actually using the
4483 argument list as a true shell would (by actually using the
4479 underlying system shell). This way, all @magics automatically get
4484 underlying system shell). This way, all @magics automatically get
4480 shell expansion for variables. Thanks to a comment by Alex
4485 shell expansion for variables. Thanks to a comment by Alex
4481 Schmolck.
4486 Schmolck.
4482
4487
4483 2004-04-04 Fernando Perez <fperez@colorado.edu>
4488 2004-04-04 Fernando Perez <fperez@colorado.edu>
4484
4489
4485 * IPython/iplib.py (InteractiveShell.interact): Added a special
4490 * IPython/iplib.py (InteractiveShell.interact): Added a special
4486 trap for a debugger quit exception, which is basically impossible
4491 trap for a debugger quit exception, which is basically impossible
4487 to handle by normal mechanisms, given what pdb does to the stack.
4492 to handle by normal mechanisms, given what pdb does to the stack.
4488 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4493 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4489
4494
4490 2004-04-03 Fernando Perez <fperez@colorado.edu>
4495 2004-04-03 Fernando Perez <fperez@colorado.edu>
4491
4496
4492 * IPython/genutils.py (Term): Standardized the names of the Term
4497 * IPython/genutils.py (Term): Standardized the names of the Term
4493 class streams to cin/cout/cerr, following C++ naming conventions
4498 class streams to cin/cout/cerr, following C++ naming conventions
4494 (I can't use in/out/err because 'in' is not a valid attribute
4499 (I can't use in/out/err because 'in' is not a valid attribute
4495 name).
4500 name).
4496
4501
4497 * IPython/iplib.py (InteractiveShell.interact): don't increment
4502 * IPython/iplib.py (InteractiveShell.interact): don't increment
4498 the prompt if there's no user input. By Daniel 'Dang' Griffith
4503 the prompt if there's no user input. By Daniel 'Dang' Griffith
4499 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4504 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4500 Francois Pinard.
4505 Francois Pinard.
4501
4506
4502 2004-04-02 Fernando Perez <fperez@colorado.edu>
4507 2004-04-02 Fernando Perez <fperez@colorado.edu>
4503
4508
4504 * IPython/genutils.py (Stream.__init__): Modified to survive at
4509 * IPython/genutils.py (Stream.__init__): Modified to survive at
4505 least importing in contexts where stdin/out/err aren't true file
4510 least importing in contexts where stdin/out/err aren't true file
4506 objects, such as PyCrust (they lack fileno() and mode). However,
4511 objects, such as PyCrust (they lack fileno() and mode). However,
4507 the recovery facilities which rely on these things existing will
4512 the recovery facilities which rely on these things existing will
4508 not work.
4513 not work.
4509
4514
4510 2004-04-01 Fernando Perez <fperez@colorado.edu>
4515 2004-04-01 Fernando Perez <fperez@colorado.edu>
4511
4516
4512 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4517 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4513 use the new getoutputerror() function, so it properly
4518 use the new getoutputerror() function, so it properly
4514 distinguishes stdout/err.
4519 distinguishes stdout/err.
4515
4520
4516 * IPython/genutils.py (getoutputerror): added a function to
4521 * IPython/genutils.py (getoutputerror): added a function to
4517 capture separately the standard output and error of a command.
4522 capture separately the standard output and error of a command.
4518 After a comment from dang on the mailing lists. This code is
4523 After a comment from dang on the mailing lists. This code is
4519 basically a modified version of commands.getstatusoutput(), from
4524 basically a modified version of commands.getstatusoutput(), from
4520 the standard library.
4525 the standard library.
4521
4526
4522 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4527 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4523 '!!' as a special syntax (shorthand) to access @sx.
4528 '!!' as a special syntax (shorthand) to access @sx.
4524
4529
4525 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4530 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4526 command and return its output as a list split on '\n'.
4531 command and return its output as a list split on '\n'.
4527
4532
4528 2004-03-31 Fernando Perez <fperez@colorado.edu>
4533 2004-03-31 Fernando Perez <fperez@colorado.edu>
4529
4534
4530 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4535 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4531 method to dictionaries used as FakeModule instances if they lack
4536 method to dictionaries used as FakeModule instances if they lack
4532 it. At least pydoc in python2.3 breaks for runtime-defined
4537 it. At least pydoc in python2.3 breaks for runtime-defined
4533 functions without this hack. At some point I need to _really_
4538 functions without this hack. At some point I need to _really_
4534 understand what FakeModule is doing, because it's a gross hack.
4539 understand what FakeModule is doing, because it's a gross hack.
4535 But it solves Arnd's problem for now...
4540 But it solves Arnd's problem for now...
4536
4541
4537 2004-02-27 Fernando Perez <fperez@colorado.edu>
4542 2004-02-27 Fernando Perez <fperez@colorado.edu>
4538
4543
4539 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4544 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4540 mode would behave erratically. Also increased the number of
4545 mode would behave erratically. Also increased the number of
4541 possible logs in rotate mod to 999. Thanks to Rod Holland
4546 possible logs in rotate mod to 999. Thanks to Rod Holland
4542 <rhh@StructureLABS.com> for the report and fixes.
4547 <rhh@StructureLABS.com> for the report and fixes.
4543
4548
4544 2004-02-26 Fernando Perez <fperez@colorado.edu>
4549 2004-02-26 Fernando Perez <fperez@colorado.edu>
4545
4550
4546 * IPython/genutils.py (page): Check that the curses module really
4551 * IPython/genutils.py (page): Check that the curses module really
4547 has the initscr attribute before trying to use it. For some
4552 has the initscr attribute before trying to use it. For some
4548 reason, the Solaris curses module is missing this. I think this
4553 reason, the Solaris curses module is missing this. I think this
4549 should be considered a Solaris python bug, but I'm not sure.
4554 should be considered a Solaris python bug, but I'm not sure.
4550
4555
4551 2004-01-17 Fernando Perez <fperez@colorado.edu>
4556 2004-01-17 Fernando Perez <fperez@colorado.edu>
4552
4557
4553 * IPython/genutils.py (Stream.__init__): Changes to try to make
4558 * IPython/genutils.py (Stream.__init__): Changes to try to make
4554 ipython robust against stdin/out/err being closed by the user.
4559 ipython robust against stdin/out/err being closed by the user.
4555 This is 'user error' (and blocks a normal python session, at least
4560 This is 'user error' (and blocks a normal python session, at least
4556 the stdout case). However, Ipython should be able to survive such
4561 the stdout case). However, Ipython should be able to survive such
4557 instances of abuse as gracefully as possible. To simplify the
4562 instances of abuse as gracefully as possible. To simplify the
4558 coding and maintain compatibility with Gary Bishop's Term
4563 coding and maintain compatibility with Gary Bishop's Term
4559 contributions, I've made use of classmethods for this. I think
4564 contributions, I've made use of classmethods for this. I think
4560 this introduces a dependency on python 2.2.
4565 this introduces a dependency on python 2.2.
4561
4566
4562 2004-01-13 Fernando Perez <fperez@colorado.edu>
4567 2004-01-13 Fernando Perez <fperez@colorado.edu>
4563
4568
4564 * IPython/numutils.py (exp_safe): simplified the code a bit and
4569 * IPython/numutils.py (exp_safe): simplified the code a bit and
4565 removed the need for importing the kinds module altogether.
4570 removed the need for importing the kinds module altogether.
4566
4571
4567 2004-01-06 Fernando Perez <fperez@colorado.edu>
4572 2004-01-06 Fernando Perez <fperez@colorado.edu>
4568
4573
4569 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4574 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4570 a magic function instead, after some community feedback. No
4575 a magic function instead, after some community feedback. No
4571 special syntax will exist for it, but its name is deliberately
4576 special syntax will exist for it, but its name is deliberately
4572 very short.
4577 very short.
4573
4578
4574 2003-12-20 Fernando Perez <fperez@colorado.edu>
4579 2003-12-20 Fernando Perez <fperez@colorado.edu>
4575
4580
4576 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4581 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4577 new functionality, to automagically assign the result of a shell
4582 new functionality, to automagically assign the result of a shell
4578 command to a variable. I'll solicit some community feedback on
4583 command to a variable. I'll solicit some community feedback on
4579 this before making it permanent.
4584 this before making it permanent.
4580
4585
4581 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4586 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4582 requested about callables for which inspect couldn't obtain a
4587 requested about callables for which inspect couldn't obtain a
4583 proper argspec. Thanks to a crash report sent by Etienne
4588 proper argspec. Thanks to a crash report sent by Etienne
4584 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4589 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4585
4590
4586 2003-12-09 Fernando Perez <fperez@colorado.edu>
4591 2003-12-09 Fernando Perez <fperez@colorado.edu>
4587
4592
4588 * IPython/genutils.py (page): patch for the pager to work across
4593 * IPython/genutils.py (page): patch for the pager to work across
4589 various versions of Windows. By Gary Bishop.
4594 various versions of Windows. By Gary Bishop.
4590
4595
4591 2003-12-04 Fernando Perez <fperez@colorado.edu>
4596 2003-12-04 Fernando Perez <fperez@colorado.edu>
4592
4597
4593 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4598 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4594 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4599 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4595 While I tested this and it looks ok, there may still be corner
4600 While I tested this and it looks ok, there may still be corner
4596 cases I've missed.
4601 cases I've missed.
4597
4602
4598 2003-12-01 Fernando Perez <fperez@colorado.edu>
4603 2003-12-01 Fernando Perez <fperez@colorado.edu>
4599
4604
4600 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4605 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4601 where a line like 'p,q=1,2' would fail because the automagic
4606 where a line like 'p,q=1,2' would fail because the automagic
4602 system would be triggered for @p.
4607 system would be triggered for @p.
4603
4608
4604 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4609 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4605 cleanups, code unmodified.
4610 cleanups, code unmodified.
4606
4611
4607 * IPython/genutils.py (Term): added a class for IPython to handle
4612 * IPython/genutils.py (Term): added a class for IPython to handle
4608 output. In most cases it will just be a proxy for stdout/err, but
4613 output. In most cases it will just be a proxy for stdout/err, but
4609 having this allows modifications to be made for some platforms,
4614 having this allows modifications to be made for some platforms,
4610 such as handling color escapes under Windows. All of this code
4615 such as handling color escapes under Windows. All of this code
4611 was contributed by Gary Bishop, with minor modifications by me.
4616 was contributed by Gary Bishop, with minor modifications by me.
4612 The actual changes affect many files.
4617 The actual changes affect many files.
4613
4618
4614 2003-11-30 Fernando Perez <fperez@colorado.edu>
4619 2003-11-30 Fernando Perez <fperez@colorado.edu>
4615
4620
4616 * IPython/iplib.py (file_matches): new completion code, courtesy
4621 * IPython/iplib.py (file_matches): new completion code, courtesy
4617 of Jeff Collins. This enables filename completion again under
4622 of Jeff Collins. This enables filename completion again under
4618 python 2.3, which disabled it at the C level.
4623 python 2.3, which disabled it at the C level.
4619
4624
4620 2003-11-11 Fernando Perez <fperez@colorado.edu>
4625 2003-11-11 Fernando Perez <fperez@colorado.edu>
4621
4626
4622 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4627 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4623 for Numeric.array(map(...)), but often convenient.
4628 for Numeric.array(map(...)), but often convenient.
4624
4629
4625 2003-11-05 Fernando Perez <fperez@colorado.edu>
4630 2003-11-05 Fernando Perez <fperez@colorado.edu>
4626
4631
4627 * IPython/numutils.py (frange): Changed a call from int() to
4632 * IPython/numutils.py (frange): Changed a call from int() to
4628 int(round()) to prevent a problem reported with arange() in the
4633 int(round()) to prevent a problem reported with arange() in the
4629 numpy list.
4634 numpy list.
4630
4635
4631 2003-10-06 Fernando Perez <fperez@colorado.edu>
4636 2003-10-06 Fernando Perez <fperez@colorado.edu>
4632
4637
4633 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4638 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4634 prevent crashes if sys lacks an argv attribute (it happens with
4639 prevent crashes if sys lacks an argv attribute (it happens with
4635 embedded interpreters which build a bare-bones sys module).
4640 embedded interpreters which build a bare-bones sys module).
4636 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4641 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4637
4642
4638 2003-09-24 Fernando Perez <fperez@colorado.edu>
4643 2003-09-24 Fernando Perez <fperez@colorado.edu>
4639
4644
4640 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4645 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4641 to protect against poorly written user objects where __getattr__
4646 to protect against poorly written user objects where __getattr__
4642 raises exceptions other than AttributeError. Thanks to a bug
4647 raises exceptions other than AttributeError. Thanks to a bug
4643 report by Oliver Sander <osander-AT-gmx.de>.
4648 report by Oliver Sander <osander-AT-gmx.de>.
4644
4649
4645 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4650 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4646 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4651 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4647
4652
4648 2003-09-09 Fernando Perez <fperez@colorado.edu>
4653 2003-09-09 Fernando Perez <fperez@colorado.edu>
4649
4654
4650 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4655 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4651 unpacking a list whith a callable as first element would
4656 unpacking a list whith a callable as first element would
4652 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4657 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4653 Collins.
4658 Collins.
4654
4659
4655 2003-08-25 *** Released version 0.5.0
4660 2003-08-25 *** Released version 0.5.0
4656
4661
4657 2003-08-22 Fernando Perez <fperez@colorado.edu>
4662 2003-08-22 Fernando Perez <fperez@colorado.edu>
4658
4663
4659 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4664 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4660 improperly defined user exceptions. Thanks to feedback from Mark
4665 improperly defined user exceptions. Thanks to feedback from Mark
4661 Russell <mrussell-AT-verio.net>.
4666 Russell <mrussell-AT-verio.net>.
4662
4667
4663 2003-08-20 Fernando Perez <fperez@colorado.edu>
4668 2003-08-20 Fernando Perez <fperez@colorado.edu>
4664
4669
4665 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4670 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4666 printing so that it would print multi-line string forms starting
4671 printing so that it would print multi-line string forms starting
4667 with a new line. This way the formatting is better respected for
4672 with a new line. This way the formatting is better respected for
4668 objects which work hard to make nice string forms.
4673 objects which work hard to make nice string forms.
4669
4674
4670 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4675 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4671 autocall would overtake data access for objects with both
4676 autocall would overtake data access for objects with both
4672 __getitem__ and __call__.
4677 __getitem__ and __call__.
4673
4678
4674 2003-08-19 *** Released version 0.5.0-rc1
4679 2003-08-19 *** Released version 0.5.0-rc1
4675
4680
4676 2003-08-19 Fernando Perez <fperez@colorado.edu>
4681 2003-08-19 Fernando Perez <fperez@colorado.edu>
4677
4682
4678 * IPython/deep_reload.py (load_tail): single tiny change here
4683 * IPython/deep_reload.py (load_tail): single tiny change here
4679 seems to fix the long-standing bug of dreload() failing to work
4684 seems to fix the long-standing bug of dreload() failing to work
4680 for dotted names. But this module is pretty tricky, so I may have
4685 for dotted names. But this module is pretty tricky, so I may have
4681 missed some subtlety. Needs more testing!.
4686 missed some subtlety. Needs more testing!.
4682
4687
4683 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4688 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4684 exceptions which have badly implemented __str__ methods.
4689 exceptions which have badly implemented __str__ methods.
4685 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4690 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4686 which I've been getting reports about from Python 2.3 users. I
4691 which I've been getting reports about from Python 2.3 users. I
4687 wish I had a simple test case to reproduce the problem, so I could
4692 wish I had a simple test case to reproduce the problem, so I could
4688 either write a cleaner workaround or file a bug report if
4693 either write a cleaner workaround or file a bug report if
4689 necessary.
4694 necessary.
4690
4695
4691 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4696 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4692 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4697 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4693 a bug report by Tjabo Kloppenburg.
4698 a bug report by Tjabo Kloppenburg.
4694
4699
4695 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4700 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4696 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4701 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4697 seems rather unstable. Thanks to a bug report by Tjabo
4702 seems rather unstable. Thanks to a bug report by Tjabo
4698 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4703 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4699
4704
4700 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4705 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4701 this out soon because of the critical fixes in the inner loop for
4706 this out soon because of the critical fixes in the inner loop for
4702 generators.
4707 generators.
4703
4708
4704 * IPython/Magic.py (Magic.getargspec): removed. This (and
4709 * IPython/Magic.py (Magic.getargspec): removed. This (and
4705 _get_def) have been obsoleted by OInspect for a long time, I
4710 _get_def) have been obsoleted by OInspect for a long time, I
4706 hadn't noticed that they were dead code.
4711 hadn't noticed that they were dead code.
4707 (Magic._ofind): restored _ofind functionality for a few literals
4712 (Magic._ofind): restored _ofind functionality for a few literals
4708 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4713 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4709 for things like "hello".capitalize?, since that would require a
4714 for things like "hello".capitalize?, since that would require a
4710 potentially dangerous eval() again.
4715 potentially dangerous eval() again.
4711
4716
4712 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4717 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4713 logic a bit more to clean up the escapes handling and minimize the
4718 logic a bit more to clean up the escapes handling and minimize the
4714 use of _ofind to only necessary cases. The interactive 'feel' of
4719 use of _ofind to only necessary cases. The interactive 'feel' of
4715 IPython should have improved quite a bit with the changes in
4720 IPython should have improved quite a bit with the changes in
4716 _prefilter and _ofind (besides being far safer than before).
4721 _prefilter and _ofind (besides being far safer than before).
4717
4722
4718 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4723 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4719 obscure, never reported). Edit would fail to find the object to
4724 obscure, never reported). Edit would fail to find the object to
4720 edit under some circumstances.
4725 edit under some circumstances.
4721 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4726 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4722 which were causing double-calling of generators. Those eval calls
4727 which were causing double-calling of generators. Those eval calls
4723 were _very_ dangerous, since code with side effects could be
4728 were _very_ dangerous, since code with side effects could be
4724 triggered. As they say, 'eval is evil'... These were the
4729 triggered. As they say, 'eval is evil'... These were the
4725 nastiest evals in IPython. Besides, _ofind is now far simpler,
4730 nastiest evals in IPython. Besides, _ofind is now far simpler,
4726 and it should also be quite a bit faster. Its use of inspect is
4731 and it should also be quite a bit faster. Its use of inspect is
4727 also safer, so perhaps some of the inspect-related crashes I've
4732 also safer, so perhaps some of the inspect-related crashes I've
4728 seen lately with Python 2.3 might be taken care of. That will
4733 seen lately with Python 2.3 might be taken care of. That will
4729 need more testing.
4734 need more testing.
4730
4735
4731 2003-08-17 Fernando Perez <fperez@colorado.edu>
4736 2003-08-17 Fernando Perez <fperez@colorado.edu>
4732
4737
4733 * IPython/iplib.py (InteractiveShell._prefilter): significant
4738 * IPython/iplib.py (InteractiveShell._prefilter): significant
4734 simplifications to the logic for handling user escapes. Faster
4739 simplifications to the logic for handling user escapes. Faster
4735 and simpler code.
4740 and simpler code.
4736
4741
4737 2003-08-14 Fernando Perez <fperez@colorado.edu>
4742 2003-08-14 Fernando Perez <fperez@colorado.edu>
4738
4743
4739 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4744 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4740 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4745 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4741 but it should be quite a bit faster. And the recursive version
4746 but it should be quite a bit faster. And the recursive version
4742 generated O(log N) intermediate storage for all rank>1 arrays,
4747 generated O(log N) intermediate storage for all rank>1 arrays,
4743 even if they were contiguous.
4748 even if they were contiguous.
4744 (l1norm): Added this function.
4749 (l1norm): Added this function.
4745 (norm): Added this function for arbitrary norms (including
4750 (norm): Added this function for arbitrary norms (including
4746 l-infinity). l1 and l2 are still special cases for convenience
4751 l-infinity). l1 and l2 are still special cases for convenience
4747 and speed.
4752 and speed.
4748
4753
4749 2003-08-03 Fernando Perez <fperez@colorado.edu>
4754 2003-08-03 Fernando Perez <fperez@colorado.edu>
4750
4755
4751 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4756 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4752 exceptions, which now raise PendingDeprecationWarnings in Python
4757 exceptions, which now raise PendingDeprecationWarnings in Python
4753 2.3. There were some in Magic and some in Gnuplot2.
4758 2.3. There were some in Magic and some in Gnuplot2.
4754
4759
4755 2003-06-30 Fernando Perez <fperez@colorado.edu>
4760 2003-06-30 Fernando Perez <fperez@colorado.edu>
4756
4761
4757 * IPython/genutils.py (page): modified to call curses only for
4762 * IPython/genutils.py (page): modified to call curses only for
4758 terminals where TERM=='xterm'. After problems under many other
4763 terminals where TERM=='xterm'. After problems under many other
4759 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4764 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4760
4765
4761 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4766 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4762 would be triggered when readline was absent. This was just an old
4767 would be triggered when readline was absent. This was just an old
4763 debugging statement I'd forgotten to take out.
4768 debugging statement I'd forgotten to take out.
4764
4769
4765 2003-06-20 Fernando Perez <fperez@colorado.edu>
4770 2003-06-20 Fernando Perez <fperez@colorado.edu>
4766
4771
4767 * IPython/genutils.py (clock): modified to return only user time
4772 * IPython/genutils.py (clock): modified to return only user time
4768 (not counting system time), after a discussion on scipy. While
4773 (not counting system time), after a discussion on scipy. While
4769 system time may be a useful quantity occasionally, it may much
4774 system time may be a useful quantity occasionally, it may much
4770 more easily be skewed by occasional swapping or other similar
4775 more easily be skewed by occasional swapping or other similar
4771 activity.
4776 activity.
4772
4777
4773 2003-06-05 Fernando Perez <fperez@colorado.edu>
4778 2003-06-05 Fernando Perez <fperez@colorado.edu>
4774
4779
4775 * IPython/numutils.py (identity): new function, for building
4780 * IPython/numutils.py (identity): new function, for building
4776 arbitrary rank Kronecker deltas (mostly backwards compatible with
4781 arbitrary rank Kronecker deltas (mostly backwards compatible with
4777 Numeric.identity)
4782 Numeric.identity)
4778
4783
4779 2003-06-03 Fernando Perez <fperez@colorado.edu>
4784 2003-06-03 Fernando Perez <fperez@colorado.edu>
4780
4785
4781 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4786 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4782 arguments passed to magics with spaces, to allow trailing '\' to
4787 arguments passed to magics with spaces, to allow trailing '\' to
4783 work normally (mainly for Windows users).
4788 work normally (mainly for Windows users).
4784
4789
4785 2003-05-29 Fernando Perez <fperez@colorado.edu>
4790 2003-05-29 Fernando Perez <fperez@colorado.edu>
4786
4791
4787 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4792 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4788 instead of pydoc.help. This fixes a bizarre behavior where
4793 instead of pydoc.help. This fixes a bizarre behavior where
4789 printing '%s' % locals() would trigger the help system. Now
4794 printing '%s' % locals() would trigger the help system. Now
4790 ipython behaves like normal python does.
4795 ipython behaves like normal python does.
4791
4796
4792 Note that if one does 'from pydoc import help', the bizarre
4797 Note that if one does 'from pydoc import help', the bizarre
4793 behavior returns, but this will also happen in normal python, so
4798 behavior returns, but this will also happen in normal python, so
4794 it's not an ipython bug anymore (it has to do with how pydoc.help
4799 it's not an ipython bug anymore (it has to do with how pydoc.help
4795 is implemented).
4800 is implemented).
4796
4801
4797 2003-05-22 Fernando Perez <fperez@colorado.edu>
4802 2003-05-22 Fernando Perez <fperez@colorado.edu>
4798
4803
4799 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4804 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4800 return [] instead of None when nothing matches, also match to end
4805 return [] instead of None when nothing matches, also match to end
4801 of line. Patch by Gary Bishop.
4806 of line. Patch by Gary Bishop.
4802
4807
4803 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4808 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4804 protection as before, for files passed on the command line. This
4809 protection as before, for files passed on the command line. This
4805 prevents the CrashHandler from kicking in if user files call into
4810 prevents the CrashHandler from kicking in if user files call into
4806 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4811 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4807 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4812 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4808
4813
4809 2003-05-20 *** Released version 0.4.0
4814 2003-05-20 *** Released version 0.4.0
4810
4815
4811 2003-05-20 Fernando Perez <fperez@colorado.edu>
4816 2003-05-20 Fernando Perez <fperez@colorado.edu>
4812
4817
4813 * setup.py: added support for manpages. It's a bit hackish b/c of
4818 * setup.py: added support for manpages. It's a bit hackish b/c of
4814 a bug in the way the bdist_rpm distutils target handles gzipped
4819 a bug in the way the bdist_rpm distutils target handles gzipped
4815 manpages, but it works. After a patch by Jack.
4820 manpages, but it works. After a patch by Jack.
4816
4821
4817 2003-05-19 Fernando Perez <fperez@colorado.edu>
4822 2003-05-19 Fernando Perez <fperez@colorado.edu>
4818
4823
4819 * IPython/numutils.py: added a mockup of the kinds module, since
4824 * IPython/numutils.py: added a mockup of the kinds module, since
4820 it was recently removed from Numeric. This way, numutils will
4825 it was recently removed from Numeric. This way, numutils will
4821 work for all users even if they are missing kinds.
4826 work for all users even if they are missing kinds.
4822
4827
4823 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4828 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4824 failure, which can occur with SWIG-wrapped extensions. After a
4829 failure, which can occur with SWIG-wrapped extensions. After a
4825 crash report from Prabhu.
4830 crash report from Prabhu.
4826
4831
4827 2003-05-16 Fernando Perez <fperez@colorado.edu>
4832 2003-05-16 Fernando Perez <fperez@colorado.edu>
4828
4833
4829 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4834 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4830 protect ipython from user code which may call directly
4835 protect ipython from user code which may call directly
4831 sys.excepthook (this looks like an ipython crash to the user, even
4836 sys.excepthook (this looks like an ipython crash to the user, even
4832 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4837 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4833 This is especially important to help users of WxWindows, but may
4838 This is especially important to help users of WxWindows, but may
4834 also be useful in other cases.
4839 also be useful in other cases.
4835
4840
4836 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4841 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4837 an optional tb_offset to be specified, and to preserve exception
4842 an optional tb_offset to be specified, and to preserve exception
4838 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4843 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4839
4844
4840 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4845 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4841
4846
4842 2003-05-15 Fernando Perez <fperez@colorado.edu>
4847 2003-05-15 Fernando Perez <fperez@colorado.edu>
4843
4848
4844 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4849 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4845 installing for a new user under Windows.
4850 installing for a new user under Windows.
4846
4851
4847 2003-05-12 Fernando Perez <fperez@colorado.edu>
4852 2003-05-12 Fernando Perez <fperez@colorado.edu>
4848
4853
4849 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4854 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4850 handler for Emacs comint-based lines. Currently it doesn't do
4855 handler for Emacs comint-based lines. Currently it doesn't do
4851 much (but importantly, it doesn't update the history cache). In
4856 much (but importantly, it doesn't update the history cache). In
4852 the future it may be expanded if Alex needs more functionality
4857 the future it may be expanded if Alex needs more functionality
4853 there.
4858 there.
4854
4859
4855 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4860 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4856 info to crash reports.
4861 info to crash reports.
4857
4862
4858 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4863 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4859 just like Python's -c. Also fixed crash with invalid -color
4864 just like Python's -c. Also fixed crash with invalid -color
4860 option value at startup. Thanks to Will French
4865 option value at startup. Thanks to Will French
4861 <wfrench-AT-bestweb.net> for the bug report.
4866 <wfrench-AT-bestweb.net> for the bug report.
4862
4867
4863 2003-05-09 Fernando Perez <fperez@colorado.edu>
4868 2003-05-09 Fernando Perez <fperez@colorado.edu>
4864
4869
4865 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4870 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4866 to EvalDict (it's a mapping, after all) and simplified its code
4871 to EvalDict (it's a mapping, after all) and simplified its code
4867 quite a bit, after a nice discussion on c.l.py where Gustavo
4872 quite a bit, after a nice discussion on c.l.py where Gustavo
4868 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4873 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4869
4874
4870 2003-04-30 Fernando Perez <fperez@colorado.edu>
4875 2003-04-30 Fernando Perez <fperez@colorado.edu>
4871
4876
4872 * IPython/genutils.py (timings_out): modified it to reduce its
4877 * IPython/genutils.py (timings_out): modified it to reduce its
4873 overhead in the common reps==1 case.
4878 overhead in the common reps==1 case.
4874
4879
4875 2003-04-29 Fernando Perez <fperez@colorado.edu>
4880 2003-04-29 Fernando Perez <fperez@colorado.edu>
4876
4881
4877 * IPython/genutils.py (timings_out): Modified to use the resource
4882 * IPython/genutils.py (timings_out): Modified to use the resource
4878 module, which avoids the wraparound problems of time.clock().
4883 module, which avoids the wraparound problems of time.clock().
4879
4884
4880 2003-04-17 *** Released version 0.2.15pre4
4885 2003-04-17 *** Released version 0.2.15pre4
4881
4886
4882 2003-04-17 Fernando Perez <fperez@colorado.edu>
4887 2003-04-17 Fernando Perez <fperez@colorado.edu>
4883
4888
4884 * setup.py (scriptfiles): Split windows-specific stuff over to a
4889 * setup.py (scriptfiles): Split windows-specific stuff over to a
4885 separate file, in an attempt to have a Windows GUI installer.
4890 separate file, in an attempt to have a Windows GUI installer.
4886 That didn't work, but part of the groundwork is done.
4891 That didn't work, but part of the groundwork is done.
4887
4892
4888 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4893 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4889 indent/unindent with 4 spaces. Particularly useful in combination
4894 indent/unindent with 4 spaces. Particularly useful in combination
4890 with the new auto-indent option.
4895 with the new auto-indent option.
4891
4896
4892 2003-04-16 Fernando Perez <fperez@colorado.edu>
4897 2003-04-16 Fernando Perez <fperez@colorado.edu>
4893
4898
4894 * IPython/Magic.py: various replacements of self.rc for
4899 * IPython/Magic.py: various replacements of self.rc for
4895 self.shell.rc. A lot more remains to be done to fully disentangle
4900 self.shell.rc. A lot more remains to be done to fully disentangle
4896 this class from the main Shell class.
4901 this class from the main Shell class.
4897
4902
4898 * IPython/GnuplotRuntime.py: added checks for mouse support so
4903 * IPython/GnuplotRuntime.py: added checks for mouse support so
4899 that we don't try to enable it if the current gnuplot doesn't
4904 that we don't try to enable it if the current gnuplot doesn't
4900 really support it. Also added checks so that we don't try to
4905 really support it. Also added checks so that we don't try to
4901 enable persist under Windows (where Gnuplot doesn't recognize the
4906 enable persist under Windows (where Gnuplot doesn't recognize the
4902 option).
4907 option).
4903
4908
4904 * IPython/iplib.py (InteractiveShell.interact): Added optional
4909 * IPython/iplib.py (InteractiveShell.interact): Added optional
4905 auto-indenting code, after a patch by King C. Shu
4910 auto-indenting code, after a patch by King C. Shu
4906 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4911 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4907 get along well with pasting indented code. If I ever figure out
4912 get along well with pasting indented code. If I ever figure out
4908 how to make that part go well, it will become on by default.
4913 how to make that part go well, it will become on by default.
4909
4914
4910 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4915 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4911 crash ipython if there was an unmatched '%' in the user's prompt
4916 crash ipython if there was an unmatched '%' in the user's prompt
4912 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4917 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4913
4918
4914 * IPython/iplib.py (InteractiveShell.interact): removed the
4919 * IPython/iplib.py (InteractiveShell.interact): removed the
4915 ability to ask the user whether he wants to crash or not at the
4920 ability to ask the user whether he wants to crash or not at the
4916 'last line' exception handler. Calling functions at that point
4921 'last line' exception handler. Calling functions at that point
4917 changes the stack, and the error reports would have incorrect
4922 changes the stack, and the error reports would have incorrect
4918 tracebacks.
4923 tracebacks.
4919
4924
4920 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4925 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4921 pass through a peger a pretty-printed form of any object. After a
4926 pass through a peger a pretty-printed form of any object. After a
4922 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4927 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4923
4928
4924 2003-04-14 Fernando Perez <fperez@colorado.edu>
4929 2003-04-14 Fernando Perez <fperez@colorado.edu>
4925
4930
4926 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4931 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4927 all files in ~ would be modified at first install (instead of
4932 all files in ~ would be modified at first install (instead of
4928 ~/.ipython). This could be potentially disastrous, as the
4933 ~/.ipython). This could be potentially disastrous, as the
4929 modification (make line-endings native) could damage binary files.
4934 modification (make line-endings native) could damage binary files.
4930
4935
4931 2003-04-10 Fernando Perez <fperez@colorado.edu>
4936 2003-04-10 Fernando Perez <fperez@colorado.edu>
4932
4937
4933 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4938 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4934 handle only lines which are invalid python. This now means that
4939 handle only lines which are invalid python. This now means that
4935 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4940 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4936 for the bug report.
4941 for the bug report.
4937
4942
4938 2003-04-01 Fernando Perez <fperez@colorado.edu>
4943 2003-04-01 Fernando Perez <fperez@colorado.edu>
4939
4944
4940 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4945 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4941 where failing to set sys.last_traceback would crash pdb.pm().
4946 where failing to set sys.last_traceback would crash pdb.pm().
4942 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4947 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4943 report.
4948 report.
4944
4949
4945 2003-03-25 Fernando Perez <fperez@colorado.edu>
4950 2003-03-25 Fernando Perez <fperez@colorado.edu>
4946
4951
4947 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4952 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4948 before printing it (it had a lot of spurious blank lines at the
4953 before printing it (it had a lot of spurious blank lines at the
4949 end).
4954 end).
4950
4955
4951 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4956 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4952 output would be sent 21 times! Obviously people don't use this
4957 output would be sent 21 times! Obviously people don't use this
4953 too often, or I would have heard about it.
4958 too often, or I would have heard about it.
4954
4959
4955 2003-03-24 Fernando Perez <fperez@colorado.edu>
4960 2003-03-24 Fernando Perez <fperez@colorado.edu>
4956
4961
4957 * setup.py (scriptfiles): renamed the data_files parameter from
4962 * setup.py (scriptfiles): renamed the data_files parameter from
4958 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4963 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4959 for the patch.
4964 for the patch.
4960
4965
4961 2003-03-20 Fernando Perez <fperez@colorado.edu>
4966 2003-03-20 Fernando Perez <fperez@colorado.edu>
4962
4967
4963 * IPython/genutils.py (error): added error() and fatal()
4968 * IPython/genutils.py (error): added error() and fatal()
4964 functions.
4969 functions.
4965
4970
4966 2003-03-18 *** Released version 0.2.15pre3
4971 2003-03-18 *** Released version 0.2.15pre3
4967
4972
4968 2003-03-18 Fernando Perez <fperez@colorado.edu>
4973 2003-03-18 Fernando Perez <fperez@colorado.edu>
4969
4974
4970 * setupext/install_data_ext.py
4975 * setupext/install_data_ext.py
4971 (install_data_ext.initialize_options): Class contributed by Jack
4976 (install_data_ext.initialize_options): Class contributed by Jack
4972 Moffit for fixing the old distutils hack. He is sending this to
4977 Moffit for fixing the old distutils hack. He is sending this to
4973 the distutils folks so in the future we may not need it as a
4978 the distutils folks so in the future we may not need it as a
4974 private fix.
4979 private fix.
4975
4980
4976 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4981 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4977 changes for Debian packaging. See his patch for full details.
4982 changes for Debian packaging. See his patch for full details.
4978 The old distutils hack of making the ipythonrc* files carry a
4983 The old distutils hack of making the ipythonrc* files carry a
4979 bogus .py extension is gone, at last. Examples were moved to a
4984 bogus .py extension is gone, at last. Examples were moved to a
4980 separate subdir under doc/, and the separate executable scripts
4985 separate subdir under doc/, and the separate executable scripts
4981 now live in their own directory. Overall a great cleanup. The
4986 now live in their own directory. Overall a great cleanup. The
4982 manual was updated to use the new files, and setup.py has been
4987 manual was updated to use the new files, and setup.py has been
4983 fixed for this setup.
4988 fixed for this setup.
4984
4989
4985 * IPython/PyColorize.py (Parser.usage): made non-executable and
4990 * IPython/PyColorize.py (Parser.usage): made non-executable and
4986 created a pycolor wrapper around it to be included as a script.
4991 created a pycolor wrapper around it to be included as a script.
4987
4992
4988 2003-03-12 *** Released version 0.2.15pre2
4993 2003-03-12 *** Released version 0.2.15pre2
4989
4994
4990 2003-03-12 Fernando Perez <fperez@colorado.edu>
4995 2003-03-12 Fernando Perez <fperez@colorado.edu>
4991
4996
4992 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4997 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4993 long-standing problem with garbage characters in some terminals.
4998 long-standing problem with garbage characters in some terminals.
4994 The issue was really that the \001 and \002 escapes must _only_ be
4999 The issue was really that the \001 and \002 escapes must _only_ be
4995 passed to input prompts (which call readline), but _never_ to
5000 passed to input prompts (which call readline), but _never_ to
4996 normal text to be printed on screen. I changed ColorANSI to have
5001 normal text to be printed on screen. I changed ColorANSI to have
4997 two classes: TermColors and InputTermColors, each with the
5002 two classes: TermColors and InputTermColors, each with the
4998 appropriate escapes for input prompts or normal text. The code in
5003 appropriate escapes for input prompts or normal text. The code in
4999 Prompts.py got slightly more complicated, but this very old and
5004 Prompts.py got slightly more complicated, but this very old and
5000 annoying bug is finally fixed.
5005 annoying bug is finally fixed.
5001
5006
5002 All the credit for nailing down the real origin of this problem
5007 All the credit for nailing down the real origin of this problem
5003 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5008 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5004 *Many* thanks to him for spending quite a bit of effort on this.
5009 *Many* thanks to him for spending quite a bit of effort on this.
5005
5010
5006 2003-03-05 *** Released version 0.2.15pre1
5011 2003-03-05 *** Released version 0.2.15pre1
5007
5012
5008 2003-03-03 Fernando Perez <fperez@colorado.edu>
5013 2003-03-03 Fernando Perez <fperez@colorado.edu>
5009
5014
5010 * IPython/FakeModule.py: Moved the former _FakeModule to a
5015 * IPython/FakeModule.py: Moved the former _FakeModule to a
5011 separate file, because it's also needed by Magic (to fix a similar
5016 separate file, because it's also needed by Magic (to fix a similar
5012 pickle-related issue in @run).
5017 pickle-related issue in @run).
5013
5018
5014 2003-03-02 Fernando Perez <fperez@colorado.edu>
5019 2003-03-02 Fernando Perez <fperez@colorado.edu>
5015
5020
5016 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5021 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5017 the autocall option at runtime.
5022 the autocall option at runtime.
5018 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5023 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5019 across Magic.py to start separating Magic from InteractiveShell.
5024 across Magic.py to start separating Magic from InteractiveShell.
5020 (Magic._ofind): Fixed to return proper namespace for dotted
5025 (Magic._ofind): Fixed to return proper namespace for dotted
5021 names. Before, a dotted name would always return 'not currently
5026 names. Before, a dotted name would always return 'not currently
5022 defined', because it would find the 'parent'. s.x would be found,
5027 defined', because it would find the 'parent'. s.x would be found,
5023 but since 'x' isn't defined by itself, it would get confused.
5028 but since 'x' isn't defined by itself, it would get confused.
5024 (Magic.magic_run): Fixed pickling problems reported by Ralf
5029 (Magic.magic_run): Fixed pickling problems reported by Ralf
5025 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5030 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5026 that I'd used when Mike Heeter reported similar issues at the
5031 that I'd used when Mike Heeter reported similar issues at the
5027 top-level, but now for @run. It boils down to injecting the
5032 top-level, but now for @run. It boils down to injecting the
5028 namespace where code is being executed with something that looks
5033 namespace where code is being executed with something that looks
5029 enough like a module to fool pickle.dump(). Since a pickle stores
5034 enough like a module to fool pickle.dump(). Since a pickle stores
5030 a named reference to the importing module, we need this for
5035 a named reference to the importing module, we need this for
5031 pickles to save something sensible.
5036 pickles to save something sensible.
5032
5037
5033 * IPython/ipmaker.py (make_IPython): added an autocall option.
5038 * IPython/ipmaker.py (make_IPython): added an autocall option.
5034
5039
5035 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5040 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5036 the auto-eval code. Now autocalling is an option, and the code is
5041 the auto-eval code. Now autocalling is an option, and the code is
5037 also vastly safer. There is no more eval() involved at all.
5042 also vastly safer. There is no more eval() involved at all.
5038
5043
5039 2003-03-01 Fernando Perez <fperez@colorado.edu>
5044 2003-03-01 Fernando Perez <fperez@colorado.edu>
5040
5045
5041 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5046 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5042 dict with named keys instead of a tuple.
5047 dict with named keys instead of a tuple.
5043
5048
5044 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5049 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5045
5050
5046 * setup.py (make_shortcut): Fixed message about directories
5051 * setup.py (make_shortcut): Fixed message about directories
5047 created during Windows installation (the directories were ok, just
5052 created during Windows installation (the directories were ok, just
5048 the printed message was misleading). Thanks to Chris Liechti
5053 the printed message was misleading). Thanks to Chris Liechti
5049 <cliechti-AT-gmx.net> for the heads up.
5054 <cliechti-AT-gmx.net> for the heads up.
5050
5055
5051 2003-02-21 Fernando Perez <fperez@colorado.edu>
5056 2003-02-21 Fernando Perez <fperez@colorado.edu>
5052
5057
5053 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5058 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5054 of ValueError exception when checking for auto-execution. This
5059 of ValueError exception when checking for auto-execution. This
5055 one is raised by things like Numeric arrays arr.flat when the
5060 one is raised by things like Numeric arrays arr.flat when the
5056 array is non-contiguous.
5061 array is non-contiguous.
5057
5062
5058 2003-01-31 Fernando Perez <fperez@colorado.edu>
5063 2003-01-31 Fernando Perez <fperez@colorado.edu>
5059
5064
5060 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5065 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5061 not return any value at all (even though the command would get
5066 not return any value at all (even though the command would get
5062 executed).
5067 executed).
5063 (xsys): Flush stdout right after printing the command to ensure
5068 (xsys): Flush stdout right after printing the command to ensure
5064 proper ordering of commands and command output in the total
5069 proper ordering of commands and command output in the total
5065 output.
5070 output.
5066 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5071 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5067 system/getoutput as defaults. The old ones are kept for
5072 system/getoutput as defaults. The old ones are kept for
5068 compatibility reasons, so no code which uses this library needs
5073 compatibility reasons, so no code which uses this library needs
5069 changing.
5074 changing.
5070
5075
5071 2003-01-27 *** Released version 0.2.14
5076 2003-01-27 *** Released version 0.2.14
5072
5077
5073 2003-01-25 Fernando Perez <fperez@colorado.edu>
5078 2003-01-25 Fernando Perez <fperez@colorado.edu>
5074
5079
5075 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5080 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5076 functions defined in previous edit sessions could not be re-edited
5081 functions defined in previous edit sessions could not be re-edited
5077 (because the temp files were immediately removed). Now temp files
5082 (because the temp files were immediately removed). Now temp files
5078 are removed only at IPython's exit.
5083 are removed only at IPython's exit.
5079 (Magic.magic_run): Improved @run to perform shell-like expansions
5084 (Magic.magic_run): Improved @run to perform shell-like expansions
5080 on its arguments (~users and $VARS). With this, @run becomes more
5085 on its arguments (~users and $VARS). With this, @run becomes more
5081 like a normal command-line.
5086 like a normal command-line.
5082
5087
5083 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5088 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5084 bugs related to embedding and cleaned up that code. A fairly
5089 bugs related to embedding and cleaned up that code. A fairly
5085 important one was the impossibility to access the global namespace
5090 important one was the impossibility to access the global namespace
5086 through the embedded IPython (only local variables were visible).
5091 through the embedded IPython (only local variables were visible).
5087
5092
5088 2003-01-14 Fernando Perez <fperez@colorado.edu>
5093 2003-01-14 Fernando Perez <fperez@colorado.edu>
5089
5094
5090 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5095 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5091 auto-calling to be a bit more conservative. Now it doesn't get
5096 auto-calling to be a bit more conservative. Now it doesn't get
5092 triggered if any of '!=()<>' are in the rest of the input line, to
5097 triggered if any of '!=()<>' are in the rest of the input line, to
5093 allow comparing callables. Thanks to Alex for the heads up.
5098 allow comparing callables. Thanks to Alex for the heads up.
5094
5099
5095 2003-01-07 Fernando Perez <fperez@colorado.edu>
5100 2003-01-07 Fernando Perez <fperez@colorado.edu>
5096
5101
5097 * IPython/genutils.py (page): fixed estimation of the number of
5102 * IPython/genutils.py (page): fixed estimation of the number of
5098 lines in a string to be paged to simply count newlines. This
5103 lines in a string to be paged to simply count newlines. This
5099 prevents over-guessing due to embedded escape sequences. A better
5104 prevents over-guessing due to embedded escape sequences. A better
5100 long-term solution would involve stripping out the control chars
5105 long-term solution would involve stripping out the control chars
5101 for the count, but it's potentially so expensive I just don't
5106 for the count, but it's potentially so expensive I just don't
5102 think it's worth doing.
5107 think it's worth doing.
5103
5108
5104 2002-12-19 *** Released version 0.2.14pre50
5109 2002-12-19 *** Released version 0.2.14pre50
5105
5110
5106 2002-12-19 Fernando Perez <fperez@colorado.edu>
5111 2002-12-19 Fernando Perez <fperez@colorado.edu>
5107
5112
5108 * tools/release (version): Changed release scripts to inform
5113 * tools/release (version): Changed release scripts to inform
5109 Andrea and build a NEWS file with a list of recent changes.
5114 Andrea and build a NEWS file with a list of recent changes.
5110
5115
5111 * IPython/ColorANSI.py (__all__): changed terminal detection
5116 * IPython/ColorANSI.py (__all__): changed terminal detection
5112 code. Seems to work better for xterms without breaking
5117 code. Seems to work better for xterms without breaking
5113 konsole. Will need more testing to determine if WinXP and Mac OSX
5118 konsole. Will need more testing to determine if WinXP and Mac OSX
5114 also work ok.
5119 also work ok.
5115
5120
5116 2002-12-18 *** Released version 0.2.14pre49
5121 2002-12-18 *** Released version 0.2.14pre49
5117
5122
5118 2002-12-18 Fernando Perez <fperez@colorado.edu>
5123 2002-12-18 Fernando Perez <fperez@colorado.edu>
5119
5124
5120 * Docs: added new info about Mac OSX, from Andrea.
5125 * Docs: added new info about Mac OSX, from Andrea.
5121
5126
5122 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5127 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5123 allow direct plotting of python strings whose format is the same
5128 allow direct plotting of python strings whose format is the same
5124 of gnuplot data files.
5129 of gnuplot data files.
5125
5130
5126 2002-12-16 Fernando Perez <fperez@colorado.edu>
5131 2002-12-16 Fernando Perez <fperez@colorado.edu>
5127
5132
5128 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5133 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5129 value of exit question to be acknowledged.
5134 value of exit question to be acknowledged.
5130
5135
5131 2002-12-03 Fernando Perez <fperez@colorado.edu>
5136 2002-12-03 Fernando Perez <fperez@colorado.edu>
5132
5137
5133 * IPython/ipmaker.py: removed generators, which had been added
5138 * IPython/ipmaker.py: removed generators, which had been added
5134 by mistake in an earlier debugging run. This was causing trouble
5139 by mistake in an earlier debugging run. This was causing trouble
5135 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5140 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5136 for pointing this out.
5141 for pointing this out.
5137
5142
5138 2002-11-17 Fernando Perez <fperez@colorado.edu>
5143 2002-11-17 Fernando Perez <fperez@colorado.edu>
5139
5144
5140 * Manual: updated the Gnuplot section.
5145 * Manual: updated the Gnuplot section.
5141
5146
5142 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5147 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5143 a much better split of what goes in Runtime and what goes in
5148 a much better split of what goes in Runtime and what goes in
5144 Interactive.
5149 Interactive.
5145
5150
5146 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5151 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5147 being imported from iplib.
5152 being imported from iplib.
5148
5153
5149 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5154 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5150 for command-passing. Now the global Gnuplot instance is called
5155 for command-passing. Now the global Gnuplot instance is called
5151 'gp' instead of 'g', which was really a far too fragile and
5156 'gp' instead of 'g', which was really a far too fragile and
5152 common name.
5157 common name.
5153
5158
5154 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5159 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5155 bounding boxes generated by Gnuplot for square plots.
5160 bounding boxes generated by Gnuplot for square plots.
5156
5161
5157 * IPython/genutils.py (popkey): new function added. I should
5162 * IPython/genutils.py (popkey): new function added. I should
5158 suggest this on c.l.py as a dict method, it seems useful.
5163 suggest this on c.l.py as a dict method, it seems useful.
5159
5164
5160 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5165 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5161 to transparently handle PostScript generation. MUCH better than
5166 to transparently handle PostScript generation. MUCH better than
5162 the previous plot_eps/replot_eps (which I removed now). The code
5167 the previous plot_eps/replot_eps (which I removed now). The code
5163 is also fairly clean and well documented now (including
5168 is also fairly clean and well documented now (including
5164 docstrings).
5169 docstrings).
5165
5170
5166 2002-11-13 Fernando Perez <fperez@colorado.edu>
5171 2002-11-13 Fernando Perez <fperez@colorado.edu>
5167
5172
5168 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5173 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5169 (inconsistent with options).
5174 (inconsistent with options).
5170
5175
5171 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5176 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5172 manually disabled, I don't know why. Fixed it.
5177 manually disabled, I don't know why. Fixed it.
5173 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5178 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5174 eps output.
5179 eps output.
5175
5180
5176 2002-11-12 Fernando Perez <fperez@colorado.edu>
5181 2002-11-12 Fernando Perez <fperez@colorado.edu>
5177
5182
5178 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5183 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5179 don't propagate up to caller. Fixes crash reported by François
5184 don't propagate up to caller. Fixes crash reported by François
5180 Pinard.
5185 Pinard.
5181
5186
5182 2002-11-09 Fernando Perez <fperez@colorado.edu>
5187 2002-11-09 Fernando Perez <fperez@colorado.edu>
5183
5188
5184 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5189 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5185 history file for new users.
5190 history file for new users.
5186 (make_IPython): fixed bug where initial install would leave the
5191 (make_IPython): fixed bug where initial install would leave the
5187 user running in the .ipython dir.
5192 user running in the .ipython dir.
5188 (make_IPython): fixed bug where config dir .ipython would be
5193 (make_IPython): fixed bug where config dir .ipython would be
5189 created regardless of the given -ipythondir option. Thanks to Cory
5194 created regardless of the given -ipythondir option. Thanks to Cory
5190 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5195 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5191
5196
5192 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5197 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5193 type confirmations. Will need to use it in all of IPython's code
5198 type confirmations. Will need to use it in all of IPython's code
5194 consistently.
5199 consistently.
5195
5200
5196 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5201 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5197 context to print 31 lines instead of the default 5. This will make
5202 context to print 31 lines instead of the default 5. This will make
5198 the crash reports extremely detailed in case the problem is in
5203 the crash reports extremely detailed in case the problem is in
5199 libraries I don't have access to.
5204 libraries I don't have access to.
5200
5205
5201 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5206 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5202 line of defense' code to still crash, but giving users fair
5207 line of defense' code to still crash, but giving users fair
5203 warning. I don't want internal errors to go unreported: if there's
5208 warning. I don't want internal errors to go unreported: if there's
5204 an internal problem, IPython should crash and generate a full
5209 an internal problem, IPython should crash and generate a full
5205 report.
5210 report.
5206
5211
5207 2002-11-08 Fernando Perez <fperez@colorado.edu>
5212 2002-11-08 Fernando Perez <fperez@colorado.edu>
5208
5213
5209 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5214 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5210 otherwise uncaught exceptions which can appear if people set
5215 otherwise uncaught exceptions which can appear if people set
5211 sys.stdout to something badly broken. Thanks to a crash report
5216 sys.stdout to something badly broken. Thanks to a crash report
5212 from henni-AT-mail.brainbot.com.
5217 from henni-AT-mail.brainbot.com.
5213
5218
5214 2002-11-04 Fernando Perez <fperez@colorado.edu>
5219 2002-11-04 Fernando Perez <fperez@colorado.edu>
5215
5220
5216 * IPython/iplib.py (InteractiveShell.interact): added
5221 * IPython/iplib.py (InteractiveShell.interact): added
5217 __IPYTHON__active to the builtins. It's a flag which goes on when
5222 __IPYTHON__active to the builtins. It's a flag which goes on when
5218 the interaction starts and goes off again when it stops. This
5223 the interaction starts and goes off again when it stops. This
5219 allows embedding code to detect being inside IPython. Before this
5224 allows embedding code to detect being inside IPython. Before this
5220 was done via __IPYTHON__, but that only shows that an IPython
5225 was done via __IPYTHON__, but that only shows that an IPython
5221 instance has been created.
5226 instance has been created.
5222
5227
5223 * IPython/Magic.py (Magic.magic_env): I realized that in a
5228 * IPython/Magic.py (Magic.magic_env): I realized that in a
5224 UserDict, instance.data holds the data as a normal dict. So I
5229 UserDict, instance.data holds the data as a normal dict. So I
5225 modified @env to return os.environ.data instead of rebuilding a
5230 modified @env to return os.environ.data instead of rebuilding a
5226 dict by hand.
5231 dict by hand.
5227
5232
5228 2002-11-02 Fernando Perez <fperez@colorado.edu>
5233 2002-11-02 Fernando Perez <fperez@colorado.edu>
5229
5234
5230 * IPython/genutils.py (warn): changed so that level 1 prints no
5235 * IPython/genutils.py (warn): changed so that level 1 prints no
5231 header. Level 2 is now the default (with 'WARNING' header, as
5236 header. Level 2 is now the default (with 'WARNING' header, as
5232 before). I think I tracked all places where changes were needed in
5237 before). I think I tracked all places where changes were needed in
5233 IPython, but outside code using the old level numbering may have
5238 IPython, but outside code using the old level numbering may have
5234 broken.
5239 broken.
5235
5240
5236 * IPython/iplib.py (InteractiveShell.runcode): added this to
5241 * IPython/iplib.py (InteractiveShell.runcode): added this to
5237 handle the tracebacks in SystemExit traps correctly. The previous
5242 handle the tracebacks in SystemExit traps correctly. The previous
5238 code (through interact) was printing more of the stack than
5243 code (through interact) was printing more of the stack than
5239 necessary, showing IPython internal code to the user.
5244 necessary, showing IPython internal code to the user.
5240
5245
5241 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5246 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5242 default. Now that the default at the confirmation prompt is yes,
5247 default. Now that the default at the confirmation prompt is yes,
5243 it's not so intrusive. François' argument that ipython sessions
5248 it's not so intrusive. François' argument that ipython sessions
5244 tend to be complex enough not to lose them from an accidental C-d,
5249 tend to be complex enough not to lose them from an accidental C-d,
5245 is a valid one.
5250 is a valid one.
5246
5251
5247 * IPython/iplib.py (InteractiveShell.interact): added a
5252 * IPython/iplib.py (InteractiveShell.interact): added a
5248 showtraceback() call to the SystemExit trap, and modified the exit
5253 showtraceback() call to the SystemExit trap, and modified the exit
5249 confirmation to have yes as the default.
5254 confirmation to have yes as the default.
5250
5255
5251 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5256 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5252 this file. It's been gone from the code for a long time, this was
5257 this file. It's been gone from the code for a long time, this was
5253 simply leftover junk.
5258 simply leftover junk.
5254
5259
5255 2002-11-01 Fernando Perez <fperez@colorado.edu>
5260 2002-11-01 Fernando Perez <fperez@colorado.edu>
5256
5261
5257 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5262 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5258 added. If set, IPython now traps EOF and asks for
5263 added. If set, IPython now traps EOF and asks for
5259 confirmation. After a request by François Pinard.
5264 confirmation. After a request by François Pinard.
5260
5265
5261 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5266 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5262 of @abort, and with a new (better) mechanism for handling the
5267 of @abort, and with a new (better) mechanism for handling the
5263 exceptions.
5268 exceptions.
5264
5269
5265 2002-10-27 Fernando Perez <fperez@colorado.edu>
5270 2002-10-27 Fernando Perez <fperez@colorado.edu>
5266
5271
5267 * IPython/usage.py (__doc__): updated the --help information and
5272 * IPython/usage.py (__doc__): updated the --help information and
5268 the ipythonrc file to indicate that -log generates
5273 the ipythonrc file to indicate that -log generates
5269 ./ipython.log. Also fixed the corresponding info in @logstart.
5274 ./ipython.log. Also fixed the corresponding info in @logstart.
5270 This and several other fixes in the manuals thanks to reports by
5275 This and several other fixes in the manuals thanks to reports by
5271 François Pinard <pinard-AT-iro.umontreal.ca>.
5276 François Pinard <pinard-AT-iro.umontreal.ca>.
5272
5277
5273 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5278 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5274 refer to @logstart (instead of @log, which doesn't exist).
5279 refer to @logstart (instead of @log, which doesn't exist).
5275
5280
5276 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5281 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5277 AttributeError crash. Thanks to Christopher Armstrong
5282 AttributeError crash. Thanks to Christopher Armstrong
5278 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5283 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5279 introduced recently (in 0.2.14pre37) with the fix to the eval
5284 introduced recently (in 0.2.14pre37) with the fix to the eval
5280 problem mentioned below.
5285 problem mentioned below.
5281
5286
5282 2002-10-17 Fernando Perez <fperez@colorado.edu>
5287 2002-10-17 Fernando Perez <fperez@colorado.edu>
5283
5288
5284 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5289 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5285 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5290 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5286
5291
5287 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5292 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5288 this function to fix a problem reported by Alex Schmolck. He saw
5293 this function to fix a problem reported by Alex Schmolck. He saw
5289 it with list comprehensions and generators, which were getting
5294 it with list comprehensions and generators, which were getting
5290 called twice. The real problem was an 'eval' call in testing for
5295 called twice. The real problem was an 'eval' call in testing for
5291 automagic which was evaluating the input line silently.
5296 automagic which was evaluating the input line silently.
5292
5297
5293 This is a potentially very nasty bug, if the input has side
5298 This is a potentially very nasty bug, if the input has side
5294 effects which must not be repeated. The code is much cleaner now,
5299 effects which must not be repeated. The code is much cleaner now,
5295 without any blanket 'except' left and with a regexp test for
5300 without any blanket 'except' left and with a regexp test for
5296 actual function names.
5301 actual function names.
5297
5302
5298 But an eval remains, which I'm not fully comfortable with. I just
5303 But an eval remains, which I'm not fully comfortable with. I just
5299 don't know how to find out if an expression could be a callable in
5304 don't know how to find out if an expression could be a callable in
5300 the user's namespace without doing an eval on the string. However
5305 the user's namespace without doing an eval on the string. However
5301 that string is now much more strictly checked so that no code
5306 that string is now much more strictly checked so that no code
5302 slips by, so the eval should only happen for things that can
5307 slips by, so the eval should only happen for things that can
5303 really be only function/method names.
5308 really be only function/method names.
5304
5309
5305 2002-10-15 Fernando Perez <fperez@colorado.edu>
5310 2002-10-15 Fernando Perez <fperez@colorado.edu>
5306
5311
5307 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5312 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5308 OSX information to main manual, removed README_Mac_OSX file from
5313 OSX information to main manual, removed README_Mac_OSX file from
5309 distribution. Also updated credits for recent additions.
5314 distribution. Also updated credits for recent additions.
5310
5315
5311 2002-10-10 Fernando Perez <fperez@colorado.edu>
5316 2002-10-10 Fernando Perez <fperez@colorado.edu>
5312
5317
5313 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5318 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5314 terminal-related issues. Many thanks to Andrea Riciputi
5319 terminal-related issues. Many thanks to Andrea Riciputi
5315 <andrea.riciputi-AT-libero.it> for writing it.
5320 <andrea.riciputi-AT-libero.it> for writing it.
5316
5321
5317 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5322 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5318 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5323 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5319
5324
5320 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5325 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5321 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5326 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5322 <syver-en-AT-online.no> who both submitted patches for this problem.
5327 <syver-en-AT-online.no> who both submitted patches for this problem.
5323
5328
5324 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5329 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5325 global embedding to make sure that things don't overwrite user
5330 global embedding to make sure that things don't overwrite user
5326 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5331 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5327
5332
5328 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5333 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5329 compatibility. Thanks to Hayden Callow
5334 compatibility. Thanks to Hayden Callow
5330 <h.callow-AT-elec.canterbury.ac.nz>
5335 <h.callow-AT-elec.canterbury.ac.nz>
5331
5336
5332 2002-10-04 Fernando Perez <fperez@colorado.edu>
5337 2002-10-04 Fernando Perez <fperez@colorado.edu>
5333
5338
5334 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5339 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5335 Gnuplot.File objects.
5340 Gnuplot.File objects.
5336
5341
5337 2002-07-23 Fernando Perez <fperez@colorado.edu>
5342 2002-07-23 Fernando Perez <fperez@colorado.edu>
5338
5343
5339 * IPython/genutils.py (timing): Added timings() and timing() for
5344 * IPython/genutils.py (timing): Added timings() and timing() for
5340 quick access to the most commonly needed data, the execution
5345 quick access to the most commonly needed data, the execution
5341 times. Old timing() renamed to timings_out().
5346 times. Old timing() renamed to timings_out().
5342
5347
5343 2002-07-18 Fernando Perez <fperez@colorado.edu>
5348 2002-07-18 Fernando Perez <fperez@colorado.edu>
5344
5349
5345 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5350 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5346 bug with nested instances disrupting the parent's tab completion.
5351 bug with nested instances disrupting the parent's tab completion.
5347
5352
5348 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5353 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5349 all_completions code to begin the emacs integration.
5354 all_completions code to begin the emacs integration.
5350
5355
5351 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5356 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5352 argument to allow titling individual arrays when plotting.
5357 argument to allow titling individual arrays when plotting.
5353
5358
5354 2002-07-15 Fernando Perez <fperez@colorado.edu>
5359 2002-07-15 Fernando Perez <fperez@colorado.edu>
5355
5360
5356 * setup.py (make_shortcut): changed to retrieve the value of
5361 * setup.py (make_shortcut): changed to retrieve the value of
5357 'Program Files' directory from the registry (this value changes in
5362 'Program Files' directory from the registry (this value changes in
5358 non-english versions of Windows). Thanks to Thomas Fanslau
5363 non-english versions of Windows). Thanks to Thomas Fanslau
5359 <tfanslau-AT-gmx.de> for the report.
5364 <tfanslau-AT-gmx.de> for the report.
5360
5365
5361 2002-07-10 Fernando Perez <fperez@colorado.edu>
5366 2002-07-10 Fernando Perez <fperez@colorado.edu>
5362
5367
5363 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5368 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5364 a bug in pdb, which crashes if a line with only whitespace is
5369 a bug in pdb, which crashes if a line with only whitespace is
5365 entered. Bug report submitted to sourceforge.
5370 entered. Bug report submitted to sourceforge.
5366
5371
5367 2002-07-09 Fernando Perez <fperez@colorado.edu>
5372 2002-07-09 Fernando Perez <fperez@colorado.edu>
5368
5373
5369 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5374 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5370 reporting exceptions (it's a bug in inspect.py, I just set a
5375 reporting exceptions (it's a bug in inspect.py, I just set a
5371 workaround).
5376 workaround).
5372
5377
5373 2002-07-08 Fernando Perez <fperez@colorado.edu>
5378 2002-07-08 Fernando Perez <fperez@colorado.edu>
5374
5379
5375 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5380 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5376 __IPYTHON__ in __builtins__ to show up in user_ns.
5381 __IPYTHON__ in __builtins__ to show up in user_ns.
5377
5382
5378 2002-07-03 Fernando Perez <fperez@colorado.edu>
5383 2002-07-03 Fernando Perez <fperez@colorado.edu>
5379
5384
5380 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5385 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5381 name from @gp_set_instance to @gp_set_default.
5386 name from @gp_set_instance to @gp_set_default.
5382
5387
5383 * IPython/ipmaker.py (make_IPython): default editor value set to
5388 * IPython/ipmaker.py (make_IPython): default editor value set to
5384 '0' (a string), to match the rc file. Otherwise will crash when
5389 '0' (a string), to match the rc file. Otherwise will crash when
5385 .strip() is called on it.
5390 .strip() is called on it.
5386
5391
5387
5392
5388 2002-06-28 Fernando Perez <fperez@colorado.edu>
5393 2002-06-28 Fernando Perez <fperez@colorado.edu>
5389
5394
5390 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5395 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5391 of files in current directory when a file is executed via
5396 of files in current directory when a file is executed via
5392 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5397 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5393
5398
5394 * setup.py (manfiles): fix for rpm builds, submitted by RA
5399 * setup.py (manfiles): fix for rpm builds, submitted by RA
5395 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5400 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5396
5401
5397 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5402 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5398 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5403 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5399 string!). A. Schmolck caught this one.
5404 string!). A. Schmolck caught this one.
5400
5405
5401 2002-06-27 Fernando Perez <fperez@colorado.edu>
5406 2002-06-27 Fernando Perez <fperez@colorado.edu>
5402
5407
5403 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5408 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5404 defined files at the cmd line. __name__ wasn't being set to
5409 defined files at the cmd line. __name__ wasn't being set to
5405 __main__.
5410 __main__.
5406
5411
5407 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5412 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5408 regular lists and tuples besides Numeric arrays.
5413 regular lists and tuples besides Numeric arrays.
5409
5414
5410 * IPython/Prompts.py (CachedOutput.__call__): Added output
5415 * IPython/Prompts.py (CachedOutput.__call__): Added output
5411 supression for input ending with ';'. Similar to Mathematica and
5416 supression for input ending with ';'. Similar to Mathematica and
5412 Matlab. The _* vars and Out[] list are still updated, just like
5417 Matlab. The _* vars and Out[] list are still updated, just like
5413 Mathematica behaves.
5418 Mathematica behaves.
5414
5419
5415 2002-06-25 Fernando Perez <fperez@colorado.edu>
5420 2002-06-25 Fernando Perez <fperez@colorado.edu>
5416
5421
5417 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5422 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5418 .ini extensions for profiels under Windows.
5423 .ini extensions for profiels under Windows.
5419
5424
5420 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5425 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5421 string form. Fix contributed by Alexander Schmolck
5426 string form. Fix contributed by Alexander Schmolck
5422 <a.schmolck-AT-gmx.net>
5427 <a.schmolck-AT-gmx.net>
5423
5428
5424 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5429 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5425 pre-configured Gnuplot instance.
5430 pre-configured Gnuplot instance.
5426
5431
5427 2002-06-21 Fernando Perez <fperez@colorado.edu>
5432 2002-06-21 Fernando Perez <fperez@colorado.edu>
5428
5433
5429 * IPython/numutils.py (exp_safe): new function, works around the
5434 * IPython/numutils.py (exp_safe): new function, works around the
5430 underflow problems in Numeric.
5435 underflow problems in Numeric.
5431 (log2): New fn. Safe log in base 2: returns exact integer answer
5436 (log2): New fn. Safe log in base 2: returns exact integer answer
5432 for exact integer powers of 2.
5437 for exact integer powers of 2.
5433
5438
5434 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5439 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5435 properly.
5440 properly.
5436
5441
5437 2002-06-20 Fernando Perez <fperez@colorado.edu>
5442 2002-06-20 Fernando Perez <fperez@colorado.edu>
5438
5443
5439 * IPython/genutils.py (timing): new function like
5444 * IPython/genutils.py (timing): new function like
5440 Mathematica's. Similar to time_test, but returns more info.
5445 Mathematica's. Similar to time_test, but returns more info.
5441
5446
5442 2002-06-18 Fernando Perez <fperez@colorado.edu>
5447 2002-06-18 Fernando Perez <fperez@colorado.edu>
5443
5448
5444 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5449 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5445 according to Mike Heeter's suggestions.
5450 according to Mike Heeter's suggestions.
5446
5451
5447 2002-06-16 Fernando Perez <fperez@colorado.edu>
5452 2002-06-16 Fernando Perez <fperez@colorado.edu>
5448
5453
5449 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5454 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5450 system. GnuplotMagic is gone as a user-directory option. New files
5455 system. GnuplotMagic is gone as a user-directory option. New files
5451 make it easier to use all the gnuplot stuff both from external
5456 make it easier to use all the gnuplot stuff both from external
5452 programs as well as from IPython. Had to rewrite part of
5457 programs as well as from IPython. Had to rewrite part of
5453 hardcopy() b/c of a strange bug: often the ps files simply don't
5458 hardcopy() b/c of a strange bug: often the ps files simply don't
5454 get created, and require a repeat of the command (often several
5459 get created, and require a repeat of the command (often several
5455 times).
5460 times).
5456
5461
5457 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5462 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5458 resolve output channel at call time, so that if sys.stderr has
5463 resolve output channel at call time, so that if sys.stderr has
5459 been redirected by user this gets honored.
5464 been redirected by user this gets honored.
5460
5465
5461 2002-06-13 Fernando Perez <fperez@colorado.edu>
5466 2002-06-13 Fernando Perez <fperez@colorado.edu>
5462
5467
5463 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5468 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5464 IPShell. Kept a copy with the old names to avoid breaking people's
5469 IPShell. Kept a copy with the old names to avoid breaking people's
5465 embedded code.
5470 embedded code.
5466
5471
5467 * IPython/ipython: simplified it to the bare minimum after
5472 * IPython/ipython: simplified it to the bare minimum after
5468 Holger's suggestions. Added info about how to use it in
5473 Holger's suggestions. Added info about how to use it in
5469 PYTHONSTARTUP.
5474 PYTHONSTARTUP.
5470
5475
5471 * IPython/Shell.py (IPythonShell): changed the options passing
5476 * IPython/Shell.py (IPythonShell): changed the options passing
5472 from a string with funky %s replacements to a straight list. Maybe
5477 from a string with funky %s replacements to a straight list. Maybe
5473 a bit more typing, but it follows sys.argv conventions, so there's
5478 a bit more typing, but it follows sys.argv conventions, so there's
5474 less special-casing to remember.
5479 less special-casing to remember.
5475
5480
5476 2002-06-12 Fernando Perez <fperez@colorado.edu>
5481 2002-06-12 Fernando Perez <fperez@colorado.edu>
5477
5482
5478 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5483 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5479 command. Thanks to a suggestion by Mike Heeter.
5484 command. Thanks to a suggestion by Mike Heeter.
5480 (Magic.magic_pfile): added behavior to look at filenames if given
5485 (Magic.magic_pfile): added behavior to look at filenames if given
5481 arg is not a defined object.
5486 arg is not a defined object.
5482 (Magic.magic_save): New @save function to save code snippets. Also
5487 (Magic.magic_save): New @save function to save code snippets. Also
5483 a Mike Heeter idea.
5488 a Mike Heeter idea.
5484
5489
5485 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5490 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5486 plot() and replot(). Much more convenient now, especially for
5491 plot() and replot(). Much more convenient now, especially for
5487 interactive use.
5492 interactive use.
5488
5493
5489 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5494 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5490 filenames.
5495 filenames.
5491
5496
5492 2002-06-02 Fernando Perez <fperez@colorado.edu>
5497 2002-06-02 Fernando Perez <fperez@colorado.edu>
5493
5498
5494 * IPython/Struct.py (Struct.__init__): modified to admit
5499 * IPython/Struct.py (Struct.__init__): modified to admit
5495 initialization via another struct.
5500 initialization via another struct.
5496
5501
5497 * IPython/genutils.py (SystemExec.__init__): New stateful
5502 * IPython/genutils.py (SystemExec.__init__): New stateful
5498 interface to xsys and bq. Useful for writing system scripts.
5503 interface to xsys and bq. Useful for writing system scripts.
5499
5504
5500 2002-05-30 Fernando Perez <fperez@colorado.edu>
5505 2002-05-30 Fernando Perez <fperez@colorado.edu>
5501
5506
5502 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5507 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5503 documents. This will make the user download smaller (it's getting
5508 documents. This will make the user download smaller (it's getting
5504 too big).
5509 too big).
5505
5510
5506 2002-05-29 Fernando Perez <fperez@colorado.edu>
5511 2002-05-29 Fernando Perez <fperez@colorado.edu>
5507
5512
5508 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5513 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5509 fix problems with shelve and pickle. Seems to work, but I don't
5514 fix problems with shelve and pickle. Seems to work, but I don't
5510 know if corner cases break it. Thanks to Mike Heeter
5515 know if corner cases break it. Thanks to Mike Heeter
5511 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5516 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5512
5517
5513 2002-05-24 Fernando Perez <fperez@colorado.edu>
5518 2002-05-24 Fernando Perez <fperez@colorado.edu>
5514
5519
5515 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5520 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5516 macros having broken.
5521 macros having broken.
5517
5522
5518 2002-05-21 Fernando Perez <fperez@colorado.edu>
5523 2002-05-21 Fernando Perez <fperez@colorado.edu>
5519
5524
5520 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5525 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5521 introduced logging bug: all history before logging started was
5526 introduced logging bug: all history before logging started was
5522 being written one character per line! This came from the redesign
5527 being written one character per line! This came from the redesign
5523 of the input history as a special list which slices to strings,
5528 of the input history as a special list which slices to strings,
5524 not to lists.
5529 not to lists.
5525
5530
5526 2002-05-20 Fernando Perez <fperez@colorado.edu>
5531 2002-05-20 Fernando Perez <fperez@colorado.edu>
5527
5532
5528 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5533 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5529 be an attribute of all classes in this module. The design of these
5534 be an attribute of all classes in this module. The design of these
5530 classes needs some serious overhauling.
5535 classes needs some serious overhauling.
5531
5536
5532 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5537 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5533 which was ignoring '_' in option names.
5538 which was ignoring '_' in option names.
5534
5539
5535 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5540 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5536 'Verbose_novars' to 'Context' and made it the new default. It's a
5541 'Verbose_novars' to 'Context' and made it the new default. It's a
5537 bit more readable and also safer than verbose.
5542 bit more readable and also safer than verbose.
5538
5543
5539 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5544 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5540 triple-quoted strings.
5545 triple-quoted strings.
5541
5546
5542 * IPython/OInspect.py (__all__): new module exposing the object
5547 * IPython/OInspect.py (__all__): new module exposing the object
5543 introspection facilities. Now the corresponding magics are dummy
5548 introspection facilities. Now the corresponding magics are dummy
5544 wrappers around this. Having this module will make it much easier
5549 wrappers around this. Having this module will make it much easier
5545 to put these functions into our modified pdb.
5550 to put these functions into our modified pdb.
5546 This new object inspector system uses the new colorizing module,
5551 This new object inspector system uses the new colorizing module,
5547 so source code and other things are nicely syntax highlighted.
5552 so source code and other things are nicely syntax highlighted.
5548
5553
5549 2002-05-18 Fernando Perez <fperez@colorado.edu>
5554 2002-05-18 Fernando Perez <fperez@colorado.edu>
5550
5555
5551 * IPython/ColorANSI.py: Split the coloring tools into a separate
5556 * IPython/ColorANSI.py: Split the coloring tools into a separate
5552 module so I can use them in other code easier (they were part of
5557 module so I can use them in other code easier (they were part of
5553 ultraTB).
5558 ultraTB).
5554
5559
5555 2002-05-17 Fernando Perez <fperez@colorado.edu>
5560 2002-05-17 Fernando Perez <fperez@colorado.edu>
5556
5561
5557 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5562 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5558 fixed it to set the global 'g' also to the called instance, as
5563 fixed it to set the global 'g' also to the called instance, as
5559 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5564 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5560 user's 'g' variables).
5565 user's 'g' variables).
5561
5566
5562 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5567 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5563 global variables (aliases to _ih,_oh) so that users which expect
5568 global variables (aliases to _ih,_oh) so that users which expect
5564 In[5] or Out[7] to work aren't unpleasantly surprised.
5569 In[5] or Out[7] to work aren't unpleasantly surprised.
5565 (InputList.__getslice__): new class to allow executing slices of
5570 (InputList.__getslice__): new class to allow executing slices of
5566 input history directly. Very simple class, complements the use of
5571 input history directly. Very simple class, complements the use of
5567 macros.
5572 macros.
5568
5573
5569 2002-05-16 Fernando Perez <fperez@colorado.edu>
5574 2002-05-16 Fernando Perez <fperez@colorado.edu>
5570
5575
5571 * setup.py (docdirbase): make doc directory be just doc/IPython
5576 * setup.py (docdirbase): make doc directory be just doc/IPython
5572 without version numbers, it will reduce clutter for users.
5577 without version numbers, it will reduce clutter for users.
5573
5578
5574 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5579 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5575 execfile call to prevent possible memory leak. See for details:
5580 execfile call to prevent possible memory leak. See for details:
5576 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5581 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5577
5582
5578 2002-05-15 Fernando Perez <fperez@colorado.edu>
5583 2002-05-15 Fernando Perez <fperez@colorado.edu>
5579
5584
5580 * IPython/Magic.py (Magic.magic_psource): made the object
5585 * IPython/Magic.py (Magic.magic_psource): made the object
5581 introspection names be more standard: pdoc, pdef, pfile and
5586 introspection names be more standard: pdoc, pdef, pfile and
5582 psource. They all print/page their output, and it makes
5587 psource. They all print/page their output, and it makes
5583 remembering them easier. Kept old names for compatibility as
5588 remembering them easier. Kept old names for compatibility as
5584 aliases.
5589 aliases.
5585
5590
5586 2002-05-14 Fernando Perez <fperez@colorado.edu>
5591 2002-05-14 Fernando Perez <fperez@colorado.edu>
5587
5592
5588 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5593 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5589 what the mouse problem was. The trick is to use gnuplot with temp
5594 what the mouse problem was. The trick is to use gnuplot with temp
5590 files and NOT with pipes (for data communication), because having
5595 files and NOT with pipes (for data communication), because having
5591 both pipes and the mouse on is bad news.
5596 both pipes and the mouse on is bad news.
5592
5597
5593 2002-05-13 Fernando Perez <fperez@colorado.edu>
5598 2002-05-13 Fernando Perez <fperez@colorado.edu>
5594
5599
5595 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5600 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5596 bug. Information would be reported about builtins even when
5601 bug. Information would be reported about builtins even when
5597 user-defined functions overrode them.
5602 user-defined functions overrode them.
5598
5603
5599 2002-05-11 Fernando Perez <fperez@colorado.edu>
5604 2002-05-11 Fernando Perez <fperez@colorado.edu>
5600
5605
5601 * IPython/__init__.py (__all__): removed FlexCompleter from
5606 * IPython/__init__.py (__all__): removed FlexCompleter from
5602 __all__ so that things don't fail in platforms without readline.
5607 __all__ so that things don't fail in platforms without readline.
5603
5608
5604 2002-05-10 Fernando Perez <fperez@colorado.edu>
5609 2002-05-10 Fernando Perez <fperez@colorado.edu>
5605
5610
5606 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5611 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5607 it requires Numeric, effectively making Numeric a dependency for
5612 it requires Numeric, effectively making Numeric a dependency for
5608 IPython.
5613 IPython.
5609
5614
5610 * Released 0.2.13
5615 * Released 0.2.13
5611
5616
5612 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5617 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5613 profiler interface. Now all the major options from the profiler
5618 profiler interface. Now all the major options from the profiler
5614 module are directly supported in IPython, both for single
5619 module are directly supported in IPython, both for single
5615 expressions (@prun) and for full programs (@run -p).
5620 expressions (@prun) and for full programs (@run -p).
5616
5621
5617 2002-05-09 Fernando Perez <fperez@colorado.edu>
5622 2002-05-09 Fernando Perez <fperez@colorado.edu>
5618
5623
5619 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5624 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5620 magic properly formatted for screen.
5625 magic properly formatted for screen.
5621
5626
5622 * setup.py (make_shortcut): Changed things to put pdf version in
5627 * setup.py (make_shortcut): Changed things to put pdf version in
5623 doc/ instead of doc/manual (had to change lyxport a bit).
5628 doc/ instead of doc/manual (had to change lyxport a bit).
5624
5629
5625 * IPython/Magic.py (Profile.string_stats): made profile runs go
5630 * IPython/Magic.py (Profile.string_stats): made profile runs go
5626 through pager (they are long and a pager allows searching, saving,
5631 through pager (they are long and a pager allows searching, saving,
5627 etc.)
5632 etc.)
5628
5633
5629 2002-05-08 Fernando Perez <fperez@colorado.edu>
5634 2002-05-08 Fernando Perez <fperez@colorado.edu>
5630
5635
5631 * Released 0.2.12
5636 * Released 0.2.12
5632
5637
5633 2002-05-06 Fernando Perez <fperez@colorado.edu>
5638 2002-05-06 Fernando Perez <fperez@colorado.edu>
5634
5639
5635 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5640 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5636 introduced); 'hist n1 n2' was broken.
5641 introduced); 'hist n1 n2' was broken.
5637 (Magic.magic_pdb): added optional on/off arguments to @pdb
5642 (Magic.magic_pdb): added optional on/off arguments to @pdb
5638 (Magic.magic_run): added option -i to @run, which executes code in
5643 (Magic.magic_run): added option -i to @run, which executes code in
5639 the IPython namespace instead of a clean one. Also added @irun as
5644 the IPython namespace instead of a clean one. Also added @irun as
5640 an alias to @run -i.
5645 an alias to @run -i.
5641
5646
5642 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5647 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5643 fixed (it didn't really do anything, the namespaces were wrong).
5648 fixed (it didn't really do anything, the namespaces were wrong).
5644
5649
5645 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5650 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5646
5651
5647 * IPython/__init__.py (__all__): Fixed package namespace, now
5652 * IPython/__init__.py (__all__): Fixed package namespace, now
5648 'import IPython' does give access to IPython.<all> as
5653 'import IPython' does give access to IPython.<all> as
5649 expected. Also renamed __release__ to Release.
5654 expected. Also renamed __release__ to Release.
5650
5655
5651 * IPython/Debugger.py (__license__): created new Pdb class which
5656 * IPython/Debugger.py (__license__): created new Pdb class which
5652 functions like a drop-in for the normal pdb.Pdb but does NOT
5657 functions like a drop-in for the normal pdb.Pdb but does NOT
5653 import readline by default. This way it doesn't muck up IPython's
5658 import readline by default. This way it doesn't muck up IPython's
5654 readline handling, and now tab-completion finally works in the
5659 readline handling, and now tab-completion finally works in the
5655 debugger -- sort of. It completes things globally visible, but the
5660 debugger -- sort of. It completes things globally visible, but the
5656 completer doesn't track the stack as pdb walks it. That's a bit
5661 completer doesn't track the stack as pdb walks it. That's a bit
5657 tricky, and I'll have to implement it later.
5662 tricky, and I'll have to implement it later.
5658
5663
5659 2002-05-05 Fernando Perez <fperez@colorado.edu>
5664 2002-05-05 Fernando Perez <fperez@colorado.edu>
5660
5665
5661 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5666 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5662 magic docstrings when printed via ? (explicit \'s were being
5667 magic docstrings when printed via ? (explicit \'s were being
5663 printed).
5668 printed).
5664
5669
5665 * IPython/ipmaker.py (make_IPython): fixed namespace
5670 * IPython/ipmaker.py (make_IPython): fixed namespace
5666 identification bug. Now variables loaded via logs or command-line
5671 identification bug. Now variables loaded via logs or command-line
5667 files are recognized in the interactive namespace by @who.
5672 files are recognized in the interactive namespace by @who.
5668
5673
5669 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5674 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5670 log replay system stemming from the string form of Structs.
5675 log replay system stemming from the string form of Structs.
5671
5676
5672 * IPython/Magic.py (Macro.__init__): improved macros to properly
5677 * IPython/Magic.py (Macro.__init__): improved macros to properly
5673 handle magic commands in them.
5678 handle magic commands in them.
5674 (Magic.magic_logstart): usernames are now expanded so 'logstart
5679 (Magic.magic_logstart): usernames are now expanded so 'logstart
5675 ~/mylog' now works.
5680 ~/mylog' now works.
5676
5681
5677 * IPython/iplib.py (complete): fixed bug where paths starting with
5682 * IPython/iplib.py (complete): fixed bug where paths starting with
5678 '/' would be completed as magic names.
5683 '/' would be completed as magic names.
5679
5684
5680 2002-05-04 Fernando Perez <fperez@colorado.edu>
5685 2002-05-04 Fernando Perez <fperez@colorado.edu>
5681
5686
5682 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5687 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5683 allow running full programs under the profiler's control.
5688 allow running full programs under the profiler's control.
5684
5689
5685 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5690 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5686 mode to report exceptions verbosely but without formatting
5691 mode to report exceptions verbosely but without formatting
5687 variables. This addresses the issue of ipython 'freezing' (it's
5692 variables. This addresses the issue of ipython 'freezing' (it's
5688 not frozen, but caught in an expensive formatting loop) when huge
5693 not frozen, but caught in an expensive formatting loop) when huge
5689 variables are in the context of an exception.
5694 variables are in the context of an exception.
5690 (VerboseTB.text): Added '--->' markers at line where exception was
5695 (VerboseTB.text): Added '--->' markers at line where exception was
5691 triggered. Much clearer to read, especially in NoColor modes.
5696 triggered. Much clearer to read, especially in NoColor modes.
5692
5697
5693 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5698 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5694 implemented in reverse when changing to the new parse_options().
5699 implemented in reverse when changing to the new parse_options().
5695
5700
5696 2002-05-03 Fernando Perez <fperez@colorado.edu>
5701 2002-05-03 Fernando Perez <fperez@colorado.edu>
5697
5702
5698 * IPython/Magic.py (Magic.parse_options): new function so that
5703 * IPython/Magic.py (Magic.parse_options): new function so that
5699 magics can parse options easier.
5704 magics can parse options easier.
5700 (Magic.magic_prun): new function similar to profile.run(),
5705 (Magic.magic_prun): new function similar to profile.run(),
5701 suggested by Chris Hart.
5706 suggested by Chris Hart.
5702 (Magic.magic_cd): fixed behavior so that it only changes if
5707 (Magic.magic_cd): fixed behavior so that it only changes if
5703 directory actually is in history.
5708 directory actually is in history.
5704
5709
5705 * IPython/usage.py (__doc__): added information about potential
5710 * IPython/usage.py (__doc__): added information about potential
5706 slowness of Verbose exception mode when there are huge data
5711 slowness of Verbose exception mode when there are huge data
5707 structures to be formatted (thanks to Archie Paulson).
5712 structures to be formatted (thanks to Archie Paulson).
5708
5713
5709 * IPython/ipmaker.py (make_IPython): Changed default logging
5714 * IPython/ipmaker.py (make_IPython): Changed default logging
5710 (when simply called with -log) to use curr_dir/ipython.log in
5715 (when simply called with -log) to use curr_dir/ipython.log in
5711 rotate mode. Fixed crash which was occuring with -log before
5716 rotate mode. Fixed crash which was occuring with -log before
5712 (thanks to Jim Boyle).
5717 (thanks to Jim Boyle).
5713
5718
5714 2002-05-01 Fernando Perez <fperez@colorado.edu>
5719 2002-05-01 Fernando Perez <fperez@colorado.edu>
5715
5720
5716 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5721 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5717 was nasty -- though somewhat of a corner case).
5722 was nasty -- though somewhat of a corner case).
5718
5723
5719 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5724 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5720 text (was a bug).
5725 text (was a bug).
5721
5726
5722 2002-04-30 Fernando Perez <fperez@colorado.edu>
5727 2002-04-30 Fernando Perez <fperez@colorado.edu>
5723
5728
5724 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5729 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5725 a print after ^D or ^C from the user so that the In[] prompt
5730 a print after ^D or ^C from the user so that the In[] prompt
5726 doesn't over-run the gnuplot one.
5731 doesn't over-run the gnuplot one.
5727
5732
5728 2002-04-29 Fernando Perez <fperez@colorado.edu>
5733 2002-04-29 Fernando Perez <fperez@colorado.edu>
5729
5734
5730 * Released 0.2.10
5735 * Released 0.2.10
5731
5736
5732 * IPython/__release__.py (version): get date dynamically.
5737 * IPython/__release__.py (version): get date dynamically.
5733
5738
5734 * Misc. documentation updates thanks to Arnd's comments. Also ran
5739 * Misc. documentation updates thanks to Arnd's comments. Also ran
5735 a full spellcheck on the manual (hadn't been done in a while).
5740 a full spellcheck on the manual (hadn't been done in a while).
5736
5741
5737 2002-04-27 Fernando Perez <fperez@colorado.edu>
5742 2002-04-27 Fernando Perez <fperez@colorado.edu>
5738
5743
5739 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5744 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5740 starting a log in mid-session would reset the input history list.
5745 starting a log in mid-session would reset the input history list.
5741
5746
5742 2002-04-26 Fernando Perez <fperez@colorado.edu>
5747 2002-04-26 Fernando Perez <fperez@colorado.edu>
5743
5748
5744 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5749 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5745 all files were being included in an update. Now anything in
5750 all files were being included in an update. Now anything in
5746 UserConfig that matches [A-Za-z]*.py will go (this excludes
5751 UserConfig that matches [A-Za-z]*.py will go (this excludes
5747 __init__.py)
5752 __init__.py)
5748
5753
5749 2002-04-25 Fernando Perez <fperez@colorado.edu>
5754 2002-04-25 Fernando Perez <fperez@colorado.edu>
5750
5755
5751 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5756 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5752 to __builtins__ so that any form of embedded or imported code can
5757 to __builtins__ so that any form of embedded or imported code can
5753 test for being inside IPython.
5758 test for being inside IPython.
5754
5759
5755 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5760 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5756 changed to GnuplotMagic because it's now an importable module,
5761 changed to GnuplotMagic because it's now an importable module,
5757 this makes the name follow that of the standard Gnuplot module.
5762 this makes the name follow that of the standard Gnuplot module.
5758 GnuplotMagic can now be loaded at any time in mid-session.
5763 GnuplotMagic can now be loaded at any time in mid-session.
5759
5764
5760 2002-04-24 Fernando Perez <fperez@colorado.edu>
5765 2002-04-24 Fernando Perez <fperez@colorado.edu>
5761
5766
5762 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5767 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5763 the globals (IPython has its own namespace) and the
5768 the globals (IPython has its own namespace) and the
5764 PhysicalQuantity stuff is much better anyway.
5769 PhysicalQuantity stuff is much better anyway.
5765
5770
5766 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5771 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5767 embedding example to standard user directory for
5772 embedding example to standard user directory for
5768 distribution. Also put it in the manual.
5773 distribution. Also put it in the manual.
5769
5774
5770 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5775 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5771 instance as first argument (so it doesn't rely on some obscure
5776 instance as first argument (so it doesn't rely on some obscure
5772 hidden global).
5777 hidden global).
5773
5778
5774 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5779 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5775 delimiters. While it prevents ().TAB from working, it allows
5780 delimiters. While it prevents ().TAB from working, it allows
5776 completions in open (... expressions. This is by far a more common
5781 completions in open (... expressions. This is by far a more common
5777 case.
5782 case.
5778
5783
5779 2002-04-23 Fernando Perez <fperez@colorado.edu>
5784 2002-04-23 Fernando Perez <fperez@colorado.edu>
5780
5785
5781 * IPython/Extensions/InterpreterPasteInput.py: new
5786 * IPython/Extensions/InterpreterPasteInput.py: new
5782 syntax-processing module for pasting lines with >>> or ... at the
5787 syntax-processing module for pasting lines with >>> or ... at the
5783 start.
5788 start.
5784
5789
5785 * IPython/Extensions/PhysicalQ_Interactive.py
5790 * IPython/Extensions/PhysicalQ_Interactive.py
5786 (PhysicalQuantityInteractive.__int__): fixed to work with either
5791 (PhysicalQuantityInteractive.__int__): fixed to work with either
5787 Numeric or math.
5792 Numeric or math.
5788
5793
5789 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5794 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5790 provided profiles. Now we have:
5795 provided profiles. Now we have:
5791 -math -> math module as * and cmath with its own namespace.
5796 -math -> math module as * and cmath with its own namespace.
5792 -numeric -> Numeric as *, plus gnuplot & grace
5797 -numeric -> Numeric as *, plus gnuplot & grace
5793 -physics -> same as before
5798 -physics -> same as before
5794
5799
5795 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5800 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5796 user-defined magics wouldn't be found by @magic if they were
5801 user-defined magics wouldn't be found by @magic if they were
5797 defined as class methods. Also cleaned up the namespace search
5802 defined as class methods. Also cleaned up the namespace search
5798 logic and the string building (to use %s instead of many repeated
5803 logic and the string building (to use %s instead of many repeated
5799 string adds).
5804 string adds).
5800
5805
5801 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5806 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5802 of user-defined magics to operate with class methods (cleaner, in
5807 of user-defined magics to operate with class methods (cleaner, in
5803 line with the gnuplot code).
5808 line with the gnuplot code).
5804
5809
5805 2002-04-22 Fernando Perez <fperez@colorado.edu>
5810 2002-04-22 Fernando Perez <fperez@colorado.edu>
5806
5811
5807 * setup.py: updated dependency list so that manual is updated when
5812 * setup.py: updated dependency list so that manual is updated when
5808 all included files change.
5813 all included files change.
5809
5814
5810 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5815 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5811 the delimiter removal option (the fix is ugly right now).
5816 the delimiter removal option (the fix is ugly right now).
5812
5817
5813 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5818 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5814 all of the math profile (quicker loading, no conflict between
5819 all of the math profile (quicker loading, no conflict between
5815 g-9.8 and g-gnuplot).
5820 g-9.8 and g-gnuplot).
5816
5821
5817 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5822 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5818 name of post-mortem files to IPython_crash_report.txt.
5823 name of post-mortem files to IPython_crash_report.txt.
5819
5824
5820 * Cleanup/update of the docs. Added all the new readline info and
5825 * Cleanup/update of the docs. Added all the new readline info and
5821 formatted all lists as 'real lists'.
5826 formatted all lists as 'real lists'.
5822
5827
5823 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5828 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5824 tab-completion options, since the full readline parse_and_bind is
5829 tab-completion options, since the full readline parse_and_bind is
5825 now accessible.
5830 now accessible.
5826
5831
5827 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5832 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5828 handling of readline options. Now users can specify any string to
5833 handling of readline options. Now users can specify any string to
5829 be passed to parse_and_bind(), as well as the delimiters to be
5834 be passed to parse_and_bind(), as well as the delimiters to be
5830 removed.
5835 removed.
5831 (InteractiveShell.__init__): Added __name__ to the global
5836 (InteractiveShell.__init__): Added __name__ to the global
5832 namespace so that things like Itpl which rely on its existence
5837 namespace so that things like Itpl which rely on its existence
5833 don't crash.
5838 don't crash.
5834 (InteractiveShell._prefilter): Defined the default with a _ so
5839 (InteractiveShell._prefilter): Defined the default with a _ so
5835 that prefilter() is easier to override, while the default one
5840 that prefilter() is easier to override, while the default one
5836 remains available.
5841 remains available.
5837
5842
5838 2002-04-18 Fernando Perez <fperez@colorado.edu>
5843 2002-04-18 Fernando Perez <fperez@colorado.edu>
5839
5844
5840 * Added information about pdb in the docs.
5845 * Added information about pdb in the docs.
5841
5846
5842 2002-04-17 Fernando Perez <fperez@colorado.edu>
5847 2002-04-17 Fernando Perez <fperez@colorado.edu>
5843
5848
5844 * IPython/ipmaker.py (make_IPython): added rc_override option to
5849 * IPython/ipmaker.py (make_IPython): added rc_override option to
5845 allow passing config options at creation time which may override
5850 allow passing config options at creation time which may override
5846 anything set in the config files or command line. This is
5851 anything set in the config files or command line. This is
5847 particularly useful for configuring embedded instances.
5852 particularly useful for configuring embedded instances.
5848
5853
5849 2002-04-15 Fernando Perez <fperez@colorado.edu>
5854 2002-04-15 Fernando Perez <fperez@colorado.edu>
5850
5855
5851 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5856 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5852 crash embedded instances because of the input cache falling out of
5857 crash embedded instances because of the input cache falling out of
5853 sync with the output counter.
5858 sync with the output counter.
5854
5859
5855 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5860 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5856 mode which calls pdb after an uncaught exception in IPython itself.
5861 mode which calls pdb after an uncaught exception in IPython itself.
5857
5862
5858 2002-04-14 Fernando Perez <fperez@colorado.edu>
5863 2002-04-14 Fernando Perez <fperez@colorado.edu>
5859
5864
5860 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5865 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5861 readline, fix it back after each call.
5866 readline, fix it back after each call.
5862
5867
5863 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5868 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5864 method to force all access via __call__(), which guarantees that
5869 method to force all access via __call__(), which guarantees that
5865 traceback references are properly deleted.
5870 traceback references are properly deleted.
5866
5871
5867 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5872 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5868 improve printing when pprint is in use.
5873 improve printing when pprint is in use.
5869
5874
5870 2002-04-13 Fernando Perez <fperez@colorado.edu>
5875 2002-04-13 Fernando Perez <fperez@colorado.edu>
5871
5876
5872 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5877 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5873 exceptions aren't caught anymore. If the user triggers one, he
5878 exceptions aren't caught anymore. If the user triggers one, he
5874 should know why he's doing it and it should go all the way up,
5879 should know why he's doing it and it should go all the way up,
5875 just like any other exception. So now @abort will fully kill the
5880 just like any other exception. So now @abort will fully kill the
5876 embedded interpreter and the embedding code (unless that happens
5881 embedded interpreter and the embedding code (unless that happens
5877 to catch SystemExit).
5882 to catch SystemExit).
5878
5883
5879 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5884 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5880 and a debugger() method to invoke the interactive pdb debugger
5885 and a debugger() method to invoke the interactive pdb debugger
5881 after printing exception information. Also added the corresponding
5886 after printing exception information. Also added the corresponding
5882 -pdb option and @pdb magic to control this feature, and updated
5887 -pdb option and @pdb magic to control this feature, and updated
5883 the docs. After a suggestion from Christopher Hart
5888 the docs. After a suggestion from Christopher Hart
5884 (hart-AT-caltech.edu).
5889 (hart-AT-caltech.edu).
5885
5890
5886 2002-04-12 Fernando Perez <fperez@colorado.edu>
5891 2002-04-12 Fernando Perez <fperez@colorado.edu>
5887
5892
5888 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5893 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5889 the exception handlers defined by the user (not the CrashHandler)
5894 the exception handlers defined by the user (not the CrashHandler)
5890 so that user exceptions don't trigger an ipython bug report.
5895 so that user exceptions don't trigger an ipython bug report.
5891
5896
5892 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5897 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5893 configurable (it should have always been so).
5898 configurable (it should have always been so).
5894
5899
5895 2002-03-26 Fernando Perez <fperez@colorado.edu>
5900 2002-03-26 Fernando Perez <fperez@colorado.edu>
5896
5901
5897 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5902 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5898 and there to fix embedding namespace issues. This should all be
5903 and there to fix embedding namespace issues. This should all be
5899 done in a more elegant way.
5904 done in a more elegant way.
5900
5905
5901 2002-03-25 Fernando Perez <fperez@colorado.edu>
5906 2002-03-25 Fernando Perez <fperez@colorado.edu>
5902
5907
5903 * IPython/genutils.py (get_home_dir): Try to make it work under
5908 * IPython/genutils.py (get_home_dir): Try to make it work under
5904 win9x also.
5909 win9x also.
5905
5910
5906 2002-03-20 Fernando Perez <fperez@colorado.edu>
5911 2002-03-20 Fernando Perez <fperez@colorado.edu>
5907
5912
5908 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5913 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5909 sys.displayhook untouched upon __init__.
5914 sys.displayhook untouched upon __init__.
5910
5915
5911 2002-03-19 Fernando Perez <fperez@colorado.edu>
5916 2002-03-19 Fernando Perez <fperez@colorado.edu>
5912
5917
5913 * Released 0.2.9 (for embedding bug, basically).
5918 * Released 0.2.9 (for embedding bug, basically).
5914
5919
5915 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5920 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5916 exceptions so that enclosing shell's state can be restored.
5921 exceptions so that enclosing shell's state can be restored.
5917
5922
5918 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5923 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5919 naming conventions in the .ipython/ dir.
5924 naming conventions in the .ipython/ dir.
5920
5925
5921 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5926 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5922 from delimiters list so filenames with - in them get expanded.
5927 from delimiters list so filenames with - in them get expanded.
5923
5928
5924 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5929 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5925 sys.displayhook not being properly restored after an embedded call.
5930 sys.displayhook not being properly restored after an embedded call.
5926
5931
5927 2002-03-18 Fernando Perez <fperez@colorado.edu>
5932 2002-03-18 Fernando Perez <fperez@colorado.edu>
5928
5933
5929 * Released 0.2.8
5934 * Released 0.2.8
5930
5935
5931 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5936 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5932 some files weren't being included in a -upgrade.
5937 some files weren't being included in a -upgrade.
5933 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5938 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5934 on' so that the first tab completes.
5939 on' so that the first tab completes.
5935 (InteractiveShell.handle_magic): fixed bug with spaces around
5940 (InteractiveShell.handle_magic): fixed bug with spaces around
5936 quotes breaking many magic commands.
5941 quotes breaking many magic commands.
5937
5942
5938 * setup.py: added note about ignoring the syntax error messages at
5943 * setup.py: added note about ignoring the syntax error messages at
5939 installation.
5944 installation.
5940
5945
5941 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5946 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5942 streamlining the gnuplot interface, now there's only one magic @gp.
5947 streamlining the gnuplot interface, now there's only one magic @gp.
5943
5948
5944 2002-03-17 Fernando Perez <fperez@colorado.edu>
5949 2002-03-17 Fernando Perez <fperez@colorado.edu>
5945
5950
5946 * IPython/UserConfig/magic_gnuplot.py: new name for the
5951 * IPython/UserConfig/magic_gnuplot.py: new name for the
5947 example-magic_pm.py file. Much enhanced system, now with a shell
5952 example-magic_pm.py file. Much enhanced system, now with a shell
5948 for communicating directly with gnuplot, one command at a time.
5953 for communicating directly with gnuplot, one command at a time.
5949
5954
5950 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5955 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5951 setting __name__=='__main__'.
5956 setting __name__=='__main__'.
5952
5957
5953 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5958 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5954 mini-shell for accessing gnuplot from inside ipython. Should
5959 mini-shell for accessing gnuplot from inside ipython. Should
5955 extend it later for grace access too. Inspired by Arnd's
5960 extend it later for grace access too. Inspired by Arnd's
5956 suggestion.
5961 suggestion.
5957
5962
5958 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5963 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5959 calling magic functions with () in their arguments. Thanks to Arnd
5964 calling magic functions with () in their arguments. Thanks to Arnd
5960 Baecker for pointing this to me.
5965 Baecker for pointing this to me.
5961
5966
5962 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5967 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5963 infinitely for integer or complex arrays (only worked with floats).
5968 infinitely for integer or complex arrays (only worked with floats).
5964
5969
5965 2002-03-16 Fernando Perez <fperez@colorado.edu>
5970 2002-03-16 Fernando Perez <fperez@colorado.edu>
5966
5971
5967 * setup.py: Merged setup and setup_windows into a single script
5972 * setup.py: Merged setup and setup_windows into a single script
5968 which properly handles things for windows users.
5973 which properly handles things for windows users.
5969
5974
5970 2002-03-15 Fernando Perez <fperez@colorado.edu>
5975 2002-03-15 Fernando Perez <fperez@colorado.edu>
5971
5976
5972 * Big change to the manual: now the magics are all automatically
5977 * Big change to the manual: now the magics are all automatically
5973 documented. This information is generated from their docstrings
5978 documented. This information is generated from their docstrings
5974 and put in a latex file included by the manual lyx file. This way
5979 and put in a latex file included by the manual lyx file. This way
5975 we get always up to date information for the magics. The manual
5980 we get always up to date information for the magics. The manual
5976 now also has proper version information, also auto-synced.
5981 now also has proper version information, also auto-synced.
5977
5982
5978 For this to work, an undocumented --magic_docstrings option was added.
5983 For this to work, an undocumented --magic_docstrings option was added.
5979
5984
5980 2002-03-13 Fernando Perez <fperez@colorado.edu>
5985 2002-03-13 Fernando Perez <fperez@colorado.edu>
5981
5986
5982 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5987 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5983 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5988 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5984
5989
5985 2002-03-12 Fernando Perez <fperez@colorado.edu>
5990 2002-03-12 Fernando Perez <fperez@colorado.edu>
5986
5991
5987 * IPython/ultraTB.py (TermColors): changed color escapes again to
5992 * IPython/ultraTB.py (TermColors): changed color escapes again to
5988 fix the (old, reintroduced) line-wrapping bug. Basically, if
5993 fix the (old, reintroduced) line-wrapping bug. Basically, if
5989 \001..\002 aren't given in the color escapes, lines get wrapped
5994 \001..\002 aren't given in the color escapes, lines get wrapped
5990 weirdly. But giving those screws up old xterms and emacs terms. So
5995 weirdly. But giving those screws up old xterms and emacs terms. So
5991 I added some logic for emacs terms to be ok, but I can't identify old
5996 I added some logic for emacs terms to be ok, but I can't identify old
5992 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5997 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5993
5998
5994 2002-03-10 Fernando Perez <fperez@colorado.edu>
5999 2002-03-10 Fernando Perez <fperez@colorado.edu>
5995
6000
5996 * IPython/usage.py (__doc__): Various documentation cleanups and
6001 * IPython/usage.py (__doc__): Various documentation cleanups and
5997 updates, both in usage docstrings and in the manual.
6002 updates, both in usage docstrings and in the manual.
5998
6003
5999 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6004 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6000 handling of caching. Set minimum acceptabe value for having a
6005 handling of caching. Set minimum acceptabe value for having a
6001 cache at 20 values.
6006 cache at 20 values.
6002
6007
6003 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6008 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6004 install_first_time function to a method, renamed it and added an
6009 install_first_time function to a method, renamed it and added an
6005 'upgrade' mode. Now people can update their config directory with
6010 'upgrade' mode. Now people can update their config directory with
6006 a simple command line switch (-upgrade, also new).
6011 a simple command line switch (-upgrade, also new).
6007
6012
6008 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6013 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6009 @file (convenient for automagic users under Python >= 2.2).
6014 @file (convenient for automagic users under Python >= 2.2).
6010 Removed @files (it seemed more like a plural than an abbrev. of
6015 Removed @files (it seemed more like a plural than an abbrev. of
6011 'file show').
6016 'file show').
6012
6017
6013 * IPython/iplib.py (install_first_time): Fixed crash if there were
6018 * IPython/iplib.py (install_first_time): Fixed crash if there were
6014 backup files ('~') in .ipython/ install directory.
6019 backup files ('~') in .ipython/ install directory.
6015
6020
6016 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6021 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6017 system. Things look fine, but these changes are fairly
6022 system. Things look fine, but these changes are fairly
6018 intrusive. Test them for a few days.
6023 intrusive. Test them for a few days.
6019
6024
6020 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6025 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6021 the prompts system. Now all in/out prompt strings are user
6026 the prompts system. Now all in/out prompt strings are user
6022 controllable. This is particularly useful for embedding, as one
6027 controllable. This is particularly useful for embedding, as one
6023 can tag embedded instances with particular prompts.
6028 can tag embedded instances with particular prompts.
6024
6029
6025 Also removed global use of sys.ps1/2, which now allows nested
6030 Also removed global use of sys.ps1/2, which now allows nested
6026 embeddings without any problems. Added command-line options for
6031 embeddings without any problems. Added command-line options for
6027 the prompt strings.
6032 the prompt strings.
6028
6033
6029 2002-03-08 Fernando Perez <fperez@colorado.edu>
6034 2002-03-08 Fernando Perez <fperez@colorado.edu>
6030
6035
6031 * IPython/UserConfig/example-embed-short.py (ipshell): added
6036 * IPython/UserConfig/example-embed-short.py (ipshell): added
6032 example file with the bare minimum code for embedding.
6037 example file with the bare minimum code for embedding.
6033
6038
6034 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6039 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6035 functionality for the embeddable shell to be activated/deactivated
6040 functionality for the embeddable shell to be activated/deactivated
6036 either globally or at each call.
6041 either globally or at each call.
6037
6042
6038 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6043 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6039 rewriting the prompt with '--->' for auto-inputs with proper
6044 rewriting the prompt with '--->' for auto-inputs with proper
6040 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6045 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6041 this is handled by the prompts class itself, as it should.
6046 this is handled by the prompts class itself, as it should.
6042
6047
6043 2002-03-05 Fernando Perez <fperez@colorado.edu>
6048 2002-03-05 Fernando Perez <fperez@colorado.edu>
6044
6049
6045 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6050 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6046 @logstart to avoid name clashes with the math log function.
6051 @logstart to avoid name clashes with the math log function.
6047
6052
6048 * Big updates to X/Emacs section of the manual.
6053 * Big updates to X/Emacs section of the manual.
6049
6054
6050 * Removed ipython_emacs. Milan explained to me how to pass
6055 * Removed ipython_emacs. Milan explained to me how to pass
6051 arguments to ipython through Emacs. Some day I'm going to end up
6056 arguments to ipython through Emacs. Some day I'm going to end up
6052 learning some lisp...
6057 learning some lisp...
6053
6058
6054 2002-03-04 Fernando Perez <fperez@colorado.edu>
6059 2002-03-04 Fernando Perez <fperez@colorado.edu>
6055
6060
6056 * IPython/ipython_emacs: Created script to be used as the
6061 * IPython/ipython_emacs: Created script to be used as the
6057 py-python-command Emacs variable so we can pass IPython
6062 py-python-command Emacs variable so we can pass IPython
6058 parameters. I can't figure out how to tell Emacs directly to pass
6063 parameters. I can't figure out how to tell Emacs directly to pass
6059 parameters to IPython, so a dummy shell script will do it.
6064 parameters to IPython, so a dummy shell script will do it.
6060
6065
6061 Other enhancements made for things to work better under Emacs'
6066 Other enhancements made for things to work better under Emacs'
6062 various types of terminals. Many thanks to Milan Zamazal
6067 various types of terminals. Many thanks to Milan Zamazal
6063 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6068 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6064
6069
6065 2002-03-01 Fernando Perez <fperez@colorado.edu>
6070 2002-03-01 Fernando Perez <fperez@colorado.edu>
6066
6071
6067 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6072 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6068 that loading of readline is now optional. This gives better
6073 that loading of readline is now optional. This gives better
6069 control to emacs users.
6074 control to emacs users.
6070
6075
6071 * IPython/ultraTB.py (__date__): Modified color escape sequences
6076 * IPython/ultraTB.py (__date__): Modified color escape sequences
6072 and now things work fine under xterm and in Emacs' term buffers
6077 and now things work fine under xterm and in Emacs' term buffers
6073 (though not shell ones). Well, in emacs you get colors, but all
6078 (though not shell ones). Well, in emacs you get colors, but all
6074 seem to be 'light' colors (no difference between dark and light
6079 seem to be 'light' colors (no difference between dark and light
6075 ones). But the garbage chars are gone, and also in xterms. It
6080 ones). But the garbage chars are gone, and also in xterms. It
6076 seems that now I'm using 'cleaner' ansi sequences.
6081 seems that now I'm using 'cleaner' ansi sequences.
6077
6082
6078 2002-02-21 Fernando Perez <fperez@colorado.edu>
6083 2002-02-21 Fernando Perez <fperez@colorado.edu>
6079
6084
6080 * Released 0.2.7 (mainly to publish the scoping fix).
6085 * Released 0.2.7 (mainly to publish the scoping fix).
6081
6086
6082 * IPython/Logger.py (Logger.logstate): added. A corresponding
6087 * IPython/Logger.py (Logger.logstate): added. A corresponding
6083 @logstate magic was created.
6088 @logstate magic was created.
6084
6089
6085 * IPython/Magic.py: fixed nested scoping problem under Python
6090 * IPython/Magic.py: fixed nested scoping problem under Python
6086 2.1.x (automagic wasn't working).
6091 2.1.x (automagic wasn't working).
6087
6092
6088 2002-02-20 Fernando Perez <fperez@colorado.edu>
6093 2002-02-20 Fernando Perez <fperez@colorado.edu>
6089
6094
6090 * Released 0.2.6.
6095 * Released 0.2.6.
6091
6096
6092 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6097 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6093 option so that logs can come out without any headers at all.
6098 option so that logs can come out without any headers at all.
6094
6099
6095 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6100 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6096 SciPy.
6101 SciPy.
6097
6102
6098 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6103 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6099 that embedded IPython calls don't require vars() to be explicitly
6104 that embedded IPython calls don't require vars() to be explicitly
6100 passed. Now they are extracted from the caller's frame (code
6105 passed. Now they are extracted from the caller's frame (code
6101 snatched from Eric Jones' weave). Added better documentation to
6106 snatched from Eric Jones' weave). Added better documentation to
6102 the section on embedding and the example file.
6107 the section on embedding and the example file.
6103
6108
6104 * IPython/genutils.py (page): Changed so that under emacs, it just
6109 * IPython/genutils.py (page): Changed so that under emacs, it just
6105 prints the string. You can then page up and down in the emacs
6110 prints the string. You can then page up and down in the emacs
6106 buffer itself. This is how the builtin help() works.
6111 buffer itself. This is how the builtin help() works.
6107
6112
6108 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6113 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6109 macro scoping: macros need to be executed in the user's namespace
6114 macro scoping: macros need to be executed in the user's namespace
6110 to work as if they had been typed by the user.
6115 to work as if they had been typed by the user.
6111
6116
6112 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6117 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6113 execute automatically (no need to type 'exec...'). They then
6118 execute automatically (no need to type 'exec...'). They then
6114 behave like 'true macros'. The printing system was also modified
6119 behave like 'true macros'. The printing system was also modified
6115 for this to work.
6120 for this to work.
6116
6121
6117 2002-02-19 Fernando Perez <fperez@colorado.edu>
6122 2002-02-19 Fernando Perez <fperez@colorado.edu>
6118
6123
6119 * IPython/genutils.py (page_file): new function for paging files
6124 * IPython/genutils.py (page_file): new function for paging files
6120 in an OS-independent way. Also necessary for file viewing to work
6125 in an OS-independent way. Also necessary for file viewing to work
6121 well inside Emacs buffers.
6126 well inside Emacs buffers.
6122 (page): Added checks for being in an emacs buffer.
6127 (page): Added checks for being in an emacs buffer.
6123 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6128 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6124 same bug in iplib.
6129 same bug in iplib.
6125
6130
6126 2002-02-18 Fernando Perez <fperez@colorado.edu>
6131 2002-02-18 Fernando Perez <fperez@colorado.edu>
6127
6132
6128 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6133 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6129 of readline so that IPython can work inside an Emacs buffer.
6134 of readline so that IPython can work inside an Emacs buffer.
6130
6135
6131 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6136 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6132 method signatures (they weren't really bugs, but it looks cleaner
6137 method signatures (they weren't really bugs, but it looks cleaner
6133 and keeps PyChecker happy).
6138 and keeps PyChecker happy).
6134
6139
6135 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6140 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6136 for implementing various user-defined hooks. Currently only
6141 for implementing various user-defined hooks. Currently only
6137 display is done.
6142 display is done.
6138
6143
6139 * IPython/Prompts.py (CachedOutput._display): changed display
6144 * IPython/Prompts.py (CachedOutput._display): changed display
6140 functions so that they can be dynamically changed by users easily.
6145 functions so that they can be dynamically changed by users easily.
6141
6146
6142 * IPython/Extensions/numeric_formats.py (num_display): added an
6147 * IPython/Extensions/numeric_formats.py (num_display): added an
6143 extension for printing NumPy arrays in flexible manners. It
6148 extension for printing NumPy arrays in flexible manners. It
6144 doesn't do anything yet, but all the structure is in
6149 doesn't do anything yet, but all the structure is in
6145 place. Ultimately the plan is to implement output format control
6150 place. Ultimately the plan is to implement output format control
6146 like in Octave.
6151 like in Octave.
6147
6152
6148 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6153 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6149 methods are found at run-time by all the automatic machinery.
6154 methods are found at run-time by all the automatic machinery.
6150
6155
6151 2002-02-17 Fernando Perez <fperez@colorado.edu>
6156 2002-02-17 Fernando Perez <fperez@colorado.edu>
6152
6157
6153 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6158 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6154 whole file a little.
6159 whole file a little.
6155
6160
6156 * ToDo: closed this document. Now there's a new_design.lyx
6161 * ToDo: closed this document. Now there's a new_design.lyx
6157 document for all new ideas. Added making a pdf of it for the
6162 document for all new ideas. Added making a pdf of it for the
6158 end-user distro.
6163 end-user distro.
6159
6164
6160 * IPython/Logger.py (Logger.switch_log): Created this to replace
6165 * IPython/Logger.py (Logger.switch_log): Created this to replace
6161 logon() and logoff(). It also fixes a nasty crash reported by
6166 logon() and logoff(). It also fixes a nasty crash reported by
6162 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6167 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6163
6168
6164 * IPython/iplib.py (complete): got auto-completion to work with
6169 * IPython/iplib.py (complete): got auto-completion to work with
6165 automagic (I had wanted this for a long time).
6170 automagic (I had wanted this for a long time).
6166
6171
6167 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6172 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6168 to @file, since file() is now a builtin and clashes with automagic
6173 to @file, since file() is now a builtin and clashes with automagic
6169 for @file.
6174 for @file.
6170
6175
6171 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6176 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6172 of this was previously in iplib, which had grown to more than 2000
6177 of this was previously in iplib, which had grown to more than 2000
6173 lines, way too long. No new functionality, but it makes managing
6178 lines, way too long. No new functionality, but it makes managing
6174 the code a bit easier.
6179 the code a bit easier.
6175
6180
6176 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6181 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6177 information to crash reports.
6182 information to crash reports.
6178
6183
6179 2002-02-12 Fernando Perez <fperez@colorado.edu>
6184 2002-02-12 Fernando Perez <fperez@colorado.edu>
6180
6185
6181 * Released 0.2.5.
6186 * Released 0.2.5.
6182
6187
6183 2002-02-11 Fernando Perez <fperez@colorado.edu>
6188 2002-02-11 Fernando Perez <fperez@colorado.edu>
6184
6189
6185 * Wrote a relatively complete Windows installer. It puts
6190 * Wrote a relatively complete Windows installer. It puts
6186 everything in place, creates Start Menu entries and fixes the
6191 everything in place, creates Start Menu entries and fixes the
6187 color issues. Nothing fancy, but it works.
6192 color issues. Nothing fancy, but it works.
6188
6193
6189 2002-02-10 Fernando Perez <fperez@colorado.edu>
6194 2002-02-10 Fernando Perez <fperez@colorado.edu>
6190
6195
6191 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6196 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6192 os.path.expanduser() call so that we can type @run ~/myfile.py and
6197 os.path.expanduser() call so that we can type @run ~/myfile.py and
6193 have thigs work as expected.
6198 have thigs work as expected.
6194
6199
6195 * IPython/genutils.py (page): fixed exception handling so things
6200 * IPython/genutils.py (page): fixed exception handling so things
6196 work both in Unix and Windows correctly. Quitting a pager triggers
6201 work both in Unix and Windows correctly. Quitting a pager triggers
6197 an IOError/broken pipe in Unix, and in windows not finding a pager
6202 an IOError/broken pipe in Unix, and in windows not finding a pager
6198 is also an IOError, so I had to actually look at the return value
6203 is also an IOError, so I had to actually look at the return value
6199 of the exception, not just the exception itself. Should be ok now.
6204 of the exception, not just the exception itself. Should be ok now.
6200
6205
6201 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6206 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6202 modified to allow case-insensitive color scheme changes.
6207 modified to allow case-insensitive color scheme changes.
6203
6208
6204 2002-02-09 Fernando Perez <fperez@colorado.edu>
6209 2002-02-09 Fernando Perez <fperez@colorado.edu>
6205
6210
6206 * IPython/genutils.py (native_line_ends): new function to leave
6211 * IPython/genutils.py (native_line_ends): new function to leave
6207 user config files with os-native line-endings.
6212 user config files with os-native line-endings.
6208
6213
6209 * README and manual updates.
6214 * README and manual updates.
6210
6215
6211 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6216 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6212 instead of StringType to catch Unicode strings.
6217 instead of StringType to catch Unicode strings.
6213
6218
6214 * IPython/genutils.py (filefind): fixed bug for paths with
6219 * IPython/genutils.py (filefind): fixed bug for paths with
6215 embedded spaces (very common in Windows).
6220 embedded spaces (very common in Windows).
6216
6221
6217 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6222 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6218 files under Windows, so that they get automatically associated
6223 files under Windows, so that they get automatically associated
6219 with a text editor. Windows makes it a pain to handle
6224 with a text editor. Windows makes it a pain to handle
6220 extension-less files.
6225 extension-less files.
6221
6226
6222 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6227 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6223 warning about readline only occur for Posix. In Windows there's no
6228 warning about readline only occur for Posix. In Windows there's no
6224 way to get readline, so why bother with the warning.
6229 way to get readline, so why bother with the warning.
6225
6230
6226 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6231 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6227 for __str__ instead of dir(self), since dir() changed in 2.2.
6232 for __str__ instead of dir(self), since dir() changed in 2.2.
6228
6233
6229 * Ported to Windows! Tested on XP, I suspect it should work fine
6234 * Ported to Windows! Tested on XP, I suspect it should work fine
6230 on NT/2000, but I don't think it will work on 98 et al. That
6235 on NT/2000, but I don't think it will work on 98 et al. That
6231 series of Windows is such a piece of junk anyway that I won't try
6236 series of Windows is such a piece of junk anyway that I won't try
6232 porting it there. The XP port was straightforward, showed a few
6237 porting it there. The XP port was straightforward, showed a few
6233 bugs here and there (fixed all), in particular some string
6238 bugs here and there (fixed all), in particular some string
6234 handling stuff which required considering Unicode strings (which
6239 handling stuff which required considering Unicode strings (which
6235 Windows uses). This is good, but hasn't been too tested :) No
6240 Windows uses). This is good, but hasn't been too tested :) No
6236 fancy installer yet, I'll put a note in the manual so people at
6241 fancy installer yet, I'll put a note in the manual so people at
6237 least make manually a shortcut.
6242 least make manually a shortcut.
6238
6243
6239 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6244 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6240 into a single one, "colors". This now controls both prompt and
6245 into a single one, "colors". This now controls both prompt and
6241 exception color schemes, and can be changed both at startup
6246 exception color schemes, and can be changed both at startup
6242 (either via command-line switches or via ipythonrc files) and at
6247 (either via command-line switches or via ipythonrc files) and at
6243 runtime, with @colors.
6248 runtime, with @colors.
6244 (Magic.magic_run): renamed @prun to @run and removed the old
6249 (Magic.magic_run): renamed @prun to @run and removed the old
6245 @run. The two were too similar to warrant keeping both.
6250 @run. The two were too similar to warrant keeping both.
6246
6251
6247 2002-02-03 Fernando Perez <fperez@colorado.edu>
6252 2002-02-03 Fernando Perez <fperez@colorado.edu>
6248
6253
6249 * IPython/iplib.py (install_first_time): Added comment on how to
6254 * IPython/iplib.py (install_first_time): Added comment on how to
6250 configure the color options for first-time users. Put a <return>
6255 configure the color options for first-time users. Put a <return>
6251 request at the end so that small-terminal users get a chance to
6256 request at the end so that small-terminal users get a chance to
6252 read the startup info.
6257 read the startup info.
6253
6258
6254 2002-01-23 Fernando Perez <fperez@colorado.edu>
6259 2002-01-23 Fernando Perez <fperez@colorado.edu>
6255
6260
6256 * IPython/iplib.py (CachedOutput.update): Changed output memory
6261 * IPython/iplib.py (CachedOutput.update): Changed output memory
6257 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6262 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6258 input history we still use _i. Did this b/c these variable are
6263 input history we still use _i. Did this b/c these variable are
6259 very commonly used in interactive work, so the less we need to
6264 very commonly used in interactive work, so the less we need to
6260 type the better off we are.
6265 type the better off we are.
6261 (Magic.magic_prun): updated @prun to better handle the namespaces
6266 (Magic.magic_prun): updated @prun to better handle the namespaces
6262 the file will run in, including a fix for __name__ not being set
6267 the file will run in, including a fix for __name__ not being set
6263 before.
6268 before.
6264
6269
6265 2002-01-20 Fernando Perez <fperez@colorado.edu>
6270 2002-01-20 Fernando Perez <fperez@colorado.edu>
6266
6271
6267 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6272 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6268 extra garbage for Python 2.2. Need to look more carefully into
6273 extra garbage for Python 2.2. Need to look more carefully into
6269 this later.
6274 this later.
6270
6275
6271 2002-01-19 Fernando Perez <fperez@colorado.edu>
6276 2002-01-19 Fernando Perez <fperez@colorado.edu>
6272
6277
6273 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6278 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6274 display SyntaxError exceptions properly formatted when they occur
6279 display SyntaxError exceptions properly formatted when they occur
6275 (they can be triggered by imported code).
6280 (they can be triggered by imported code).
6276
6281
6277 2002-01-18 Fernando Perez <fperez@colorado.edu>
6282 2002-01-18 Fernando Perez <fperez@colorado.edu>
6278
6283
6279 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6284 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6280 SyntaxError exceptions are reported nicely formatted, instead of
6285 SyntaxError exceptions are reported nicely formatted, instead of
6281 spitting out only offset information as before.
6286 spitting out only offset information as before.
6282 (Magic.magic_prun): Added the @prun function for executing
6287 (Magic.magic_prun): Added the @prun function for executing
6283 programs with command line args inside IPython.
6288 programs with command line args inside IPython.
6284
6289
6285 2002-01-16 Fernando Perez <fperez@colorado.edu>
6290 2002-01-16 Fernando Perez <fperez@colorado.edu>
6286
6291
6287 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6292 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6288 to *not* include the last item given in a range. This brings their
6293 to *not* include the last item given in a range. This brings their
6289 behavior in line with Python's slicing:
6294 behavior in line with Python's slicing:
6290 a[n1:n2] -> a[n1]...a[n2-1]
6295 a[n1:n2] -> a[n1]...a[n2-1]
6291 It may be a bit less convenient, but I prefer to stick to Python's
6296 It may be a bit less convenient, but I prefer to stick to Python's
6292 conventions *everywhere*, so users never have to wonder.
6297 conventions *everywhere*, so users never have to wonder.
6293 (Magic.magic_macro): Added @macro function to ease the creation of
6298 (Magic.magic_macro): Added @macro function to ease the creation of
6294 macros.
6299 macros.
6295
6300
6296 2002-01-05 Fernando Perez <fperez@colorado.edu>
6301 2002-01-05 Fernando Perez <fperez@colorado.edu>
6297
6302
6298 * Released 0.2.4.
6303 * Released 0.2.4.
6299
6304
6300 * IPython/iplib.py (Magic.magic_pdef):
6305 * IPython/iplib.py (Magic.magic_pdef):
6301 (InteractiveShell.safe_execfile): report magic lines and error
6306 (InteractiveShell.safe_execfile): report magic lines and error
6302 lines without line numbers so one can easily copy/paste them for
6307 lines without line numbers so one can easily copy/paste them for
6303 re-execution.
6308 re-execution.
6304
6309
6305 * Updated manual with recent changes.
6310 * Updated manual with recent changes.
6306
6311
6307 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6312 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6308 docstring printing when class? is called. Very handy for knowing
6313 docstring printing when class? is called. Very handy for knowing
6309 how to create class instances (as long as __init__ is well
6314 how to create class instances (as long as __init__ is well
6310 documented, of course :)
6315 documented, of course :)
6311 (Magic.magic_doc): print both class and constructor docstrings.
6316 (Magic.magic_doc): print both class and constructor docstrings.
6312 (Magic.magic_pdef): give constructor info if passed a class and
6317 (Magic.magic_pdef): give constructor info if passed a class and
6313 __call__ info for callable object instances.
6318 __call__ info for callable object instances.
6314
6319
6315 2002-01-04 Fernando Perez <fperez@colorado.edu>
6320 2002-01-04 Fernando Perez <fperez@colorado.edu>
6316
6321
6317 * Made deep_reload() off by default. It doesn't always work
6322 * Made deep_reload() off by default. It doesn't always work
6318 exactly as intended, so it's probably safer to have it off. It's
6323 exactly as intended, so it's probably safer to have it off. It's
6319 still available as dreload() anyway, so nothing is lost.
6324 still available as dreload() anyway, so nothing is lost.
6320
6325
6321 2002-01-02 Fernando Perez <fperez@colorado.edu>
6326 2002-01-02 Fernando Perez <fperez@colorado.edu>
6322
6327
6323 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6328 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6324 so I wanted an updated release).
6329 so I wanted an updated release).
6325
6330
6326 2001-12-27 Fernando Perez <fperez@colorado.edu>
6331 2001-12-27 Fernando Perez <fperez@colorado.edu>
6327
6332
6328 * IPython/iplib.py (InteractiveShell.interact): Added the original
6333 * IPython/iplib.py (InteractiveShell.interact): Added the original
6329 code from 'code.py' for this module in order to change the
6334 code from 'code.py' for this module in order to change the
6330 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6335 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6331 the history cache would break when the user hit Ctrl-C, and
6336 the history cache would break when the user hit Ctrl-C, and
6332 interact() offers no way to add any hooks to it.
6337 interact() offers no way to add any hooks to it.
6333
6338
6334 2001-12-23 Fernando Perez <fperez@colorado.edu>
6339 2001-12-23 Fernando Perez <fperez@colorado.edu>
6335
6340
6336 * setup.py: added check for 'MANIFEST' before trying to remove
6341 * setup.py: added check for 'MANIFEST' before trying to remove
6337 it. Thanks to Sean Reifschneider.
6342 it. Thanks to Sean Reifschneider.
6338
6343
6339 2001-12-22 Fernando Perez <fperez@colorado.edu>
6344 2001-12-22 Fernando Perez <fperez@colorado.edu>
6340
6345
6341 * Released 0.2.2.
6346 * Released 0.2.2.
6342
6347
6343 * Finished (reasonably) writing the manual. Later will add the
6348 * Finished (reasonably) writing the manual. Later will add the
6344 python-standard navigation stylesheets, but for the time being
6349 python-standard navigation stylesheets, but for the time being
6345 it's fairly complete. Distribution will include html and pdf
6350 it's fairly complete. Distribution will include html and pdf
6346 versions.
6351 versions.
6347
6352
6348 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6353 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6349 (MayaVi author).
6354 (MayaVi author).
6350
6355
6351 2001-12-21 Fernando Perez <fperez@colorado.edu>
6356 2001-12-21 Fernando Perez <fperez@colorado.edu>
6352
6357
6353 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6358 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6354 good public release, I think (with the manual and the distutils
6359 good public release, I think (with the manual and the distutils
6355 installer). The manual can use some work, but that can go
6360 installer). The manual can use some work, but that can go
6356 slowly. Otherwise I think it's quite nice for end users. Next
6361 slowly. Otherwise I think it's quite nice for end users. Next
6357 summer, rewrite the guts of it...
6362 summer, rewrite the guts of it...
6358
6363
6359 * Changed format of ipythonrc files to use whitespace as the
6364 * Changed format of ipythonrc files to use whitespace as the
6360 separator instead of an explicit '='. Cleaner.
6365 separator instead of an explicit '='. Cleaner.
6361
6366
6362 2001-12-20 Fernando Perez <fperez@colorado.edu>
6367 2001-12-20 Fernando Perez <fperez@colorado.edu>
6363
6368
6364 * Started a manual in LyX. For now it's just a quick merge of the
6369 * Started a manual in LyX. For now it's just a quick merge of the
6365 various internal docstrings and READMEs. Later it may grow into a
6370 various internal docstrings and READMEs. Later it may grow into a
6366 nice, full-blown manual.
6371 nice, full-blown manual.
6367
6372
6368 * Set up a distutils based installer. Installation should now be
6373 * Set up a distutils based installer. Installation should now be
6369 trivially simple for end-users.
6374 trivially simple for end-users.
6370
6375
6371 2001-12-11 Fernando Perez <fperez@colorado.edu>
6376 2001-12-11 Fernando Perez <fperez@colorado.edu>
6372
6377
6373 * Released 0.2.0. First public release, announced it at
6378 * Released 0.2.0. First public release, announced it at
6374 comp.lang.python. From now on, just bugfixes...
6379 comp.lang.python. From now on, just bugfixes...
6375
6380
6376 * Went through all the files, set copyright/license notices and
6381 * Went through all the files, set copyright/license notices and
6377 cleaned up things. Ready for release.
6382 cleaned up things. Ready for release.
6378
6383
6379 2001-12-10 Fernando Perez <fperez@colorado.edu>
6384 2001-12-10 Fernando Perez <fperez@colorado.edu>
6380
6385
6381 * Changed the first-time installer not to use tarfiles. It's more
6386 * Changed the first-time installer not to use tarfiles. It's more
6382 robust now and less unix-dependent. Also makes it easier for
6387 robust now and less unix-dependent. Also makes it easier for
6383 people to later upgrade versions.
6388 people to later upgrade versions.
6384
6389
6385 * Changed @exit to @abort to reflect the fact that it's pretty
6390 * Changed @exit to @abort to reflect the fact that it's pretty
6386 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6391 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6387 becomes significant only when IPyhton is embedded: in that case,
6392 becomes significant only when IPyhton is embedded: in that case,
6388 C-D closes IPython only, but @abort kills the enclosing program
6393 C-D closes IPython only, but @abort kills the enclosing program
6389 too (unless it had called IPython inside a try catching
6394 too (unless it had called IPython inside a try catching
6390 SystemExit).
6395 SystemExit).
6391
6396
6392 * Created Shell module which exposes the actuall IPython Shell
6397 * Created Shell module which exposes the actuall IPython Shell
6393 classes, currently the normal and the embeddable one. This at
6398 classes, currently the normal and the embeddable one. This at
6394 least offers a stable interface we won't need to change when
6399 least offers a stable interface we won't need to change when
6395 (later) the internals are rewritten. That rewrite will be confined
6400 (later) the internals are rewritten. That rewrite will be confined
6396 to iplib and ipmaker, but the Shell interface should remain as is.
6401 to iplib and ipmaker, but the Shell interface should remain as is.
6397
6402
6398 * Added embed module which offers an embeddable IPShell object,
6403 * Added embed module which offers an embeddable IPShell object,
6399 useful to fire up IPython *inside* a running program. Great for
6404 useful to fire up IPython *inside* a running program. Great for
6400 debugging or dynamical data analysis.
6405 debugging or dynamical data analysis.
6401
6406
6402 2001-12-08 Fernando Perez <fperez@colorado.edu>
6407 2001-12-08 Fernando Perez <fperez@colorado.edu>
6403
6408
6404 * Fixed small bug preventing seeing info from methods of defined
6409 * Fixed small bug preventing seeing info from methods of defined
6405 objects (incorrect namespace in _ofind()).
6410 objects (incorrect namespace in _ofind()).
6406
6411
6407 * Documentation cleanup. Moved the main usage docstrings to a
6412 * Documentation cleanup. Moved the main usage docstrings to a
6408 separate file, usage.py (cleaner to maintain, and hopefully in the
6413 separate file, usage.py (cleaner to maintain, and hopefully in the
6409 future some perlpod-like way of producing interactive, man and
6414 future some perlpod-like way of producing interactive, man and
6410 html docs out of it will be found).
6415 html docs out of it will be found).
6411
6416
6412 * Added @profile to see your profile at any time.
6417 * Added @profile to see your profile at any time.
6413
6418
6414 * Added @p as an alias for 'print'. It's especially convenient if
6419 * Added @p as an alias for 'print'. It's especially convenient if
6415 using automagic ('p x' prints x).
6420 using automagic ('p x' prints x).
6416
6421
6417 * Small cleanups and fixes after a pychecker run.
6422 * Small cleanups and fixes after a pychecker run.
6418
6423
6419 * Changed the @cd command to handle @cd - and @cd -<n> for
6424 * Changed the @cd command to handle @cd - and @cd -<n> for
6420 visiting any directory in _dh.
6425 visiting any directory in _dh.
6421
6426
6422 * Introduced _dh, a history of visited directories. @dhist prints
6427 * Introduced _dh, a history of visited directories. @dhist prints
6423 it out with numbers.
6428 it out with numbers.
6424
6429
6425 2001-12-07 Fernando Perez <fperez@colorado.edu>
6430 2001-12-07 Fernando Perez <fperez@colorado.edu>
6426
6431
6427 * Released 0.1.22
6432 * Released 0.1.22
6428
6433
6429 * Made initialization a bit more robust against invalid color
6434 * Made initialization a bit more robust against invalid color
6430 options in user input (exit, not traceback-crash).
6435 options in user input (exit, not traceback-crash).
6431
6436
6432 * Changed the bug crash reporter to write the report only in the
6437 * Changed the bug crash reporter to write the report only in the
6433 user's .ipython directory. That way IPython won't litter people's
6438 user's .ipython directory. That way IPython won't litter people's
6434 hard disks with crash files all over the place. Also print on
6439 hard disks with crash files all over the place. Also print on
6435 screen the necessary mail command.
6440 screen the necessary mail command.
6436
6441
6437 * With the new ultraTB, implemented LightBG color scheme for light
6442 * With the new ultraTB, implemented LightBG color scheme for light
6438 background terminals. A lot of people like white backgrounds, so I
6443 background terminals. A lot of people like white backgrounds, so I
6439 guess we should at least give them something readable.
6444 guess we should at least give them something readable.
6440
6445
6441 2001-12-06 Fernando Perez <fperez@colorado.edu>
6446 2001-12-06 Fernando Perez <fperez@colorado.edu>
6442
6447
6443 * Modified the structure of ultraTB. Now there's a proper class
6448 * Modified the structure of ultraTB. Now there's a proper class
6444 for tables of color schemes which allow adding schemes easily and
6449 for tables of color schemes which allow adding schemes easily and
6445 switching the active scheme without creating a new instance every
6450 switching the active scheme without creating a new instance every
6446 time (which was ridiculous). The syntax for creating new schemes
6451 time (which was ridiculous). The syntax for creating new schemes
6447 is also cleaner. I think ultraTB is finally done, with a clean
6452 is also cleaner. I think ultraTB is finally done, with a clean
6448 class structure. Names are also much cleaner (now there's proper
6453 class structure. Names are also much cleaner (now there's proper
6449 color tables, no need for every variable to also have 'color' in
6454 color tables, no need for every variable to also have 'color' in
6450 its name).
6455 its name).
6451
6456
6452 * Broke down genutils into separate files. Now genutils only
6457 * Broke down genutils into separate files. Now genutils only
6453 contains utility functions, and classes have been moved to their
6458 contains utility functions, and classes have been moved to their
6454 own files (they had enough independent functionality to warrant
6459 own files (they had enough independent functionality to warrant
6455 it): ConfigLoader, OutputTrap, Struct.
6460 it): ConfigLoader, OutputTrap, Struct.
6456
6461
6457 2001-12-05 Fernando Perez <fperez@colorado.edu>
6462 2001-12-05 Fernando Perez <fperez@colorado.edu>
6458
6463
6459 * IPython turns 21! Released version 0.1.21, as a candidate for
6464 * IPython turns 21! Released version 0.1.21, as a candidate for
6460 public consumption. If all goes well, release in a few days.
6465 public consumption. If all goes well, release in a few days.
6461
6466
6462 * Fixed path bug (files in Extensions/ directory wouldn't be found
6467 * Fixed path bug (files in Extensions/ directory wouldn't be found
6463 unless IPython/ was explicitly in sys.path).
6468 unless IPython/ was explicitly in sys.path).
6464
6469
6465 * Extended the FlexCompleter class as MagicCompleter to allow
6470 * Extended the FlexCompleter class as MagicCompleter to allow
6466 completion of @-starting lines.
6471 completion of @-starting lines.
6467
6472
6468 * Created __release__.py file as a central repository for release
6473 * Created __release__.py file as a central repository for release
6469 info that other files can read from.
6474 info that other files can read from.
6470
6475
6471 * Fixed small bug in logging: when logging was turned on in
6476 * Fixed small bug in logging: when logging was turned on in
6472 mid-session, old lines with special meanings (!@?) were being
6477 mid-session, old lines with special meanings (!@?) were being
6473 logged without the prepended comment, which is necessary since
6478 logged without the prepended comment, which is necessary since
6474 they are not truly valid python syntax. This should make session
6479 they are not truly valid python syntax. This should make session
6475 restores produce less errors.
6480 restores produce less errors.
6476
6481
6477 * The namespace cleanup forced me to make a FlexCompleter class
6482 * The namespace cleanup forced me to make a FlexCompleter class
6478 which is nothing but a ripoff of rlcompleter, but with selectable
6483 which is nothing but a ripoff of rlcompleter, but with selectable
6479 namespace (rlcompleter only works in __main__.__dict__). I'll try
6484 namespace (rlcompleter only works in __main__.__dict__). I'll try
6480 to submit a note to the authors to see if this change can be
6485 to submit a note to the authors to see if this change can be
6481 incorporated in future rlcompleter releases (Dec.6: done)
6486 incorporated in future rlcompleter releases (Dec.6: done)
6482
6487
6483 * More fixes to namespace handling. It was a mess! Now all
6488 * More fixes to namespace handling. It was a mess! Now all
6484 explicit references to __main__.__dict__ are gone (except when
6489 explicit references to __main__.__dict__ are gone (except when
6485 really needed) and everything is handled through the namespace
6490 really needed) and everything is handled through the namespace
6486 dicts in the IPython instance. We seem to be getting somewhere
6491 dicts in the IPython instance. We seem to be getting somewhere
6487 with this, finally...
6492 with this, finally...
6488
6493
6489 * Small documentation updates.
6494 * Small documentation updates.
6490
6495
6491 * Created the Extensions directory under IPython (with an
6496 * Created the Extensions directory under IPython (with an
6492 __init__.py). Put the PhysicalQ stuff there. This directory should
6497 __init__.py). Put the PhysicalQ stuff there. This directory should
6493 be used for all special-purpose extensions.
6498 be used for all special-purpose extensions.
6494
6499
6495 * File renaming:
6500 * File renaming:
6496 ipythonlib --> ipmaker
6501 ipythonlib --> ipmaker
6497 ipplib --> iplib
6502 ipplib --> iplib
6498 This makes a bit more sense in terms of what these files actually do.
6503 This makes a bit more sense in terms of what these files actually do.
6499
6504
6500 * Moved all the classes and functions in ipythonlib to ipplib, so
6505 * Moved all the classes and functions in ipythonlib to ipplib, so
6501 now ipythonlib only has make_IPython(). This will ease up its
6506 now ipythonlib only has make_IPython(). This will ease up its
6502 splitting in smaller functional chunks later.
6507 splitting in smaller functional chunks later.
6503
6508
6504 * Cleaned up (done, I think) output of @whos. Better column
6509 * Cleaned up (done, I think) output of @whos. Better column
6505 formatting, and now shows str(var) for as much as it can, which is
6510 formatting, and now shows str(var) for as much as it can, which is
6506 typically what one gets with a 'print var'.
6511 typically what one gets with a 'print var'.
6507
6512
6508 2001-12-04 Fernando Perez <fperez@colorado.edu>
6513 2001-12-04 Fernando Perez <fperez@colorado.edu>
6509
6514
6510 * Fixed namespace problems. Now builtin/IPyhton/user names get
6515 * Fixed namespace problems. Now builtin/IPyhton/user names get
6511 properly reported in their namespace. Internal namespace handling
6516 properly reported in their namespace. Internal namespace handling
6512 is finally getting decent (not perfect yet, but much better than
6517 is finally getting decent (not perfect yet, but much better than
6513 the ad-hoc mess we had).
6518 the ad-hoc mess we had).
6514
6519
6515 * Removed -exit option. If people just want to run a python
6520 * Removed -exit option. If people just want to run a python
6516 script, that's what the normal interpreter is for. Less
6521 script, that's what the normal interpreter is for. Less
6517 unnecessary options, less chances for bugs.
6522 unnecessary options, less chances for bugs.
6518
6523
6519 * Added a crash handler which generates a complete post-mortem if
6524 * Added a crash handler which generates a complete post-mortem if
6520 IPython crashes. This will help a lot in tracking bugs down the
6525 IPython crashes. This will help a lot in tracking bugs down the
6521 road.
6526 road.
6522
6527
6523 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6528 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6524 which were boud to functions being reassigned would bypass the
6529 which were boud to functions being reassigned would bypass the
6525 logger, breaking the sync of _il with the prompt counter. This
6530 logger, breaking the sync of _il with the prompt counter. This
6526 would then crash IPython later when a new line was logged.
6531 would then crash IPython later when a new line was logged.
6527
6532
6528 2001-12-02 Fernando Perez <fperez@colorado.edu>
6533 2001-12-02 Fernando Perez <fperez@colorado.edu>
6529
6534
6530 * Made IPython a package. This means people don't have to clutter
6535 * Made IPython a package. This means people don't have to clutter
6531 their sys.path with yet another directory. Changed the INSTALL
6536 their sys.path with yet another directory. Changed the INSTALL
6532 file accordingly.
6537 file accordingly.
6533
6538
6534 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6539 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6535 sorts its output (so @who shows it sorted) and @whos formats the
6540 sorts its output (so @who shows it sorted) and @whos formats the
6536 table according to the width of the first column. Nicer, easier to
6541 table according to the width of the first column. Nicer, easier to
6537 read. Todo: write a generic table_format() which takes a list of
6542 read. Todo: write a generic table_format() which takes a list of
6538 lists and prints it nicely formatted, with optional row/column
6543 lists and prints it nicely formatted, with optional row/column
6539 separators and proper padding and justification.
6544 separators and proper padding and justification.
6540
6545
6541 * Released 0.1.20
6546 * Released 0.1.20
6542
6547
6543 * Fixed bug in @log which would reverse the inputcache list (a
6548 * Fixed bug in @log which would reverse the inputcache list (a
6544 copy operation was missing).
6549 copy operation was missing).
6545
6550
6546 * Code cleanup. @config was changed to use page(). Better, since
6551 * Code cleanup. @config was changed to use page(). Better, since
6547 its output is always quite long.
6552 its output is always quite long.
6548
6553
6549 * Itpl is back as a dependency. I was having too many problems
6554 * Itpl is back as a dependency. I was having too many problems
6550 getting the parametric aliases to work reliably, and it's just
6555 getting the parametric aliases to work reliably, and it's just
6551 easier to code weird string operations with it than playing %()s
6556 easier to code weird string operations with it than playing %()s
6552 games. It's only ~6k, so I don't think it's too big a deal.
6557 games. It's only ~6k, so I don't think it's too big a deal.
6553
6558
6554 * Found (and fixed) a very nasty bug with history. !lines weren't
6559 * Found (and fixed) a very nasty bug with history. !lines weren't
6555 getting cached, and the out of sync caches would crash
6560 getting cached, and the out of sync caches would crash
6556 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6561 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6557 division of labor a bit better. Bug fixed, cleaner structure.
6562 division of labor a bit better. Bug fixed, cleaner structure.
6558
6563
6559 2001-12-01 Fernando Perez <fperez@colorado.edu>
6564 2001-12-01 Fernando Perez <fperez@colorado.edu>
6560
6565
6561 * Released 0.1.19
6566 * Released 0.1.19
6562
6567
6563 * Added option -n to @hist to prevent line number printing. Much
6568 * Added option -n to @hist to prevent line number printing. Much
6564 easier to copy/paste code this way.
6569 easier to copy/paste code this way.
6565
6570
6566 * Created global _il to hold the input list. Allows easy
6571 * Created global _il to hold the input list. Allows easy
6567 re-execution of blocks of code by slicing it (inspired by Janko's
6572 re-execution of blocks of code by slicing it (inspired by Janko's
6568 comment on 'macros').
6573 comment on 'macros').
6569
6574
6570 * Small fixes and doc updates.
6575 * Small fixes and doc updates.
6571
6576
6572 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6577 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6573 much too fragile with automagic. Handles properly multi-line
6578 much too fragile with automagic. Handles properly multi-line
6574 statements and takes parameters.
6579 statements and takes parameters.
6575
6580
6576 2001-11-30 Fernando Perez <fperez@colorado.edu>
6581 2001-11-30 Fernando Perez <fperez@colorado.edu>
6577
6582
6578 * Version 0.1.18 released.
6583 * Version 0.1.18 released.
6579
6584
6580 * Fixed nasty namespace bug in initial module imports.
6585 * Fixed nasty namespace bug in initial module imports.
6581
6586
6582 * Added copyright/license notes to all code files (except
6587 * Added copyright/license notes to all code files (except
6583 DPyGetOpt). For the time being, LGPL. That could change.
6588 DPyGetOpt). For the time being, LGPL. That could change.
6584
6589
6585 * Rewrote a much nicer README, updated INSTALL, cleaned up
6590 * Rewrote a much nicer README, updated INSTALL, cleaned up
6586 ipythonrc-* samples.
6591 ipythonrc-* samples.
6587
6592
6588 * Overall code/documentation cleanup. Basically ready for
6593 * Overall code/documentation cleanup. Basically ready for
6589 release. Only remaining thing: licence decision (LGPL?).
6594 release. Only remaining thing: licence decision (LGPL?).
6590
6595
6591 * Converted load_config to a class, ConfigLoader. Now recursion
6596 * Converted load_config to a class, ConfigLoader. Now recursion
6592 control is better organized. Doesn't include the same file twice.
6597 control is better organized. Doesn't include the same file twice.
6593
6598
6594 2001-11-29 Fernando Perez <fperez@colorado.edu>
6599 2001-11-29 Fernando Perez <fperez@colorado.edu>
6595
6600
6596 * Got input history working. Changed output history variables from
6601 * Got input history working. Changed output history variables from
6597 _p to _o so that _i is for input and _o for output. Just cleaner
6602 _p to _o so that _i is for input and _o for output. Just cleaner
6598 convention.
6603 convention.
6599
6604
6600 * Implemented parametric aliases. This pretty much allows the
6605 * Implemented parametric aliases. This pretty much allows the
6601 alias system to offer full-blown shell convenience, I think.
6606 alias system to offer full-blown shell convenience, I think.
6602
6607
6603 * Version 0.1.17 released, 0.1.18 opened.
6608 * Version 0.1.17 released, 0.1.18 opened.
6604
6609
6605 * dot_ipython/ipythonrc (alias): added documentation.
6610 * dot_ipython/ipythonrc (alias): added documentation.
6606 (xcolor): Fixed small bug (xcolors -> xcolor)
6611 (xcolor): Fixed small bug (xcolors -> xcolor)
6607
6612
6608 * Changed the alias system. Now alias is a magic command to define
6613 * Changed the alias system. Now alias is a magic command to define
6609 aliases just like the shell. Rationale: the builtin magics should
6614 aliases just like the shell. Rationale: the builtin magics should
6610 be there for things deeply connected to IPython's
6615 be there for things deeply connected to IPython's
6611 architecture. And this is a much lighter system for what I think
6616 architecture. And this is a much lighter system for what I think
6612 is the really important feature: allowing users to define quickly
6617 is the really important feature: allowing users to define quickly
6613 magics that will do shell things for them, so they can customize
6618 magics that will do shell things for them, so they can customize
6614 IPython easily to match their work habits. If someone is really
6619 IPython easily to match their work habits. If someone is really
6615 desperate to have another name for a builtin alias, they can
6620 desperate to have another name for a builtin alias, they can
6616 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6621 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6617 works.
6622 works.
6618
6623
6619 2001-11-28 Fernando Perez <fperez@colorado.edu>
6624 2001-11-28 Fernando Perez <fperez@colorado.edu>
6620
6625
6621 * Changed @file so that it opens the source file at the proper
6626 * Changed @file so that it opens the source file at the proper
6622 line. Since it uses less, if your EDITOR environment is
6627 line. Since it uses less, if your EDITOR environment is
6623 configured, typing v will immediately open your editor of choice
6628 configured, typing v will immediately open your editor of choice
6624 right at the line where the object is defined. Not as quick as
6629 right at the line where the object is defined. Not as quick as
6625 having a direct @edit command, but for all intents and purposes it
6630 having a direct @edit command, but for all intents and purposes it
6626 works. And I don't have to worry about writing @edit to deal with
6631 works. And I don't have to worry about writing @edit to deal with
6627 all the editors, less does that.
6632 all the editors, less does that.
6628
6633
6629 * Version 0.1.16 released, 0.1.17 opened.
6634 * Version 0.1.16 released, 0.1.17 opened.
6630
6635
6631 * Fixed some nasty bugs in the page/page_dumb combo that could
6636 * Fixed some nasty bugs in the page/page_dumb combo that could
6632 crash IPython.
6637 crash IPython.
6633
6638
6634 2001-11-27 Fernando Perez <fperez@colorado.edu>
6639 2001-11-27 Fernando Perez <fperez@colorado.edu>
6635
6640
6636 * Version 0.1.15 released, 0.1.16 opened.
6641 * Version 0.1.15 released, 0.1.16 opened.
6637
6642
6638 * Finally got ? and ?? to work for undefined things: now it's
6643 * Finally got ? and ?? to work for undefined things: now it's
6639 possible to type {}.get? and get information about the get method
6644 possible to type {}.get? and get information about the get method
6640 of dicts, or os.path? even if only os is defined (so technically
6645 of dicts, or os.path? even if only os is defined (so technically
6641 os.path isn't). Works at any level. For example, after import os,
6646 os.path isn't). Works at any level. For example, after import os,
6642 os?, os.path?, os.path.abspath? all work. This is great, took some
6647 os?, os.path?, os.path.abspath? all work. This is great, took some
6643 work in _ofind.
6648 work in _ofind.
6644
6649
6645 * Fixed more bugs with logging. The sanest way to do it was to add
6650 * Fixed more bugs with logging. The sanest way to do it was to add
6646 to @log a 'mode' parameter. Killed two in one shot (this mode
6651 to @log a 'mode' parameter. Killed two in one shot (this mode
6647 option was a request of Janko's). I think it's finally clean
6652 option was a request of Janko's). I think it's finally clean
6648 (famous last words).
6653 (famous last words).
6649
6654
6650 * Added a page_dumb() pager which does a decent job of paging on
6655 * Added a page_dumb() pager which does a decent job of paging on
6651 screen, if better things (like less) aren't available. One less
6656 screen, if better things (like less) aren't available. One less
6652 unix dependency (someday maybe somebody will port this to
6657 unix dependency (someday maybe somebody will port this to
6653 windows).
6658 windows).
6654
6659
6655 * Fixed problem in magic_log: would lock of logging out if log
6660 * Fixed problem in magic_log: would lock of logging out if log
6656 creation failed (because it would still think it had succeeded).
6661 creation failed (because it would still think it had succeeded).
6657
6662
6658 * Improved the page() function using curses to auto-detect screen
6663 * Improved the page() function using curses to auto-detect screen
6659 size. Now it can make a much better decision on whether to print
6664 size. Now it can make a much better decision on whether to print
6660 or page a string. Option screen_length was modified: a value 0
6665 or page a string. Option screen_length was modified: a value 0
6661 means auto-detect, and that's the default now.
6666 means auto-detect, and that's the default now.
6662
6667
6663 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6668 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6664 go out. I'll test it for a few days, then talk to Janko about
6669 go out. I'll test it for a few days, then talk to Janko about
6665 licences and announce it.
6670 licences and announce it.
6666
6671
6667 * Fixed the length of the auto-generated ---> prompt which appears
6672 * Fixed the length of the auto-generated ---> prompt which appears
6668 for auto-parens and auto-quotes. Getting this right isn't trivial,
6673 for auto-parens and auto-quotes. Getting this right isn't trivial,
6669 with all the color escapes, different prompt types and optional
6674 with all the color escapes, different prompt types and optional
6670 separators. But it seems to be working in all the combinations.
6675 separators. But it seems to be working in all the combinations.
6671
6676
6672 2001-11-26 Fernando Perez <fperez@colorado.edu>
6677 2001-11-26 Fernando Perez <fperez@colorado.edu>
6673
6678
6674 * Wrote a regexp filter to get option types from the option names
6679 * Wrote a regexp filter to get option types from the option names
6675 string. This eliminates the need to manually keep two duplicate
6680 string. This eliminates the need to manually keep two duplicate
6676 lists.
6681 lists.
6677
6682
6678 * Removed the unneeded check_option_names. Now options are handled
6683 * Removed the unneeded check_option_names. Now options are handled
6679 in a much saner manner and it's easy to visually check that things
6684 in a much saner manner and it's easy to visually check that things
6680 are ok.
6685 are ok.
6681
6686
6682 * Updated version numbers on all files I modified to carry a
6687 * Updated version numbers on all files I modified to carry a
6683 notice so Janko and Nathan have clear version markers.
6688 notice so Janko and Nathan have clear version markers.
6684
6689
6685 * Updated docstring for ultraTB with my changes. I should send
6690 * Updated docstring for ultraTB with my changes. I should send
6686 this to Nathan.
6691 this to Nathan.
6687
6692
6688 * Lots of small fixes. Ran everything through pychecker again.
6693 * Lots of small fixes. Ran everything through pychecker again.
6689
6694
6690 * Made loading of deep_reload an cmd line option. If it's not too
6695 * Made loading of deep_reload an cmd line option. If it's not too
6691 kosher, now people can just disable it. With -nodeep_reload it's
6696 kosher, now people can just disable it. With -nodeep_reload it's
6692 still available as dreload(), it just won't overwrite reload().
6697 still available as dreload(), it just won't overwrite reload().
6693
6698
6694 * Moved many options to the no| form (-opt and -noopt
6699 * Moved many options to the no| form (-opt and -noopt
6695 accepted). Cleaner.
6700 accepted). Cleaner.
6696
6701
6697 * Changed magic_log so that if called with no parameters, it uses
6702 * Changed magic_log so that if called with no parameters, it uses
6698 'rotate' mode. That way auto-generated logs aren't automatically
6703 'rotate' mode. That way auto-generated logs aren't automatically
6699 over-written. For normal logs, now a backup is made if it exists
6704 over-written. For normal logs, now a backup is made if it exists
6700 (only 1 level of backups). A new 'backup' mode was added to the
6705 (only 1 level of backups). A new 'backup' mode was added to the
6701 Logger class to support this. This was a request by Janko.
6706 Logger class to support this. This was a request by Janko.
6702
6707
6703 * Added @logoff/@logon to stop/restart an active log.
6708 * Added @logoff/@logon to stop/restart an active log.
6704
6709
6705 * Fixed a lot of bugs in log saving/replay. It was pretty
6710 * Fixed a lot of bugs in log saving/replay. It was pretty
6706 broken. Now special lines (!@,/) appear properly in the command
6711 broken. Now special lines (!@,/) appear properly in the command
6707 history after a log replay.
6712 history after a log replay.
6708
6713
6709 * Tried and failed to implement full session saving via pickle. My
6714 * Tried and failed to implement full session saving via pickle. My
6710 idea was to pickle __main__.__dict__, but modules can't be
6715 idea was to pickle __main__.__dict__, but modules can't be
6711 pickled. This would be a better alternative to replaying logs, but
6716 pickled. This would be a better alternative to replaying logs, but
6712 seems quite tricky to get to work. Changed -session to be called
6717 seems quite tricky to get to work. Changed -session to be called
6713 -logplay, which more accurately reflects what it does. And if we
6718 -logplay, which more accurately reflects what it does. And if we
6714 ever get real session saving working, -session is now available.
6719 ever get real session saving working, -session is now available.
6715
6720
6716 * Implemented color schemes for prompts also. As for tracebacks,
6721 * Implemented color schemes for prompts also. As for tracebacks,
6717 currently only NoColor and Linux are supported. But now the
6722 currently only NoColor and Linux are supported. But now the
6718 infrastructure is in place, based on a generic ColorScheme
6723 infrastructure is in place, based on a generic ColorScheme
6719 class. So writing and activating new schemes both for the prompts
6724 class. So writing and activating new schemes both for the prompts
6720 and the tracebacks should be straightforward.
6725 and the tracebacks should be straightforward.
6721
6726
6722 * Version 0.1.13 released, 0.1.14 opened.
6727 * Version 0.1.13 released, 0.1.14 opened.
6723
6728
6724 * Changed handling of options for output cache. Now counter is
6729 * Changed handling of options for output cache. Now counter is
6725 hardwired starting at 1 and one specifies the maximum number of
6730 hardwired starting at 1 and one specifies the maximum number of
6726 entries *in the outcache* (not the max prompt counter). This is
6731 entries *in the outcache* (not the max prompt counter). This is
6727 much better, since many statements won't increase the cache
6732 much better, since many statements won't increase the cache
6728 count. It also eliminated some confusing options, now there's only
6733 count. It also eliminated some confusing options, now there's only
6729 one: cache_size.
6734 one: cache_size.
6730
6735
6731 * Added 'alias' magic function and magic_alias option in the
6736 * Added 'alias' magic function and magic_alias option in the
6732 ipythonrc file. Now the user can easily define whatever names he
6737 ipythonrc file. Now the user can easily define whatever names he
6733 wants for the magic functions without having to play weird
6738 wants for the magic functions without having to play weird
6734 namespace games. This gives IPython a real shell-like feel.
6739 namespace games. This gives IPython a real shell-like feel.
6735
6740
6736 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6741 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6737 @ or not).
6742 @ or not).
6738
6743
6739 This was one of the last remaining 'visible' bugs (that I know
6744 This was one of the last remaining 'visible' bugs (that I know
6740 of). I think if I can clean up the session loading so it works
6745 of). I think if I can clean up the session loading so it works
6741 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6746 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6742 about licensing).
6747 about licensing).
6743
6748
6744 2001-11-25 Fernando Perez <fperez@colorado.edu>
6749 2001-11-25 Fernando Perez <fperez@colorado.edu>
6745
6750
6746 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6751 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6747 there's a cleaner distinction between what ? and ?? show.
6752 there's a cleaner distinction between what ? and ?? show.
6748
6753
6749 * Added screen_length option. Now the user can define his own
6754 * Added screen_length option. Now the user can define his own
6750 screen size for page() operations.
6755 screen size for page() operations.
6751
6756
6752 * Implemented magic shell-like functions with automatic code
6757 * Implemented magic shell-like functions with automatic code
6753 generation. Now adding another function is just a matter of adding
6758 generation. Now adding another function is just a matter of adding
6754 an entry to a dict, and the function is dynamically generated at
6759 an entry to a dict, and the function is dynamically generated at
6755 run-time. Python has some really cool features!
6760 run-time. Python has some really cool features!
6756
6761
6757 * Renamed many options to cleanup conventions a little. Now all
6762 * Renamed many options to cleanup conventions a little. Now all
6758 are lowercase, and only underscores where needed. Also in the code
6763 are lowercase, and only underscores where needed. Also in the code
6759 option name tables are clearer.
6764 option name tables are clearer.
6760
6765
6761 * Changed prompts a little. Now input is 'In [n]:' instead of
6766 * Changed prompts a little. Now input is 'In [n]:' instead of
6762 'In[n]:='. This allows it the numbers to be aligned with the
6767 'In[n]:='. This allows it the numbers to be aligned with the
6763 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6768 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6764 Python (it was a Mathematica thing). The '...' continuation prompt
6769 Python (it was a Mathematica thing). The '...' continuation prompt
6765 was also changed a little to align better.
6770 was also changed a little to align better.
6766
6771
6767 * Fixed bug when flushing output cache. Not all _p<n> variables
6772 * Fixed bug when flushing output cache. Not all _p<n> variables
6768 exist, so their deletion needs to be wrapped in a try:
6773 exist, so their deletion needs to be wrapped in a try:
6769
6774
6770 * Figured out how to properly use inspect.formatargspec() (it
6775 * Figured out how to properly use inspect.formatargspec() (it
6771 requires the args preceded by *). So I removed all the code from
6776 requires the args preceded by *). So I removed all the code from
6772 _get_pdef in Magic, which was just replicating that.
6777 _get_pdef in Magic, which was just replicating that.
6773
6778
6774 * Added test to prefilter to allow redefining magic function names
6779 * Added test to prefilter to allow redefining magic function names
6775 as variables. This is ok, since the @ form is always available,
6780 as variables. This is ok, since the @ form is always available,
6776 but whe should allow the user to define a variable called 'ls' if
6781 but whe should allow the user to define a variable called 'ls' if
6777 he needs it.
6782 he needs it.
6778
6783
6779 * Moved the ToDo information from README into a separate ToDo.
6784 * Moved the ToDo information from README into a separate ToDo.
6780
6785
6781 * General code cleanup and small bugfixes. I think it's close to a
6786 * General code cleanup and small bugfixes. I think it's close to a
6782 state where it can be released, obviously with a big 'beta'
6787 state where it can be released, obviously with a big 'beta'
6783 warning on it.
6788 warning on it.
6784
6789
6785 * Got the magic function split to work. Now all magics are defined
6790 * Got the magic function split to work. Now all magics are defined
6786 in a separate class. It just organizes things a bit, and now
6791 in a separate class. It just organizes things a bit, and now
6787 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6792 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6788 was too long).
6793 was too long).
6789
6794
6790 * Changed @clear to @reset to avoid potential confusions with
6795 * Changed @clear to @reset to avoid potential confusions with
6791 the shell command clear. Also renamed @cl to @clear, which does
6796 the shell command clear. Also renamed @cl to @clear, which does
6792 exactly what people expect it to from their shell experience.
6797 exactly what people expect it to from their shell experience.
6793
6798
6794 Added a check to the @reset command (since it's so
6799 Added a check to the @reset command (since it's so
6795 destructive, it's probably a good idea to ask for confirmation).
6800 destructive, it's probably a good idea to ask for confirmation).
6796 But now reset only works for full namespace resetting. Since the
6801 But now reset only works for full namespace resetting. Since the
6797 del keyword is already there for deleting a few specific
6802 del keyword is already there for deleting a few specific
6798 variables, I don't see the point of having a redundant magic
6803 variables, I don't see the point of having a redundant magic
6799 function for the same task.
6804 function for the same task.
6800
6805
6801 2001-11-24 Fernando Perez <fperez@colorado.edu>
6806 2001-11-24 Fernando Perez <fperez@colorado.edu>
6802
6807
6803 * Updated the builtin docs (esp. the ? ones).
6808 * Updated the builtin docs (esp. the ? ones).
6804
6809
6805 * Ran all the code through pychecker. Not terribly impressed with
6810 * Ran all the code through pychecker. Not terribly impressed with
6806 it: lots of spurious warnings and didn't really find anything of
6811 it: lots of spurious warnings and didn't really find anything of
6807 substance (just a few modules being imported and not used).
6812 substance (just a few modules being imported and not used).
6808
6813
6809 * Implemented the new ultraTB functionality into IPython. New
6814 * Implemented the new ultraTB functionality into IPython. New
6810 option: xcolors. This chooses color scheme. xmode now only selects
6815 option: xcolors. This chooses color scheme. xmode now only selects
6811 between Plain and Verbose. Better orthogonality.
6816 between Plain and Verbose. Better orthogonality.
6812
6817
6813 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6818 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6814 mode and color scheme for the exception handlers. Now it's
6819 mode and color scheme for the exception handlers. Now it's
6815 possible to have the verbose traceback with no coloring.
6820 possible to have the verbose traceback with no coloring.
6816
6821
6817 2001-11-23 Fernando Perez <fperez@colorado.edu>
6822 2001-11-23 Fernando Perez <fperez@colorado.edu>
6818
6823
6819 * Version 0.1.12 released, 0.1.13 opened.
6824 * Version 0.1.12 released, 0.1.13 opened.
6820
6825
6821 * Removed option to set auto-quote and auto-paren escapes by
6826 * Removed option to set auto-quote and auto-paren escapes by
6822 user. The chances of breaking valid syntax are just too high. If
6827 user. The chances of breaking valid syntax are just too high. If
6823 someone *really* wants, they can always dig into the code.
6828 someone *really* wants, they can always dig into the code.
6824
6829
6825 * Made prompt separators configurable.
6830 * Made prompt separators configurable.
6826
6831
6827 2001-11-22 Fernando Perez <fperez@colorado.edu>
6832 2001-11-22 Fernando Perez <fperez@colorado.edu>
6828
6833
6829 * Small bugfixes in many places.
6834 * Small bugfixes in many places.
6830
6835
6831 * Removed the MyCompleter class from ipplib. It seemed redundant
6836 * Removed the MyCompleter class from ipplib. It seemed redundant
6832 with the C-p,C-n history search functionality. Less code to
6837 with the C-p,C-n history search functionality. Less code to
6833 maintain.
6838 maintain.
6834
6839
6835 * Moved all the original ipython.py code into ipythonlib.py. Right
6840 * Moved all the original ipython.py code into ipythonlib.py. Right
6836 now it's just one big dump into a function called make_IPython, so
6841 now it's just one big dump into a function called make_IPython, so
6837 no real modularity has been gained. But at least it makes the
6842 no real modularity has been gained. But at least it makes the
6838 wrapper script tiny, and since ipythonlib is a module, it gets
6843 wrapper script tiny, and since ipythonlib is a module, it gets
6839 compiled and startup is much faster.
6844 compiled and startup is much faster.
6840
6845
6841 This is a reasobably 'deep' change, so we should test it for a
6846 This is a reasobably 'deep' change, so we should test it for a
6842 while without messing too much more with the code.
6847 while without messing too much more with the code.
6843
6848
6844 2001-11-21 Fernando Perez <fperez@colorado.edu>
6849 2001-11-21 Fernando Perez <fperez@colorado.edu>
6845
6850
6846 * Version 0.1.11 released, 0.1.12 opened for further work.
6851 * Version 0.1.11 released, 0.1.12 opened for further work.
6847
6852
6848 * Removed dependency on Itpl. It was only needed in one place. It
6853 * Removed dependency on Itpl. It was only needed in one place. It
6849 would be nice if this became part of python, though. It makes life
6854 would be nice if this became part of python, though. It makes life
6850 *a lot* easier in some cases.
6855 *a lot* easier in some cases.
6851
6856
6852 * Simplified the prefilter code a bit. Now all handlers are
6857 * Simplified the prefilter code a bit. Now all handlers are
6853 expected to explicitly return a value (at least a blank string).
6858 expected to explicitly return a value (at least a blank string).
6854
6859
6855 * Heavy edits in ipplib. Removed the help system altogether. Now
6860 * Heavy edits in ipplib. Removed the help system altogether. Now
6856 obj?/?? is used for inspecting objects, a magic @doc prints
6861 obj?/?? is used for inspecting objects, a magic @doc prints
6857 docstrings, and full-blown Python help is accessed via the 'help'
6862 docstrings, and full-blown Python help is accessed via the 'help'
6858 keyword. This cleans up a lot of code (less to maintain) and does
6863 keyword. This cleans up a lot of code (less to maintain) and does
6859 the job. Since 'help' is now a standard Python component, might as
6864 the job. Since 'help' is now a standard Python component, might as
6860 well use it and remove duplicate functionality.
6865 well use it and remove duplicate functionality.
6861
6866
6862 Also removed the option to use ipplib as a standalone program. By
6867 Also removed the option to use ipplib as a standalone program. By
6863 now it's too dependent on other parts of IPython to function alone.
6868 now it's too dependent on other parts of IPython to function alone.
6864
6869
6865 * Fixed bug in genutils.pager. It would crash if the pager was
6870 * Fixed bug in genutils.pager. It would crash if the pager was
6866 exited immediately after opening (broken pipe).
6871 exited immediately after opening (broken pipe).
6867
6872
6868 * Trimmed down the VerboseTB reporting a little. The header is
6873 * Trimmed down the VerboseTB reporting a little. The header is
6869 much shorter now and the repeated exception arguments at the end
6874 much shorter now and the repeated exception arguments at the end
6870 have been removed. For interactive use the old header seemed a bit
6875 have been removed. For interactive use the old header seemed a bit
6871 excessive.
6876 excessive.
6872
6877
6873 * Fixed small bug in output of @whos for variables with multi-word
6878 * Fixed small bug in output of @whos for variables with multi-word
6874 types (only first word was displayed).
6879 types (only first word was displayed).
6875
6880
6876 2001-11-17 Fernando Perez <fperez@colorado.edu>
6881 2001-11-17 Fernando Perez <fperez@colorado.edu>
6877
6882
6878 * Version 0.1.10 released, 0.1.11 opened for further work.
6883 * Version 0.1.10 released, 0.1.11 opened for further work.
6879
6884
6880 * Modified dirs and friends. dirs now *returns* the stack (not
6885 * Modified dirs and friends. dirs now *returns* the stack (not
6881 prints), so one can manipulate it as a variable. Convenient to
6886 prints), so one can manipulate it as a variable. Convenient to
6882 travel along many directories.
6887 travel along many directories.
6883
6888
6884 * Fixed bug in magic_pdef: would only work with functions with
6889 * Fixed bug in magic_pdef: would only work with functions with
6885 arguments with default values.
6890 arguments with default values.
6886
6891
6887 2001-11-14 Fernando Perez <fperez@colorado.edu>
6892 2001-11-14 Fernando Perez <fperez@colorado.edu>
6888
6893
6889 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6894 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6890 example with IPython. Various other minor fixes and cleanups.
6895 example with IPython. Various other minor fixes and cleanups.
6891
6896
6892 * Version 0.1.9 released, 0.1.10 opened for further work.
6897 * Version 0.1.9 released, 0.1.10 opened for further work.
6893
6898
6894 * Added sys.path to the list of directories searched in the
6899 * Added sys.path to the list of directories searched in the
6895 execfile= option. It used to be the current directory and the
6900 execfile= option. It used to be the current directory and the
6896 user's IPYTHONDIR only.
6901 user's IPYTHONDIR only.
6897
6902
6898 2001-11-13 Fernando Perez <fperez@colorado.edu>
6903 2001-11-13 Fernando Perez <fperez@colorado.edu>
6899
6904
6900 * Reinstated the raw_input/prefilter separation that Janko had
6905 * Reinstated the raw_input/prefilter separation that Janko had
6901 initially. This gives a more convenient setup for extending the
6906 initially. This gives a more convenient setup for extending the
6902 pre-processor from the outside: raw_input always gets a string,
6907 pre-processor from the outside: raw_input always gets a string,
6903 and prefilter has to process it. We can then redefine prefilter
6908 and prefilter has to process it. We can then redefine prefilter
6904 from the outside and implement extensions for special
6909 from the outside and implement extensions for special
6905 purposes.
6910 purposes.
6906
6911
6907 Today I got one for inputting PhysicalQuantity objects
6912 Today I got one for inputting PhysicalQuantity objects
6908 (from Scientific) without needing any function calls at
6913 (from Scientific) without needing any function calls at
6909 all. Extremely convenient, and it's all done as a user-level
6914 all. Extremely convenient, and it's all done as a user-level
6910 extension (no IPython code was touched). Now instead of:
6915 extension (no IPython code was touched). Now instead of:
6911 a = PhysicalQuantity(4.2,'m/s**2')
6916 a = PhysicalQuantity(4.2,'m/s**2')
6912 one can simply say
6917 one can simply say
6913 a = 4.2 m/s**2
6918 a = 4.2 m/s**2
6914 or even
6919 or even
6915 a = 4.2 m/s^2
6920 a = 4.2 m/s^2
6916
6921
6917 I use this, but it's also a proof of concept: IPython really is
6922 I use this, but it's also a proof of concept: IPython really is
6918 fully user-extensible, even at the level of the parsing of the
6923 fully user-extensible, even at the level of the parsing of the
6919 command line. It's not trivial, but it's perfectly doable.
6924 command line. It's not trivial, but it's perfectly doable.
6920
6925
6921 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6926 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6922 the problem of modules being loaded in the inverse order in which
6927 the problem of modules being loaded in the inverse order in which
6923 they were defined in
6928 they were defined in
6924
6929
6925 * Version 0.1.8 released, 0.1.9 opened for further work.
6930 * Version 0.1.8 released, 0.1.9 opened for further work.
6926
6931
6927 * Added magics pdef, source and file. They respectively show the
6932 * Added magics pdef, source and file. They respectively show the
6928 definition line ('prototype' in C), source code and full python
6933 definition line ('prototype' in C), source code and full python
6929 file for any callable object. The object inspector oinfo uses
6934 file for any callable object. The object inspector oinfo uses
6930 these to show the same information.
6935 these to show the same information.
6931
6936
6932 * Version 0.1.7 released, 0.1.8 opened for further work.
6937 * Version 0.1.7 released, 0.1.8 opened for further work.
6933
6938
6934 * Separated all the magic functions into a class called Magic. The
6939 * Separated all the magic functions into a class called Magic. The
6935 InteractiveShell class was becoming too big for Xemacs to handle
6940 InteractiveShell class was becoming too big for Xemacs to handle
6936 (de-indenting a line would lock it up for 10 seconds while it
6941 (de-indenting a line would lock it up for 10 seconds while it
6937 backtracked on the whole class!)
6942 backtracked on the whole class!)
6938
6943
6939 FIXME: didn't work. It can be done, but right now namespaces are
6944 FIXME: didn't work. It can be done, but right now namespaces are
6940 all messed up. Do it later (reverted it for now, so at least
6945 all messed up. Do it later (reverted it for now, so at least
6941 everything works as before).
6946 everything works as before).
6942
6947
6943 * Got the object introspection system (magic_oinfo) working! I
6948 * Got the object introspection system (magic_oinfo) working! I
6944 think this is pretty much ready for release to Janko, so he can
6949 think this is pretty much ready for release to Janko, so he can
6945 test it for a while and then announce it. Pretty much 100% of what
6950 test it for a while and then announce it. Pretty much 100% of what
6946 I wanted for the 'phase 1' release is ready. Happy, tired.
6951 I wanted for the 'phase 1' release is ready. Happy, tired.
6947
6952
6948 2001-11-12 Fernando Perez <fperez@colorado.edu>
6953 2001-11-12 Fernando Perez <fperez@colorado.edu>
6949
6954
6950 * Version 0.1.6 released, 0.1.7 opened for further work.
6955 * Version 0.1.6 released, 0.1.7 opened for further work.
6951
6956
6952 * Fixed bug in printing: it used to test for truth before
6957 * Fixed bug in printing: it used to test for truth before
6953 printing, so 0 wouldn't print. Now checks for None.
6958 printing, so 0 wouldn't print. Now checks for None.
6954
6959
6955 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6960 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6956 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6961 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6957 reaches by hand into the outputcache. Think of a better way to do
6962 reaches by hand into the outputcache. Think of a better way to do
6958 this later.
6963 this later.
6959
6964
6960 * Various small fixes thanks to Nathan's comments.
6965 * Various small fixes thanks to Nathan's comments.
6961
6966
6962 * Changed magic_pprint to magic_Pprint. This way it doesn't
6967 * Changed magic_pprint to magic_Pprint. This way it doesn't
6963 collide with pprint() and the name is consistent with the command
6968 collide with pprint() and the name is consistent with the command
6964 line option.
6969 line option.
6965
6970
6966 * Changed prompt counter behavior to be fully like
6971 * Changed prompt counter behavior to be fully like
6967 Mathematica's. That is, even input that doesn't return a result
6972 Mathematica's. That is, even input that doesn't return a result
6968 raises the prompt counter. The old behavior was kind of confusing
6973 raises the prompt counter. The old behavior was kind of confusing
6969 (getting the same prompt number several times if the operation
6974 (getting the same prompt number several times if the operation
6970 didn't return a result).
6975 didn't return a result).
6971
6976
6972 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6977 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6973
6978
6974 * Fixed -Classic mode (wasn't working anymore).
6979 * Fixed -Classic mode (wasn't working anymore).
6975
6980
6976 * Added colored prompts using Nathan's new code. Colors are
6981 * Added colored prompts using Nathan's new code. Colors are
6977 currently hardwired, they can be user-configurable. For
6982 currently hardwired, they can be user-configurable. For
6978 developers, they can be chosen in file ipythonlib.py, at the
6983 developers, they can be chosen in file ipythonlib.py, at the
6979 beginning of the CachedOutput class def.
6984 beginning of the CachedOutput class def.
6980
6985
6981 2001-11-11 Fernando Perez <fperez@colorado.edu>
6986 2001-11-11 Fernando Perez <fperez@colorado.edu>
6982
6987
6983 * Version 0.1.5 released, 0.1.6 opened for further work.
6988 * Version 0.1.5 released, 0.1.6 opened for further work.
6984
6989
6985 * Changed magic_env to *return* the environment as a dict (not to
6990 * Changed magic_env to *return* the environment as a dict (not to
6986 print it). This way it prints, but it can also be processed.
6991 print it). This way it prints, but it can also be processed.
6987
6992
6988 * Added Verbose exception reporting to interactive
6993 * Added Verbose exception reporting to interactive
6989 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6994 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6990 traceback. Had to make some changes to the ultraTB file. This is
6995 traceback. Had to make some changes to the ultraTB file. This is
6991 probably the last 'big' thing in my mental todo list. This ties
6996 probably the last 'big' thing in my mental todo list. This ties
6992 in with the next entry:
6997 in with the next entry:
6993
6998
6994 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6999 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6995 has to specify is Plain, Color or Verbose for all exception
7000 has to specify is Plain, Color or Verbose for all exception
6996 handling.
7001 handling.
6997
7002
6998 * Removed ShellServices option. All this can really be done via
7003 * Removed ShellServices option. All this can really be done via
6999 the magic system. It's easier to extend, cleaner and has automatic
7004 the magic system. It's easier to extend, cleaner and has automatic
7000 namespace protection and documentation.
7005 namespace protection and documentation.
7001
7006
7002 2001-11-09 Fernando Perez <fperez@colorado.edu>
7007 2001-11-09 Fernando Perez <fperez@colorado.edu>
7003
7008
7004 * Fixed bug in output cache flushing (missing parameter to
7009 * Fixed bug in output cache flushing (missing parameter to
7005 __init__). Other small bugs fixed (found using pychecker).
7010 __init__). Other small bugs fixed (found using pychecker).
7006
7011
7007 * Version 0.1.4 opened for bugfixing.
7012 * Version 0.1.4 opened for bugfixing.
7008
7013
7009 2001-11-07 Fernando Perez <fperez@colorado.edu>
7014 2001-11-07 Fernando Perez <fperez@colorado.edu>
7010
7015
7011 * Version 0.1.3 released, mainly because of the raw_input bug.
7016 * Version 0.1.3 released, mainly because of the raw_input bug.
7012
7017
7013 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7018 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7014 and when testing for whether things were callable, a call could
7019 and when testing for whether things were callable, a call could
7015 actually be made to certain functions. They would get called again
7020 actually be made to certain functions. They would get called again
7016 once 'really' executed, with a resulting double call. A disaster
7021 once 'really' executed, with a resulting double call. A disaster
7017 in many cases (list.reverse() would never work!).
7022 in many cases (list.reverse() would never work!).
7018
7023
7019 * Removed prefilter() function, moved its code to raw_input (which
7024 * Removed prefilter() function, moved its code to raw_input (which
7020 after all was just a near-empty caller for prefilter). This saves
7025 after all was just a near-empty caller for prefilter). This saves
7021 a function call on every prompt, and simplifies the class a tiny bit.
7026 a function call on every prompt, and simplifies the class a tiny bit.
7022
7027
7023 * Fix _ip to __ip name in magic example file.
7028 * Fix _ip to __ip name in magic example file.
7024
7029
7025 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7030 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7026 work with non-gnu versions of tar.
7031 work with non-gnu versions of tar.
7027
7032
7028 2001-11-06 Fernando Perez <fperez@colorado.edu>
7033 2001-11-06 Fernando Perez <fperez@colorado.edu>
7029
7034
7030 * Version 0.1.2. Just to keep track of the recent changes.
7035 * Version 0.1.2. Just to keep track of the recent changes.
7031
7036
7032 * Fixed nasty bug in output prompt routine. It used to check 'if
7037 * Fixed nasty bug in output prompt routine. It used to check 'if
7033 arg != None...'. Problem is, this fails if arg implements a
7038 arg != None...'. Problem is, this fails if arg implements a
7034 special comparison (__cmp__) which disallows comparing to
7039 special comparison (__cmp__) which disallows comparing to
7035 None. Found it when trying to use the PhysicalQuantity module from
7040 None. Found it when trying to use the PhysicalQuantity module from
7036 ScientificPython.
7041 ScientificPython.
7037
7042
7038 2001-11-05 Fernando Perez <fperez@colorado.edu>
7043 2001-11-05 Fernando Perez <fperez@colorado.edu>
7039
7044
7040 * Also added dirs. Now the pushd/popd/dirs family functions
7045 * Also added dirs. Now the pushd/popd/dirs family functions
7041 basically like the shell, with the added convenience of going home
7046 basically like the shell, with the added convenience of going home
7042 when called with no args.
7047 when called with no args.
7043
7048
7044 * pushd/popd slightly modified to mimic shell behavior more
7049 * pushd/popd slightly modified to mimic shell behavior more
7045 closely.
7050 closely.
7046
7051
7047 * Added env,pushd,popd from ShellServices as magic functions. I
7052 * Added env,pushd,popd from ShellServices as magic functions. I
7048 think the cleanest will be to port all desired functions from
7053 think the cleanest will be to port all desired functions from
7049 ShellServices as magics and remove ShellServices altogether. This
7054 ShellServices as magics and remove ShellServices altogether. This
7050 will provide a single, clean way of adding functionality
7055 will provide a single, clean way of adding functionality
7051 (shell-type or otherwise) to IP.
7056 (shell-type or otherwise) to IP.
7052
7057
7053 2001-11-04 Fernando Perez <fperez@colorado.edu>
7058 2001-11-04 Fernando Perez <fperez@colorado.edu>
7054
7059
7055 * Added .ipython/ directory to sys.path. This way users can keep
7060 * Added .ipython/ directory to sys.path. This way users can keep
7056 customizations there and access them via import.
7061 customizations there and access them via import.
7057
7062
7058 2001-11-03 Fernando Perez <fperez@colorado.edu>
7063 2001-11-03 Fernando Perez <fperez@colorado.edu>
7059
7064
7060 * Opened version 0.1.1 for new changes.
7065 * Opened version 0.1.1 for new changes.
7061
7066
7062 * Changed version number to 0.1.0: first 'public' release, sent to
7067 * Changed version number to 0.1.0: first 'public' release, sent to
7063 Nathan and Janko.
7068 Nathan and Janko.
7064
7069
7065 * Lots of small fixes and tweaks.
7070 * Lots of small fixes and tweaks.
7066
7071
7067 * Minor changes to whos format. Now strings are shown, snipped if
7072 * Minor changes to whos format. Now strings are shown, snipped if
7068 too long.
7073 too long.
7069
7074
7070 * Changed ShellServices to work on __main__ so they show up in @who
7075 * Changed ShellServices to work on __main__ so they show up in @who
7071
7076
7072 * Help also works with ? at the end of a line:
7077 * Help also works with ? at the end of a line:
7073 ?sin and sin?
7078 ?sin and sin?
7074 both produce the same effect. This is nice, as often I use the
7079 both produce the same effect. This is nice, as often I use the
7075 tab-complete to find the name of a method, but I used to then have
7080 tab-complete to find the name of a method, but I used to then have
7076 to go to the beginning of the line to put a ? if I wanted more
7081 to go to the beginning of the line to put a ? if I wanted more
7077 info. Now I can just add the ? and hit return. Convenient.
7082 info. Now I can just add the ? and hit return. Convenient.
7078
7083
7079 2001-11-02 Fernando Perez <fperez@colorado.edu>
7084 2001-11-02 Fernando Perez <fperez@colorado.edu>
7080
7085
7081 * Python version check (>=2.1) added.
7086 * Python version check (>=2.1) added.
7082
7087
7083 * Added LazyPython documentation. At this point the docs are quite
7088 * Added LazyPython documentation. At this point the docs are quite
7084 a mess. A cleanup is in order.
7089 a mess. A cleanup is in order.
7085
7090
7086 * Auto-installer created. For some bizarre reason, the zipfiles
7091 * Auto-installer created. For some bizarre reason, the zipfiles
7087 module isn't working on my system. So I made a tar version
7092 module isn't working on my system. So I made a tar version
7088 (hopefully the command line options in various systems won't kill
7093 (hopefully the command line options in various systems won't kill
7089 me).
7094 me).
7090
7095
7091 * Fixes to Struct in genutils. Now all dictionary-like methods are
7096 * Fixes to Struct in genutils. Now all dictionary-like methods are
7092 protected (reasonably).
7097 protected (reasonably).
7093
7098
7094 * Added pager function to genutils and changed ? to print usage
7099 * Added pager function to genutils and changed ? to print usage
7095 note through it (it was too long).
7100 note through it (it was too long).
7096
7101
7097 * Added the LazyPython functionality. Works great! I changed the
7102 * Added the LazyPython functionality. Works great! I changed the
7098 auto-quote escape to ';', it's on home row and next to '. But
7103 auto-quote escape to ';', it's on home row and next to '. But
7099 both auto-quote and auto-paren (still /) escapes are command-line
7104 both auto-quote and auto-paren (still /) escapes are command-line
7100 parameters.
7105 parameters.
7101
7106
7102
7107
7103 2001-11-01 Fernando Perez <fperez@colorado.edu>
7108 2001-11-01 Fernando Perez <fperez@colorado.edu>
7104
7109
7105 * Version changed to 0.0.7. Fairly large change: configuration now
7110 * Version changed to 0.0.7. Fairly large change: configuration now
7106 is all stored in a directory, by default .ipython. There, all
7111 is all stored in a directory, by default .ipython. There, all
7107 config files have normal looking names (not .names)
7112 config files have normal looking names (not .names)
7108
7113
7109 * Version 0.0.6 Released first to Lucas and Archie as a test
7114 * Version 0.0.6 Released first to Lucas and Archie as a test
7110 run. Since it's the first 'semi-public' release, change version to
7115 run. Since it's the first 'semi-public' release, change version to
7111 > 0.0.6 for any changes now.
7116 > 0.0.6 for any changes now.
7112
7117
7113 * Stuff I had put in the ipplib.py changelog:
7118 * Stuff I had put in the ipplib.py changelog:
7114
7119
7115 Changes to InteractiveShell:
7120 Changes to InteractiveShell:
7116
7121
7117 - Made the usage message a parameter.
7122 - Made the usage message a parameter.
7118
7123
7119 - Require the name of the shell variable to be given. It's a bit
7124 - Require the name of the shell variable to be given. It's a bit
7120 of a hack, but allows the name 'shell' not to be hardwired in the
7125 of a hack, but allows the name 'shell' not to be hardwired in the
7121 magic (@) handler, which is problematic b/c it requires
7126 magic (@) handler, which is problematic b/c it requires
7122 polluting the global namespace with 'shell'. This in turn is
7127 polluting the global namespace with 'shell'. This in turn is
7123 fragile: if a user redefines a variable called shell, things
7128 fragile: if a user redefines a variable called shell, things
7124 break.
7129 break.
7125
7130
7126 - magic @: all functions available through @ need to be defined
7131 - magic @: all functions available through @ need to be defined
7127 as magic_<name>, even though they can be called simply as
7132 as magic_<name>, even though they can be called simply as
7128 @<name>. This allows the special command @magic to gather
7133 @<name>. This allows the special command @magic to gather
7129 information automatically about all existing magic functions,
7134 information automatically about all existing magic functions,
7130 even if they are run-time user extensions, by parsing the shell
7135 even if they are run-time user extensions, by parsing the shell
7131 instance __dict__ looking for special magic_ names.
7136 instance __dict__ looking for special magic_ names.
7132
7137
7133 - mainloop: added *two* local namespace parameters. This allows
7138 - mainloop: added *two* local namespace parameters. This allows
7134 the class to differentiate between parameters which were there
7139 the class to differentiate between parameters which were there
7135 before and after command line initialization was processed. This
7140 before and after command line initialization was processed. This
7136 way, later @who can show things loaded at startup by the
7141 way, later @who can show things loaded at startup by the
7137 user. This trick was necessary to make session saving/reloading
7142 user. This trick was necessary to make session saving/reloading
7138 really work: ideally after saving/exiting/reloading a session,
7143 really work: ideally after saving/exiting/reloading a session,
7139 *everything* should look the same, including the output of @who. I
7144 *everything* should look the same, including the output of @who. I
7140 was only able to make this work with this double namespace
7145 was only able to make this work with this double namespace
7141 trick.
7146 trick.
7142
7147
7143 - added a header to the logfile which allows (almost) full
7148 - added a header to the logfile which allows (almost) full
7144 session restoring.
7149 session restoring.
7145
7150
7146 - prepend lines beginning with @ or !, with a and log
7151 - prepend lines beginning with @ or !, with a and log
7147 them. Why? !lines: may be useful to know what you did @lines:
7152 them. Why? !lines: may be useful to know what you did @lines:
7148 they may affect session state. So when restoring a session, at
7153 they may affect session state. So when restoring a session, at
7149 least inform the user of their presence. I couldn't quite get
7154 least inform the user of their presence. I couldn't quite get
7150 them to properly re-execute, but at least the user is warned.
7155 them to properly re-execute, but at least the user is warned.
7151
7156
7152 * Started ChangeLog.
7157 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now