##// END OF EJS Templates
update changelog
vivainio -
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -1,3067 +1,3072 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 1918 2006-11-21 20:19:13Z vivainio $"""
4 $Id: Magic.py 1921 2006-11-21 20:49:55Z 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
38
39 # profile isn't bundled by default in Debian for license reasons
39 # cProfile was added in Python2.5
40 try:
40 try:
41 import profile,pstats
41 import cProfile as profile
42 import pstats
42 except ImportError:
43 except ImportError:
43 profile = pstats = None
44 # profile isn't bundled by default in Debian for license reasons
45 try:
46 import profile,pstats
47 except ImportError:
48 profile = pstats = None
44
49
45 # Homebrewed
50 # Homebrewed
46 import IPython
51 import IPython
47 from IPython import Debugger, OInspect, wildcard
52 from IPython import Debugger, OInspect, wildcard
48 from IPython.FakeModule import FakeModule
53 from IPython.FakeModule import FakeModule
49 from IPython.Itpl import Itpl, itpl, printpl,itplns
54 from IPython.Itpl import Itpl, itpl, printpl,itplns
50 from IPython.PyColorize import Parser
55 from IPython.PyColorize import Parser
51 from IPython.ipstruct import Struct
56 from IPython.ipstruct import Struct
52 from IPython.macro import Macro
57 from IPython.macro import Macro
53 from IPython.genutils import *
58 from IPython.genutils import *
54 from IPython import platutils
59 from IPython import platutils
55
60
56 #***************************************************************************
61 #***************************************************************************
57 # Utility functions
62 # Utility functions
58 def on_off(tag):
63 def on_off(tag):
59 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
64 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
60 return ['OFF','ON'][tag]
65 return ['OFF','ON'][tag]
61
66
62 class Bunch: pass
67 class Bunch: pass
63
68
64 #***************************************************************************
69 #***************************************************************************
65 # Main class implementing Magic functionality
70 # Main class implementing Magic functionality
66 class Magic:
71 class Magic:
67 """Magic functions for InteractiveShell.
72 """Magic functions for InteractiveShell.
68
73
69 Shell functions which can be reached as %function_name. All magic
74 Shell functions which can be reached as %function_name. All magic
70 functions should accept a string, which they can parse for their own
75 functions should accept a string, which they can parse for their own
71 needs. This can make some functions easier to type, eg `%cd ../`
76 needs. This can make some functions easier to type, eg `%cd ../`
72 vs. `%cd("../")`
77 vs. `%cd("../")`
73
78
74 ALL definitions MUST begin with the prefix magic_. The user won't need it
79 ALL definitions MUST begin with the prefix magic_. The user won't need it
75 at the command line, but it is is needed in the definition. """
80 at the command line, but it is is needed in the definition. """
76
81
77 # class globals
82 # class globals
78 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
83 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
79 'Automagic is ON, % prefix NOT needed for magic functions.']
84 'Automagic is ON, % prefix NOT needed for magic functions.']
80
85
81 #......................................................................
86 #......................................................................
82 # some utility functions
87 # some utility functions
83
88
84 def __init__(self,shell):
89 def __init__(self,shell):
85
90
86 self.options_table = {}
91 self.options_table = {}
87 if profile is None:
92 if profile is None:
88 self.magic_prun = self.profile_missing_notice
93 self.magic_prun = self.profile_missing_notice
89 self.shell = shell
94 self.shell = shell
90
95
91 # namespace for holding state we may need
96 # namespace for holding state we may need
92 self._magic_state = Bunch()
97 self._magic_state = Bunch()
93
98
94 def profile_missing_notice(self, *args, **kwargs):
99 def profile_missing_notice(self, *args, **kwargs):
95 error("""\
100 error("""\
96 The profile module could not be found. If you are a Debian user,
101 The profile module could not be found. If you are a Debian user,
97 it has been removed from the standard Debian package because of its non-free
102 it has been removed from the standard Debian package because of its non-free
98 license. To use profiling, please install"python2.3-profiler" from non-free.""")
103 license. To use profiling, please install"python2.3-profiler" from non-free.""")
99
104
100 def default_option(self,fn,optstr):
105 def default_option(self,fn,optstr):
101 """Make an entry in the options_table for fn, with value optstr"""
106 """Make an entry in the options_table for fn, with value optstr"""
102
107
103 if fn not in self.lsmagic():
108 if fn not in self.lsmagic():
104 error("%s is not a magic function" % fn)
109 error("%s is not a magic function" % fn)
105 self.options_table[fn] = optstr
110 self.options_table[fn] = optstr
106
111
107 def lsmagic(self):
112 def lsmagic(self):
108 """Return a list of currently available magic functions.
113 """Return a list of currently available magic functions.
109
114
110 Gives a list of the bare names after mangling (['ls','cd', ...], not
115 Gives a list of the bare names after mangling (['ls','cd', ...], not
111 ['magic_ls','magic_cd',...]"""
116 ['magic_ls','magic_cd',...]"""
112
117
113 # FIXME. This needs a cleanup, in the way the magics list is built.
118 # FIXME. This needs a cleanup, in the way the magics list is built.
114
119
115 # magics in class definition
120 # magics in class definition
116 class_magic = lambda fn: fn.startswith('magic_') and \
121 class_magic = lambda fn: fn.startswith('magic_') and \
117 callable(Magic.__dict__[fn])
122 callable(Magic.__dict__[fn])
118 # in instance namespace (run-time user additions)
123 # in instance namespace (run-time user additions)
119 inst_magic = lambda fn: fn.startswith('magic_') and \
124 inst_magic = lambda fn: fn.startswith('magic_') and \
120 callable(self.__dict__[fn])
125 callable(self.__dict__[fn])
121 # and bound magics by user (so they can access self):
126 # and bound magics by user (so they can access self):
122 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
127 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
123 callable(self.__class__.__dict__[fn])
128 callable(self.__class__.__dict__[fn])
124 magics = filter(class_magic,Magic.__dict__.keys()) + \
129 magics = filter(class_magic,Magic.__dict__.keys()) + \
125 filter(inst_magic,self.__dict__.keys()) + \
130 filter(inst_magic,self.__dict__.keys()) + \
126 filter(inst_bound_magic,self.__class__.__dict__.keys())
131 filter(inst_bound_magic,self.__class__.__dict__.keys())
127 out = []
132 out = []
128 for fn in magics:
133 for fn in magics:
129 out.append(fn.replace('magic_','',1))
134 out.append(fn.replace('magic_','',1))
130 out.sort()
135 out.sort()
131 return out
136 return out
132
137
133 def extract_input_slices(self,slices,raw=False):
138 def extract_input_slices(self,slices,raw=False):
134 """Return as a string a set of input history slices.
139 """Return as a string a set of input history slices.
135
140
136 Inputs:
141 Inputs:
137
142
138 - slices: the set of slices is given as a list of strings (like
143 - slices: the set of slices is given as a list of strings (like
139 ['1','4:8','9'], since this function is for use by magic functions
144 ['1','4:8','9'], since this function is for use by magic functions
140 which get their arguments as strings.
145 which get their arguments as strings.
141
146
142 Optional inputs:
147 Optional inputs:
143
148
144 - raw(False): by default, the processed input is used. If this is
149 - raw(False): by default, the processed input is used. If this is
145 true, the raw input history is used instead.
150 true, the raw input history is used instead.
146
151
147 Note that slices can be called with two notations:
152 Note that slices can be called with two notations:
148
153
149 N:M -> standard python form, means including items N...(M-1).
154 N:M -> standard python form, means including items N...(M-1).
150
155
151 N-M -> include items N..M (closed endpoint)."""
156 N-M -> include items N..M (closed endpoint)."""
152
157
153 if raw:
158 if raw:
154 hist = self.shell.input_hist_raw
159 hist = self.shell.input_hist_raw
155 else:
160 else:
156 hist = self.shell.input_hist
161 hist = self.shell.input_hist
157
162
158 cmds = []
163 cmds = []
159 for chunk in slices:
164 for chunk in slices:
160 if ':' in chunk:
165 if ':' in chunk:
161 ini,fin = map(int,chunk.split(':'))
166 ini,fin = map(int,chunk.split(':'))
162 elif '-' in chunk:
167 elif '-' in chunk:
163 ini,fin = map(int,chunk.split('-'))
168 ini,fin = map(int,chunk.split('-'))
164 fin += 1
169 fin += 1
165 else:
170 else:
166 ini = int(chunk)
171 ini = int(chunk)
167 fin = ini+1
172 fin = ini+1
168 cmds.append(hist[ini:fin])
173 cmds.append(hist[ini:fin])
169 return cmds
174 return cmds
170
175
171 def _ofind(self, oname, namespaces=None):
176 def _ofind(self, oname, namespaces=None):
172 """Find an object in the available namespaces.
177 """Find an object in the available namespaces.
173
178
174 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
179 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
175
180
176 Has special code to detect magic functions.
181 Has special code to detect magic functions.
177 """
182 """
178
183
179 oname = oname.strip()
184 oname = oname.strip()
180
185
181 alias_ns = None
186 alias_ns = None
182 if namespaces is None:
187 if namespaces is None:
183 # Namespaces to search in:
188 # Namespaces to search in:
184 # Put them in a list. The order is important so that we
189 # Put them in a list. The order is important so that we
185 # find things in the same order that Python finds them.
190 # find things in the same order that Python finds them.
186 namespaces = [ ('Interactive', self.shell.user_ns),
191 namespaces = [ ('Interactive', self.shell.user_ns),
187 ('IPython internal', self.shell.internal_ns),
192 ('IPython internal', self.shell.internal_ns),
188 ('Python builtin', __builtin__.__dict__),
193 ('Python builtin', __builtin__.__dict__),
189 ('Alias', self.shell.alias_table),
194 ('Alias', self.shell.alias_table),
190 ]
195 ]
191 alias_ns = self.shell.alias_table
196 alias_ns = self.shell.alias_table
192
197
193 # initialize results to 'null'
198 # initialize results to 'null'
194 found = 0; obj = None; ospace = None; ds = None;
199 found = 0; obj = None; ospace = None; ds = None;
195 ismagic = 0; isalias = 0; parent = None
200 ismagic = 0; isalias = 0; parent = None
196
201
197 # Look for the given name by splitting it in parts. If the head is
202 # Look for the given name by splitting it in parts. If the head is
198 # found, then we look for all the remaining parts as members, and only
203 # found, then we look for all the remaining parts as members, and only
199 # declare success if we can find them all.
204 # declare success if we can find them all.
200 oname_parts = oname.split('.')
205 oname_parts = oname.split('.')
201 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
206 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
202 for nsname,ns in namespaces:
207 for nsname,ns in namespaces:
203 try:
208 try:
204 obj = ns[oname_head]
209 obj = ns[oname_head]
205 except KeyError:
210 except KeyError:
206 continue
211 continue
207 else:
212 else:
208 for part in oname_rest:
213 for part in oname_rest:
209 try:
214 try:
210 parent = obj
215 parent = obj
211 obj = getattr(obj,part)
216 obj = getattr(obj,part)
212 except:
217 except:
213 # Blanket except b/c some badly implemented objects
218 # Blanket except b/c some badly implemented objects
214 # allow __getattr__ to raise exceptions other than
219 # allow __getattr__ to raise exceptions other than
215 # AttributeError, which then crashes IPython.
220 # AttributeError, which then crashes IPython.
216 break
221 break
217 else:
222 else:
218 # If we finish the for loop (no break), we got all members
223 # If we finish the for loop (no break), we got all members
219 found = 1
224 found = 1
220 ospace = nsname
225 ospace = nsname
221 if ns == alias_ns:
226 if ns == alias_ns:
222 isalias = 1
227 isalias = 1
223 break # namespace loop
228 break # namespace loop
224
229
225 # Try to see if it's magic
230 # Try to see if it's magic
226 if not found:
231 if not found:
227 if oname.startswith(self.shell.ESC_MAGIC):
232 if oname.startswith(self.shell.ESC_MAGIC):
228 oname = oname[1:]
233 oname = oname[1:]
229 obj = getattr(self,'magic_'+oname,None)
234 obj = getattr(self,'magic_'+oname,None)
230 if obj is not None:
235 if obj is not None:
231 found = 1
236 found = 1
232 ospace = 'IPython internal'
237 ospace = 'IPython internal'
233 ismagic = 1
238 ismagic = 1
234
239
235 # Last try: special-case some literals like '', [], {}, etc:
240 # Last try: special-case some literals like '', [], {}, etc:
236 if not found and oname_head in ["''",'""','[]','{}','()']:
241 if not found and oname_head in ["''",'""','[]','{}','()']:
237 obj = eval(oname_head)
242 obj = eval(oname_head)
238 found = 1
243 found = 1
239 ospace = 'Interactive'
244 ospace = 'Interactive'
240
245
241 return {'found':found, 'obj':obj, 'namespace':ospace,
246 return {'found':found, 'obj':obj, 'namespace':ospace,
242 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
247 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
243
248
244 def arg_err(self,func):
249 def arg_err(self,func):
245 """Print docstring if incorrect arguments were passed"""
250 """Print docstring if incorrect arguments were passed"""
246 print 'Error in arguments:'
251 print 'Error in arguments:'
247 print OInspect.getdoc(func)
252 print OInspect.getdoc(func)
248
253
249 def format_latex(self,strng):
254 def format_latex(self,strng):
250 """Format a string for latex inclusion."""
255 """Format a string for latex inclusion."""
251
256
252 # Characters that need to be escaped for latex:
257 # Characters that need to be escaped for latex:
253 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
258 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
254 # Magic command names as headers:
259 # Magic command names as headers:
255 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
260 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
256 re.MULTILINE)
261 re.MULTILINE)
257 # Magic commands
262 # Magic commands
258 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
263 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
259 re.MULTILINE)
264 re.MULTILINE)
260 # Paragraph continue
265 # Paragraph continue
261 par_re = re.compile(r'\\$',re.MULTILINE)
266 par_re = re.compile(r'\\$',re.MULTILINE)
262
267
263 # The "\n" symbol
268 # The "\n" symbol
264 newline_re = re.compile(r'\\n')
269 newline_re = re.compile(r'\\n')
265
270
266 # Now build the string for output:
271 # Now build the string for output:
267 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
272 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
268 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
273 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
269 strng)
274 strng)
270 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
275 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
271 strng = par_re.sub(r'\\\\',strng)
276 strng = par_re.sub(r'\\\\',strng)
272 strng = escape_re.sub(r'\\\1',strng)
277 strng = escape_re.sub(r'\\\1',strng)
273 strng = newline_re.sub(r'\\textbackslash{}n',strng)
278 strng = newline_re.sub(r'\\textbackslash{}n',strng)
274 return strng
279 return strng
275
280
276 def format_screen(self,strng):
281 def format_screen(self,strng):
277 """Format a string for screen printing.
282 """Format a string for screen printing.
278
283
279 This removes some latex-type format codes."""
284 This removes some latex-type format codes."""
280 # Paragraph continue
285 # Paragraph continue
281 par_re = re.compile(r'\\$',re.MULTILINE)
286 par_re = re.compile(r'\\$',re.MULTILINE)
282 strng = par_re.sub('',strng)
287 strng = par_re.sub('',strng)
283 return strng
288 return strng
284
289
285 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
290 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
286 """Parse options passed to an argument string.
291 """Parse options passed to an argument string.
287
292
288 The interface is similar to that of getopt(), but it returns back a
293 The interface is similar to that of getopt(), but it returns back a
289 Struct with the options as keys and the stripped argument string still
294 Struct with the options as keys and the stripped argument string still
290 as a string.
295 as a string.
291
296
292 arg_str is quoted as a true sys.argv vector by using shlex.split.
297 arg_str is quoted as a true sys.argv vector by using shlex.split.
293 This allows us to easily expand variables, glob files, quote
298 This allows us to easily expand variables, glob files, quote
294 arguments, etc.
299 arguments, etc.
295
300
296 Options:
301 Options:
297 -mode: default 'string'. If given as 'list', the argument string is
302 -mode: default 'string'. If given as 'list', the argument string is
298 returned as a list (split on whitespace) instead of a string.
303 returned as a list (split on whitespace) instead of a string.
299
304
300 -list_all: put all option values in lists. Normally only options
305 -list_all: put all option values in lists. Normally only options
301 appearing more than once are put in a list.
306 appearing more than once are put in a list.
302
307
303 -posix (True): whether to split the input line in POSIX mode or not,
308 -posix (True): whether to split the input line in POSIX mode or not,
304 as per the conventions outlined in the shlex module from the
309 as per the conventions outlined in the shlex module from the
305 standard library."""
310 standard library."""
306
311
307 # inject default options at the beginning of the input line
312 # inject default options at the beginning of the input line
308 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
313 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
309 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
314 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
310
315
311 mode = kw.get('mode','string')
316 mode = kw.get('mode','string')
312 if mode not in ['string','list']:
317 if mode not in ['string','list']:
313 raise ValueError,'incorrect mode given: %s' % mode
318 raise ValueError,'incorrect mode given: %s' % mode
314 # Get options
319 # Get options
315 list_all = kw.get('list_all',0)
320 list_all = kw.get('list_all',0)
316 posix = kw.get('posix',True)
321 posix = kw.get('posix',True)
317
322
318 # Check if we have more than one argument to warrant extra processing:
323 # Check if we have more than one argument to warrant extra processing:
319 odict = {} # Dictionary with options
324 odict = {} # Dictionary with options
320 args = arg_str.split()
325 args = arg_str.split()
321 if len(args) >= 1:
326 if len(args) >= 1:
322 # If the list of inputs only has 0 or 1 thing in it, there's no
327 # If the list of inputs only has 0 or 1 thing in it, there's no
323 # need to look for options
328 # need to look for options
324 argv = arg_split(arg_str,posix)
329 argv = arg_split(arg_str,posix)
325 # Do regular option processing
330 # Do regular option processing
326 try:
331 try:
327 opts,args = getopt(argv,opt_str,*long_opts)
332 opts,args = getopt(argv,opt_str,*long_opts)
328 except GetoptError,e:
333 except GetoptError,e:
329 raise GetoptError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
334 raise GetoptError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
330 " ".join(long_opts)))
335 " ".join(long_opts)))
331 for o,a in opts:
336 for o,a in opts:
332 if o.startswith('--'):
337 if o.startswith('--'):
333 o = o[2:]
338 o = o[2:]
334 else:
339 else:
335 o = o[1:]
340 o = o[1:]
336 try:
341 try:
337 odict[o].append(a)
342 odict[o].append(a)
338 except AttributeError:
343 except AttributeError:
339 odict[o] = [odict[o],a]
344 odict[o] = [odict[o],a]
340 except KeyError:
345 except KeyError:
341 if list_all:
346 if list_all:
342 odict[o] = [a]
347 odict[o] = [a]
343 else:
348 else:
344 odict[o] = a
349 odict[o] = a
345
350
346 # Prepare opts,args for return
351 # Prepare opts,args for return
347 opts = Struct(odict)
352 opts = Struct(odict)
348 if mode == 'string':
353 if mode == 'string':
349 args = ' '.join(args)
354 args = ' '.join(args)
350
355
351 return opts,args
356 return opts,args
352
357
353 #......................................................................
358 #......................................................................
354 # And now the actual magic functions
359 # And now the actual magic functions
355
360
356 # Functions for IPython shell work (vars,funcs, config, etc)
361 # Functions for IPython shell work (vars,funcs, config, etc)
357 def magic_lsmagic(self, parameter_s = ''):
362 def magic_lsmagic(self, parameter_s = ''):
358 """List currently available magic functions."""
363 """List currently available magic functions."""
359 mesc = self.shell.ESC_MAGIC
364 mesc = self.shell.ESC_MAGIC
360 print 'Available magic functions:\n'+mesc+\
365 print 'Available magic functions:\n'+mesc+\
361 (' '+mesc).join(self.lsmagic())
366 (' '+mesc).join(self.lsmagic())
362 print '\n' + Magic.auto_status[self.shell.rc.automagic]
367 print '\n' + Magic.auto_status[self.shell.rc.automagic]
363 return None
368 return None
364
369
365 def magic_magic(self, parameter_s = ''):
370 def magic_magic(self, parameter_s = ''):
366 """Print information about the magic function system."""
371 """Print information about the magic function system."""
367
372
368 mode = ''
373 mode = ''
369 try:
374 try:
370 if parameter_s.split()[0] == '-latex':
375 if parameter_s.split()[0] == '-latex':
371 mode = 'latex'
376 mode = 'latex'
372 if parameter_s.split()[0] == '-brief':
377 if parameter_s.split()[0] == '-brief':
373 mode = 'brief'
378 mode = 'brief'
374 except:
379 except:
375 pass
380 pass
376
381
377 magic_docs = []
382 magic_docs = []
378 for fname in self.lsmagic():
383 for fname in self.lsmagic():
379 mname = 'magic_' + fname
384 mname = 'magic_' + fname
380 for space in (Magic,self,self.__class__):
385 for space in (Magic,self,self.__class__):
381 try:
386 try:
382 fn = space.__dict__[mname]
387 fn = space.__dict__[mname]
383 except KeyError:
388 except KeyError:
384 pass
389 pass
385 else:
390 else:
386 break
391 break
387 if mode == 'brief':
392 if mode == 'brief':
388 # only first line
393 # only first line
389 fndoc = fn.__doc__.split('\n',1)[0]
394 fndoc = fn.__doc__.split('\n',1)[0]
390 else:
395 else:
391 fndoc = fn.__doc__
396 fndoc = fn.__doc__
392
397
393 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
398 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
394 fname,fndoc))
399 fname,fndoc))
395 magic_docs = ''.join(magic_docs)
400 magic_docs = ''.join(magic_docs)
396
401
397 if mode == 'latex':
402 if mode == 'latex':
398 print self.format_latex(magic_docs)
403 print self.format_latex(magic_docs)
399 return
404 return
400 else:
405 else:
401 magic_docs = self.format_screen(magic_docs)
406 magic_docs = self.format_screen(magic_docs)
402 if mode == 'brief':
407 if mode == 'brief':
403 return magic_docs
408 return magic_docs
404
409
405 outmsg = """
410 outmsg = """
406 IPython's 'magic' functions
411 IPython's 'magic' functions
407 ===========================
412 ===========================
408
413
409 The magic function system provides a series of functions which allow you to
414 The magic function system provides a series of functions which allow you to
410 control the behavior of IPython itself, plus a lot of system-type
415 control the behavior of IPython itself, plus a lot of system-type
411 features. All these functions are prefixed with a % character, but parameters
416 features. All these functions are prefixed with a % character, but parameters
412 are given without parentheses or quotes.
417 are given without parentheses or quotes.
413
418
414 NOTE: If you have 'automagic' enabled (via the command line option or with the
419 NOTE: If you have 'automagic' enabled (via the command line option or with the
415 %automagic function), you don't need to type in the % explicitly. By default,
420 %automagic function), you don't need to type in the % explicitly. By default,
416 IPython ships with automagic on, so you should only rarely need the % escape.
421 IPython ships with automagic on, so you should only rarely need the % escape.
417
422
418 Example: typing '%cd mydir' (without the quotes) changes you working directory
423 Example: typing '%cd mydir' (without the quotes) changes you working directory
419 to 'mydir', if it exists.
424 to 'mydir', if it exists.
420
425
421 You can define your own magic functions to extend the system. See the supplied
426 You can define your own magic functions to extend the system. See the supplied
422 ipythonrc and example-magic.py files for details (in your ipython
427 ipythonrc and example-magic.py files for details (in your ipython
423 configuration directory, typically $HOME/.ipython/).
428 configuration directory, typically $HOME/.ipython/).
424
429
425 You can also define your own aliased names for magic functions. In your
430 You can also define your own aliased names for magic functions. In your
426 ipythonrc file, placing a line like:
431 ipythonrc file, placing a line like:
427
432
428 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
433 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
429
434
430 will define %pf as a new name for %profile.
435 will define %pf as a new name for %profile.
431
436
432 You can also call magics in code using the ipmagic() function, which IPython
437 You can also call magics in code using the ipmagic() function, which IPython
433 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
438 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
434
439
435 For a list of the available magic functions, use %lsmagic. For a description
440 For a list of the available magic functions, use %lsmagic. For a description
436 of any of them, type %magic_name?, e.g. '%cd?'.
441 of any of them, type %magic_name?, e.g. '%cd?'.
437
442
438 Currently the magic system has the following functions:\n"""
443 Currently the magic system has the following functions:\n"""
439
444
440 mesc = self.shell.ESC_MAGIC
445 mesc = self.shell.ESC_MAGIC
441 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
446 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
442 "\n\n%s%s\n\n%s" % (outmsg,
447 "\n\n%s%s\n\n%s" % (outmsg,
443 magic_docs,mesc,mesc,
448 magic_docs,mesc,mesc,
444 (' '+mesc).join(self.lsmagic()),
449 (' '+mesc).join(self.lsmagic()),
445 Magic.auto_status[self.shell.rc.automagic] ) )
450 Magic.auto_status[self.shell.rc.automagic] ) )
446
451
447 page(outmsg,screen_lines=self.shell.rc.screen_length)
452 page(outmsg,screen_lines=self.shell.rc.screen_length)
448
453
449 def magic_automagic(self, parameter_s = ''):
454 def magic_automagic(self, parameter_s = ''):
450 """Make magic functions callable without having to type the initial %.
455 """Make magic functions callable without having to type the initial %.
451
456
452 Toggles on/off (when off, you must call it as %automagic, of
457 Toggles on/off (when off, you must call it as %automagic, of
453 course). Note that magic functions have lowest priority, so if there's
458 course). Note that magic functions have lowest priority, so if there's
454 a variable whose name collides with that of a magic fn, automagic
459 a variable whose name collides with that of a magic fn, automagic
455 won't work for that function (you get the variable instead). However,
460 won't work for that function (you get the variable instead). However,
456 if you delete the variable (del var), the previously shadowed magic
461 if you delete the variable (del var), the previously shadowed magic
457 function becomes visible to automagic again."""
462 function becomes visible to automagic again."""
458
463
459 rc = self.shell.rc
464 rc = self.shell.rc
460 rc.automagic = not rc.automagic
465 rc.automagic = not rc.automagic
461 print '\n' + Magic.auto_status[rc.automagic]
466 print '\n' + Magic.auto_status[rc.automagic]
462
467
463 def magic_autocall(self, parameter_s = ''):
468 def magic_autocall(self, parameter_s = ''):
464 """Make functions callable without having to type parentheses.
469 """Make functions callable without having to type parentheses.
465
470
466 Usage:
471 Usage:
467
472
468 %autocall [mode]
473 %autocall [mode]
469
474
470 The mode can be one of: 0->Off, 1->Smart, 2->Full. If not given, the
475 The mode can be one of: 0->Off, 1->Smart, 2->Full. If not given, the
471 value is toggled on and off (remembering the previous state)."""
476 value is toggled on and off (remembering the previous state)."""
472
477
473 rc = self.shell.rc
478 rc = self.shell.rc
474
479
475 if parameter_s:
480 if parameter_s:
476 arg = int(parameter_s)
481 arg = int(parameter_s)
477 else:
482 else:
478 arg = 'toggle'
483 arg = 'toggle'
479
484
480 if not arg in (0,1,2,'toggle'):
485 if not arg in (0,1,2,'toggle'):
481 error('Valid modes: (0->Off, 1->Smart, 2->Full')
486 error('Valid modes: (0->Off, 1->Smart, 2->Full')
482 return
487 return
483
488
484 if arg in (0,1,2):
489 if arg in (0,1,2):
485 rc.autocall = arg
490 rc.autocall = arg
486 else: # toggle
491 else: # toggle
487 if rc.autocall:
492 if rc.autocall:
488 self._magic_state.autocall_save = rc.autocall
493 self._magic_state.autocall_save = rc.autocall
489 rc.autocall = 0
494 rc.autocall = 0
490 else:
495 else:
491 try:
496 try:
492 rc.autocall = self._magic_state.autocall_save
497 rc.autocall = self._magic_state.autocall_save
493 except AttributeError:
498 except AttributeError:
494 rc.autocall = self._magic_state.autocall_save = 1
499 rc.autocall = self._magic_state.autocall_save = 1
495
500
496 print "Automatic calling is:",['OFF','Smart','Full'][rc.autocall]
501 print "Automatic calling is:",['OFF','Smart','Full'][rc.autocall]
497
502
498 def magic_autoindent(self, parameter_s = ''):
503 def magic_autoindent(self, parameter_s = ''):
499 """Toggle autoindent on/off (if available)."""
504 """Toggle autoindent on/off (if available)."""
500
505
501 self.shell.set_autoindent()
506 self.shell.set_autoindent()
502 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
507 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
503
508
504 def magic_system_verbose(self, parameter_s = ''):
509 def magic_system_verbose(self, parameter_s = ''):
505 """Set verbose printing of system calls.
510 """Set verbose printing of system calls.
506
511
507 If called without an argument, act as a toggle"""
512 If called without an argument, act as a toggle"""
508
513
509 if parameter_s:
514 if parameter_s:
510 val = bool(eval(parameter_s))
515 val = bool(eval(parameter_s))
511 else:
516 else:
512 val = None
517 val = None
513
518
514 self.shell.rc_set_toggle('system_verbose',val)
519 self.shell.rc_set_toggle('system_verbose',val)
515 print "System verbose printing is:",\
520 print "System verbose printing is:",\
516 ['OFF','ON'][self.shell.rc.system_verbose]
521 ['OFF','ON'][self.shell.rc.system_verbose]
517
522
518 def magic_history(self, parameter_s = ''):
523 def magic_history(self, parameter_s = ''):
519 """Print input history (_i<n> variables), with most recent last.
524 """Print input history (_i<n> variables), with most recent last.
520
525
521 %history -> print at most 40 inputs (some may be multi-line)\\
526 %history -> print at most 40 inputs (some may be multi-line)\\
522 %history n -> print at most n inputs\\
527 %history n -> print at most n inputs\\
523 %history n1 n2 -> print inputs between n1 and n2 (n2 not included)\\
528 %history n1 n2 -> print inputs between n1 and n2 (n2 not included)\\
524
529
525 Each input's number <n> is shown, and is accessible as the
530 Each input's number <n> is shown, and is accessible as the
526 automatically generated variable _i<n>. Multi-line statements are
531 automatically generated variable _i<n>. Multi-line statements are
527 printed starting at a new line for easy copy/paste.
532 printed starting at a new line for easy copy/paste.
528
533
529
534
530 Options:
535 Options:
531
536
532 -n: do NOT print line numbers. This is useful if you want to get a
537 -n: do NOT print line numbers. This is useful if you want to get a
533 printout of many lines which can be directly pasted into a text
538 printout of many lines which can be directly pasted into a text
534 editor.
539 editor.
535
540
536 This feature is only available if numbered prompts are in use.
541 This feature is only available if numbered prompts are in use.
537
542
538 -r: print the 'raw' history. IPython filters your input and
543 -r: print the 'raw' history. IPython filters your input and
539 converts it all into valid Python source before executing it (things
544 converts it all into valid Python source before executing it (things
540 like magics or aliases are turned into function calls, for
545 like magics or aliases are turned into function calls, for
541 example). With this option, you'll see the unfiltered history
546 example). With this option, you'll see the unfiltered history
542 instead of the filtered version: '%cd /' will be seen as '%cd /'
547 instead of the filtered version: '%cd /' will be seen as '%cd /'
543 instead of '_ip.magic("%cd /")'.
548 instead of '_ip.magic("%cd /")'.
544 """
549 """
545
550
546 shell = self.shell
551 shell = self.shell
547 if not shell.outputcache.do_full_cache:
552 if not shell.outputcache.do_full_cache:
548 print 'This feature is only available if numbered prompts are in use.'
553 print 'This feature is only available if numbered prompts are in use.'
549 return
554 return
550 opts,args = self.parse_options(parameter_s,'nr',mode='list')
555 opts,args = self.parse_options(parameter_s,'nr',mode='list')
551
556
552 if opts.has_key('r'):
557 if opts.has_key('r'):
553 input_hist = shell.input_hist_raw
558 input_hist = shell.input_hist_raw
554 else:
559 else:
555 input_hist = shell.input_hist
560 input_hist = shell.input_hist
556
561
557 default_length = 40
562 default_length = 40
558 if len(args) == 0:
563 if len(args) == 0:
559 final = len(input_hist)
564 final = len(input_hist)
560 init = max(1,final-default_length)
565 init = max(1,final-default_length)
561 elif len(args) == 1:
566 elif len(args) == 1:
562 final = len(input_hist)
567 final = len(input_hist)
563 init = max(1,final-int(args[0]))
568 init = max(1,final-int(args[0]))
564 elif len(args) == 2:
569 elif len(args) == 2:
565 init,final = map(int,args)
570 init,final = map(int,args)
566 else:
571 else:
567 warn('%hist takes 0, 1 or 2 arguments separated by spaces.')
572 warn('%hist takes 0, 1 or 2 arguments separated by spaces.')
568 print self.magic_hist.__doc__
573 print self.magic_hist.__doc__
569 return
574 return
570 width = len(str(final))
575 width = len(str(final))
571 line_sep = ['','\n']
576 line_sep = ['','\n']
572 print_nums = not opts.has_key('n')
577 print_nums = not opts.has_key('n')
573 for in_num in range(init,final):
578 for in_num in range(init,final):
574 inline = input_hist[in_num]
579 inline = input_hist[in_num]
575 multiline = int(inline.count('\n') > 1)
580 multiline = int(inline.count('\n') > 1)
576 if print_nums:
581 if print_nums:
577 print '%s:%s' % (str(in_num).ljust(width),line_sep[multiline]),
582 print '%s:%s' % (str(in_num).ljust(width),line_sep[multiline]),
578 print inline,
583 print inline,
579
584
580 def magic_hist(self, parameter_s=''):
585 def magic_hist(self, parameter_s=''):
581 """Alternate name for %history."""
586 """Alternate name for %history."""
582 return self.magic_history(parameter_s)
587 return self.magic_history(parameter_s)
583
588
584 def magic_p(self, parameter_s=''):
589 def magic_p(self, parameter_s=''):
585 """Just a short alias for Python's 'print'."""
590 """Just a short alias for Python's 'print'."""
586 exec 'print ' + parameter_s in self.shell.user_ns
591 exec 'print ' + parameter_s in self.shell.user_ns
587
592
588 def magic_r(self, parameter_s=''):
593 def magic_r(self, parameter_s=''):
589 """Repeat previous input.
594 """Repeat previous input.
590
595
591 If given an argument, repeats the previous command which starts with
596 If given an argument, repeats the previous command which starts with
592 the same string, otherwise it just repeats the previous input.
597 the same string, otherwise it just repeats the previous input.
593
598
594 Shell escaped commands (with ! as first character) are not recognized
599 Shell escaped commands (with ! as first character) are not recognized
595 by this system, only pure python code and magic commands.
600 by this system, only pure python code and magic commands.
596 """
601 """
597
602
598 start = parameter_s.strip()
603 start = parameter_s.strip()
599 esc_magic = self.shell.ESC_MAGIC
604 esc_magic = self.shell.ESC_MAGIC
600 # Identify magic commands even if automagic is on (which means
605 # Identify magic commands even if automagic is on (which means
601 # the in-memory version is different from that typed by the user).
606 # the in-memory version is different from that typed by the user).
602 if self.shell.rc.automagic:
607 if self.shell.rc.automagic:
603 start_magic = esc_magic+start
608 start_magic = esc_magic+start
604 else:
609 else:
605 start_magic = start
610 start_magic = start
606 # Look through the input history in reverse
611 # Look through the input history in reverse
607 for n in range(len(self.shell.input_hist)-2,0,-1):
612 for n in range(len(self.shell.input_hist)-2,0,-1):
608 input = self.shell.input_hist[n]
613 input = self.shell.input_hist[n]
609 # skip plain 'r' lines so we don't recurse to infinity
614 # skip plain 'r' lines so we don't recurse to infinity
610 if input != '_ip.magic("r")\n' and \
615 if input != '_ip.magic("r")\n' and \
611 (input.startswith(start) or input.startswith(start_magic)):
616 (input.startswith(start) or input.startswith(start_magic)):
612 #print 'match',`input` # dbg
617 #print 'match',`input` # dbg
613 print 'Executing:',input,
618 print 'Executing:',input,
614 self.shell.runlines(input)
619 self.shell.runlines(input)
615 return
620 return
616 print 'No previous input matching `%s` found.' % start
621 print 'No previous input matching `%s` found.' % start
617
622
618 def magic_page(self, parameter_s=''):
623 def magic_page(self, parameter_s=''):
619 """Pretty print the object and display it through a pager.
624 """Pretty print the object and display it through a pager.
620
625
621 %page [options] OBJECT
626 %page [options] OBJECT
622
627
623 If no object is given, use _ (last output).
628 If no object is given, use _ (last output).
624
629
625 Options:
630 Options:
626
631
627 -r: page str(object), don't pretty-print it."""
632 -r: page str(object), don't pretty-print it."""
628
633
629 # After a function contributed by Olivier Aubert, slightly modified.
634 # After a function contributed by Olivier Aubert, slightly modified.
630
635
631 # Process options/args
636 # Process options/args
632 opts,args = self.parse_options(parameter_s,'r')
637 opts,args = self.parse_options(parameter_s,'r')
633 raw = 'r' in opts
638 raw = 'r' in opts
634
639
635 oname = args and args or '_'
640 oname = args and args or '_'
636 info = self._ofind(oname)
641 info = self._ofind(oname)
637 if info['found']:
642 if info['found']:
638 txt = (raw and str or pformat)( info['obj'] )
643 txt = (raw and str or pformat)( info['obj'] )
639 page(txt)
644 page(txt)
640 else:
645 else:
641 print 'Object `%s` not found' % oname
646 print 'Object `%s` not found' % oname
642
647
643 def magic_profile(self, parameter_s=''):
648 def magic_profile(self, parameter_s=''):
644 """Print your currently active IPyhton profile."""
649 """Print your currently active IPyhton profile."""
645 if self.shell.rc.profile:
650 if self.shell.rc.profile:
646 printpl('Current IPython profile: $self.shell.rc.profile.')
651 printpl('Current IPython profile: $self.shell.rc.profile.')
647 else:
652 else:
648 print 'No profile active.'
653 print 'No profile active.'
649
654
650 def _inspect(self,meth,oname,namespaces=None,**kw):
655 def _inspect(self,meth,oname,namespaces=None,**kw):
651 """Generic interface to the inspector system.
656 """Generic interface to the inspector system.
652
657
653 This function is meant to be called by pdef, pdoc & friends."""
658 This function is meant to be called by pdef, pdoc & friends."""
654
659
655 oname = oname.strip()
660 oname = oname.strip()
656 info = Struct(self._ofind(oname, namespaces))
661 info = Struct(self._ofind(oname, namespaces))
657
662
658 if info.found:
663 if info.found:
659 # Get the docstring of the class property if it exists.
664 # Get the docstring of the class property if it exists.
660 path = oname.split('.')
665 path = oname.split('.')
661 root = '.'.join(path[:-1])
666 root = '.'.join(path[:-1])
662 if info.parent is not None:
667 if info.parent is not None:
663 try:
668 try:
664 target = getattr(info.parent, '__class__')
669 target = getattr(info.parent, '__class__')
665 # The object belongs to a class instance.
670 # The object belongs to a class instance.
666 try:
671 try:
667 target = getattr(target, path[-1])
672 target = getattr(target, path[-1])
668 # The class defines the object.
673 # The class defines the object.
669 if isinstance(target, property):
674 if isinstance(target, property):
670 oname = root + '.__class__.' + path[-1]
675 oname = root + '.__class__.' + path[-1]
671 info = Struct(self._ofind(oname))
676 info = Struct(self._ofind(oname))
672 except AttributeError: pass
677 except AttributeError: pass
673 except AttributeError: pass
678 except AttributeError: pass
674
679
675 pmethod = getattr(self.shell.inspector,meth)
680 pmethod = getattr(self.shell.inspector,meth)
676 formatter = info.ismagic and self.format_screen or None
681 formatter = info.ismagic and self.format_screen or None
677 if meth == 'pdoc':
682 if meth == 'pdoc':
678 pmethod(info.obj,oname,formatter)
683 pmethod(info.obj,oname,formatter)
679 elif meth == 'pinfo':
684 elif meth == 'pinfo':
680 pmethod(info.obj,oname,formatter,info,**kw)
685 pmethod(info.obj,oname,formatter,info,**kw)
681 else:
686 else:
682 pmethod(info.obj,oname)
687 pmethod(info.obj,oname)
683 else:
688 else:
684 print 'Object `%s` not found.' % oname
689 print 'Object `%s` not found.' % oname
685 return 'not found' # so callers can take other action
690 return 'not found' # so callers can take other action
686
691
687 def magic_pdef(self, parameter_s='', namespaces=None):
692 def magic_pdef(self, parameter_s='', namespaces=None):
688 """Print the definition header for any callable object.
693 """Print the definition header for any callable object.
689
694
690 If the object is a class, print the constructor information."""
695 If the object is a class, print the constructor information."""
691 print "+++"
696 print "+++"
692 self._inspect('pdef',parameter_s, namespaces)
697 self._inspect('pdef',parameter_s, namespaces)
693
698
694 def magic_pdoc(self, parameter_s='', namespaces=None):
699 def magic_pdoc(self, parameter_s='', namespaces=None):
695 """Print the docstring for an object.
700 """Print the docstring for an object.
696
701
697 If the given object is a class, it will print both the class and the
702 If the given object is a class, it will print both the class and the
698 constructor docstrings."""
703 constructor docstrings."""
699 self._inspect('pdoc',parameter_s, namespaces)
704 self._inspect('pdoc',parameter_s, namespaces)
700
705
701 def magic_psource(self, parameter_s='', namespaces=None):
706 def magic_psource(self, parameter_s='', namespaces=None):
702 """Print (or run through pager) the source code for an object."""
707 """Print (or run through pager) the source code for an object."""
703 self._inspect('psource',parameter_s, namespaces)
708 self._inspect('psource',parameter_s, namespaces)
704
709
705 def magic_pfile(self, parameter_s=''):
710 def magic_pfile(self, parameter_s=''):
706 """Print (or run through pager) the file where an object is defined.
711 """Print (or run through pager) the file where an object is defined.
707
712
708 The file opens at the line where the object definition begins. IPython
713 The file opens at the line where the object definition begins. IPython
709 will honor the environment variable PAGER if set, and otherwise will
714 will honor the environment variable PAGER if set, and otherwise will
710 do its best to print the file in a convenient form.
715 do its best to print the file in a convenient form.
711
716
712 If the given argument is not an object currently defined, IPython will
717 If the given argument is not an object currently defined, IPython will
713 try to interpret it as a filename (automatically adding a .py extension
718 try to interpret it as a filename (automatically adding a .py extension
714 if needed). You can thus use %pfile as a syntax highlighting code
719 if needed). You can thus use %pfile as a syntax highlighting code
715 viewer."""
720 viewer."""
716
721
717 # first interpret argument as an object name
722 # first interpret argument as an object name
718 out = self._inspect('pfile',parameter_s)
723 out = self._inspect('pfile',parameter_s)
719 # if not, try the input as a filename
724 # if not, try the input as a filename
720 if out == 'not found':
725 if out == 'not found':
721 try:
726 try:
722 filename = get_py_filename(parameter_s)
727 filename = get_py_filename(parameter_s)
723 except IOError,msg:
728 except IOError,msg:
724 print msg
729 print msg
725 return
730 return
726 page(self.shell.inspector.format(file(filename).read()))
731 page(self.shell.inspector.format(file(filename).read()))
727
732
728 def magic_pinfo(self, parameter_s='', namespaces=None):
733 def magic_pinfo(self, parameter_s='', namespaces=None):
729 """Provide detailed information about an object.
734 """Provide detailed information about an object.
730
735
731 '%pinfo object' is just a synonym for object? or ?object."""
736 '%pinfo object' is just a synonym for object? or ?object."""
732
737
733 #print 'pinfo par: <%s>' % parameter_s # dbg
738 #print 'pinfo par: <%s>' % parameter_s # dbg
734
739
735 # detail_level: 0 -> obj? , 1 -> obj??
740 # detail_level: 0 -> obj? , 1 -> obj??
736 detail_level = 0
741 detail_level = 0
737 # We need to detect if we got called as 'pinfo pinfo foo', which can
742 # We need to detect if we got called as 'pinfo pinfo foo', which can
738 # happen if the user types 'pinfo foo?' at the cmd line.
743 # happen if the user types 'pinfo foo?' at the cmd line.
739 pinfo,qmark1,oname,qmark2 = \
744 pinfo,qmark1,oname,qmark2 = \
740 re.match('(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
745 re.match('(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
741 if pinfo or qmark1 or qmark2:
746 if pinfo or qmark1 or qmark2:
742 detail_level = 1
747 detail_level = 1
743 if "*" in oname:
748 if "*" in oname:
744 self.magic_psearch(oname)
749 self.magic_psearch(oname)
745 else:
750 else:
746 self._inspect('pinfo', oname, detail_level=detail_level,
751 self._inspect('pinfo', oname, detail_level=detail_level,
747 namespaces=namespaces)
752 namespaces=namespaces)
748
753
749 def magic_psearch(self, parameter_s=''):
754 def magic_psearch(self, parameter_s=''):
750 """Search for object in namespaces by wildcard.
755 """Search for object in namespaces by wildcard.
751
756
752 %psearch [options] PATTERN [OBJECT TYPE]
757 %psearch [options] PATTERN [OBJECT TYPE]
753
758
754 Note: ? can be used as a synonym for %psearch, at the beginning or at
759 Note: ? can be used as a synonym for %psearch, at the beginning or at
755 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
760 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
756 rest of the command line must be unchanged (options come first), so
761 rest of the command line must be unchanged (options come first), so
757 for example the following forms are equivalent
762 for example the following forms are equivalent
758
763
759 %psearch -i a* function
764 %psearch -i a* function
760 -i a* function?
765 -i a* function?
761 ?-i a* function
766 ?-i a* function
762
767
763 Arguments:
768 Arguments:
764
769
765 PATTERN
770 PATTERN
766
771
767 where PATTERN is a string containing * as a wildcard similar to its
772 where PATTERN is a string containing * as a wildcard similar to its
768 use in a shell. The pattern is matched in all namespaces on the
773 use in a shell. The pattern is matched in all namespaces on the
769 search path. By default objects starting with a single _ are not
774 search path. By default objects starting with a single _ are not
770 matched, many IPython generated objects have a single
775 matched, many IPython generated objects have a single
771 underscore. The default is case insensitive matching. Matching is
776 underscore. The default is case insensitive matching. Matching is
772 also done on the attributes of objects and not only on the objects
777 also done on the attributes of objects and not only on the objects
773 in a module.
778 in a module.
774
779
775 [OBJECT TYPE]
780 [OBJECT TYPE]
776
781
777 Is the name of a python type from the types module. The name is
782 Is the name of a python type from the types module. The name is
778 given in lowercase without the ending type, ex. StringType is
783 given in lowercase without the ending type, ex. StringType is
779 written string. By adding a type here only objects matching the
784 written string. By adding a type here only objects matching the
780 given type are matched. Using all here makes the pattern match all
785 given type are matched. Using all here makes the pattern match all
781 types (this is the default).
786 types (this is the default).
782
787
783 Options:
788 Options:
784
789
785 -a: makes the pattern match even objects whose names start with a
790 -a: makes the pattern match even objects whose names start with a
786 single underscore. These names are normally ommitted from the
791 single underscore. These names are normally ommitted from the
787 search.
792 search.
788
793
789 -i/-c: make the pattern case insensitive/sensitive. If neither of
794 -i/-c: make the pattern case insensitive/sensitive. If neither of
790 these options is given, the default is read from your ipythonrc
795 these options is given, the default is read from your ipythonrc
791 file. The option name which sets this value is
796 file. The option name which sets this value is
792 'wildcards_case_sensitive'. If this option is not specified in your
797 'wildcards_case_sensitive'. If this option is not specified in your
793 ipythonrc file, IPython's internal default is to do a case sensitive
798 ipythonrc file, IPython's internal default is to do a case sensitive
794 search.
799 search.
795
800
796 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
801 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
797 specifiy can be searched in any of the following namespaces:
802 specifiy can be searched in any of the following namespaces:
798 'builtin', 'user', 'user_global','internal', 'alias', where
803 'builtin', 'user', 'user_global','internal', 'alias', where
799 'builtin' and 'user' are the search defaults. Note that you should
804 'builtin' and 'user' are the search defaults. Note that you should
800 not use quotes when specifying namespaces.
805 not use quotes when specifying namespaces.
801
806
802 'Builtin' contains the python module builtin, 'user' contains all
807 'Builtin' contains the python module builtin, 'user' contains all
803 user data, 'alias' only contain the shell aliases and no python
808 user data, 'alias' only contain the shell aliases and no python
804 objects, 'internal' contains objects used by IPython. The
809 objects, 'internal' contains objects used by IPython. The
805 'user_global' namespace is only used by embedded IPython instances,
810 'user_global' namespace is only used by embedded IPython instances,
806 and it contains module-level globals. You can add namespaces to the
811 and it contains module-level globals. You can add namespaces to the
807 search with -s or exclude them with -e (these options can be given
812 search with -s or exclude them with -e (these options can be given
808 more than once).
813 more than once).
809
814
810 Examples:
815 Examples:
811
816
812 %psearch a* -> objects beginning with an a
817 %psearch a* -> objects beginning with an a
813 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
818 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
814 %psearch a* function -> all functions beginning with an a
819 %psearch a* function -> all functions beginning with an a
815 %psearch re.e* -> objects beginning with an e in module re
820 %psearch re.e* -> objects beginning with an e in module re
816 %psearch r*.e* -> objects that start with e in modules starting in r
821 %psearch r*.e* -> objects that start with e in modules starting in r
817 %psearch r*.* string -> all strings in modules beginning with r
822 %psearch r*.* string -> all strings in modules beginning with r
818
823
819 Case sensitve search:
824 Case sensitve search:
820
825
821 %psearch -c a* list all object beginning with lower case a
826 %psearch -c a* list all object beginning with lower case a
822
827
823 Show objects beginning with a single _:
828 Show objects beginning with a single _:
824
829
825 %psearch -a _* list objects beginning with a single underscore"""
830 %psearch -a _* list objects beginning with a single underscore"""
826
831
827 # default namespaces to be searched
832 # default namespaces to be searched
828 def_search = ['user','builtin']
833 def_search = ['user','builtin']
829
834
830 # Process options/args
835 # Process options/args
831 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
836 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
832 opt = opts.get
837 opt = opts.get
833 shell = self.shell
838 shell = self.shell
834 psearch = shell.inspector.psearch
839 psearch = shell.inspector.psearch
835
840
836 # select case options
841 # select case options
837 if opts.has_key('i'):
842 if opts.has_key('i'):
838 ignore_case = True
843 ignore_case = True
839 elif opts.has_key('c'):
844 elif opts.has_key('c'):
840 ignore_case = False
845 ignore_case = False
841 else:
846 else:
842 ignore_case = not shell.rc.wildcards_case_sensitive
847 ignore_case = not shell.rc.wildcards_case_sensitive
843
848
844 # Build list of namespaces to search from user options
849 # Build list of namespaces to search from user options
845 def_search.extend(opt('s',[]))
850 def_search.extend(opt('s',[]))
846 ns_exclude = ns_exclude=opt('e',[])
851 ns_exclude = ns_exclude=opt('e',[])
847 ns_search = [nm for nm in def_search if nm not in ns_exclude]
852 ns_search = [nm for nm in def_search if nm not in ns_exclude]
848
853
849 # Call the actual search
854 # Call the actual search
850 try:
855 try:
851 psearch(args,shell.ns_table,ns_search,
856 psearch(args,shell.ns_table,ns_search,
852 show_all=opt('a'),ignore_case=ignore_case)
857 show_all=opt('a'),ignore_case=ignore_case)
853 except:
858 except:
854 shell.showtraceback()
859 shell.showtraceback()
855
860
856 def magic_who_ls(self, parameter_s=''):
861 def magic_who_ls(self, parameter_s=''):
857 """Return a sorted list of all interactive variables.
862 """Return a sorted list of all interactive variables.
858
863
859 If arguments are given, only variables of types matching these
864 If arguments are given, only variables of types matching these
860 arguments are returned."""
865 arguments are returned."""
861
866
862 user_ns = self.shell.user_ns
867 user_ns = self.shell.user_ns
863 internal_ns = self.shell.internal_ns
868 internal_ns = self.shell.internal_ns
864 user_config_ns = self.shell.user_config_ns
869 user_config_ns = self.shell.user_config_ns
865 out = []
870 out = []
866 typelist = parameter_s.split()
871 typelist = parameter_s.split()
867
872
868 for i in user_ns:
873 for i in user_ns:
869 if not (i.startswith('_') or i.startswith('_i')) \
874 if not (i.startswith('_') or i.startswith('_i')) \
870 and not (i in internal_ns or i in user_config_ns):
875 and not (i in internal_ns or i in user_config_ns):
871 if typelist:
876 if typelist:
872 if type(user_ns[i]).__name__ in typelist:
877 if type(user_ns[i]).__name__ in typelist:
873 out.append(i)
878 out.append(i)
874 else:
879 else:
875 out.append(i)
880 out.append(i)
876 out.sort()
881 out.sort()
877 return out
882 return out
878
883
879 def magic_who(self, parameter_s=''):
884 def magic_who(self, parameter_s=''):
880 """Print all interactive variables, with some minimal formatting.
885 """Print all interactive variables, with some minimal formatting.
881
886
882 If any arguments are given, only variables whose type matches one of
887 If any arguments are given, only variables whose type matches one of
883 these are printed. For example:
888 these are printed. For example:
884
889
885 %who function str
890 %who function str
886
891
887 will only list functions and strings, excluding all other types of
892 will only list functions and strings, excluding all other types of
888 variables. To find the proper type names, simply use type(var) at a
893 variables. To find the proper type names, simply use type(var) at a
889 command line to see how python prints type names. For example:
894 command line to see how python prints type names. For example:
890
895
891 In [1]: type('hello')\\
896 In [1]: type('hello')\\
892 Out[1]: <type 'str'>
897 Out[1]: <type 'str'>
893
898
894 indicates that the type name for strings is 'str'.
899 indicates that the type name for strings is 'str'.
895
900
896 %who always excludes executed names loaded through your configuration
901 %who always excludes executed names loaded through your configuration
897 file and things which are internal to IPython.
902 file and things which are internal to IPython.
898
903
899 This is deliberate, as typically you may load many modules and the
904 This is deliberate, as typically you may load many modules and the
900 purpose of %who is to show you only what you've manually defined."""
905 purpose of %who is to show you only what you've manually defined."""
901
906
902 varlist = self.magic_who_ls(parameter_s)
907 varlist = self.magic_who_ls(parameter_s)
903 if not varlist:
908 if not varlist:
904 print 'Interactive namespace is empty.'
909 print 'Interactive namespace is empty.'
905 return
910 return
906
911
907 # if we have variables, move on...
912 # if we have variables, move on...
908
913
909 # stupid flushing problem: when prompts have no separators, stdout is
914 # stupid flushing problem: when prompts have no separators, stdout is
910 # getting lost. I'm starting to think this is a python bug. I'm having
915 # getting lost. I'm starting to think this is a python bug. I'm having
911 # to force a flush with a print because even a sys.stdout.flush
916 # to force a flush with a print because even a sys.stdout.flush
912 # doesn't seem to do anything!
917 # doesn't seem to do anything!
913
918
914 count = 0
919 count = 0
915 for i in varlist:
920 for i in varlist:
916 print i+'\t',
921 print i+'\t',
917 count += 1
922 count += 1
918 if count > 8:
923 if count > 8:
919 count = 0
924 count = 0
920 print
925 print
921 sys.stdout.flush() # FIXME. Why the hell isn't this flushing???
926 sys.stdout.flush() # FIXME. Why the hell isn't this flushing???
922
927
923 print # well, this does force a flush at the expense of an extra \n
928 print # well, this does force a flush at the expense of an extra \n
924
929
925 def magic_whos(self, parameter_s=''):
930 def magic_whos(self, parameter_s=''):
926 """Like %who, but gives some extra information about each variable.
931 """Like %who, but gives some extra information about each variable.
927
932
928 The same type filtering of %who can be applied here.
933 The same type filtering of %who can be applied here.
929
934
930 For all variables, the type is printed. Additionally it prints:
935 For all variables, the type is printed. Additionally it prints:
931
936
932 - For {},[],(): their length.
937 - For {},[],(): their length.
933
938
934 - For Numeric arrays, a summary with shape, number of elements,
939 - For Numeric arrays, a summary with shape, number of elements,
935 typecode and size in memory.
940 typecode and size in memory.
936
941
937 - Everything else: a string representation, snipping their middle if
942 - Everything else: a string representation, snipping their middle if
938 too long."""
943 too long."""
939
944
940 varnames = self.magic_who_ls(parameter_s)
945 varnames = self.magic_who_ls(parameter_s)
941 if not varnames:
946 if not varnames:
942 print 'Interactive namespace is empty.'
947 print 'Interactive namespace is empty.'
943 return
948 return
944
949
945 # if we have variables, move on...
950 # if we have variables, move on...
946
951
947 # for these types, show len() instead of data:
952 # for these types, show len() instead of data:
948 seq_types = [types.DictType,types.ListType,types.TupleType]
953 seq_types = [types.DictType,types.ListType,types.TupleType]
949
954
950 # for Numeric arrays, display summary info
955 # for Numeric arrays, display summary info
951 try:
956 try:
952 import Numeric
957 import Numeric
953 except ImportError:
958 except ImportError:
954 array_type = None
959 array_type = None
955 else:
960 else:
956 array_type = Numeric.ArrayType.__name__
961 array_type = Numeric.ArrayType.__name__
957
962
958 # Find all variable names and types so we can figure out column sizes
963 # Find all variable names and types so we can figure out column sizes
959 get_vars = lambda i: self.shell.user_ns[i]
964 get_vars = lambda i: self.shell.user_ns[i]
960 type_name = lambda v: type(v).__name__
965 type_name = lambda v: type(v).__name__
961 varlist = map(get_vars,varnames)
966 varlist = map(get_vars,varnames)
962
967
963 typelist = []
968 typelist = []
964 for vv in varlist:
969 for vv in varlist:
965 tt = type_name(vv)
970 tt = type_name(vv)
966 if tt=='instance':
971 if tt=='instance':
967 typelist.append(str(vv.__class__))
972 typelist.append(str(vv.__class__))
968 else:
973 else:
969 typelist.append(tt)
974 typelist.append(tt)
970
975
971 # column labels and # of spaces as separator
976 # column labels and # of spaces as separator
972 varlabel = 'Variable'
977 varlabel = 'Variable'
973 typelabel = 'Type'
978 typelabel = 'Type'
974 datalabel = 'Data/Info'
979 datalabel = 'Data/Info'
975 colsep = 3
980 colsep = 3
976 # variable format strings
981 # variable format strings
977 vformat = "$vname.ljust(varwidth)$vtype.ljust(typewidth)"
982 vformat = "$vname.ljust(varwidth)$vtype.ljust(typewidth)"
978 vfmt_short = '$vstr[:25]<...>$vstr[-25:]'
983 vfmt_short = '$vstr[:25]<...>$vstr[-25:]'
979 aformat = "%s: %s elems, type `%s`, %s bytes"
984 aformat = "%s: %s elems, type `%s`, %s bytes"
980 # find the size of the columns to format the output nicely
985 # find the size of the columns to format the output nicely
981 varwidth = max(max(map(len,varnames)), len(varlabel)) + colsep
986 varwidth = max(max(map(len,varnames)), len(varlabel)) + colsep
982 typewidth = max(max(map(len,typelist)), len(typelabel)) + colsep
987 typewidth = max(max(map(len,typelist)), len(typelabel)) + colsep
983 # table header
988 # table header
984 print varlabel.ljust(varwidth) + typelabel.ljust(typewidth) + \
989 print varlabel.ljust(varwidth) + typelabel.ljust(typewidth) + \
985 ' '+datalabel+'\n' + '-'*(varwidth+typewidth+len(datalabel)+1)
990 ' '+datalabel+'\n' + '-'*(varwidth+typewidth+len(datalabel)+1)
986 # and the table itself
991 # and the table itself
987 kb = 1024
992 kb = 1024
988 Mb = 1048576 # kb**2
993 Mb = 1048576 # kb**2
989 for vname,var,vtype in zip(varnames,varlist,typelist):
994 for vname,var,vtype in zip(varnames,varlist,typelist):
990 print itpl(vformat),
995 print itpl(vformat),
991 if vtype in seq_types:
996 if vtype in seq_types:
992 print len(var)
997 print len(var)
993 elif vtype==array_type:
998 elif vtype==array_type:
994 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
999 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
995 vsize = Numeric.size(var)
1000 vsize = Numeric.size(var)
996 vbytes = vsize*var.itemsize()
1001 vbytes = vsize*var.itemsize()
997 if vbytes < 100000:
1002 if vbytes < 100000:
998 print aformat % (vshape,vsize,var.typecode(),vbytes)
1003 print aformat % (vshape,vsize,var.typecode(),vbytes)
999 else:
1004 else:
1000 print aformat % (vshape,vsize,var.typecode(),vbytes),
1005 print aformat % (vshape,vsize,var.typecode(),vbytes),
1001 if vbytes < Mb:
1006 if vbytes < Mb:
1002 print '(%s kb)' % (vbytes/kb,)
1007 print '(%s kb)' % (vbytes/kb,)
1003 else:
1008 else:
1004 print '(%s Mb)' % (vbytes/Mb,)
1009 print '(%s Mb)' % (vbytes/Mb,)
1005 else:
1010 else:
1006 vstr = str(var).replace('\n','\\n')
1011 vstr = str(var).replace('\n','\\n')
1007 if len(vstr) < 50:
1012 if len(vstr) < 50:
1008 print vstr
1013 print vstr
1009 else:
1014 else:
1010 printpl(vfmt_short)
1015 printpl(vfmt_short)
1011
1016
1012 def magic_reset(self, parameter_s=''):
1017 def magic_reset(self, parameter_s=''):
1013 """Resets the namespace by removing all names defined by the user.
1018 """Resets the namespace by removing all names defined by the user.
1014
1019
1015 Input/Output history are left around in case you need them."""
1020 Input/Output history are left around in case you need them."""
1016
1021
1017 ans = self.shell.ask_yes_no(
1022 ans = self.shell.ask_yes_no(
1018 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
1023 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
1019 if not ans:
1024 if not ans:
1020 print 'Nothing done.'
1025 print 'Nothing done.'
1021 return
1026 return
1022 user_ns = self.shell.user_ns
1027 user_ns = self.shell.user_ns
1023 for i in self.magic_who_ls():
1028 for i in self.magic_who_ls():
1024 del(user_ns[i])
1029 del(user_ns[i])
1025
1030
1026 def magic_config(self,parameter_s=''):
1031 def magic_config(self,parameter_s=''):
1027 """Handle IPython's internal configuration.
1032 """Handle IPython's internal configuration.
1028
1033
1029 If called without arguments, it will print IPython's complete internal
1034 If called without arguments, it will print IPython's complete internal
1030 configuration.
1035 configuration.
1031
1036
1032 If called with one argument, it will print the value of that key in
1037 If called with one argument, it will print the value of that key in
1033 the configuration.
1038 the configuration.
1034
1039
1035 If called with more than one argument, the first is interpreted as a
1040 If called with more than one argument, the first is interpreted as a
1036 key and the rest as a Python expression which gets eval()'d.
1041 key and the rest as a Python expression which gets eval()'d.
1037
1042
1038 Examples:
1043 Examples:
1039
1044
1040 In [1]: s='A Python string'
1045 In [1]: s='A Python string'
1041
1046
1042 In [2]: !echo $s
1047 In [2]: !echo $s
1043 A Python string
1048 A Python string
1044
1049
1045 In [3]: config system_verbose True
1050 In [3]: config system_verbose True
1046
1051
1047 In [4]: !echo $s
1052 In [4]: !echo $s
1048 IPython system call: echo A Python string
1053 IPython system call: echo A Python string
1049 A Python string
1054 A Python string
1050
1055
1051 In [5]: %config system_header 'sys> '
1056 In [5]: %config system_header 'sys> '
1052
1057
1053 In [6]: !echo $s
1058 In [6]: !echo $s
1054 sys> echo A Python string
1059 sys> echo A Python string
1055 A Python string
1060 A Python string
1056
1061
1057 # Notice the extra quotes to protect the string after interpolation:
1062 # Notice the extra quotes to protect the string after interpolation:
1058 In [7]: header = "'sys2> '"
1063 In [7]: header = "'sys2> '"
1059
1064
1060 In [8]: %config system_header $header
1065 In [8]: %config system_header $header
1061
1066
1062 In [9]: !echo $s
1067 In [9]: !echo $s
1063 sys2> echo A Python string
1068 sys2> echo A Python string
1064 A Python string
1069 A Python string
1065 """
1070 """
1066
1071
1067 args = parameter_s.split(None,1)
1072 args = parameter_s.split(None,1)
1068 key = args[0]
1073 key = args[0]
1069 if len(args)==1:
1074 if len(args)==1:
1070 self.shell.ipconfig(key)
1075 self.shell.ipconfig(key)
1071 else:
1076 else:
1072 self.shell.ipconfig(key,eval(args[1]))
1077 self.shell.ipconfig(key,eval(args[1]))
1073
1078
1074 def magic_logstart(self,parameter_s=''):
1079 def magic_logstart(self,parameter_s=''):
1075 """Start logging anywhere in a session.
1080 """Start logging anywhere in a session.
1076
1081
1077 %logstart [-o|-r|-t] [log_name [log_mode]]
1082 %logstart [-o|-r|-t] [log_name [log_mode]]
1078
1083
1079 If no name is given, it defaults to a file named 'ipython_log.py' in your
1084 If no name is given, it defaults to a file named 'ipython_log.py' in your
1080 current directory, in 'rotate' mode (see below).
1085 current directory, in 'rotate' mode (see below).
1081
1086
1082 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
1087 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
1083 history up to that point and then continues logging.
1088 history up to that point and then continues logging.
1084
1089
1085 %logstart takes a second optional parameter: logging mode. This can be one
1090 %logstart takes a second optional parameter: logging mode. This can be one
1086 of (note that the modes are given unquoted):\\
1091 of (note that the modes are given unquoted):\\
1087 append: well, that says it.\\
1092 append: well, that says it.\\
1088 backup: rename (if exists) to name~ and start name.\\
1093 backup: rename (if exists) to name~ and start name.\\
1089 global: single logfile in your home dir, appended to.\\
1094 global: single logfile in your home dir, appended to.\\
1090 over : overwrite existing log.\\
1095 over : overwrite existing log.\\
1091 rotate: create rotating logs name.1~, name.2~, etc.
1096 rotate: create rotating logs name.1~, name.2~, etc.
1092
1097
1093 Options:
1098 Options:
1094
1099
1095 -o: log also IPython's output. In this mode, all commands which
1100 -o: log also IPython's output. In this mode, all commands which
1096 generate an Out[NN] prompt are recorded to the logfile, right after
1101 generate an Out[NN] prompt are recorded to the logfile, right after
1097 their corresponding input line. The output lines are always
1102 their corresponding input line. The output lines are always
1098 prepended with a '#[Out]# ' marker, so that the log remains valid
1103 prepended with a '#[Out]# ' marker, so that the log remains valid
1099 Python code.
1104 Python code.
1100
1105
1101 Since this marker is always the same, filtering only the output from
1106 Since this marker is always the same, filtering only the output from
1102 a log is very easy, using for example a simple awk call:
1107 a log is very easy, using for example a simple awk call:
1103
1108
1104 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
1109 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
1105
1110
1106 -r: log 'raw' input. Normally, IPython's logs contain the processed
1111 -r: log 'raw' input. Normally, IPython's logs contain the processed
1107 input, so that user lines are logged in their final form, converted
1112 input, so that user lines are logged in their final form, converted
1108 into valid Python. For example, %Exit is logged as
1113 into valid Python. For example, %Exit is logged as
1109 '_ip.magic("Exit"). If the -r flag is given, all input is logged
1114 '_ip.magic("Exit"). If the -r flag is given, all input is logged
1110 exactly as typed, with no transformations applied.
1115 exactly as typed, with no transformations applied.
1111
1116
1112 -t: put timestamps before each input line logged (these are put in
1117 -t: put timestamps before each input line logged (these are put in
1113 comments)."""
1118 comments)."""
1114
1119
1115 opts,par = self.parse_options(parameter_s,'ort')
1120 opts,par = self.parse_options(parameter_s,'ort')
1116 log_output = 'o' in opts
1121 log_output = 'o' in opts
1117 log_raw_input = 'r' in opts
1122 log_raw_input = 'r' in opts
1118 timestamp = 't' in opts
1123 timestamp = 't' in opts
1119
1124
1120 rc = self.shell.rc
1125 rc = self.shell.rc
1121 logger = self.shell.logger
1126 logger = self.shell.logger
1122
1127
1123 # if no args are given, the defaults set in the logger constructor by
1128 # if no args are given, the defaults set in the logger constructor by
1124 # ipytohn remain valid
1129 # ipytohn remain valid
1125 if par:
1130 if par:
1126 try:
1131 try:
1127 logfname,logmode = par.split()
1132 logfname,logmode = par.split()
1128 except:
1133 except:
1129 logfname = par
1134 logfname = par
1130 logmode = 'backup'
1135 logmode = 'backup'
1131 else:
1136 else:
1132 logfname = logger.logfname
1137 logfname = logger.logfname
1133 logmode = logger.logmode
1138 logmode = logger.logmode
1134 # put logfname into rc struct as if it had been called on the command
1139 # put logfname into rc struct as if it had been called on the command
1135 # line, so it ends up saved in the log header Save it in case we need
1140 # line, so it ends up saved in the log header Save it in case we need
1136 # to restore it...
1141 # to restore it...
1137 old_logfile = rc.opts.get('logfile','')
1142 old_logfile = rc.opts.get('logfile','')
1138 if logfname:
1143 if logfname:
1139 logfname = os.path.expanduser(logfname)
1144 logfname = os.path.expanduser(logfname)
1140 rc.opts.logfile = logfname
1145 rc.opts.logfile = logfname
1141 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
1146 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
1142 try:
1147 try:
1143 started = logger.logstart(logfname,loghead,logmode,
1148 started = logger.logstart(logfname,loghead,logmode,
1144 log_output,timestamp,log_raw_input)
1149 log_output,timestamp,log_raw_input)
1145 except:
1150 except:
1146 rc.opts.logfile = old_logfile
1151 rc.opts.logfile = old_logfile
1147 warn("Couldn't start log: %s" % sys.exc_info()[1])
1152 warn("Couldn't start log: %s" % sys.exc_info()[1])
1148 else:
1153 else:
1149 # log input history up to this point, optionally interleaving
1154 # log input history up to this point, optionally interleaving
1150 # output if requested
1155 # output if requested
1151
1156
1152 if timestamp:
1157 if timestamp:
1153 # disable timestamping for the previous history, since we've
1158 # disable timestamping for the previous history, since we've
1154 # lost those already (no time machine here).
1159 # lost those already (no time machine here).
1155 logger.timestamp = False
1160 logger.timestamp = False
1156
1161
1157 if log_raw_input:
1162 if log_raw_input:
1158 input_hist = self.shell.input_hist_raw
1163 input_hist = self.shell.input_hist_raw
1159 else:
1164 else:
1160 input_hist = self.shell.input_hist
1165 input_hist = self.shell.input_hist
1161
1166
1162 if log_output:
1167 if log_output:
1163 log_write = logger.log_write
1168 log_write = logger.log_write
1164 output_hist = self.shell.output_hist
1169 output_hist = self.shell.output_hist
1165 for n in range(1,len(input_hist)-1):
1170 for n in range(1,len(input_hist)-1):
1166 log_write(input_hist[n].rstrip())
1171 log_write(input_hist[n].rstrip())
1167 if n in output_hist:
1172 if n in output_hist:
1168 log_write(repr(output_hist[n]),'output')
1173 log_write(repr(output_hist[n]),'output')
1169 else:
1174 else:
1170 logger.log_write(input_hist[1:])
1175 logger.log_write(input_hist[1:])
1171 if timestamp:
1176 if timestamp:
1172 # re-enable timestamping
1177 # re-enable timestamping
1173 logger.timestamp = True
1178 logger.timestamp = True
1174
1179
1175 print ('Activating auto-logging. '
1180 print ('Activating auto-logging. '
1176 'Current session state plus future input saved.')
1181 'Current session state plus future input saved.')
1177 logger.logstate()
1182 logger.logstate()
1178
1183
1179 def magic_logoff(self,parameter_s=''):
1184 def magic_logoff(self,parameter_s=''):
1180 """Temporarily stop logging.
1185 """Temporarily stop logging.
1181
1186
1182 You must have previously started logging."""
1187 You must have previously started logging."""
1183 self.shell.logger.switch_log(0)
1188 self.shell.logger.switch_log(0)
1184
1189
1185 def magic_logon(self,parameter_s=''):
1190 def magic_logon(self,parameter_s=''):
1186 """Restart logging.
1191 """Restart logging.
1187
1192
1188 This function is for restarting logging which you've temporarily
1193 This function is for restarting logging which you've temporarily
1189 stopped with %logoff. For starting logging for the first time, you
1194 stopped with %logoff. For starting logging for the first time, you
1190 must use the %logstart function, which allows you to specify an
1195 must use the %logstart function, which allows you to specify an
1191 optional log filename."""
1196 optional log filename."""
1192
1197
1193 self.shell.logger.switch_log(1)
1198 self.shell.logger.switch_log(1)
1194
1199
1195 def magic_logstate(self,parameter_s=''):
1200 def magic_logstate(self,parameter_s=''):
1196 """Print the status of the logging system."""
1201 """Print the status of the logging system."""
1197
1202
1198 self.shell.logger.logstate()
1203 self.shell.logger.logstate()
1199
1204
1200 def magic_pdb(self, parameter_s=''):
1205 def magic_pdb(self, parameter_s=''):
1201 """Control the calling of the pdb interactive debugger.
1206 """Control the calling of the pdb interactive debugger.
1202
1207
1203 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1208 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1204 argument it works as a toggle.
1209 argument it works as a toggle.
1205
1210
1206 When an exception is triggered, IPython can optionally call the
1211 When an exception is triggered, IPython can optionally call the
1207 interactive pdb debugger after the traceback printout. %pdb toggles
1212 interactive pdb debugger after the traceback printout. %pdb toggles
1208 this feature on and off."""
1213 this feature on and off."""
1209
1214
1210 par = parameter_s.strip().lower()
1215 par = parameter_s.strip().lower()
1211
1216
1212 if par:
1217 if par:
1213 try:
1218 try:
1214 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1219 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1215 except KeyError:
1220 except KeyError:
1216 print ('Incorrect argument. Use on/1, off/0, '
1221 print ('Incorrect argument. Use on/1, off/0, '
1217 'or nothing for a toggle.')
1222 'or nothing for a toggle.')
1218 return
1223 return
1219 else:
1224 else:
1220 # toggle
1225 # toggle
1221 new_pdb = not self.shell.InteractiveTB.call_pdb
1226 new_pdb = not self.shell.InteractiveTB.call_pdb
1222
1227
1223 # set on the shell
1228 # set on the shell
1224 self.shell.call_pdb = new_pdb
1229 self.shell.call_pdb = new_pdb
1225 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1230 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1226
1231
1227 def magic_prun(self, parameter_s ='',user_mode=1,
1232 def magic_prun(self, parameter_s ='',user_mode=1,
1228 opts=None,arg_lst=None,prog_ns=None):
1233 opts=None,arg_lst=None,prog_ns=None):
1229
1234
1230 """Run a statement through the python code profiler.
1235 """Run a statement through the python code profiler.
1231
1236
1232 Usage:\\
1237 Usage:\\
1233 %prun [options] statement
1238 %prun [options] statement
1234
1239
1235 The given statement (which doesn't require quote marks) is run via the
1240 The given statement (which doesn't require quote marks) is run via the
1236 python profiler in a manner similar to the profile.run() function.
1241 python profiler in a manner similar to the profile.run() function.
1237 Namespaces are internally managed to work correctly; profile.run
1242 Namespaces are internally managed to work correctly; profile.run
1238 cannot be used in IPython because it makes certain assumptions about
1243 cannot be used in IPython because it makes certain assumptions about
1239 namespaces which do not hold under IPython.
1244 namespaces which do not hold under IPython.
1240
1245
1241 Options:
1246 Options:
1242
1247
1243 -l <limit>: you can place restrictions on what or how much of the
1248 -l <limit>: you can place restrictions on what or how much of the
1244 profile gets printed. The limit value can be:
1249 profile gets printed. The limit value can be:
1245
1250
1246 * A string: only information for function names containing this string
1251 * A string: only information for function names containing this string
1247 is printed.
1252 is printed.
1248
1253
1249 * An integer: only these many lines are printed.
1254 * An integer: only these many lines are printed.
1250
1255
1251 * A float (between 0 and 1): this fraction of the report is printed
1256 * A float (between 0 and 1): this fraction of the report is printed
1252 (for example, use a limit of 0.4 to see the topmost 40% only).
1257 (for example, use a limit of 0.4 to see the topmost 40% only).
1253
1258
1254 You can combine several limits with repeated use of the option. For
1259 You can combine several limits with repeated use of the option. For
1255 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1260 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1256 information about class constructors.
1261 information about class constructors.
1257
1262
1258 -r: return the pstats.Stats object generated by the profiling. This
1263 -r: return the pstats.Stats object generated by the profiling. This
1259 object has all the information about the profile in it, and you can
1264 object has all the information about the profile in it, and you can
1260 later use it for further analysis or in other functions.
1265 later use it for further analysis or in other functions.
1261
1266
1262 -s <key>: sort profile by given key. You can provide more than one key
1267 -s <key>: sort profile by given key. You can provide more than one key
1263 by using the option several times: '-s key1 -s key2 -s key3...'. The
1268 by using the option several times: '-s key1 -s key2 -s key3...'. The
1264 default sorting key is 'time'.
1269 default sorting key is 'time'.
1265
1270
1266 The following is copied verbatim from the profile documentation
1271 The following is copied verbatim from the profile documentation
1267 referenced below:
1272 referenced below:
1268
1273
1269 When more than one key is provided, additional keys are used as
1274 When more than one key is provided, additional keys are used as
1270 secondary criteria when the there is equality in all keys selected
1275 secondary criteria when the there is equality in all keys selected
1271 before them.
1276 before them.
1272
1277
1273 Abbreviations can be used for any key names, as long as the
1278 Abbreviations can be used for any key names, as long as the
1274 abbreviation is unambiguous. The following are the keys currently
1279 abbreviation is unambiguous. The following are the keys currently
1275 defined:
1280 defined:
1276
1281
1277 Valid Arg Meaning\\
1282 Valid Arg Meaning\\
1278 "calls" call count\\
1283 "calls" call count\\
1279 "cumulative" cumulative time\\
1284 "cumulative" cumulative time\\
1280 "file" file name\\
1285 "file" file name\\
1281 "module" file name\\
1286 "module" file name\\
1282 "pcalls" primitive call count\\
1287 "pcalls" primitive call count\\
1283 "line" line number\\
1288 "line" line number\\
1284 "name" function name\\
1289 "name" function name\\
1285 "nfl" name/file/line\\
1290 "nfl" name/file/line\\
1286 "stdname" standard name\\
1291 "stdname" standard name\\
1287 "time" internal time
1292 "time" internal time
1288
1293
1289 Note that all sorts on statistics are in descending order (placing
1294 Note that all sorts on statistics are in descending order (placing
1290 most time consuming items first), where as name, file, and line number
1295 most time consuming items first), where as name, file, and line number
1291 searches are in ascending order (i.e., alphabetical). The subtle
1296 searches are in ascending order (i.e., alphabetical). The subtle
1292 distinction between "nfl" and "stdname" is that the standard name is a
1297 distinction between "nfl" and "stdname" is that the standard name is a
1293 sort of the name as printed, which means that the embedded line
1298 sort of the name as printed, which means that the embedded line
1294 numbers get compared in an odd way. For example, lines 3, 20, and 40
1299 numbers get compared in an odd way. For example, lines 3, 20, and 40
1295 would (if the file names were the same) appear in the string order
1300 would (if the file names were the same) appear in the string order
1296 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1301 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1297 line numbers. In fact, sort_stats("nfl") is the same as
1302 line numbers. In fact, sort_stats("nfl") is the same as
1298 sort_stats("name", "file", "line").
1303 sort_stats("name", "file", "line").
1299
1304
1300 -T <filename>: save profile results as shown on screen to a text
1305 -T <filename>: save profile results as shown on screen to a text
1301 file. The profile is still shown on screen.
1306 file. The profile is still shown on screen.
1302
1307
1303 -D <filename>: save (via dump_stats) profile statistics to given
1308 -D <filename>: save (via dump_stats) profile statistics to given
1304 filename. This data is in a format understod by the pstats module, and
1309 filename. This data is in a format understod by the pstats module, and
1305 is generated by a call to the dump_stats() method of profile
1310 is generated by a call to the dump_stats() method of profile
1306 objects. The profile is still shown on screen.
1311 objects. The profile is still shown on screen.
1307
1312
1308 If you want to run complete programs under the profiler's control, use
1313 If you want to run complete programs under the profiler's control, use
1309 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1314 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1310 contains profiler specific options as described here.
1315 contains profiler specific options as described here.
1311
1316
1312 You can read the complete documentation for the profile module with:\\
1317 You can read the complete documentation for the profile module with:\\
1313 In [1]: import profile; profile.help() """
1318 In [1]: import profile; profile.help() """
1314
1319
1315 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1320 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1316 # protect user quote marks
1321 # protect user quote marks
1317 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1322 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1318
1323
1319 if user_mode: # regular user call
1324 if user_mode: # regular user call
1320 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1325 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1321 list_all=1)
1326 list_all=1)
1322 namespace = self.shell.user_ns
1327 namespace = self.shell.user_ns
1323 else: # called to run a program by %run -p
1328 else: # called to run a program by %run -p
1324 try:
1329 try:
1325 filename = get_py_filename(arg_lst[0])
1330 filename = get_py_filename(arg_lst[0])
1326 except IOError,msg:
1331 except IOError,msg:
1327 error(msg)
1332 error(msg)
1328 return
1333 return
1329
1334
1330 arg_str = 'execfile(filename,prog_ns)'
1335 arg_str = 'execfile(filename,prog_ns)'
1331 namespace = locals()
1336 namespace = locals()
1332
1337
1333 opts.merge(opts_def)
1338 opts.merge(opts_def)
1334
1339
1335 prof = profile.Profile()
1340 prof = profile.Profile()
1336 try:
1341 try:
1337 prof = prof.runctx(arg_str,namespace,namespace)
1342 prof = prof.runctx(arg_str,namespace,namespace)
1338 sys_exit = ''
1343 sys_exit = ''
1339 except SystemExit:
1344 except SystemExit:
1340 sys_exit = """*** SystemExit exception caught in code being profiled."""
1345 sys_exit = """*** SystemExit exception caught in code being profiled."""
1341
1346
1342 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1347 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1343
1348
1344 lims = opts.l
1349 lims = opts.l
1345 if lims:
1350 if lims:
1346 lims = [] # rebuild lims with ints/floats/strings
1351 lims = [] # rebuild lims with ints/floats/strings
1347 for lim in opts.l:
1352 for lim in opts.l:
1348 try:
1353 try:
1349 lims.append(int(lim))
1354 lims.append(int(lim))
1350 except ValueError:
1355 except ValueError:
1351 try:
1356 try:
1352 lims.append(float(lim))
1357 lims.append(float(lim))
1353 except ValueError:
1358 except ValueError:
1354 lims.append(lim)
1359 lims.append(lim)
1355
1360
1356 # trap output
1361 # trap output
1357 sys_stdout = sys.stdout
1362 sys_stdout = sys.stdout
1358 stdout_trap = StringIO()
1363 stdout_trap = StringIO()
1359 try:
1364 try:
1360 sys.stdout = stdout_trap
1365 sys.stdout = stdout_trap
1361 stats.print_stats(*lims)
1366 stats.print_stats(*lims)
1362 finally:
1367 finally:
1363 sys.stdout = sys_stdout
1368 sys.stdout = sys_stdout
1364 output = stdout_trap.getvalue()
1369 output = stdout_trap.getvalue()
1365 output = output.rstrip()
1370 output = output.rstrip()
1366
1371
1367 page(output,screen_lines=self.shell.rc.screen_length)
1372 page(output,screen_lines=self.shell.rc.screen_length)
1368 print sys_exit,
1373 print sys_exit,
1369
1374
1370 dump_file = opts.D[0]
1375 dump_file = opts.D[0]
1371 text_file = opts.T[0]
1376 text_file = opts.T[0]
1372 if dump_file:
1377 if dump_file:
1373 prof.dump_stats(dump_file)
1378 prof.dump_stats(dump_file)
1374 print '\n*** Profile stats marshalled to file',\
1379 print '\n*** Profile stats marshalled to file',\
1375 `dump_file`+'.',sys_exit
1380 `dump_file`+'.',sys_exit
1376 if text_file:
1381 if text_file:
1377 file(text_file,'w').write(output)
1382 file(text_file,'w').write(output)
1378 print '\n*** Profile printout saved to text file',\
1383 print '\n*** Profile printout saved to text file',\
1379 `text_file`+'.',sys_exit
1384 `text_file`+'.',sys_exit
1380
1385
1381 if opts.has_key('r'):
1386 if opts.has_key('r'):
1382 return stats
1387 return stats
1383 else:
1388 else:
1384 return None
1389 return None
1385
1390
1386 def magic_run(self, parameter_s ='',runner=None):
1391 def magic_run(self, parameter_s ='',runner=None):
1387 """Run the named file inside IPython as a program.
1392 """Run the named file inside IPython as a program.
1388
1393
1389 Usage:\\
1394 Usage:\\
1390 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1395 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1391
1396
1392 Parameters after the filename are passed as command-line arguments to
1397 Parameters after the filename are passed as command-line arguments to
1393 the program (put in sys.argv). Then, control returns to IPython's
1398 the program (put in sys.argv). Then, control returns to IPython's
1394 prompt.
1399 prompt.
1395
1400
1396 This is similar to running at a system prompt:\\
1401 This is similar to running at a system prompt:\\
1397 $ python file args\\
1402 $ python file args\\
1398 but with the advantage of giving you IPython's tracebacks, and of
1403 but with the advantage of giving you IPython's tracebacks, and of
1399 loading all variables into your interactive namespace for further use
1404 loading all variables into your interactive namespace for further use
1400 (unless -p is used, see below).
1405 (unless -p is used, see below).
1401
1406
1402 The file is executed in a namespace initially consisting only of
1407 The file is executed in a namespace initially consisting only of
1403 __name__=='__main__' and sys.argv constructed as indicated. It thus
1408 __name__=='__main__' and sys.argv constructed as indicated. It thus
1404 sees its environment as if it were being run as a stand-alone
1409 sees its environment as if it were being run as a stand-alone
1405 program. But after execution, the IPython interactive namespace gets
1410 program. But after execution, the IPython interactive namespace gets
1406 updated with all variables defined in the program (except for __name__
1411 updated with all variables defined in the program (except for __name__
1407 and sys.argv). This allows for very convenient loading of code for
1412 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.
1413 interactive work, while giving each program a 'clean sheet' to run in.
1409
1414
1410 Options:
1415 Options:
1411
1416
1412 -n: __name__ is NOT set to '__main__', but to the running file's name
1417 -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
1418 without extension (as python does under import). This allows running
1414 scripts and reloading the definitions in them without calling code
1419 scripts and reloading the definitions in them without calling code
1415 protected by an ' if __name__ == "__main__" ' clause.
1420 protected by an ' if __name__ == "__main__" ' clause.
1416
1421
1417 -i: run the file in IPython's namespace instead of an empty one. This
1422 -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
1423 is useful if you are experimenting with code written in a text editor
1419 which depends on variables defined interactively.
1424 which depends on variables defined interactively.
1420
1425
1421 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1426 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1422 being run. This is particularly useful if IPython is being used to
1427 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
1428 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
1429 cases you are interested in the output of the test results, not in
1425 seeing a traceback of the unittest module.
1430 seeing a traceback of the unittest module.
1426
1431
1427 -t: print timing information at the end of the run. IPython will give
1432 -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
1433 you an estimated CPU time consumption for your script, which under
1429 Unix uses the resource module to avoid the wraparound problems of
1434 Unix uses the resource module to avoid the wraparound problems of
1430 time.clock(). Under Unix, an estimate of time spent on system tasks
1435 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).
1436 is also given (for Windows platforms this is reported as 0.0).
1432
1437
1433 If -t is given, an additional -N<N> option can be given, where <N>
1438 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
1439 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.
1440 run. The final timing report will include total and per run results.
1436
1441
1437 For example (testing the script uniq_stable.py):
1442 For example (testing the script uniq_stable.py):
1438
1443
1439 In [1]: run -t uniq_stable
1444 In [1]: run -t uniq_stable
1440
1445
1441 IPython CPU timings (estimated):\\
1446 IPython CPU timings (estimated):\\
1442 User : 0.19597 s.\\
1447 User : 0.19597 s.\\
1443 System: 0.0 s.\\
1448 System: 0.0 s.\\
1444
1449
1445 In [2]: run -t -N5 uniq_stable
1450 In [2]: run -t -N5 uniq_stable
1446
1451
1447 IPython CPU timings (estimated):\\
1452 IPython CPU timings (estimated):\\
1448 Total runs performed: 5\\
1453 Total runs performed: 5\\
1449 Times : Total Per run\\
1454 Times : Total Per run\\
1450 User : 0.910862 s, 0.1821724 s.\\
1455 User : 0.910862 s, 0.1821724 s.\\
1451 System: 0.0 s, 0.0 s.
1456 System: 0.0 s, 0.0 s.
1452
1457
1453 -d: run your program under the control of pdb, the Python debugger.
1458 -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,
1459 This allows you to execute your program step by step, watch variables,
1455 etc. Internally, what IPython does is similar to calling:
1460 etc. Internally, what IPython does is similar to calling:
1456
1461
1457 pdb.run('execfile("YOURFILENAME")')
1462 pdb.run('execfile("YOURFILENAME")')
1458
1463
1459 with a breakpoint set on line 1 of your file. You can change the line
1464 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
1465 number for this automatic breakpoint to be <N> by using the -bN option
1461 (where N must be an integer). For example:
1466 (where N must be an integer). For example:
1462
1467
1463 %run -d -b40 myscript
1468 %run -d -b40 myscript
1464
1469
1465 will set the first breakpoint at line 40 in myscript.py. Note that
1470 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
1471 the first breakpoint must be set on a line which actually does
1467 something (not a comment or docstring) for it to stop execution.
1472 something (not a comment or docstring) for it to stop execution.
1468
1473
1469 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1474 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
1475 first enter 'c' (without qoutes) to start execution up to the first
1471 breakpoint.
1476 breakpoint.
1472
1477
1473 Entering 'help' gives information about the use of the debugger. You
1478 Entering 'help' gives information about the use of the debugger. You
1474 can easily see pdb's full documentation with "import pdb;pdb.help()"
1479 can easily see pdb's full documentation with "import pdb;pdb.help()"
1475 at a prompt.
1480 at a prompt.
1476
1481
1477 -p: run program under the control of the Python profiler module (which
1482 -p: run program under the control of the Python profiler module (which
1478 prints a detailed report of execution times, function calls, etc).
1483 prints a detailed report of execution times, function calls, etc).
1479
1484
1480 You can pass other options after -p which affect the behavior of the
1485 You can pass other options after -p which affect the behavior of the
1481 profiler itself. See the docs for %prun for details.
1486 profiler itself. See the docs for %prun for details.
1482
1487
1483 In this mode, the program's variables do NOT propagate back to the
1488 In this mode, the program's variables do NOT propagate back to the
1484 IPython interactive namespace (because they remain in the namespace
1489 IPython interactive namespace (because they remain in the namespace
1485 where the profiler executes them).
1490 where the profiler executes them).
1486
1491
1487 Internally this triggers a call to %prun, see its documentation for
1492 Internally this triggers a call to %prun, see its documentation for
1488 details on the options available specifically for profiling."""
1493 details on the options available specifically for profiling."""
1489
1494
1490 # get arguments and set sys.argv for program to be run.
1495 # get arguments and set sys.argv for program to be run.
1491 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',
1492 mode='list',list_all=1)
1497 mode='list',list_all=1)
1493
1498
1494 try:
1499 try:
1495 filename = get_py_filename(arg_lst[0])
1500 filename = get_py_filename(arg_lst[0])
1496 except IndexError:
1501 except IndexError:
1497 warn('you must provide at least a filename.')
1502 warn('you must provide at least a filename.')
1498 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1503 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1499 return
1504 return
1500 except IOError,msg:
1505 except IOError,msg:
1501 error(msg)
1506 error(msg)
1502 return
1507 return
1503
1508
1504 # Control the response to exit() calls made by the script being run
1509 # Control the response to exit() calls made by the script being run
1505 exit_ignore = opts.has_key('e')
1510 exit_ignore = opts.has_key('e')
1506
1511
1507 # Make sure that the running script gets a proper sys.argv as if it
1512 # Make sure that the running script gets a proper sys.argv as if it
1508 # were run from a system shell.
1513 # were run from a system shell.
1509 save_argv = sys.argv # save it for later restoring
1514 save_argv = sys.argv # save it for later restoring
1510 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1515 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1511
1516
1512 if opts.has_key('i'):
1517 if opts.has_key('i'):
1513 prog_ns = self.shell.user_ns
1518 prog_ns = self.shell.user_ns
1514 __name__save = self.shell.user_ns['__name__']
1519 __name__save = self.shell.user_ns['__name__']
1515 prog_ns['__name__'] = '__main__'
1520 prog_ns['__name__'] = '__main__'
1516 else:
1521 else:
1517 if opts.has_key('n'):
1522 if opts.has_key('n'):
1518 name = os.path.splitext(os.path.basename(filename))[0]
1523 name = os.path.splitext(os.path.basename(filename))[0]
1519 else:
1524 else:
1520 name = '__main__'
1525 name = '__main__'
1521 prog_ns = {'__name__':name}
1526 prog_ns = {'__name__':name}
1522
1527
1523 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1528 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1524 # set the __file__ global in the script's namespace
1529 # set the __file__ global in the script's namespace
1525 prog_ns['__file__'] = filename
1530 prog_ns['__file__'] = filename
1526
1531
1527 # pickle fix. See iplib for an explanation. But we need to make sure
1532 # pickle fix. See iplib for an explanation. But we need to make sure
1528 # that, if we overwrite __main__, we replace it at the end
1533 # that, if we overwrite __main__, we replace it at the end
1529 if prog_ns['__name__'] == '__main__':
1534 if prog_ns['__name__'] == '__main__':
1530 restore_main = sys.modules['__main__']
1535 restore_main = sys.modules['__main__']
1531 else:
1536 else:
1532 restore_main = False
1537 restore_main = False
1533
1538
1534 sys.modules[prog_ns['__name__']] = FakeModule(prog_ns)
1539 sys.modules[prog_ns['__name__']] = FakeModule(prog_ns)
1535
1540
1536 stats = None
1541 stats = None
1537 try:
1542 try:
1538 if self.shell.has_readline:
1543 if self.shell.has_readline:
1539 self.shell.savehist()
1544 self.shell.savehist()
1540
1545
1541 if opts.has_key('p'):
1546 if opts.has_key('p'):
1542 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1547 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1543 else:
1548 else:
1544 if opts.has_key('d'):
1549 if opts.has_key('d'):
1545 deb = Debugger.Pdb(self.shell.rc.colors)
1550 deb = Debugger.Pdb(self.shell.rc.colors)
1546 # reset Breakpoint state, which is moronically kept
1551 # reset Breakpoint state, which is moronically kept
1547 # in a class
1552 # in a class
1548 bdb.Breakpoint.next = 1
1553 bdb.Breakpoint.next = 1
1549 bdb.Breakpoint.bplist = {}
1554 bdb.Breakpoint.bplist = {}
1550 bdb.Breakpoint.bpbynumber = [None]
1555 bdb.Breakpoint.bpbynumber = [None]
1551 # Set an initial breakpoint to stop execution
1556 # Set an initial breakpoint to stop execution
1552 maxtries = 10
1557 maxtries = 10
1553 bp = int(opts.get('b',[1])[0])
1558 bp = int(opts.get('b',[1])[0])
1554 checkline = deb.checkline(filename,bp)
1559 checkline = deb.checkline(filename,bp)
1555 if not checkline:
1560 if not checkline:
1556 for bp in range(bp+1,bp+maxtries+1):
1561 for bp in range(bp+1,bp+maxtries+1):
1557 if deb.checkline(filename,bp):
1562 if deb.checkline(filename,bp):
1558 break
1563 break
1559 else:
1564 else:
1560 msg = ("\nI failed to find a valid line to set "
1565 msg = ("\nI failed to find a valid line to set "
1561 "a breakpoint\n"
1566 "a breakpoint\n"
1562 "after trying up to line: %s.\n"
1567 "after trying up to line: %s.\n"
1563 "Please set a valid breakpoint manually "
1568 "Please set a valid breakpoint manually "
1564 "with the -b option." % bp)
1569 "with the -b option." % bp)
1565 error(msg)
1570 error(msg)
1566 return
1571 return
1567 # if we find a good linenumber, set the breakpoint
1572 # if we find a good linenumber, set the breakpoint
1568 deb.do_break('%s:%s' % (filename,bp))
1573 deb.do_break('%s:%s' % (filename,bp))
1569 # Start file run
1574 # Start file run
1570 print "NOTE: Enter 'c' at the",
1575 print "NOTE: Enter 'c' at the",
1571 print "%s prompt to start your script." % deb.prompt
1576 print "%s prompt to start your script." % deb.prompt
1572 try:
1577 try:
1573 deb.run('execfile("%s")' % filename,prog_ns)
1578 deb.run('execfile("%s")' % filename,prog_ns)
1574
1579
1575 except:
1580 except:
1576 etype, value, tb = sys.exc_info()
1581 etype, value, tb = sys.exc_info()
1577 # Skip three frames in the traceback: the %run one,
1582 # Skip three frames in the traceback: the %run one,
1578 # one inside bdb.py, and the command-line typed by the
1583 # one inside bdb.py, and the command-line typed by the
1579 # user (run by exec in pdb itself).
1584 # user (run by exec in pdb itself).
1580 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1585 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1581 else:
1586 else:
1582 if runner is None:
1587 if runner is None:
1583 runner = self.shell.safe_execfile
1588 runner = self.shell.safe_execfile
1584 if opts.has_key('t'):
1589 if opts.has_key('t'):
1585 try:
1590 try:
1586 nruns = int(opts['N'][0])
1591 nruns = int(opts['N'][0])
1587 if nruns < 1:
1592 if nruns < 1:
1588 error('Number of runs must be >=1')
1593 error('Number of runs must be >=1')
1589 return
1594 return
1590 except (KeyError):
1595 except (KeyError):
1591 nruns = 1
1596 nruns = 1
1592 if nruns == 1:
1597 if nruns == 1:
1593 t0 = clock2()
1598 t0 = clock2()
1594 runner(filename,prog_ns,prog_ns,
1599 runner(filename,prog_ns,prog_ns,
1595 exit_ignore=exit_ignore)
1600 exit_ignore=exit_ignore)
1596 t1 = clock2()
1601 t1 = clock2()
1597 t_usr = t1[0]-t0[0]
1602 t_usr = t1[0]-t0[0]
1598 t_sys = t1[1]-t1[1]
1603 t_sys = t1[1]-t1[1]
1599 print "\nIPython CPU timings (estimated):"
1604 print "\nIPython CPU timings (estimated):"
1600 print " User : %10s s." % t_usr
1605 print " User : %10s s." % t_usr
1601 print " System: %10s s." % t_sys
1606 print " System: %10s s." % t_sys
1602 else:
1607 else:
1603 runs = range(nruns)
1608 runs = range(nruns)
1604 t0 = clock2()
1609 t0 = clock2()
1605 for nr in runs:
1610 for nr in runs:
1606 runner(filename,prog_ns,prog_ns,
1611 runner(filename,prog_ns,prog_ns,
1607 exit_ignore=exit_ignore)
1612 exit_ignore=exit_ignore)
1608 t1 = clock2()
1613 t1 = clock2()
1609 t_usr = t1[0]-t0[0]
1614 t_usr = t1[0]-t0[0]
1610 t_sys = t1[1]-t1[1]
1615 t_sys = t1[1]-t1[1]
1611 print "\nIPython CPU timings (estimated):"
1616 print "\nIPython CPU timings (estimated):"
1612 print "Total runs performed:",nruns
1617 print "Total runs performed:",nruns
1613 print " Times : %10s %10s" % ('Total','Per run')
1618 print " Times : %10s %10s" % ('Total','Per run')
1614 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1619 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1615 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1620 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1616
1621
1617 else:
1622 else:
1618 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1623 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1619 if opts.has_key('i'):
1624 if opts.has_key('i'):
1620 self.shell.user_ns['__name__'] = __name__save
1625 self.shell.user_ns['__name__'] = __name__save
1621 else:
1626 else:
1622 # update IPython interactive namespace
1627 # update IPython interactive namespace
1623 del prog_ns['__name__']
1628 del prog_ns['__name__']
1624 self.shell.user_ns.update(prog_ns)
1629 self.shell.user_ns.update(prog_ns)
1625 finally:
1630 finally:
1626 sys.argv = save_argv
1631 sys.argv = save_argv
1627 if restore_main:
1632 if restore_main:
1628 sys.modules['__main__'] = restore_main
1633 sys.modules['__main__'] = restore_main
1629 if self.shell.has_readline:
1634 if self.shell.has_readline:
1630 self.shell.readline.read_history_file(self.shell.histfile)
1635 self.shell.readline.read_history_file(self.shell.histfile)
1631
1636
1632 return stats
1637 return stats
1633
1638
1634 def magic_runlog(self, parameter_s =''):
1639 def magic_runlog(self, parameter_s =''):
1635 """Run files as logs.
1640 """Run files as logs.
1636
1641
1637 Usage:\\
1642 Usage:\\
1638 %runlog file1 file2 ...
1643 %runlog file1 file2 ...
1639
1644
1640 Run the named files (treating them as log files) in sequence inside
1645 Run the named files (treating them as log files) in sequence inside
1641 the interpreter, and return to the prompt. This is much slower than
1646 the interpreter, and return to the prompt. This is much slower than
1642 %run because each line is executed in a try/except block, but it
1647 %run because each line is executed in a try/except block, but it
1643 allows running files with syntax errors in them.
1648 allows running files with syntax errors in them.
1644
1649
1645 Normally IPython will guess when a file is one of its own logfiles, so
1650 Normally IPython will guess when a file is one of its own logfiles, so
1646 you can typically use %run even for logs. This shorthand allows you to
1651 you can typically use %run even for logs. This shorthand allows you to
1647 force any file to be treated as a log file."""
1652 force any file to be treated as a log file."""
1648
1653
1649 for f in parameter_s.split():
1654 for f in parameter_s.split():
1650 self.shell.safe_execfile(f,self.shell.user_ns,
1655 self.shell.safe_execfile(f,self.shell.user_ns,
1651 self.shell.user_ns,islog=1)
1656 self.shell.user_ns,islog=1)
1652
1657
1653 def magic_timeit(self, parameter_s =''):
1658 def magic_timeit(self, parameter_s =''):
1654 """Time execution of a Python statement or expression
1659 """Time execution of a Python statement or expression
1655
1660
1656 Usage:\\
1661 Usage:\\
1657 %timeit [-n<N> -r<R> [-t|-c]] statement
1662 %timeit [-n<N> -r<R> [-t|-c]] statement
1658
1663
1659 Time execution of a Python statement or expression using the timeit
1664 Time execution of a Python statement or expression using the timeit
1660 module.
1665 module.
1661
1666
1662 Options:
1667 Options:
1663 -n<N>: execute the given statement <N> times in a loop. If this value
1668 -n<N>: execute the given statement <N> times in a loop. If this value
1664 is not given, a fitting value is chosen.
1669 is not given, a fitting value is chosen.
1665
1670
1666 -r<R>: repeat the loop iteration <R> times and take the best result.
1671 -r<R>: repeat the loop iteration <R> times and take the best result.
1667 Default: 3
1672 Default: 3
1668
1673
1669 -t: use time.time to measure the time, which is the default on Unix.
1674 -t: use time.time to measure the time, which is the default on Unix.
1670 This function measures wall time.
1675 This function measures wall time.
1671
1676
1672 -c: use time.clock to measure the time, which is the default on
1677 -c: use time.clock to measure the time, which is the default on
1673 Windows and measures wall time. On Unix, resource.getrusage is used
1678 Windows and measures wall time. On Unix, resource.getrusage is used
1674 instead and returns the CPU user time.
1679 instead and returns the CPU user time.
1675
1680
1676 -p<P>: use a precision of <P> digits to display the timing result.
1681 -p<P>: use a precision of <P> digits to display the timing result.
1677 Default: 3
1682 Default: 3
1678
1683
1679
1684
1680 Examples:\\
1685 Examples:\\
1681 In [1]: %timeit pass
1686 In [1]: %timeit pass
1682 10000000 loops, best of 3: 53.3 ns per loop
1687 10000000 loops, best of 3: 53.3 ns per loop
1683
1688
1684 In [2]: u = None
1689 In [2]: u = None
1685
1690
1686 In [3]: %timeit u is None
1691 In [3]: %timeit u is None
1687 10000000 loops, best of 3: 184 ns per loop
1692 10000000 loops, best of 3: 184 ns per loop
1688
1693
1689 In [4]: %timeit -r 4 u == None
1694 In [4]: %timeit -r 4 u == None
1690 1000000 loops, best of 4: 242 ns per loop
1695 1000000 loops, best of 4: 242 ns per loop
1691
1696
1692 In [5]: import time
1697 In [5]: import time
1693
1698
1694 In [6]: %timeit -n1 time.sleep(2)
1699 In [6]: %timeit -n1 time.sleep(2)
1695 1 loops, best of 3: 2 s per loop
1700 1 loops, best of 3: 2 s per loop
1696
1701
1697
1702
1698 The times reported by %timeit will be slightly higher than those
1703 The times reported by %timeit will be slightly higher than those
1699 reported by the timeit.py script when variables are accessed. This is
1704 reported by the timeit.py script when variables are accessed. This is
1700 due to the fact that %timeit executes the statement in the namespace
1705 due to the fact that %timeit executes the statement in the namespace
1701 of the shell, compared with timeit.py, which uses a single setup
1706 of the shell, compared with timeit.py, which uses a single setup
1702 statement to import function or create variables. Generally, the bias
1707 statement to import function or create variables. Generally, the bias
1703 does not matter as long as results from timeit.py are not mixed with
1708 does not matter as long as results from timeit.py are not mixed with
1704 those from %timeit."""
1709 those from %timeit."""
1705
1710
1706 import timeit
1711 import timeit
1707 import math
1712 import math
1708
1713
1709 units = ["s", "ms", "\xc2\xb5s", "ns"]
1714 units = ["s", "ms", "\xc2\xb5s", "ns"]
1710 scaling = [1, 1e3, 1e6, 1e9]
1715 scaling = [1, 1e3, 1e6, 1e9]
1711
1716
1712 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1717 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1713 posix=False)
1718 posix=False)
1714 if stmt == "":
1719 if stmt == "":
1715 return
1720 return
1716 timefunc = timeit.default_timer
1721 timefunc = timeit.default_timer
1717 number = int(getattr(opts, "n", 0))
1722 number = int(getattr(opts, "n", 0))
1718 repeat = int(getattr(opts, "r", timeit.default_repeat))
1723 repeat = int(getattr(opts, "r", timeit.default_repeat))
1719 precision = int(getattr(opts, "p", 3))
1724 precision = int(getattr(opts, "p", 3))
1720 if hasattr(opts, "t"):
1725 if hasattr(opts, "t"):
1721 timefunc = time.time
1726 timefunc = time.time
1722 if hasattr(opts, "c"):
1727 if hasattr(opts, "c"):
1723 timefunc = clock
1728 timefunc = clock
1724
1729
1725 timer = timeit.Timer(timer=timefunc)
1730 timer = timeit.Timer(timer=timefunc)
1726 # this code has tight coupling to the inner workings of timeit.Timer,
1731 # this code has tight coupling to the inner workings of timeit.Timer,
1727 # but is there a better way to achieve that the code stmt has access
1732 # but is there a better way to achieve that the code stmt has access
1728 # to the shell namespace?
1733 # to the shell namespace?
1729
1734
1730 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1735 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1731 'setup': "pass"}
1736 'setup': "pass"}
1732 code = compile(src, "<magic-timeit>", "exec")
1737 code = compile(src, "<magic-timeit>", "exec")
1733 ns = {}
1738 ns = {}
1734 exec code in self.shell.user_ns, ns
1739 exec code in self.shell.user_ns, ns
1735 timer.inner = ns["inner"]
1740 timer.inner = ns["inner"]
1736
1741
1737 if number == 0:
1742 if number == 0:
1738 # determine number so that 0.2 <= total time < 2.0
1743 # determine number so that 0.2 <= total time < 2.0
1739 number = 1
1744 number = 1
1740 for i in range(1, 10):
1745 for i in range(1, 10):
1741 number *= 10
1746 number *= 10
1742 if timer.timeit(number) >= 0.2:
1747 if timer.timeit(number) >= 0.2:
1743 break
1748 break
1744
1749
1745 best = min(timer.repeat(repeat, number)) / number
1750 best = min(timer.repeat(repeat, number)) / number
1746
1751
1747 if best > 0.0:
1752 if best > 0.0:
1748 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1753 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1749 else:
1754 else:
1750 order = 3
1755 order = 3
1751 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1756 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1752 precision,
1757 precision,
1753 best * scaling[order],
1758 best * scaling[order],
1754 units[order])
1759 units[order])
1755
1760
1756 def magic_time(self,parameter_s = ''):
1761 def magic_time(self,parameter_s = ''):
1757 """Time execution of a Python statement or expression.
1762 """Time execution of a Python statement or expression.
1758
1763
1759 The CPU and wall clock times are printed, and the value of the
1764 The CPU and wall clock times are printed, and the value of the
1760 expression (if any) is returned. Note that under Win32, system time
1765 expression (if any) is returned. Note that under Win32, system time
1761 is always reported as 0, since it can not be measured.
1766 is always reported as 0, since it can not be measured.
1762
1767
1763 This function provides very basic timing functionality. In Python
1768 This function provides very basic timing functionality. In Python
1764 2.3, the timeit module offers more control and sophistication, so this
1769 2.3, the timeit module offers more control and sophistication, so this
1765 could be rewritten to use it (patches welcome).
1770 could be rewritten to use it (patches welcome).
1766
1771
1767 Some examples:
1772 Some examples:
1768
1773
1769 In [1]: time 2**128
1774 In [1]: time 2**128
1770 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1775 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1771 Wall time: 0.00
1776 Wall time: 0.00
1772 Out[1]: 340282366920938463463374607431768211456L
1777 Out[1]: 340282366920938463463374607431768211456L
1773
1778
1774 In [2]: n = 1000000
1779 In [2]: n = 1000000
1775
1780
1776 In [3]: time sum(range(n))
1781 In [3]: time sum(range(n))
1777 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1782 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1778 Wall time: 1.37
1783 Wall time: 1.37
1779 Out[3]: 499999500000L
1784 Out[3]: 499999500000L
1780
1785
1781 In [4]: time print 'hello world'
1786 In [4]: time print 'hello world'
1782 hello world
1787 hello world
1783 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1788 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1784 Wall time: 0.00
1789 Wall time: 0.00
1785 """
1790 """
1786
1791
1787 # fail immediately if the given expression can't be compiled
1792 # fail immediately if the given expression can't be compiled
1788 try:
1793 try:
1789 mode = 'eval'
1794 mode = 'eval'
1790 code = compile(parameter_s,'<timed eval>',mode)
1795 code = compile(parameter_s,'<timed eval>',mode)
1791 except SyntaxError:
1796 except SyntaxError:
1792 mode = 'exec'
1797 mode = 'exec'
1793 code = compile(parameter_s,'<timed exec>',mode)
1798 code = compile(parameter_s,'<timed exec>',mode)
1794 # skew measurement as little as possible
1799 # skew measurement as little as possible
1795 glob = self.shell.user_ns
1800 glob = self.shell.user_ns
1796 clk = clock2
1801 clk = clock2
1797 wtime = time.time
1802 wtime = time.time
1798 # time execution
1803 # time execution
1799 wall_st = wtime()
1804 wall_st = wtime()
1800 if mode=='eval':
1805 if mode=='eval':
1801 st = clk()
1806 st = clk()
1802 out = eval(code,glob)
1807 out = eval(code,glob)
1803 end = clk()
1808 end = clk()
1804 else:
1809 else:
1805 st = clk()
1810 st = clk()
1806 exec code in glob
1811 exec code in glob
1807 end = clk()
1812 end = clk()
1808 out = None
1813 out = None
1809 wall_end = wtime()
1814 wall_end = wtime()
1810 # Compute actual times and report
1815 # Compute actual times and report
1811 wall_time = wall_end-wall_st
1816 wall_time = wall_end-wall_st
1812 cpu_user = end[0]-st[0]
1817 cpu_user = end[0]-st[0]
1813 cpu_sys = end[1]-st[1]
1818 cpu_sys = end[1]-st[1]
1814 cpu_tot = cpu_user+cpu_sys
1819 cpu_tot = cpu_user+cpu_sys
1815 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1820 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1816 (cpu_user,cpu_sys,cpu_tot)
1821 (cpu_user,cpu_sys,cpu_tot)
1817 print "Wall time: %.2f" % wall_time
1822 print "Wall time: %.2f" % wall_time
1818 return out
1823 return out
1819
1824
1820 def magic_macro(self,parameter_s = ''):
1825 def magic_macro(self,parameter_s = ''):
1821 """Define a set of input lines as a macro for future re-execution.
1826 """Define a set of input lines as a macro for future re-execution.
1822
1827
1823 Usage:\\
1828 Usage:\\
1824 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1829 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1825
1830
1826 Options:
1831 Options:
1827
1832
1828 -r: use 'raw' input. By default, the 'processed' history is used,
1833 -r: use 'raw' input. By default, the 'processed' history is used,
1829 so that magics are loaded in their transformed version to valid
1834 so that magics are loaded in their transformed version to valid
1830 Python. If this option is given, the raw input as typed as the
1835 Python. If this option is given, the raw input as typed as the
1831 command line is used instead.
1836 command line is used instead.
1832
1837
1833 This will define a global variable called `name` which is a string
1838 This will define a global variable called `name` which is a string
1834 made of joining the slices and lines you specify (n1,n2,... numbers
1839 made of joining the slices and lines you specify (n1,n2,... numbers
1835 above) from your input history into a single string. This variable
1840 above) from your input history into a single string. This variable
1836 acts like an automatic function which re-executes those lines as if
1841 acts like an automatic function which re-executes those lines as if
1837 you had typed them. You just type 'name' at the prompt and the code
1842 you had typed them. You just type 'name' at the prompt and the code
1838 executes.
1843 executes.
1839
1844
1840 The notation for indicating number ranges is: n1-n2 means 'use line
1845 The notation for indicating number ranges is: n1-n2 means 'use line
1841 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1846 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1842 using the lines numbered 5,6 and 7.
1847 using the lines numbered 5,6 and 7.
1843
1848
1844 Note: as a 'hidden' feature, you can also use traditional python slice
1849 Note: as a 'hidden' feature, you can also use traditional python slice
1845 notation, where N:M means numbers N through M-1.
1850 notation, where N:M means numbers N through M-1.
1846
1851
1847 For example, if your history contains (%hist prints it):
1852 For example, if your history contains (%hist prints it):
1848
1853
1849 44: x=1\\
1854 44: x=1\\
1850 45: y=3\\
1855 45: y=3\\
1851 46: z=x+y\\
1856 46: z=x+y\\
1852 47: print x\\
1857 47: print x\\
1853 48: a=5\\
1858 48: a=5\\
1854 49: print 'x',x,'y',y\\
1859 49: print 'x',x,'y',y\\
1855
1860
1856 you can create a macro with lines 44 through 47 (included) and line 49
1861 you can create a macro with lines 44 through 47 (included) and line 49
1857 called my_macro with:
1862 called my_macro with:
1858
1863
1859 In [51]: %macro my_macro 44-47 49
1864 In [51]: %macro my_macro 44-47 49
1860
1865
1861 Now, typing `my_macro` (without quotes) will re-execute all this code
1866 Now, typing `my_macro` (without quotes) will re-execute all this code
1862 in one pass.
1867 in one pass.
1863
1868
1864 You don't need to give the line-numbers in order, and any given line
1869 You don't need to give the line-numbers in order, and any given line
1865 number can appear multiple times. You can assemble macros with any
1870 number can appear multiple times. You can assemble macros with any
1866 lines from your input history in any order.
1871 lines from your input history in any order.
1867
1872
1868 The macro is a simple object which holds its value in an attribute,
1873 The macro is a simple object which holds its value in an attribute,
1869 but IPython's display system checks for macros and executes them as
1874 but IPython's display system checks for macros and executes them as
1870 code instead of printing them when you type their name.
1875 code instead of printing them when you type their name.
1871
1876
1872 You can view a macro's contents by explicitly printing it with:
1877 You can view a macro's contents by explicitly printing it with:
1873
1878
1874 'print macro_name'.
1879 'print macro_name'.
1875
1880
1876 For one-off cases which DON'T contain magic function calls in them you
1881 For one-off cases which DON'T contain magic function calls in them you
1877 can obtain similar results by explicitly executing slices from your
1882 can obtain similar results by explicitly executing slices from your
1878 input history with:
1883 input history with:
1879
1884
1880 In [60]: exec In[44:48]+In[49]"""
1885 In [60]: exec In[44:48]+In[49]"""
1881
1886
1882 opts,args = self.parse_options(parameter_s,'r',mode='list')
1887 opts,args = self.parse_options(parameter_s,'r',mode='list')
1883 name,ranges = args[0], args[1:]
1888 name,ranges = args[0], args[1:]
1884 #print 'rng',ranges # dbg
1889 #print 'rng',ranges # dbg
1885 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1890 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1886 macro = Macro(lines)
1891 macro = Macro(lines)
1887 self.shell.user_ns.update({name:macro})
1892 self.shell.user_ns.update({name:macro})
1888 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1893 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1889 print 'Macro contents:'
1894 print 'Macro contents:'
1890 print macro,
1895 print macro,
1891
1896
1892 def magic_save(self,parameter_s = ''):
1897 def magic_save(self,parameter_s = ''):
1893 """Save a set of lines to a given filename.
1898 """Save a set of lines to a given filename.
1894
1899
1895 Usage:\\
1900 Usage:\\
1896 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1901 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1897
1902
1898 Options:
1903 Options:
1899
1904
1900 -r: use 'raw' input. By default, the 'processed' history is used,
1905 -r: use 'raw' input. By default, the 'processed' history is used,
1901 so that magics are loaded in their transformed version to valid
1906 so that magics are loaded in their transformed version to valid
1902 Python. If this option is given, the raw input as typed as the
1907 Python. If this option is given, the raw input as typed as the
1903 command line is used instead.
1908 command line is used instead.
1904
1909
1905 This function uses the same syntax as %macro for line extraction, but
1910 This function uses the same syntax as %macro for line extraction, but
1906 instead of creating a macro it saves the resulting string to the
1911 instead of creating a macro it saves the resulting string to the
1907 filename you specify.
1912 filename you specify.
1908
1913
1909 It adds a '.py' extension to the file if you don't do so yourself, and
1914 It adds a '.py' extension to the file if you don't do so yourself, and
1910 it asks for confirmation before overwriting existing files."""
1915 it asks for confirmation before overwriting existing files."""
1911
1916
1912 opts,args = self.parse_options(parameter_s,'r',mode='list')
1917 opts,args = self.parse_options(parameter_s,'r',mode='list')
1913 fname,ranges = args[0], args[1:]
1918 fname,ranges = args[0], args[1:]
1914 if not fname.endswith('.py'):
1919 if not fname.endswith('.py'):
1915 fname += '.py'
1920 fname += '.py'
1916 if os.path.isfile(fname):
1921 if os.path.isfile(fname):
1917 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1922 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1918 if ans.lower() not in ['y','yes']:
1923 if ans.lower() not in ['y','yes']:
1919 print 'Operation cancelled.'
1924 print 'Operation cancelled.'
1920 return
1925 return
1921 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1926 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1922 f = file(fname,'w')
1927 f = file(fname,'w')
1923 f.write(cmds)
1928 f.write(cmds)
1924 f.close()
1929 f.close()
1925 print 'The following commands were written to file `%s`:' % fname
1930 print 'The following commands were written to file `%s`:' % fname
1926 print cmds
1931 print cmds
1927
1932
1928 def _edit_macro(self,mname,macro):
1933 def _edit_macro(self,mname,macro):
1929 """open an editor with the macro data in a file"""
1934 """open an editor with the macro data in a file"""
1930 filename = self.shell.mktempfile(macro.value)
1935 filename = self.shell.mktempfile(macro.value)
1931 self.shell.hooks.editor(filename)
1936 self.shell.hooks.editor(filename)
1932
1937
1933 # and make a new macro object, to replace the old one
1938 # and make a new macro object, to replace the old one
1934 mfile = open(filename)
1939 mfile = open(filename)
1935 mvalue = mfile.read()
1940 mvalue = mfile.read()
1936 mfile.close()
1941 mfile.close()
1937 self.shell.user_ns[mname] = Macro(mvalue)
1942 self.shell.user_ns[mname] = Macro(mvalue)
1938
1943
1939 def magic_ed(self,parameter_s=''):
1944 def magic_ed(self,parameter_s=''):
1940 """Alias to %edit."""
1945 """Alias to %edit."""
1941 return self.magic_edit(parameter_s)
1946 return self.magic_edit(parameter_s)
1942
1947
1943 def magic_edit(self,parameter_s='',last_call=['','']):
1948 def magic_edit(self,parameter_s='',last_call=['','']):
1944 """Bring up an editor and execute the resulting code.
1949 """Bring up an editor and execute the resulting code.
1945
1950
1946 Usage:
1951 Usage:
1947 %edit [options] [args]
1952 %edit [options] [args]
1948
1953
1949 %edit runs IPython's editor hook. The default version of this hook is
1954 %edit runs IPython's editor hook. The default version of this hook is
1950 set to call the __IPYTHON__.rc.editor command. This is read from your
1955 set to call the __IPYTHON__.rc.editor command. This is read from your
1951 environment variable $EDITOR. If this isn't found, it will default to
1956 environment variable $EDITOR. If this isn't found, it will default to
1952 vi under Linux/Unix and to notepad under Windows. See the end of this
1957 vi under Linux/Unix and to notepad under Windows. See the end of this
1953 docstring for how to change the editor hook.
1958 docstring for how to change the editor hook.
1954
1959
1955 You can also set the value of this editor via the command line option
1960 You can also set the value of this editor via the command line option
1956 '-editor' or in your ipythonrc file. This is useful if you wish to use
1961 '-editor' or in your ipythonrc file. This is useful if you wish to use
1957 specifically for IPython an editor different from your typical default
1962 specifically for IPython an editor different from your typical default
1958 (and for Windows users who typically don't set environment variables).
1963 (and for Windows users who typically don't set environment variables).
1959
1964
1960 This command allows you to conveniently edit multi-line code right in
1965 This command allows you to conveniently edit multi-line code right in
1961 your IPython session.
1966 your IPython session.
1962
1967
1963 If called without arguments, %edit opens up an empty editor with a
1968 If called without arguments, %edit opens up an empty editor with a
1964 temporary file and will execute the contents of this file when you
1969 temporary file and will execute the contents of this file when you
1965 close it (don't forget to save it!).
1970 close it (don't forget to save it!).
1966
1971
1967
1972
1968 Options:
1973 Options:
1969
1974
1970 -n <number>: open the editor at a specified line number. By default,
1975 -n <number>: open the editor at a specified line number. By default,
1971 the IPython editor hook uses the unix syntax 'editor +N filename', but
1976 the IPython editor hook uses the unix syntax 'editor +N filename', but
1972 you can configure this by providing your own modified hook if your
1977 you can configure this by providing your own modified hook if your
1973 favorite editor supports line-number specifications with a different
1978 favorite editor supports line-number specifications with a different
1974 syntax.
1979 syntax.
1975
1980
1976 -p: this will call the editor with the same data as the previous time
1981 -p: this will call the editor with the same data as the previous time
1977 it was used, regardless of how long ago (in your current session) it
1982 it was used, regardless of how long ago (in your current session) it
1978 was.
1983 was.
1979
1984
1980 -r: use 'raw' input. This option only applies to input taken from the
1985 -r: use 'raw' input. This option only applies to input taken from the
1981 user's history. By default, the 'processed' history is used, so that
1986 user's history. By default, the 'processed' history is used, so that
1982 magics are loaded in their transformed version to valid Python. If
1987 magics are loaded in their transformed version to valid Python. If
1983 this option is given, the raw input as typed as the command line is
1988 this option is given, the raw input as typed as the command line is
1984 used instead. When you exit the editor, it will be executed by
1989 used instead. When you exit the editor, it will be executed by
1985 IPython's own processor.
1990 IPython's own processor.
1986
1991
1987 -x: do not execute the edited code immediately upon exit. This is
1992 -x: do not execute the edited code immediately upon exit. This is
1988 mainly useful if you are editing programs which need to be called with
1993 mainly useful if you are editing programs which need to be called with
1989 command line arguments, which you can then do using %run.
1994 command line arguments, which you can then do using %run.
1990
1995
1991
1996
1992 Arguments:
1997 Arguments:
1993
1998
1994 If arguments are given, the following possibilites exist:
1999 If arguments are given, the following possibilites exist:
1995
2000
1996 - The arguments are numbers or pairs of colon-separated numbers (like
2001 - The arguments are numbers or pairs of colon-separated numbers (like
1997 1 4:8 9). These are interpreted as lines of previous input to be
2002 1 4:8 9). These are interpreted as lines of previous input to be
1998 loaded into the editor. The syntax is the same of the %macro command.
2003 loaded into the editor. The syntax is the same of the %macro command.
1999
2004
2000 - If the argument doesn't start with a number, it is evaluated as a
2005 - If the argument doesn't start with a number, it is evaluated as a
2001 variable and its contents loaded into the editor. You can thus edit
2006 variable and its contents loaded into the editor. You can thus edit
2002 any string which contains python code (including the result of
2007 any string which contains python code (including the result of
2003 previous edits).
2008 previous edits).
2004
2009
2005 - If the argument is the name of an object (other than a string),
2010 - If the argument is the name of an object (other than a string),
2006 IPython will try to locate the file where it was defined and open the
2011 IPython will try to locate the file where it was defined and open the
2007 editor at the point where it is defined. You can use `%edit function`
2012 editor at the point where it is defined. You can use `%edit function`
2008 to load an editor exactly at the point where 'function' is defined,
2013 to load an editor exactly at the point where 'function' is defined,
2009 edit it and have the file be executed automatically.
2014 edit it and have the file be executed automatically.
2010
2015
2011 If the object is a macro (see %macro for details), this opens up your
2016 If the object is a macro (see %macro for details), this opens up your
2012 specified editor with a temporary file containing the macro's data.
2017 specified editor with a temporary file containing the macro's data.
2013 Upon exit, the macro is reloaded with the contents of the file.
2018 Upon exit, the macro is reloaded with the contents of the file.
2014
2019
2015 Note: opening at an exact line is only supported under Unix, and some
2020 Note: opening at an exact line is only supported under Unix, and some
2016 editors (like kedit and gedit up to Gnome 2.8) do not understand the
2021 editors (like kedit and gedit up to Gnome 2.8) do not understand the
2017 '+NUMBER' parameter necessary for this feature. Good editors like
2022 '+NUMBER' parameter necessary for this feature. Good editors like
2018 (X)Emacs, vi, jed, pico and joe all do.
2023 (X)Emacs, vi, jed, pico and joe all do.
2019
2024
2020 - If the argument is not found as a variable, IPython will look for a
2025 - If the argument is not found as a variable, IPython will look for a
2021 file with that name (adding .py if necessary) and load it into the
2026 file with that name (adding .py if necessary) and load it into the
2022 editor. It will execute its contents with execfile() when you exit,
2027 editor. It will execute its contents with execfile() when you exit,
2023 loading any code in the file into your interactive namespace.
2028 loading any code in the file into your interactive namespace.
2024
2029
2025 After executing your code, %edit will return as output the code you
2030 After executing your code, %edit will return as output the code you
2026 typed in the editor (except when it was an existing file). This way
2031 typed in the editor (except when it was an existing file). This way
2027 you can reload the code in further invocations of %edit as a variable,
2032 you can reload the code in further invocations of %edit as a variable,
2028 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
2033 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
2029 the output.
2034 the output.
2030
2035
2031 Note that %edit is also available through the alias %ed.
2036 Note that %edit is also available through the alias %ed.
2032
2037
2033 This is an example of creating a simple function inside the editor and
2038 This is an example of creating a simple function inside the editor and
2034 then modifying it. First, start up the editor:
2039 then modifying it. First, start up the editor:
2035
2040
2036 In [1]: ed\\
2041 In [1]: ed\\
2037 Editing... done. Executing edited code...\\
2042 Editing... done. Executing edited code...\\
2038 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
2043 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
2039
2044
2040 We can then call the function foo():
2045 We can then call the function foo():
2041
2046
2042 In [2]: foo()\\
2047 In [2]: foo()\\
2043 foo() was defined in an editing session
2048 foo() was defined in an editing session
2044
2049
2045 Now we edit foo. IPython automatically loads the editor with the
2050 Now we edit foo. IPython automatically loads the editor with the
2046 (temporary) file where foo() was previously defined:
2051 (temporary) file where foo() was previously defined:
2047
2052
2048 In [3]: ed foo\\
2053 In [3]: ed foo\\
2049 Editing... done. Executing edited code...
2054 Editing... done. Executing edited code...
2050
2055
2051 And if we call foo() again we get the modified version:
2056 And if we call foo() again we get the modified version:
2052
2057
2053 In [4]: foo()\\
2058 In [4]: foo()\\
2054 foo() has now been changed!
2059 foo() has now been changed!
2055
2060
2056 Here is an example of how to edit a code snippet successive
2061 Here is an example of how to edit a code snippet successive
2057 times. First we call the editor:
2062 times. First we call the editor:
2058
2063
2059 In [8]: ed\\
2064 In [8]: ed\\
2060 Editing... done. Executing edited code...\\
2065 Editing... done. Executing edited code...\\
2061 hello\\
2066 hello\\
2062 Out[8]: "print 'hello'\\n"
2067 Out[8]: "print 'hello'\\n"
2063
2068
2064 Now we call it again with the previous output (stored in _):
2069 Now we call it again with the previous output (stored in _):
2065
2070
2066 In [9]: ed _\\
2071 In [9]: ed _\\
2067 Editing... done. Executing edited code...\\
2072 Editing... done. Executing edited code...\\
2068 hello world\\
2073 hello world\\
2069 Out[9]: "print 'hello world'\\n"
2074 Out[9]: "print 'hello world'\\n"
2070
2075
2071 Now we call it with the output #8 (stored in _8, also as Out[8]):
2076 Now we call it with the output #8 (stored in _8, also as Out[8]):
2072
2077
2073 In [10]: ed _8\\
2078 In [10]: ed _8\\
2074 Editing... done. Executing edited code...\\
2079 Editing... done. Executing edited code...\\
2075 hello again\\
2080 hello again\\
2076 Out[10]: "print 'hello again'\\n"
2081 Out[10]: "print 'hello again'\\n"
2077
2082
2078
2083
2079 Changing the default editor hook:
2084 Changing the default editor hook:
2080
2085
2081 If you wish to write your own editor hook, you can put it in a
2086 If you wish to write your own editor hook, you can put it in a
2082 configuration file which you load at startup time. The default hook
2087 configuration file which you load at startup time. The default hook
2083 is defined in the IPython.hooks module, and you can use that as a
2088 is defined in the IPython.hooks module, and you can use that as a
2084 starting example for further modifications. That file also has
2089 starting example for further modifications. That file also has
2085 general instructions on how to set a new hook for use once you've
2090 general instructions on how to set a new hook for use once you've
2086 defined it."""
2091 defined it."""
2087
2092
2088 # FIXME: This function has become a convoluted mess. It needs a
2093 # FIXME: This function has become a convoluted mess. It needs a
2089 # ground-up rewrite with clean, simple logic.
2094 # ground-up rewrite with clean, simple logic.
2090
2095
2091 def make_filename(arg):
2096 def make_filename(arg):
2092 "Make a filename from the given args"
2097 "Make a filename from the given args"
2093 try:
2098 try:
2094 filename = get_py_filename(arg)
2099 filename = get_py_filename(arg)
2095 except IOError:
2100 except IOError:
2096 if args.endswith('.py'):
2101 if args.endswith('.py'):
2097 filename = arg
2102 filename = arg
2098 else:
2103 else:
2099 filename = None
2104 filename = None
2100 return filename
2105 return filename
2101
2106
2102 # custom exceptions
2107 # custom exceptions
2103 class DataIsObject(Exception): pass
2108 class DataIsObject(Exception): pass
2104
2109
2105 opts,args = self.parse_options(parameter_s,'prxn:')
2110 opts,args = self.parse_options(parameter_s,'prxn:')
2106 # Set a few locals from the options for convenience:
2111 # Set a few locals from the options for convenience:
2107 opts_p = opts.has_key('p')
2112 opts_p = opts.has_key('p')
2108 opts_r = opts.has_key('r')
2113 opts_r = opts.has_key('r')
2109
2114
2110 # Default line number value
2115 # Default line number value
2111 lineno = opts.get('n',None)
2116 lineno = opts.get('n',None)
2112
2117
2113 if opts_p:
2118 if opts_p:
2114 args = '_%s' % last_call[0]
2119 args = '_%s' % last_call[0]
2115 if not self.shell.user_ns.has_key(args):
2120 if not self.shell.user_ns.has_key(args):
2116 args = last_call[1]
2121 args = last_call[1]
2117
2122
2118 # use last_call to remember the state of the previous call, but don't
2123 # use last_call to remember the state of the previous call, but don't
2119 # let it be clobbered by successive '-p' calls.
2124 # let it be clobbered by successive '-p' calls.
2120 try:
2125 try:
2121 last_call[0] = self.shell.outputcache.prompt_count
2126 last_call[0] = self.shell.outputcache.prompt_count
2122 if not opts_p:
2127 if not opts_p:
2123 last_call[1] = parameter_s
2128 last_call[1] = parameter_s
2124 except:
2129 except:
2125 pass
2130 pass
2126
2131
2127 # by default this is done with temp files, except when the given
2132 # by default this is done with temp files, except when the given
2128 # arg is a filename
2133 # arg is a filename
2129 use_temp = 1
2134 use_temp = 1
2130
2135
2131 if re.match(r'\d',args):
2136 if re.match(r'\d',args):
2132 # Mode where user specifies ranges of lines, like in %macro.
2137 # Mode where user specifies ranges of lines, like in %macro.
2133 # This means that you can't edit files whose names begin with
2138 # This means that you can't edit files whose names begin with
2134 # numbers this way. Tough.
2139 # numbers this way. Tough.
2135 ranges = args.split()
2140 ranges = args.split()
2136 data = ''.join(self.extract_input_slices(ranges,opts_r))
2141 data = ''.join(self.extract_input_slices(ranges,opts_r))
2137 elif args.endswith('.py'):
2142 elif args.endswith('.py'):
2138 filename = make_filename(args)
2143 filename = make_filename(args)
2139 data = ''
2144 data = ''
2140 use_temp = 0
2145 use_temp = 0
2141 elif args:
2146 elif args:
2142 try:
2147 try:
2143 # Load the parameter given as a variable. If not a string,
2148 # Load the parameter given as a variable. If not a string,
2144 # process it as an object instead (below)
2149 # process it as an object instead (below)
2145
2150
2146 #print '*** args',args,'type',type(args) # dbg
2151 #print '*** args',args,'type',type(args) # dbg
2147 data = eval(args,self.shell.user_ns)
2152 data = eval(args,self.shell.user_ns)
2148 if not type(data) in StringTypes:
2153 if not type(data) in StringTypes:
2149 raise DataIsObject
2154 raise DataIsObject
2150
2155
2151 except (NameError,SyntaxError):
2156 except (NameError,SyntaxError):
2152 # given argument is not a variable, try as a filename
2157 # given argument is not a variable, try as a filename
2153 filename = make_filename(args)
2158 filename = make_filename(args)
2154 if filename is None:
2159 if filename is None:
2155 warn("Argument given (%s) can't be found as a variable "
2160 warn("Argument given (%s) can't be found as a variable "
2156 "or as a filename." % args)
2161 "or as a filename." % args)
2157 return
2162 return
2158
2163
2159 data = ''
2164 data = ''
2160 use_temp = 0
2165 use_temp = 0
2161 except DataIsObject:
2166 except DataIsObject:
2162
2167
2163 # macros have a special edit function
2168 # macros have a special edit function
2164 if isinstance(data,Macro):
2169 if isinstance(data,Macro):
2165 self._edit_macro(args,data)
2170 self._edit_macro(args,data)
2166 return
2171 return
2167
2172
2168 # For objects, try to edit the file where they are defined
2173 # For objects, try to edit the file where they are defined
2169 try:
2174 try:
2170 filename = inspect.getabsfile(data)
2175 filename = inspect.getabsfile(data)
2171 datafile = 1
2176 datafile = 1
2172 except TypeError:
2177 except TypeError:
2173 filename = make_filename(args)
2178 filename = make_filename(args)
2174 datafile = 1
2179 datafile = 1
2175 warn('Could not find file where `%s` is defined.\n'
2180 warn('Could not find file where `%s` is defined.\n'
2176 'Opening a file named `%s`' % (args,filename))
2181 'Opening a file named `%s`' % (args,filename))
2177 # Now, make sure we can actually read the source (if it was in
2182 # Now, make sure we can actually read the source (if it was in
2178 # a temp file it's gone by now).
2183 # a temp file it's gone by now).
2179 if datafile:
2184 if datafile:
2180 try:
2185 try:
2181 if lineno is None:
2186 if lineno is None:
2182 lineno = inspect.getsourcelines(data)[1]
2187 lineno = inspect.getsourcelines(data)[1]
2183 except IOError:
2188 except IOError:
2184 filename = make_filename(args)
2189 filename = make_filename(args)
2185 if filename is None:
2190 if filename is None:
2186 warn('The file `%s` where `%s` was defined cannot '
2191 warn('The file `%s` where `%s` was defined cannot '
2187 'be read.' % (filename,data))
2192 'be read.' % (filename,data))
2188 return
2193 return
2189 use_temp = 0
2194 use_temp = 0
2190 else:
2195 else:
2191 data = ''
2196 data = ''
2192
2197
2193 if use_temp:
2198 if use_temp:
2194 filename = self.shell.mktempfile(data)
2199 filename = self.shell.mktempfile(data)
2195 print 'IPython will make a temporary file named:',filename
2200 print 'IPython will make a temporary file named:',filename
2196
2201
2197 # do actual editing here
2202 # do actual editing here
2198 print 'Editing...',
2203 print 'Editing...',
2199 sys.stdout.flush()
2204 sys.stdout.flush()
2200 self.shell.hooks.editor(filename,lineno)
2205 self.shell.hooks.editor(filename,lineno)
2201 if opts.has_key('x'): # -x prevents actual execution
2206 if opts.has_key('x'): # -x prevents actual execution
2202 print
2207 print
2203 else:
2208 else:
2204 print 'done. Executing edited code...'
2209 print 'done. Executing edited code...'
2205 if opts_r:
2210 if opts_r:
2206 self.shell.runlines(file_read(filename))
2211 self.shell.runlines(file_read(filename))
2207 else:
2212 else:
2208 self.shell.safe_execfile(filename,self.shell.user_ns)
2213 self.shell.safe_execfile(filename,self.shell.user_ns)
2209 if use_temp:
2214 if use_temp:
2210 try:
2215 try:
2211 return open(filename).read()
2216 return open(filename).read()
2212 except IOError,msg:
2217 except IOError,msg:
2213 if msg.filename == filename:
2218 if msg.filename == filename:
2214 warn('File not found. Did you forget to save?')
2219 warn('File not found. Did you forget to save?')
2215 return
2220 return
2216 else:
2221 else:
2217 self.shell.showtraceback()
2222 self.shell.showtraceback()
2218
2223
2219 def magic_xmode(self,parameter_s = ''):
2224 def magic_xmode(self,parameter_s = ''):
2220 """Switch modes for the exception handlers.
2225 """Switch modes for the exception handlers.
2221
2226
2222 Valid modes: Plain, Context and Verbose.
2227 Valid modes: Plain, Context and Verbose.
2223
2228
2224 If called without arguments, acts as a toggle."""
2229 If called without arguments, acts as a toggle."""
2225
2230
2226 def xmode_switch_err(name):
2231 def xmode_switch_err(name):
2227 warn('Error changing %s exception modes.\n%s' %
2232 warn('Error changing %s exception modes.\n%s' %
2228 (name,sys.exc_info()[1]))
2233 (name,sys.exc_info()[1]))
2229
2234
2230 shell = self.shell
2235 shell = self.shell
2231 new_mode = parameter_s.strip().capitalize()
2236 new_mode = parameter_s.strip().capitalize()
2232 try:
2237 try:
2233 shell.InteractiveTB.set_mode(mode=new_mode)
2238 shell.InteractiveTB.set_mode(mode=new_mode)
2234 print 'Exception reporting mode:',shell.InteractiveTB.mode
2239 print 'Exception reporting mode:',shell.InteractiveTB.mode
2235 except:
2240 except:
2236 xmode_switch_err('user')
2241 xmode_switch_err('user')
2237
2242
2238 # threaded shells use a special handler in sys.excepthook
2243 # threaded shells use a special handler in sys.excepthook
2239 if shell.isthreaded:
2244 if shell.isthreaded:
2240 try:
2245 try:
2241 shell.sys_excepthook.set_mode(mode=new_mode)
2246 shell.sys_excepthook.set_mode(mode=new_mode)
2242 except:
2247 except:
2243 xmode_switch_err('threaded')
2248 xmode_switch_err('threaded')
2244
2249
2245 def magic_colors(self,parameter_s = ''):
2250 def magic_colors(self,parameter_s = ''):
2246 """Switch color scheme for prompts, info system and exception handlers.
2251 """Switch color scheme for prompts, info system and exception handlers.
2247
2252
2248 Currently implemented schemes: NoColor, Linux, LightBG.
2253 Currently implemented schemes: NoColor, Linux, LightBG.
2249
2254
2250 Color scheme names are not case-sensitive."""
2255 Color scheme names are not case-sensitive."""
2251
2256
2252 def color_switch_err(name):
2257 def color_switch_err(name):
2253 warn('Error changing %s color schemes.\n%s' %
2258 warn('Error changing %s color schemes.\n%s' %
2254 (name,sys.exc_info()[1]))
2259 (name,sys.exc_info()[1]))
2255
2260
2256
2261
2257 new_scheme = parameter_s.strip()
2262 new_scheme = parameter_s.strip()
2258 if not new_scheme:
2263 if not new_scheme:
2259 print 'You must specify a color scheme.'
2264 print 'You must specify a color scheme.'
2260 return
2265 return
2261 import IPython.rlineimpl as readline
2266 import IPython.rlineimpl as readline
2262 if not readline.have_readline:
2267 if not readline.have_readline:
2263 msg = """\
2268 msg = """\
2264 Proper color support under MS Windows requires the pyreadline library.
2269 Proper color support under MS Windows requires the pyreadline library.
2265 You can find it at:
2270 You can find it at:
2266 http://ipython.scipy.org/moin/PyReadline/Intro
2271 http://ipython.scipy.org/moin/PyReadline/Intro
2267 Gary's readline needs the ctypes module, from:
2272 Gary's readline needs the ctypes module, from:
2268 http://starship.python.net/crew/theller/ctypes
2273 http://starship.python.net/crew/theller/ctypes
2269 (Note that ctypes is already part of Python versions 2.5 and newer).
2274 (Note that ctypes is already part of Python versions 2.5 and newer).
2270
2275
2271 Defaulting color scheme to 'NoColor'"""
2276 Defaulting color scheme to 'NoColor'"""
2272 new_scheme = 'NoColor'
2277 new_scheme = 'NoColor'
2273 warn(msg)
2278 warn(msg)
2274 # local shortcut
2279 # local shortcut
2275 shell = self.shell
2280 shell = self.shell
2276
2281
2277 # Set prompt colors
2282 # Set prompt colors
2278 try:
2283 try:
2279 shell.outputcache.set_colors(new_scheme)
2284 shell.outputcache.set_colors(new_scheme)
2280 except:
2285 except:
2281 color_switch_err('prompt')
2286 color_switch_err('prompt')
2282 else:
2287 else:
2283 shell.rc.colors = \
2288 shell.rc.colors = \
2284 shell.outputcache.color_table.active_scheme_name
2289 shell.outputcache.color_table.active_scheme_name
2285 # Set exception colors
2290 # Set exception colors
2286 try:
2291 try:
2287 shell.InteractiveTB.set_colors(scheme = new_scheme)
2292 shell.InteractiveTB.set_colors(scheme = new_scheme)
2288 shell.SyntaxTB.set_colors(scheme = new_scheme)
2293 shell.SyntaxTB.set_colors(scheme = new_scheme)
2289 except:
2294 except:
2290 color_switch_err('exception')
2295 color_switch_err('exception')
2291
2296
2292 # threaded shells use a verbose traceback in sys.excepthook
2297 # threaded shells use a verbose traceback in sys.excepthook
2293 if shell.isthreaded:
2298 if shell.isthreaded:
2294 try:
2299 try:
2295 shell.sys_excepthook.set_colors(scheme=new_scheme)
2300 shell.sys_excepthook.set_colors(scheme=new_scheme)
2296 except:
2301 except:
2297 color_switch_err('system exception handler')
2302 color_switch_err('system exception handler')
2298
2303
2299 # Set info (for 'object?') colors
2304 # Set info (for 'object?') colors
2300 if shell.rc.color_info:
2305 if shell.rc.color_info:
2301 try:
2306 try:
2302 shell.inspector.set_active_scheme(new_scheme)
2307 shell.inspector.set_active_scheme(new_scheme)
2303 except:
2308 except:
2304 color_switch_err('object inspector')
2309 color_switch_err('object inspector')
2305 else:
2310 else:
2306 shell.inspector.set_active_scheme('NoColor')
2311 shell.inspector.set_active_scheme('NoColor')
2307
2312
2308 def magic_color_info(self,parameter_s = ''):
2313 def magic_color_info(self,parameter_s = ''):
2309 """Toggle color_info.
2314 """Toggle color_info.
2310
2315
2311 The color_info configuration parameter controls whether colors are
2316 The color_info configuration parameter controls whether colors are
2312 used for displaying object details (by things like %psource, %pfile or
2317 used for displaying object details (by things like %psource, %pfile or
2313 the '?' system). This function toggles this value with each call.
2318 the '?' system). This function toggles this value with each call.
2314
2319
2315 Note that unless you have a fairly recent pager (less works better
2320 Note that unless you have a fairly recent pager (less works better
2316 than more) in your system, using colored object information displays
2321 than more) in your system, using colored object information displays
2317 will not work properly. Test it and see."""
2322 will not work properly. Test it and see."""
2318
2323
2319 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2324 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2320 self.magic_colors(self.shell.rc.colors)
2325 self.magic_colors(self.shell.rc.colors)
2321 print 'Object introspection functions have now coloring:',
2326 print 'Object introspection functions have now coloring:',
2322 print ['OFF','ON'][self.shell.rc.color_info]
2327 print ['OFF','ON'][self.shell.rc.color_info]
2323
2328
2324 def magic_Pprint(self, parameter_s=''):
2329 def magic_Pprint(self, parameter_s=''):
2325 """Toggle pretty printing on/off."""
2330 """Toggle pretty printing on/off."""
2326
2331
2327 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2332 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2328 print 'Pretty printing has been turned', \
2333 print 'Pretty printing has been turned', \
2329 ['OFF','ON'][self.shell.rc.pprint]
2334 ['OFF','ON'][self.shell.rc.pprint]
2330
2335
2331 def magic_exit(self, parameter_s=''):
2336 def magic_exit(self, parameter_s=''):
2332 """Exit IPython, confirming if configured to do so.
2337 """Exit IPython, confirming if configured to do so.
2333
2338
2334 You can configure whether IPython asks for confirmation upon exit by
2339 You can configure whether IPython asks for confirmation upon exit by
2335 setting the confirm_exit flag in the ipythonrc file."""
2340 setting the confirm_exit flag in the ipythonrc file."""
2336
2341
2337 self.shell.exit()
2342 self.shell.exit()
2338
2343
2339 def magic_quit(self, parameter_s=''):
2344 def magic_quit(self, parameter_s=''):
2340 """Exit IPython, confirming if configured to do so (like %exit)"""
2345 """Exit IPython, confirming if configured to do so (like %exit)"""
2341
2346
2342 self.shell.exit()
2347 self.shell.exit()
2343
2348
2344 def magic_Exit(self, parameter_s=''):
2349 def magic_Exit(self, parameter_s=''):
2345 """Exit IPython without confirmation."""
2350 """Exit IPython without confirmation."""
2346
2351
2347 self.shell.exit_now = True
2352 self.shell.exit_now = True
2348
2353
2349 def magic_Quit(self, parameter_s=''):
2354 def magic_Quit(self, parameter_s=''):
2350 """Exit IPython without confirmation (like %Exit)."""
2355 """Exit IPython without confirmation (like %Exit)."""
2351
2356
2352 self.shell.exit_now = True
2357 self.shell.exit_now = True
2353
2358
2354 #......................................................................
2359 #......................................................................
2355 # Functions to implement unix shell-type things
2360 # Functions to implement unix shell-type things
2356
2361
2357 def magic_alias(self, parameter_s = ''):
2362 def magic_alias(self, parameter_s = ''):
2358 """Define an alias for a system command.
2363 """Define an alias for a system command.
2359
2364
2360 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2365 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2361
2366
2362 Then, typing 'alias_name params' will execute the system command 'cmd
2367 Then, typing 'alias_name params' will execute the system command 'cmd
2363 params' (from your underlying operating system).
2368 params' (from your underlying operating system).
2364
2369
2365 Aliases have lower precedence than magic functions and Python normal
2370 Aliases have lower precedence than magic functions and Python normal
2366 variables, so if 'foo' is both a Python variable and an alias, the
2371 variables, so if 'foo' is both a Python variable and an alias, the
2367 alias can not be executed until 'del foo' removes the Python variable.
2372 alias can not be executed until 'del foo' removes the Python variable.
2368
2373
2369 You can use the %l specifier in an alias definition to represent the
2374 You can use the %l specifier in an alias definition to represent the
2370 whole line when the alias is called. For example:
2375 whole line when the alias is called. For example:
2371
2376
2372 In [2]: alias all echo "Input in brackets: <%l>"\\
2377 In [2]: alias all echo "Input in brackets: <%l>"\\
2373 In [3]: all hello world\\
2378 In [3]: all hello world\\
2374 Input in brackets: <hello world>
2379 Input in brackets: <hello world>
2375
2380
2376 You can also define aliases with parameters using %s specifiers (one
2381 You can also define aliases with parameters using %s specifiers (one
2377 per parameter):
2382 per parameter):
2378
2383
2379 In [1]: alias parts echo first %s second %s\\
2384 In [1]: alias parts echo first %s second %s\\
2380 In [2]: %parts A B\\
2385 In [2]: %parts A B\\
2381 first A second B\\
2386 first A second B\\
2382 In [3]: %parts A\\
2387 In [3]: %parts A\\
2383 Incorrect number of arguments: 2 expected.\\
2388 Incorrect number of arguments: 2 expected.\\
2384 parts is an alias to: 'echo first %s second %s'
2389 parts is an alias to: 'echo first %s second %s'
2385
2390
2386 Note that %l and %s are mutually exclusive. You can only use one or
2391 Note that %l and %s are mutually exclusive. You can only use one or
2387 the other in your aliases.
2392 the other in your aliases.
2388
2393
2389 Aliases expand Python variables just like system calls using ! or !!
2394 Aliases expand Python variables just like system calls using ! or !!
2390 do: all expressions prefixed with '$' get expanded. For details of
2395 do: all expressions prefixed with '$' get expanded. For details of
2391 the semantic rules, see PEP-215:
2396 the semantic rules, see PEP-215:
2392 http://www.python.org/peps/pep-0215.html. This is the library used by
2397 http://www.python.org/peps/pep-0215.html. This is the library used by
2393 IPython for variable expansion. If you want to access a true shell
2398 IPython for variable expansion. If you want to access a true shell
2394 variable, an extra $ is necessary to prevent its expansion by IPython:
2399 variable, an extra $ is necessary to prevent its expansion by IPython:
2395
2400
2396 In [6]: alias show echo\\
2401 In [6]: alias show echo\\
2397 In [7]: PATH='A Python string'\\
2402 In [7]: PATH='A Python string'\\
2398 In [8]: show $PATH\\
2403 In [8]: show $PATH\\
2399 A Python string\\
2404 A Python string\\
2400 In [9]: show $$PATH\\
2405 In [9]: show $$PATH\\
2401 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2406 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2402
2407
2403 You can use the alias facility to acess all of $PATH. See the %rehash
2408 You can use the alias facility to acess all of $PATH. See the %rehash
2404 and %rehashx functions, which automatically create aliases for the
2409 and %rehashx functions, which automatically create aliases for the
2405 contents of your $PATH.
2410 contents of your $PATH.
2406
2411
2407 If called with no parameters, %alias prints the current alias table."""
2412 If called with no parameters, %alias prints the current alias table."""
2408
2413
2409 par = parameter_s.strip()
2414 par = parameter_s.strip()
2410 if not par:
2415 if not par:
2411 stored = self.db.get('stored_aliases', {} )
2416 stored = self.db.get('stored_aliases', {} )
2412 atab = self.shell.alias_table
2417 atab = self.shell.alias_table
2413 aliases = atab.keys()
2418 aliases = atab.keys()
2414 aliases.sort()
2419 aliases.sort()
2415 res = []
2420 res = []
2416 showlast = []
2421 showlast = []
2417 for alias in aliases:
2422 for alias in aliases:
2418 tgt = atab[alias][1]
2423 tgt = atab[alias][1]
2419 # 'interesting' aliases
2424 # 'interesting' aliases
2420 if (alias in stored or
2425 if (alias in stored or
2421 alias != os.path.splitext(tgt)[0] or
2426 alias != os.path.splitext(tgt)[0] or
2422 ' ' in tgt):
2427 ' ' in tgt):
2423 showlast.append((alias, tgt))
2428 showlast.append((alias, tgt))
2424 else:
2429 else:
2425 res.append((alias, tgt ))
2430 res.append((alias, tgt ))
2426
2431
2427 # show most interesting aliases last
2432 # show most interesting aliases last
2428 res.extend(showlast)
2433 res.extend(showlast)
2429 print "Total number of aliases:",len(aliases)
2434 print "Total number of aliases:",len(aliases)
2430 return res
2435 return res
2431 try:
2436 try:
2432 alias,cmd = par.split(None,1)
2437 alias,cmd = par.split(None,1)
2433 except:
2438 except:
2434 print OInspect.getdoc(self.magic_alias)
2439 print OInspect.getdoc(self.magic_alias)
2435 else:
2440 else:
2436 nargs = cmd.count('%s')
2441 nargs = cmd.count('%s')
2437 if nargs>0 and cmd.find('%l')>=0:
2442 if nargs>0 and cmd.find('%l')>=0:
2438 error('The %s and %l specifiers are mutually exclusive '
2443 error('The %s and %l specifiers are mutually exclusive '
2439 'in alias definitions.')
2444 'in alias definitions.')
2440 else: # all looks OK
2445 else: # all looks OK
2441 self.shell.alias_table[alias] = (nargs,cmd)
2446 self.shell.alias_table[alias] = (nargs,cmd)
2442 self.shell.alias_table_validate(verbose=0)
2447 self.shell.alias_table_validate(verbose=0)
2443 # end magic_alias
2448 # end magic_alias
2444
2449
2445 def magic_unalias(self, parameter_s = ''):
2450 def magic_unalias(self, parameter_s = ''):
2446 """Remove an alias"""
2451 """Remove an alias"""
2447
2452
2448 aname = parameter_s.strip()
2453 aname = parameter_s.strip()
2449 if aname in self.shell.alias_table:
2454 if aname in self.shell.alias_table:
2450 del self.shell.alias_table[aname]
2455 del self.shell.alias_table[aname]
2451 stored = self.db.get('stored_aliases', {} )
2456 stored = self.db.get('stored_aliases', {} )
2452 if aname in stored:
2457 if aname in stored:
2453 print "Removing %stored alias",aname
2458 print "Removing %stored alias",aname
2454 del stored[aname]
2459 del stored[aname]
2455 self.db['stored_aliases'] = stored
2460 self.db['stored_aliases'] = stored
2456
2461
2457 def magic_rehash(self, parameter_s = ''):
2462 def magic_rehash(self, parameter_s = ''):
2458 """Update the alias table with all entries in $PATH.
2463 """Update the alias table with all entries in $PATH.
2459
2464
2460 This version does no checks on execute permissions or whether the
2465 This version does no checks on execute permissions or whether the
2461 contents of $PATH are truly files (instead of directories or something
2466 contents of $PATH are truly files (instead of directories or something
2462 else). For such a safer (but slower) version, use %rehashx."""
2467 else). For such a safer (but slower) version, use %rehashx."""
2463
2468
2464 # This function (and rehashx) manipulate the alias_table directly
2469 # This function (and rehashx) manipulate the alias_table directly
2465 # rather than calling magic_alias, for speed reasons. A rehash on a
2470 # rather than calling magic_alias, for speed reasons. A rehash on a
2466 # typical Linux box involves several thousand entries, so efficiency
2471 # typical Linux box involves several thousand entries, so efficiency
2467 # here is a top concern.
2472 # here is a top concern.
2468
2473
2469 path = filter(os.path.isdir,os.environ['PATH'].split(os.pathsep))
2474 path = filter(os.path.isdir,os.environ['PATH'].split(os.pathsep))
2470 alias_table = self.shell.alias_table
2475 alias_table = self.shell.alias_table
2471 for pdir in path:
2476 for pdir in path:
2472 for ff in os.listdir(pdir):
2477 for ff in os.listdir(pdir):
2473 # each entry in the alias table must be (N,name), where
2478 # each entry in the alias table must be (N,name), where
2474 # N is the number of positional arguments of the alias.
2479 # N is the number of positional arguments of the alias.
2475 alias_table[ff] = (0,ff)
2480 alias_table[ff] = (0,ff)
2476 # Make sure the alias table doesn't contain keywords or builtins
2481 # Make sure the alias table doesn't contain keywords or builtins
2477 self.shell.alias_table_validate()
2482 self.shell.alias_table_validate()
2478 # Call again init_auto_alias() so we get 'rm -i' and other modified
2483 # Call again init_auto_alias() so we get 'rm -i' and other modified
2479 # aliases since %rehash will probably clobber them
2484 # aliases since %rehash will probably clobber them
2480 self.shell.init_auto_alias()
2485 self.shell.init_auto_alias()
2481
2486
2482 def magic_rehashx(self, parameter_s = ''):
2487 def magic_rehashx(self, parameter_s = ''):
2483 """Update the alias table with all executable files in $PATH.
2488 """Update the alias table with all executable files in $PATH.
2484
2489
2485 This version explicitly checks that every entry in $PATH is a file
2490 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.
2491 with execute access (os.X_OK), so it is much slower than %rehash.
2487
2492
2488 Under Windows, it checks executability as a match agains a
2493 Under Windows, it checks executability as a match agains a
2489 '|'-separated string of extensions, stored in the IPython config
2494 '|'-separated string of extensions, stored in the IPython config
2490 variable win_exec_ext. This defaults to 'exe|com|bat'. """
2495 variable win_exec_ext. This defaults to 'exe|com|bat'. """
2491
2496
2492 path = [os.path.abspath(os.path.expanduser(p)) for p in
2497 path = [os.path.abspath(os.path.expanduser(p)) for p in
2493 os.environ['PATH'].split(os.pathsep)]
2498 os.environ['PATH'].split(os.pathsep)]
2494 path = filter(os.path.isdir,path)
2499 path = filter(os.path.isdir,path)
2495
2500
2496 alias_table = self.shell.alias_table
2501 alias_table = self.shell.alias_table
2497 syscmdlist = []
2502 syscmdlist = []
2498 if os.name == 'posix':
2503 if os.name == 'posix':
2499 isexec = lambda fname:os.path.isfile(fname) and \
2504 isexec = lambda fname:os.path.isfile(fname) and \
2500 os.access(fname,os.X_OK)
2505 os.access(fname,os.X_OK)
2501 else:
2506 else:
2502
2507
2503 try:
2508 try:
2504 winext = os.environ['pathext'].replace(';','|').replace('.','')
2509 winext = os.environ['pathext'].replace(';','|').replace('.','')
2505 except KeyError:
2510 except KeyError:
2506 winext = 'exe|com|bat|py'
2511 winext = 'exe|com|bat|py'
2507 if 'py' not in winext:
2512 if 'py' not in winext:
2508 winext += '|py'
2513 winext += '|py'
2509 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2514 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2510 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2515 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2511 savedir = os.getcwd()
2516 savedir = os.getcwd()
2512 try:
2517 try:
2513 # write the whole loop for posix/Windows so we don't have an if in
2518 # write the whole loop for posix/Windows so we don't have an if in
2514 # the innermost part
2519 # the innermost part
2515 if os.name == 'posix':
2520 if os.name == 'posix':
2516 for pdir in path:
2521 for pdir in path:
2517 os.chdir(pdir)
2522 os.chdir(pdir)
2518 for ff in os.listdir(pdir):
2523 for ff in os.listdir(pdir):
2519 if isexec(ff) and ff not in self.shell.no_alias:
2524 if isexec(ff) and ff not in self.shell.no_alias:
2520 # each entry in the alias table must be (N,name),
2525 # each entry in the alias table must be (N,name),
2521 # where N is the number of positional arguments of the
2526 # where N is the number of positional arguments of the
2522 # alias.
2527 # alias.
2523 alias_table[ff] = (0,ff)
2528 alias_table[ff] = (0,ff)
2524 syscmdlist.append(ff)
2529 syscmdlist.append(ff)
2525 else:
2530 else:
2526 for pdir in path:
2531 for pdir in path:
2527 os.chdir(pdir)
2532 os.chdir(pdir)
2528 for ff in os.listdir(pdir):
2533 for ff in os.listdir(pdir):
2529 if isexec(ff) and os.path.splitext(ff)[0] not in self.shell.no_alias:
2534 if isexec(ff) and os.path.splitext(ff)[0] not in self.shell.no_alias:
2530 alias_table[execre.sub(r'\1',ff)] = (0,ff)
2535 alias_table[execre.sub(r'\1',ff)] = (0,ff)
2531 syscmdlist.append(ff)
2536 syscmdlist.append(ff)
2532 # Make sure the alias table doesn't contain keywords or builtins
2537 # Make sure the alias table doesn't contain keywords or builtins
2533 self.shell.alias_table_validate()
2538 self.shell.alias_table_validate()
2534 # Call again init_auto_alias() so we get 'rm -i' and other
2539 # Call again init_auto_alias() so we get 'rm -i' and other
2535 # modified aliases since %rehashx will probably clobber them
2540 # modified aliases since %rehashx will probably clobber them
2536 self.shell.init_auto_alias()
2541 self.shell.init_auto_alias()
2537 db = self.getapi().db
2542 db = self.getapi().db
2538 db['syscmdlist'] = syscmdlist
2543 db['syscmdlist'] = syscmdlist
2539 finally:
2544 finally:
2540 os.chdir(savedir)
2545 os.chdir(savedir)
2541
2546
2542 def magic_pwd(self, parameter_s = ''):
2547 def magic_pwd(self, parameter_s = ''):
2543 """Return the current working directory path."""
2548 """Return the current working directory path."""
2544 return os.getcwd()
2549 return os.getcwd()
2545
2550
2546 def magic_cd(self, parameter_s=''):
2551 def magic_cd(self, parameter_s=''):
2547 """Change the current working directory.
2552 """Change the current working directory.
2548
2553
2549 This command automatically maintains an internal list of directories
2554 This command automatically maintains an internal list of directories
2550 you visit during your IPython session, in the variable _dh. The
2555 you visit during your IPython session, in the variable _dh. The
2551 command %dhist shows this history nicely formatted.
2556 command %dhist shows this history nicely formatted.
2552
2557
2553 Usage:
2558 Usage:
2554
2559
2555 cd 'dir': changes to directory 'dir'.
2560 cd 'dir': changes to directory 'dir'.
2556
2561
2557 cd -: changes to the last visited directory.
2562 cd -: changes to the last visited directory.
2558
2563
2559 cd -<n>: changes to the n-th directory in the directory history.
2564 cd -<n>: changes to the n-th directory in the directory history.
2560
2565
2561 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2566 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2562 (note: cd <bookmark_name> is enough if there is no
2567 (note: cd <bookmark_name> is enough if there is no
2563 directory <bookmark_name>, but a bookmark with the name exists.)
2568 directory <bookmark_name>, but a bookmark with the name exists.)
2564
2569
2565 Options:
2570 Options:
2566
2571
2567 -q: quiet. Do not print the working directory after the cd command is
2572 -q: quiet. Do not print the working directory after the cd command is
2568 executed. By default IPython's cd command does print this directory,
2573 executed. By default IPython's cd command does print this directory,
2569 since the default prompts do not display path information.
2574 since the default prompts do not display path information.
2570
2575
2571 Note that !cd doesn't work for this purpose because the shell where
2576 Note that !cd doesn't work for this purpose because the shell where
2572 !command runs is immediately discarded after executing 'command'."""
2577 !command runs is immediately discarded after executing 'command'."""
2573
2578
2574 parameter_s = parameter_s.strip()
2579 parameter_s = parameter_s.strip()
2575 #bkms = self.shell.persist.get("bookmarks",{})
2580 #bkms = self.shell.persist.get("bookmarks",{})
2576
2581
2577 numcd = re.match(r'(-)(\d+)$',parameter_s)
2582 numcd = re.match(r'(-)(\d+)$',parameter_s)
2578 # jump in directory history by number
2583 # jump in directory history by number
2579 if numcd:
2584 if numcd:
2580 nn = int(numcd.group(2))
2585 nn = int(numcd.group(2))
2581 try:
2586 try:
2582 ps = self.shell.user_ns['_dh'][nn]
2587 ps = self.shell.user_ns['_dh'][nn]
2583 except IndexError:
2588 except IndexError:
2584 print 'The requested directory does not exist in history.'
2589 print 'The requested directory does not exist in history.'
2585 return
2590 return
2586 else:
2591 else:
2587 opts = {}
2592 opts = {}
2588 else:
2593 else:
2589 #turn all non-space-escaping backslashes to slashes,
2594 #turn all non-space-escaping backslashes to slashes,
2590 # for c:\windows\directory\names\
2595 # for c:\windows\directory\names\
2591 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2596 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2592 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2597 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2593 # jump to previous
2598 # jump to previous
2594 if ps == '-':
2599 if ps == '-':
2595 try:
2600 try:
2596 ps = self.shell.user_ns['_dh'][-2]
2601 ps = self.shell.user_ns['_dh'][-2]
2597 except IndexError:
2602 except IndexError:
2598 print 'No previous directory to change to.'
2603 print 'No previous directory to change to.'
2599 return
2604 return
2600 # jump to bookmark if needed
2605 # jump to bookmark if needed
2601 else:
2606 else:
2602 if not os.path.isdir(ps) or opts.has_key('b'):
2607 if not os.path.isdir(ps) or opts.has_key('b'):
2603 bkms = self.db.get('bookmarks', {})
2608 bkms = self.db.get('bookmarks', {})
2604
2609
2605 if bkms.has_key(ps):
2610 if bkms.has_key(ps):
2606 target = bkms[ps]
2611 target = bkms[ps]
2607 print '(bookmark:%s) -> %s' % (ps,target)
2612 print '(bookmark:%s) -> %s' % (ps,target)
2608 ps = target
2613 ps = target
2609 else:
2614 else:
2610 if opts.has_key('b'):
2615 if opts.has_key('b'):
2611 error("Bookmark '%s' not found. "
2616 error("Bookmark '%s' not found. "
2612 "Use '%%bookmark -l' to see your bookmarks." % ps)
2617 "Use '%%bookmark -l' to see your bookmarks." % ps)
2613 return
2618 return
2614
2619
2615 # at this point ps should point to the target dir
2620 # at this point ps should point to the target dir
2616 if ps:
2621 if ps:
2617 try:
2622 try:
2618 os.chdir(os.path.expanduser(ps))
2623 os.chdir(os.path.expanduser(ps))
2619 ttitle = ("IPy:" + (
2624 ttitle = ("IPy:" + (
2620 os.getcwd() == '/' and '/' or os.path.basename(os.getcwd())))
2625 os.getcwd() == '/' and '/' or os.path.basename(os.getcwd())))
2621 platutils.set_term_title(ttitle)
2626 platutils.set_term_title(ttitle)
2622 except OSError:
2627 except OSError:
2623 print sys.exc_info()[1]
2628 print sys.exc_info()[1]
2624 else:
2629 else:
2625 self.shell.user_ns['_dh'].append(os.getcwd())
2630 self.shell.user_ns['_dh'].append(os.getcwd())
2626 else:
2631 else:
2627 os.chdir(self.shell.home_dir)
2632 os.chdir(self.shell.home_dir)
2628 platutils.set_term_title("IPy:~")
2633 platutils.set_term_title("IPy:~")
2629 self.shell.user_ns['_dh'].append(os.getcwd())
2634 self.shell.user_ns['_dh'].append(os.getcwd())
2630 if not 'q' in opts:
2635 if not 'q' in opts:
2631 print self.shell.user_ns['_dh'][-1]
2636 print self.shell.user_ns['_dh'][-1]
2632
2637
2633 def magic_dhist(self, parameter_s=''):
2638 def magic_dhist(self, parameter_s=''):
2634 """Print your history of visited directories.
2639 """Print your history of visited directories.
2635
2640
2636 %dhist -> print full history\\
2641 %dhist -> print full history\\
2637 %dhist n -> print last n entries only\\
2642 %dhist n -> print last n entries only\\
2638 %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\\
2643 %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\\
2639
2644
2640 This history is automatically maintained by the %cd command, and
2645 This history is automatically maintained by the %cd command, and
2641 always available as the global list variable _dh. You can use %cd -<n>
2646 always available as the global list variable _dh. You can use %cd -<n>
2642 to go to directory number <n>."""
2647 to go to directory number <n>."""
2643
2648
2644 dh = self.shell.user_ns['_dh']
2649 dh = self.shell.user_ns['_dh']
2645 if parameter_s:
2650 if parameter_s:
2646 try:
2651 try:
2647 args = map(int,parameter_s.split())
2652 args = map(int,parameter_s.split())
2648 except:
2653 except:
2649 self.arg_err(Magic.magic_dhist)
2654 self.arg_err(Magic.magic_dhist)
2650 return
2655 return
2651 if len(args) == 1:
2656 if len(args) == 1:
2652 ini,fin = max(len(dh)-(args[0]),0),len(dh)
2657 ini,fin = max(len(dh)-(args[0]),0),len(dh)
2653 elif len(args) == 2:
2658 elif len(args) == 2:
2654 ini,fin = args
2659 ini,fin = args
2655 else:
2660 else:
2656 self.arg_err(Magic.magic_dhist)
2661 self.arg_err(Magic.magic_dhist)
2657 return
2662 return
2658 else:
2663 else:
2659 ini,fin = 0,len(dh)
2664 ini,fin = 0,len(dh)
2660 nlprint(dh,
2665 nlprint(dh,
2661 header = 'Directory history (kept in _dh)',
2666 header = 'Directory history (kept in _dh)',
2662 start=ini,stop=fin)
2667 start=ini,stop=fin)
2663
2668
2664 def magic_env(self, parameter_s=''):
2669 def magic_env(self, parameter_s=''):
2665 """List environment variables."""
2670 """List environment variables."""
2666
2671
2667 return os.environ.data
2672 return os.environ.data
2668
2673
2669 def magic_pushd(self, parameter_s=''):
2674 def magic_pushd(self, parameter_s=''):
2670 """Place the current dir on stack and change directory.
2675 """Place the current dir on stack and change directory.
2671
2676
2672 Usage:\\
2677 Usage:\\
2673 %pushd ['dirname']
2678 %pushd ['dirname']
2674
2679
2675 %pushd with no arguments does a %pushd to your home directory.
2680 %pushd with no arguments does a %pushd to your home directory.
2676 """
2681 """
2677 if parameter_s == '': parameter_s = '~'
2682 if parameter_s == '': parameter_s = '~'
2678 dir_s = self.shell.dir_stack
2683 dir_s = self.shell.dir_stack
2679 if len(dir_s)>0 and os.path.expanduser(parameter_s) != \
2684 if len(dir_s)>0 and os.path.expanduser(parameter_s) != \
2680 os.path.expanduser(self.shell.dir_stack[0]):
2685 os.path.expanduser(self.shell.dir_stack[0]):
2681 try:
2686 try:
2682 self.magic_cd(parameter_s)
2687 self.magic_cd(parameter_s)
2683 dir_s.insert(0,os.getcwd().replace(self.home_dir,'~'))
2688 dir_s.insert(0,os.getcwd().replace(self.home_dir,'~'))
2684 self.magic_dirs()
2689 self.magic_dirs()
2685 except:
2690 except:
2686 print 'Invalid directory'
2691 print 'Invalid directory'
2687 else:
2692 else:
2688 print 'You are already there!'
2693 print 'You are already there!'
2689
2694
2690 def magic_popd(self, parameter_s=''):
2695 def magic_popd(self, parameter_s=''):
2691 """Change to directory popped off the top of the stack.
2696 """Change to directory popped off the top of the stack.
2692 """
2697 """
2693 if len (self.shell.dir_stack) > 1:
2698 if len (self.shell.dir_stack) > 1:
2694 self.shell.dir_stack.pop(0)
2699 self.shell.dir_stack.pop(0)
2695 self.magic_cd(self.shell.dir_stack[0])
2700 self.magic_cd(self.shell.dir_stack[0])
2696 print self.shell.dir_stack[0]
2701 print self.shell.dir_stack[0]
2697 else:
2702 else:
2698 print "You can't remove the starting directory from the stack:",\
2703 print "You can't remove the starting directory from the stack:",\
2699 self.shell.dir_stack
2704 self.shell.dir_stack
2700
2705
2701 def magic_dirs(self, parameter_s=''):
2706 def magic_dirs(self, parameter_s=''):
2702 """Return the current directory stack."""
2707 """Return the current directory stack."""
2703
2708
2704 return self.shell.dir_stack[:]
2709 return self.shell.dir_stack[:]
2705
2710
2706 def magic_sc(self, parameter_s=''):
2711 def magic_sc(self, parameter_s=''):
2707 """Shell capture - execute a shell command and capture its output.
2712 """Shell capture - execute a shell command and capture its output.
2708
2713
2709 DEPRECATED. Suboptimal, retained for backwards compatibility.
2714 DEPRECATED. Suboptimal, retained for backwards compatibility.
2710
2715
2711 You should use the form 'var = !command' instead. Example:
2716 You should use the form 'var = !command' instead. Example:
2712
2717
2713 "%sc -l myfiles = ls ~" should now be written as
2718 "%sc -l myfiles = ls ~" should now be written as
2714
2719
2715 "myfiles = !ls ~"
2720 "myfiles = !ls ~"
2716
2721
2717 myfiles.s, myfiles.l and myfiles.n still apply as documented
2722 myfiles.s, myfiles.l and myfiles.n still apply as documented
2718 below.
2723 below.
2719
2724
2720 --
2725 --
2721 %sc [options] varname=command
2726 %sc [options] varname=command
2722
2727
2723 IPython will run the given command using commands.getoutput(), and
2728 IPython will run the given command using commands.getoutput(), and
2724 will then update the user's interactive namespace with a variable
2729 will then update the user's interactive namespace with a variable
2725 called varname, containing the value of the call. Your command can
2730 called varname, containing the value of the call. Your command can
2726 contain shell wildcards, pipes, etc.
2731 contain shell wildcards, pipes, etc.
2727
2732
2728 The '=' sign in the syntax is mandatory, and the variable name you
2733 The '=' sign in the syntax is mandatory, and the variable name you
2729 supply must follow Python's standard conventions for valid names.
2734 supply must follow Python's standard conventions for valid names.
2730
2735
2731 (A special format without variable name exists for internal use)
2736 (A special format without variable name exists for internal use)
2732
2737
2733 Options:
2738 Options:
2734
2739
2735 -l: list output. Split the output on newlines into a list before
2740 -l: list output. Split the output on newlines into a list before
2736 assigning it to the given variable. By default the output is stored
2741 assigning it to the given variable. By default the output is stored
2737 as a single string.
2742 as a single string.
2738
2743
2739 -v: verbose. Print the contents of the variable.
2744 -v: verbose. Print the contents of the variable.
2740
2745
2741 In most cases you should not need to split as a list, because the
2746 In most cases you should not need to split as a list, because the
2742 returned value is a special type of string which can automatically
2747 returned value is a special type of string which can automatically
2743 provide its contents either as a list (split on newlines) or as a
2748 provide its contents either as a list (split on newlines) or as a
2744 space-separated string. These are convenient, respectively, either
2749 space-separated string. These are convenient, respectively, either
2745 for sequential processing or to be passed to a shell command.
2750 for sequential processing or to be passed to a shell command.
2746
2751
2747 For example:
2752 For example:
2748
2753
2749 # Capture into variable a
2754 # Capture into variable a
2750 In [9]: sc a=ls *py
2755 In [9]: sc a=ls *py
2751
2756
2752 # a is a string with embedded newlines
2757 # a is a string with embedded newlines
2753 In [10]: a
2758 In [10]: a
2754 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2759 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2755
2760
2756 # which can be seen as a list:
2761 # which can be seen as a list:
2757 In [11]: a.l
2762 In [11]: a.l
2758 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2763 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2759
2764
2760 # or as a whitespace-separated string:
2765 # or as a whitespace-separated string:
2761 In [12]: a.s
2766 In [12]: a.s
2762 Out[12]: 'setup.py win32_manual_post_install.py'
2767 Out[12]: 'setup.py win32_manual_post_install.py'
2763
2768
2764 # a.s is useful to pass as a single command line:
2769 # a.s is useful to pass as a single command line:
2765 In [13]: !wc -l $a.s
2770 In [13]: !wc -l $a.s
2766 146 setup.py
2771 146 setup.py
2767 130 win32_manual_post_install.py
2772 130 win32_manual_post_install.py
2768 276 total
2773 276 total
2769
2774
2770 # while the list form is useful to loop over:
2775 # while the list form is useful to loop over:
2771 In [14]: for f in a.l:
2776 In [14]: for f in a.l:
2772 ....: !wc -l $f
2777 ....: !wc -l $f
2773 ....:
2778 ....:
2774 146 setup.py
2779 146 setup.py
2775 130 win32_manual_post_install.py
2780 130 win32_manual_post_install.py
2776
2781
2777 Similiarly, the lists returned by the -l option are also special, in
2782 Similiarly, the lists returned by the -l option are also special, in
2778 the sense that you can equally invoke the .s attribute on them to
2783 the sense that you can equally invoke the .s attribute on them to
2779 automatically get a whitespace-separated string from their contents:
2784 automatically get a whitespace-separated string from their contents:
2780
2785
2781 In [1]: sc -l b=ls *py
2786 In [1]: sc -l b=ls *py
2782
2787
2783 In [2]: b
2788 In [2]: b
2784 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2789 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2785
2790
2786 In [3]: b.s
2791 In [3]: b.s
2787 Out[3]: 'setup.py win32_manual_post_install.py'
2792 Out[3]: 'setup.py win32_manual_post_install.py'
2788
2793
2789 In summary, both the lists and strings used for ouptut capture have
2794 In summary, both the lists and strings used for ouptut capture have
2790 the following special attributes:
2795 the following special attributes:
2791
2796
2792 .l (or .list) : value as list.
2797 .l (or .list) : value as list.
2793 .n (or .nlstr): value as newline-separated string.
2798 .n (or .nlstr): value as newline-separated string.
2794 .s (or .spstr): value as space-separated string.
2799 .s (or .spstr): value as space-separated string.
2795 """
2800 """
2796
2801
2797 opts,args = self.parse_options(parameter_s,'lv')
2802 opts,args = self.parse_options(parameter_s,'lv')
2798 # Try to get a variable name and command to run
2803 # Try to get a variable name and command to run
2799 try:
2804 try:
2800 # the variable name must be obtained from the parse_options
2805 # the variable name must be obtained from the parse_options
2801 # output, which uses shlex.split to strip options out.
2806 # output, which uses shlex.split to strip options out.
2802 var,_ = args.split('=',1)
2807 var,_ = args.split('=',1)
2803 var = var.strip()
2808 var = var.strip()
2804 # But the the command has to be extracted from the original input
2809 # But the the command has to be extracted from the original input
2805 # parameter_s, not on what parse_options returns, to avoid the
2810 # parameter_s, not on what parse_options returns, to avoid the
2806 # quote stripping which shlex.split performs on it.
2811 # quote stripping which shlex.split performs on it.
2807 _,cmd = parameter_s.split('=',1)
2812 _,cmd = parameter_s.split('=',1)
2808 except ValueError:
2813 except ValueError:
2809 var,cmd = '',''
2814 var,cmd = '',''
2810 # If all looks ok, proceed
2815 # If all looks ok, proceed
2811 out,err = self.shell.getoutputerror(cmd)
2816 out,err = self.shell.getoutputerror(cmd)
2812 if err:
2817 if err:
2813 print >> Term.cerr,err
2818 print >> Term.cerr,err
2814 if opts.has_key('l'):
2819 if opts.has_key('l'):
2815 out = SList(out.split('\n'))
2820 out = SList(out.split('\n'))
2816 else:
2821 else:
2817 out = LSString(out)
2822 out = LSString(out)
2818 if opts.has_key('v'):
2823 if opts.has_key('v'):
2819 print '%s ==\n%s' % (var,pformat(out))
2824 print '%s ==\n%s' % (var,pformat(out))
2820 if var:
2825 if var:
2821 self.shell.user_ns.update({var:out})
2826 self.shell.user_ns.update({var:out})
2822 else:
2827 else:
2823 return out
2828 return out
2824
2829
2825 def magic_sx(self, parameter_s=''):
2830 def magic_sx(self, parameter_s=''):
2826 """Shell execute - run a shell command and capture its output.
2831 """Shell execute - run a shell command and capture its output.
2827
2832
2828 %sx command
2833 %sx command
2829
2834
2830 IPython will run the given command using commands.getoutput(), and
2835 IPython will run the given command using commands.getoutput(), and
2831 return the result formatted as a list (split on '\\n'). Since the
2836 return the result formatted as a list (split on '\\n'). Since the
2832 output is _returned_, it will be stored in ipython's regular output
2837 output is _returned_, it will be stored in ipython's regular output
2833 cache Out[N] and in the '_N' automatic variables.
2838 cache Out[N] and in the '_N' automatic variables.
2834
2839
2835 Notes:
2840 Notes:
2836
2841
2837 1) If an input line begins with '!!', then %sx is automatically
2842 1) If an input line begins with '!!', then %sx is automatically
2838 invoked. That is, while:
2843 invoked. That is, while:
2839 !ls
2844 !ls
2840 causes ipython to simply issue system('ls'), typing
2845 causes ipython to simply issue system('ls'), typing
2841 !!ls
2846 !!ls
2842 is a shorthand equivalent to:
2847 is a shorthand equivalent to:
2843 %sx ls
2848 %sx ls
2844
2849
2845 2) %sx differs from %sc in that %sx automatically splits into a list,
2850 2) %sx differs from %sc in that %sx automatically splits into a list,
2846 like '%sc -l'. The reason for this is to make it as easy as possible
2851 like '%sc -l'. The reason for this is to make it as easy as possible
2847 to process line-oriented shell output via further python commands.
2852 to process line-oriented shell output via further python commands.
2848 %sc is meant to provide much finer control, but requires more
2853 %sc is meant to provide much finer control, but requires more
2849 typing.
2854 typing.
2850
2855
2851 3) Just like %sc -l, this is a list with special attributes:
2856 3) Just like %sc -l, this is a list with special attributes:
2852
2857
2853 .l (or .list) : value as list.
2858 .l (or .list) : value as list.
2854 .n (or .nlstr): value as newline-separated string.
2859 .n (or .nlstr): value as newline-separated string.
2855 .s (or .spstr): value as whitespace-separated string.
2860 .s (or .spstr): value as whitespace-separated string.
2856
2861
2857 This is very useful when trying to use such lists as arguments to
2862 This is very useful when trying to use such lists as arguments to
2858 system commands."""
2863 system commands."""
2859
2864
2860 if parameter_s:
2865 if parameter_s:
2861 out,err = self.shell.getoutputerror(parameter_s)
2866 out,err = self.shell.getoutputerror(parameter_s)
2862 if err:
2867 if err:
2863 print >> Term.cerr,err
2868 print >> Term.cerr,err
2864 return SList(out.split('\n'))
2869 return SList(out.split('\n'))
2865
2870
2866 def magic_bg(self, parameter_s=''):
2871 def magic_bg(self, parameter_s=''):
2867 """Run a job in the background, in a separate thread.
2872 """Run a job in the background, in a separate thread.
2868
2873
2869 For example,
2874 For example,
2870
2875
2871 %bg myfunc(x,y,z=1)
2876 %bg myfunc(x,y,z=1)
2872
2877
2873 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2878 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2874 execution starts, a message will be printed indicating the job
2879 execution starts, a message will be printed indicating the job
2875 number. If your job number is 5, you can use
2880 number. If your job number is 5, you can use
2876
2881
2877 myvar = jobs.result(5) or myvar = jobs[5].result
2882 myvar = jobs.result(5) or myvar = jobs[5].result
2878
2883
2879 to assign this result to variable 'myvar'.
2884 to assign this result to variable 'myvar'.
2880
2885
2881 IPython has a job manager, accessible via the 'jobs' object. You can
2886 IPython has a job manager, accessible via the 'jobs' object. You can
2882 type jobs? to get more information about it, and use jobs.<TAB> to see
2887 type jobs? to get more information about it, and use jobs.<TAB> to see
2883 its attributes. All attributes not starting with an underscore are
2888 its attributes. All attributes not starting with an underscore are
2884 meant for public use.
2889 meant for public use.
2885
2890
2886 In particular, look at the jobs.new() method, which is used to create
2891 In particular, look at the jobs.new() method, which is used to create
2887 new jobs. This magic %bg function is just a convenience wrapper
2892 new jobs. This magic %bg function is just a convenience wrapper
2888 around jobs.new(), for expression-based jobs. If you want to create a
2893 around jobs.new(), for expression-based jobs. If you want to create a
2889 new job with an explicit function object and arguments, you must call
2894 new job with an explicit function object and arguments, you must call
2890 jobs.new() directly.
2895 jobs.new() directly.
2891
2896
2892 The jobs.new docstring also describes in detail several important
2897 The jobs.new docstring also describes in detail several important
2893 caveats associated with a thread-based model for background job
2898 caveats associated with a thread-based model for background job
2894 execution. Type jobs.new? for details.
2899 execution. Type jobs.new? for details.
2895
2900
2896 You can check the status of all jobs with jobs.status().
2901 You can check the status of all jobs with jobs.status().
2897
2902
2898 The jobs variable is set by IPython into the Python builtin namespace.
2903 The jobs variable is set by IPython into the Python builtin namespace.
2899 If you ever declare a variable named 'jobs', you will shadow this
2904 If you ever declare a variable named 'jobs', you will shadow this
2900 name. You can either delete your global jobs variable to regain
2905 name. You can either delete your global jobs variable to regain
2901 access to the job manager, or make a new name and assign it manually
2906 access to the job manager, or make a new name and assign it manually
2902 to the manager (stored in IPython's namespace). For example, to
2907 to the manager (stored in IPython's namespace). For example, to
2903 assign the job manager to the Jobs name, use:
2908 assign the job manager to the Jobs name, use:
2904
2909
2905 Jobs = __builtins__.jobs"""
2910 Jobs = __builtins__.jobs"""
2906
2911
2907 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2912 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2908
2913
2909
2914
2910 def magic_bookmark(self, parameter_s=''):
2915 def magic_bookmark(self, parameter_s=''):
2911 """Manage IPython's bookmark system.
2916 """Manage IPython's bookmark system.
2912
2917
2913 %bookmark <name> - set bookmark to current dir
2918 %bookmark <name> - set bookmark to current dir
2914 %bookmark <name> <dir> - set bookmark to <dir>
2919 %bookmark <name> <dir> - set bookmark to <dir>
2915 %bookmark -l - list all bookmarks
2920 %bookmark -l - list all bookmarks
2916 %bookmark -d <name> - remove bookmark
2921 %bookmark -d <name> - remove bookmark
2917 %bookmark -r - remove all bookmarks
2922 %bookmark -r - remove all bookmarks
2918
2923
2919 You can later on access a bookmarked folder with:
2924 You can later on access a bookmarked folder with:
2920 %cd -b <name>
2925 %cd -b <name>
2921 or simply '%cd <name>' if there is no directory called <name> AND
2926 or simply '%cd <name>' if there is no directory called <name> AND
2922 there is such a bookmark defined.
2927 there is such a bookmark defined.
2923
2928
2924 Your bookmarks persist through IPython sessions, but they are
2929 Your bookmarks persist through IPython sessions, but they are
2925 associated with each profile."""
2930 associated with each profile."""
2926
2931
2927 opts,args = self.parse_options(parameter_s,'drl',mode='list')
2932 opts,args = self.parse_options(parameter_s,'drl',mode='list')
2928 if len(args) > 2:
2933 if len(args) > 2:
2929 error('You can only give at most two arguments')
2934 error('You can only give at most two arguments')
2930 return
2935 return
2931
2936
2932 bkms = self.db.get('bookmarks',{})
2937 bkms = self.db.get('bookmarks',{})
2933
2938
2934 if opts.has_key('d'):
2939 if opts.has_key('d'):
2935 try:
2940 try:
2936 todel = args[0]
2941 todel = args[0]
2937 except IndexError:
2942 except IndexError:
2938 error('You must provide a bookmark to delete')
2943 error('You must provide a bookmark to delete')
2939 else:
2944 else:
2940 try:
2945 try:
2941 del bkms[todel]
2946 del bkms[todel]
2942 except:
2947 except:
2943 error("Can't delete bookmark '%s'" % todel)
2948 error("Can't delete bookmark '%s'" % todel)
2944 elif opts.has_key('r'):
2949 elif opts.has_key('r'):
2945 bkms = {}
2950 bkms = {}
2946 elif opts.has_key('l'):
2951 elif opts.has_key('l'):
2947 bks = bkms.keys()
2952 bks = bkms.keys()
2948 bks.sort()
2953 bks.sort()
2949 if bks:
2954 if bks:
2950 size = max(map(len,bks))
2955 size = max(map(len,bks))
2951 else:
2956 else:
2952 size = 0
2957 size = 0
2953 fmt = '%-'+str(size)+'s -> %s'
2958 fmt = '%-'+str(size)+'s -> %s'
2954 print 'Current bookmarks:'
2959 print 'Current bookmarks:'
2955 for bk in bks:
2960 for bk in bks:
2956 print fmt % (bk,bkms[bk])
2961 print fmt % (bk,bkms[bk])
2957 else:
2962 else:
2958 if not args:
2963 if not args:
2959 error("You must specify the bookmark name")
2964 error("You must specify the bookmark name")
2960 elif len(args)==1:
2965 elif len(args)==1:
2961 bkms[args[0]] = os.getcwd()
2966 bkms[args[0]] = os.getcwd()
2962 elif len(args)==2:
2967 elif len(args)==2:
2963 bkms[args[0]] = args[1]
2968 bkms[args[0]] = args[1]
2964 self.db['bookmarks'] = bkms
2969 self.db['bookmarks'] = bkms
2965
2970
2966 def magic_pycat(self, parameter_s=''):
2971 def magic_pycat(self, parameter_s=''):
2967 """Show a syntax-highlighted file through a pager.
2972 """Show a syntax-highlighted file through a pager.
2968
2973
2969 This magic is similar to the cat utility, but it will assume the file
2974 This magic is similar to the cat utility, but it will assume the file
2970 to be Python source and will show it with syntax highlighting. """
2975 to be Python source and will show it with syntax highlighting. """
2971
2976
2972 try:
2977 try:
2973 filename = get_py_filename(parameter_s)
2978 filename = get_py_filename(parameter_s)
2974 cont = file_read(filename)
2979 cont = file_read(filename)
2975 except IOError:
2980 except IOError:
2976 try:
2981 try:
2977 cont = eval(parameter_s,self.user_ns)
2982 cont = eval(parameter_s,self.user_ns)
2978 except NameError:
2983 except NameError:
2979 cont = None
2984 cont = None
2980 if cont is None:
2985 if cont is None:
2981 print "Error: no such file or variable"
2986 print "Error: no such file or variable"
2982 return
2987 return
2983
2988
2984 page(self.shell.pycolorize(cont),
2989 page(self.shell.pycolorize(cont),
2985 screen_lines=self.shell.rc.screen_length)
2990 screen_lines=self.shell.rc.screen_length)
2986
2991
2987 def magic_cpaste(self, parameter_s=''):
2992 def magic_cpaste(self, parameter_s=''):
2988 """Allows you to paste & execute a pre-formatted code block from clipboard
2993 """Allows you to paste & execute a pre-formatted code block from clipboard
2989
2994
2990 You must terminate the block with '--' (two minus-signs) alone on the
2995 You must terminate the block with '--' (two minus-signs) alone on the
2991 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
2996 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
2992 is the new sentinel for this operation)
2997 is the new sentinel for this operation)
2993
2998
2994 The block is dedented prior to execution to enable execution of
2999 The block is dedented prior to execution to enable execution of
2995 method definitions. '>' characters at the beginning of a line is
3000 method definitions. '>' characters at the beginning of a line is
2996 ignored, to allow pasting directly from e-mails. The executed block
3001 ignored, to allow pasting directly from e-mails. The executed block
2997 is also assigned to variable named 'pasted_block' for later editing
3002 is also assigned to variable named 'pasted_block' for later editing
2998 with '%edit pasted_block'.
3003 with '%edit pasted_block'.
2999
3004
3000 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
3005 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
3001 This assigns the pasted block to variable 'foo' as string, without
3006 This assigns the pasted block to variable 'foo' as string, without
3002 dedenting or executing it.
3007 dedenting or executing it.
3003
3008
3004 Do not be alarmed by garbled output on Windows (it's a readline bug).
3009 Do not be alarmed by garbled output on Windows (it's a readline bug).
3005 Just press enter and type -- (and press enter again) and the block
3010 Just press enter and type -- (and press enter again) and the block
3006 will be what was just pasted.
3011 will be what was just pasted.
3007
3012
3008 IPython statements (magics, shell escapes) are not supported (yet).
3013 IPython statements (magics, shell escapes) are not supported (yet).
3009 """
3014 """
3010 opts,args = self.parse_options(parameter_s,'s:',mode='string')
3015 opts,args = self.parse_options(parameter_s,'s:',mode='string')
3011 par = args.strip()
3016 par = args.strip()
3012 sentinel = opts.get('s','--')
3017 sentinel = opts.get('s','--')
3013
3018
3014 from IPython import iplib
3019 from IPython import iplib
3015 lines = []
3020 lines = []
3016 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3021 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
3017 while 1:
3022 while 1:
3018 l = iplib.raw_input_original(':')
3023 l = iplib.raw_input_original(':')
3019 if l ==sentinel:
3024 if l ==sentinel:
3020 break
3025 break
3021 lines.append(l.lstrip('>'))
3026 lines.append(l.lstrip('>'))
3022 block = "\n".join(lines) + '\n'
3027 block = "\n".join(lines) + '\n'
3023 #print "block:\n",block
3028 #print "block:\n",block
3024 if not par:
3029 if not par:
3025 b = textwrap.dedent(block)
3030 b = textwrap.dedent(block)
3026 exec b in self.user_ns
3031 exec b in self.user_ns
3027 self.user_ns['pasted_block'] = b
3032 self.user_ns['pasted_block'] = b
3028 else:
3033 else:
3029 self.user_ns[par] = block
3034 self.user_ns[par] = block
3030 print "Block assigned to '%s'" % par
3035 print "Block assigned to '%s'" % par
3031
3036
3032 def magic_quickref(self,arg):
3037 def magic_quickref(self,arg):
3033 """ Show a quick reference sheet """
3038 """ Show a quick reference sheet """
3034 import IPython.usage
3039 import IPython.usage
3035 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
3040 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
3036
3041
3037 page(qr)
3042 page(qr)
3038
3043
3039 def magic_upgrade(self,arg):
3044 def magic_upgrade(self,arg):
3040 """ Upgrade your IPython installation
3045 """ Upgrade your IPython installation
3041
3046
3042 This will copy the config files that don't yet exist in your
3047 This will copy the config files that don't yet exist in your
3043 ipython dir from the system config dir. Use this after upgrading
3048 ipython dir from the system config dir. Use this after upgrading
3044 IPython if you don't wish to delete your .ipython dir.
3049 IPython if you don't wish to delete your .ipython dir.
3045
3050
3046 Call with -nolegacy to get rid of ipythonrc* files (recommended for
3051 Call with -nolegacy to get rid of ipythonrc* files (recommended for
3047 new users)
3052 new users)
3048
3053
3049 """
3054 """
3050 ip = self.getapi()
3055 ip = self.getapi()
3051 ipinstallation = path(IPython.__file__).dirname()
3056 ipinstallation = path(IPython.__file__).dirname()
3052 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
3057 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
3053 src_config = ipinstallation / 'UserConfig'
3058 src_config = ipinstallation / 'UserConfig'
3054 userdir = path(ip.options.ipythondir)
3059 userdir = path(ip.options.ipythondir)
3055 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
3060 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
3056 print ">",cmd
3061 print ">",cmd
3057 shell(cmd)
3062 shell(cmd)
3058 if arg == '-nolegacy':
3063 if arg == '-nolegacy':
3059 legacy = userdir.files('ipythonrc*')
3064 legacy = userdir.files('ipythonrc*')
3060 print "Nuking legacy files:",legacy
3065 print "Nuking legacy files:",legacy
3061
3066
3062 [p.remove() for p in legacy]
3067 [p.remove() for p in legacy]
3063 suffix = (sys.platform == 'win32' and '.ini' or '')
3068 suffix = (sys.platform == 'win32' and '.ini' or '')
3064 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
3069 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
3065
3070
3066
3071
3067 # end Magic
3072 # end Magic
@@ -1,5953 +1,5968 b''
1
1 2006-11-21 Ville Vainio <vivainio@gmail.com>
2 2006-11-21 Ville Vainio <vivainio@gmail.com>
2
3
3 * upgrade_dir.py: Now actually overwrites a nonmodified user file
4 * upgrade_dir.py: Now actually overwrites a nonmodified user file
4 with one from UserConfig.
5 with one from UserConfig.
5
6
6 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
7 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
7 it was missing which broke the sh profile.
8 it was missing which broke the sh profile.
8
9
9 * completer.py: file completer now uses explicit '/' instead
10 * completer.py: file completer now uses explicit '/' instead
10 of os.path.join, expansion of 'foo' was broken on win32
11 of os.path.join, expansion of 'foo' was broken on win32
11 if there was one directory with name 'foobar'.
12 if there was one directory with name 'foobar'.
12
13
14 * A bunch of patches from Kirill Smelkov:
15
16 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
17
18 * [patch 7/9] Implement %page -r (page in raw mode) -
19
20 * [patch 5/9] ScientificPython webpage has moved
21
22 * [patch 4/9] The manual mentions %ds, should be %dhist
23
24 * [patch 3/9] Kill old bits from %prun doc.
25
26 * [patch 1/9] Fix typos here and there.
27
13 2006-11-08 Ville Vainio <vivainio@gmail.com>
28 2006-11-08 Ville Vainio <vivainio@gmail.com>
14
29
15 * completer.py (attr_matches): catch all exceptions raised
30 * completer.py (attr_matches): catch all exceptions raised
16 by eval of expr with dots.
31 by eval of expr with dots.
17
32
18 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
33 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
19
34
20 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
35 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
21 input if it starts with whitespace. This allows you to paste
36 input if it starts with whitespace. This allows you to paste
22 indented input from any editor without manually having to type in
37 indented input from any editor without manually having to type in
23 the 'if 1:', which is convenient when working interactively.
38 the 'if 1:', which is convenient when working interactively.
24 Slightly modifed version of a patch by Bo Peng
39 Slightly modifed version of a patch by Bo Peng
25 <bpeng-AT-rice.edu>.
40 <bpeng-AT-rice.edu>.
26
41
27 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
42 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
28
43
29 * IPython/irunner.py (main): modified irunner so it automatically
44 * IPython/irunner.py (main): modified irunner so it automatically
30 recognizes the right runner to use based on the extension (.py for
45 recognizes the right runner to use based on the extension (.py for
31 python, .ipy for ipython and .sage for sage).
46 python, .ipy for ipython and .sage for sage).
32
47
33 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
48 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
34 visible in ipapi as ip.config(), to programatically control the
49 visible in ipapi as ip.config(), to programatically control the
35 internal rc object. There's an accompanying %config magic for
50 internal rc object. There's an accompanying %config magic for
36 interactive use, which has been enhanced to match the
51 interactive use, which has been enhanced to match the
37 funtionality in ipconfig.
52 funtionality in ipconfig.
38
53
39 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
54 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
40 so it's not just a toggle, it now takes an argument. Add support
55 so it's not just a toggle, it now takes an argument. Add support
41 for a customizable header when making system calls, as the new
56 for a customizable header when making system calls, as the new
42 system_header variable in the ipythonrc file.
57 system_header variable in the ipythonrc file.
43
58
44 2006-11-03 Walter Doerwald <walter@livinglogic.de>
59 2006-11-03 Walter Doerwald <walter@livinglogic.de>
45
60
46 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
61 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
47 generic functions (using Philip J. Eby's simplegeneric package).
62 generic functions (using Philip J. Eby's simplegeneric package).
48 This makes it possible to customize the display of third-party classes
63 This makes it possible to customize the display of third-party classes
49 without having to monkeypatch them. xiter() no longer supports a mode
64 without having to monkeypatch them. xiter() no longer supports a mode
50 argument and the XMode class has been removed. The same functionality can
65 argument and the XMode class has been removed. The same functionality can
51 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
66 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
52 One consequence of the switch to generic functions is that xrepr() and
67 One consequence of the switch to generic functions is that xrepr() and
53 xattrs() implementation must define the default value for the mode
68 xattrs() implementation must define the default value for the mode
54 argument themselves and xattrs() implementations must return real
69 argument themselves and xattrs() implementations must return real
55 descriptors.
70 descriptors.
56
71
57 * IPython/external: This new subpackage will contain all third-party
72 * IPython/external: This new subpackage will contain all third-party
58 packages that are bundled with IPython. (The first one is simplegeneric).
73 packages that are bundled with IPython. (The first one is simplegeneric).
59
74
60 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
75 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
61 directory which as been dropped in r1703.
76 directory which as been dropped in r1703.
62
77
63 * IPython/Extensions/ipipe.py (iless): Fixed.
78 * IPython/Extensions/ipipe.py (iless): Fixed.
64
79
65 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
80 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
66
81
67 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
82 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
68
83
69 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
84 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
70 handling in variable expansion so that shells and magics recognize
85 handling in variable expansion so that shells and magics recognize
71 function local scopes correctly. Bug reported by Brian.
86 function local scopes correctly. Bug reported by Brian.
72
87
73 * scripts/ipython: remove the very first entry in sys.path which
88 * scripts/ipython: remove the very first entry in sys.path which
74 Python auto-inserts for scripts, so that sys.path under IPython is
89 Python auto-inserts for scripts, so that sys.path under IPython is
75 as similar as possible to that under plain Python.
90 as similar as possible to that under plain Python.
76
91
77 * IPython/completer.py (IPCompleter.file_matches): Fix
92 * IPython/completer.py (IPCompleter.file_matches): Fix
78 tab-completion so that quotes are not closed unless the completion
93 tab-completion so that quotes are not closed unless the completion
79 is unambiguous. After a request by Stefan. Minor cleanups in
94 is unambiguous. After a request by Stefan. Minor cleanups in
80 ipy_stock_completers.
95 ipy_stock_completers.
81
96
82 2006-11-02 Ville Vainio <vivainio@gmail.com>
97 2006-11-02 Ville Vainio <vivainio@gmail.com>
83
98
84 * ipy_stock_completers.py: Add %run and %cd completers.
99 * ipy_stock_completers.py: Add %run and %cd completers.
85
100
86 * completer.py: Try running custom completer for both
101 * completer.py: Try running custom completer for both
87 "foo" and "%foo" if the command is just "foo". Ignore case
102 "foo" and "%foo" if the command is just "foo". Ignore case
88 when filtering possible completions.
103 when filtering possible completions.
89
104
90 * UserConfig/ipy_user_conf.py: install stock completers as default
105 * UserConfig/ipy_user_conf.py: install stock completers as default
91
106
92 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
107 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
93 simplified readline history save / restore through a wrapper
108 simplified readline history save / restore through a wrapper
94 function
109 function
95
110
96
111
97 2006-10-31 Ville Vainio <vivainio@gmail.com>
112 2006-10-31 Ville Vainio <vivainio@gmail.com>
98
113
99 * strdispatch.py, completer.py, ipy_stock_completers.py:
114 * strdispatch.py, completer.py, ipy_stock_completers.py:
100 Allow str_key ("command") in completer hooks. Implement
115 Allow str_key ("command") in completer hooks. Implement
101 trivial completer for 'import' (stdlib modules only). Rename
116 trivial completer for 'import' (stdlib modules only). Rename
102 ipy_linux_package_managers.py to ipy_stock_completers.py.
117 ipy_linux_package_managers.py to ipy_stock_completers.py.
103 SVN completer.
118 SVN completer.
104
119
105 * Extensions/ledit.py: %magic line editor for easily and
120 * Extensions/ledit.py: %magic line editor for easily and
106 incrementally manipulating lists of strings. The magic command
121 incrementally manipulating lists of strings. The magic command
107 name is %led.
122 name is %led.
108
123
109 2006-10-30 Ville Vainio <vivainio@gmail.com>
124 2006-10-30 Ville Vainio <vivainio@gmail.com>
110
125
111 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
126 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
112 Bernsteins's patches for pydb integration.
127 Bernsteins's patches for pydb integration.
113 http://bashdb.sourceforge.net/pydb/
128 http://bashdb.sourceforge.net/pydb/
114
129
115 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
130 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
116 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
131 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
117 custom completer hook to allow the users to implement their own
132 custom completer hook to allow the users to implement their own
118 completers. See ipy_linux_package_managers.py for example. The
133 completers. See ipy_linux_package_managers.py for example. The
119 hook name is 'complete_command'.
134 hook name is 'complete_command'.
120
135
121 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
136 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
122
137
123 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
138 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
124 Numeric leftovers.
139 Numeric leftovers.
125
140
126 * ipython.el (py-execute-region): apply Stefan's patch to fix
141 * ipython.el (py-execute-region): apply Stefan's patch to fix
127 garbled results if the python shell hasn't been previously started.
142 garbled results if the python shell hasn't been previously started.
128
143
129 * IPython/genutils.py (arg_split): moved to genutils, since it's a
144 * IPython/genutils.py (arg_split): moved to genutils, since it's a
130 pretty generic function and useful for other things.
145 pretty generic function and useful for other things.
131
146
132 * IPython/OInspect.py (getsource): Add customizable source
147 * IPython/OInspect.py (getsource): Add customizable source
133 extractor. After a request/patch form W. Stein (SAGE).
148 extractor. After a request/patch form W. Stein (SAGE).
134
149
135 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
150 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
136 window size to a more reasonable value from what pexpect does,
151 window size to a more reasonable value from what pexpect does,
137 since their choice causes wrapping bugs with long input lines.
152 since their choice causes wrapping bugs with long input lines.
138
153
139 2006-10-28 Ville Vainio <vivainio@gmail.com>
154 2006-10-28 Ville Vainio <vivainio@gmail.com>
140
155
141 * Magic.py (%run): Save and restore the readline history from
156 * Magic.py (%run): Save and restore the readline history from
142 file around %run commands to prevent side effects from
157 file around %run commands to prevent side effects from
143 %runned programs that might use readline (e.g. pydb).
158 %runned programs that might use readline (e.g. pydb).
144
159
145 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
160 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
146 invoking the pydb enhanced debugger.
161 invoking the pydb enhanced debugger.
147
162
148 2006-10-23 Walter Doerwald <walter@livinglogic.de>
163 2006-10-23 Walter Doerwald <walter@livinglogic.de>
149
164
150 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
165 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
151 call the base class method and propagate the return value to
166 call the base class method and propagate the return value to
152 ifile. This is now done by path itself.
167 ifile. This is now done by path itself.
153
168
154 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
169 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
155
170
156 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
171 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
157 api: set_crash_handler(), to expose the ability to change the
172 api: set_crash_handler(), to expose the ability to change the
158 internal crash handler.
173 internal crash handler.
159
174
160 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
175 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
161 the various parameters of the crash handler so that apps using
176 the various parameters of the crash handler so that apps using
162 IPython as their engine can customize crash handling. Ipmlemented
177 IPython as their engine can customize crash handling. Ipmlemented
163 at the request of SAGE.
178 at the request of SAGE.
164
179
165 2006-10-14 Ville Vainio <vivainio@gmail.com>
180 2006-10-14 Ville Vainio <vivainio@gmail.com>
166
181
167 * Magic.py, ipython.el: applied first "safe" part of Rocky
182 * Magic.py, ipython.el: applied first "safe" part of Rocky
168 Bernstein's patch set for pydb integration.
183 Bernstein's patch set for pydb integration.
169
184
170 * Magic.py (%unalias, %alias): %store'd aliases can now be
185 * Magic.py (%unalias, %alias): %store'd aliases can now be
171 removed with '%unalias'. %alias w/o args now shows most
186 removed with '%unalias'. %alias w/o args now shows most
172 interesting (stored / manually defined) aliases last
187 interesting (stored / manually defined) aliases last
173 where they catch the eye w/o scrolling.
188 where they catch the eye w/o scrolling.
174
189
175 * Magic.py (%rehashx), ext_rehashdir.py: files with
190 * Magic.py (%rehashx), ext_rehashdir.py: files with
176 'py' extension are always considered executable, even
191 'py' extension are always considered executable, even
177 when not in PATHEXT environment variable.
192 when not in PATHEXT environment variable.
178
193
179 2006-10-12 Ville Vainio <vivainio@gmail.com>
194 2006-10-12 Ville Vainio <vivainio@gmail.com>
180
195
181 * jobctrl.py: Add new "jobctrl" extension for spawning background
196 * jobctrl.py: Add new "jobctrl" extension for spawning background
182 processes with "&find /". 'import jobctrl' to try it out. Requires
197 processes with "&find /". 'import jobctrl' to try it out. Requires
183 'subprocess' module, standard in python 2.4+.
198 'subprocess' module, standard in python 2.4+.
184
199
185 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
200 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
186 so if foo -> bar and bar -> baz, then foo -> baz.
201 so if foo -> bar and bar -> baz, then foo -> baz.
187
202
188 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
203 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
189
204
190 * IPython/Magic.py (Magic.parse_options): add a new posix option
205 * IPython/Magic.py (Magic.parse_options): add a new posix option
191 to allow parsing of input args in magics that doesn't strip quotes
206 to allow parsing of input args in magics that doesn't strip quotes
192 (if posix=False). This also closes %timeit bug reported by
207 (if posix=False). This also closes %timeit bug reported by
193 Stefan.
208 Stefan.
194
209
195 2006-10-03 Ville Vainio <vivainio@gmail.com>
210 2006-10-03 Ville Vainio <vivainio@gmail.com>
196
211
197 * iplib.py (raw_input, interact): Return ValueError catching for
212 * iplib.py (raw_input, interact): Return ValueError catching for
198 raw_input. Fixes infinite loop for sys.stdin.close() or
213 raw_input. Fixes infinite loop for sys.stdin.close() or
199 sys.stdout.close().
214 sys.stdout.close().
200
215
201 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
216 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
202
217
203 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
218 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
204 to help in handling doctests. irunner is now pretty useful for
219 to help in handling doctests. irunner is now pretty useful for
205 running standalone scripts and simulate a full interactive session
220 running standalone scripts and simulate a full interactive session
206 in a format that can be then pasted as a doctest.
221 in a format that can be then pasted as a doctest.
207
222
208 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
223 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
209 on top of the default (useless) ones. This also fixes the nasty
224 on top of the default (useless) ones. This also fixes the nasty
210 way in which 2.5's Quitter() exits (reverted [1785]).
225 way in which 2.5's Quitter() exits (reverted [1785]).
211
226
212 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
227 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
213 2.5.
228 2.5.
214
229
215 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
230 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
216 color scheme is updated as well when color scheme is changed
231 color scheme is updated as well when color scheme is changed
217 interactively.
232 interactively.
218
233
219 2006-09-27 Ville Vainio <vivainio@gmail.com>
234 2006-09-27 Ville Vainio <vivainio@gmail.com>
220
235
221 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
236 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
222 infinite loop and just exit. It's a hack, but will do for a while.
237 infinite loop and just exit. It's a hack, but will do for a while.
223
238
224 2006-08-25 Walter Doerwald <walter@livinglogic.de>
239 2006-08-25 Walter Doerwald <walter@livinglogic.de>
225
240
226 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
241 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
227 the constructor, this makes it possible to get a list of only directories
242 the constructor, this makes it possible to get a list of only directories
228 or only files.
243 or only files.
229
244
230 2006-08-12 Ville Vainio <vivainio@gmail.com>
245 2006-08-12 Ville Vainio <vivainio@gmail.com>
231
246
232 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
247 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
233 they broke unittest
248 they broke unittest
234
249
235 2006-08-11 Ville Vainio <vivainio@gmail.com>
250 2006-08-11 Ville Vainio <vivainio@gmail.com>
236
251
237 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
252 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
238 by resolving issue properly, i.e. by inheriting FakeModule
253 by resolving issue properly, i.e. by inheriting FakeModule
239 from types.ModuleType. Pickling ipython interactive data
254 from types.ModuleType. Pickling ipython interactive data
240 should still work as usual (testing appreciated).
255 should still work as usual (testing appreciated).
241
256
242 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
257 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
243
258
244 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
259 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
245 running under python 2.3 with code from 2.4 to fix a bug with
260 running under python 2.3 with code from 2.4 to fix a bug with
246 help(). Reported by the Debian maintainers, Norbert Tretkowski
261 help(). Reported by the Debian maintainers, Norbert Tretkowski
247 <norbert-AT-tretkowski.de> and Alexandre Fayolle
262 <norbert-AT-tretkowski.de> and Alexandre Fayolle
248 <afayolle-AT-debian.org>.
263 <afayolle-AT-debian.org>.
249
264
250 2006-08-04 Walter Doerwald <walter@livinglogic.de>
265 2006-08-04 Walter Doerwald <walter@livinglogic.de>
251
266
252 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
267 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
253 (which was displaying "quit" twice).
268 (which was displaying "quit" twice).
254
269
255 2006-07-28 Walter Doerwald <walter@livinglogic.de>
270 2006-07-28 Walter Doerwald <walter@livinglogic.de>
256
271
257 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
272 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
258 the mode argument).
273 the mode argument).
259
274
260 2006-07-27 Walter Doerwald <walter@livinglogic.de>
275 2006-07-27 Walter Doerwald <walter@livinglogic.de>
261
276
262 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
277 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
263 not running under IPython.
278 not running under IPython.
264
279
265 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
280 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
266 and make it iterable (iterating over the attribute itself). Add two new
281 and make it iterable (iterating over the attribute itself). Add two new
267 magic strings for __xattrs__(): If the string starts with "-", the attribute
282 magic strings for __xattrs__(): If the string starts with "-", the attribute
268 will not be displayed in ibrowse's detail view (but it can still be
283 will not be displayed in ibrowse's detail view (but it can still be
269 iterated over). This makes it possible to add attributes that are large
284 iterated over). This makes it possible to add attributes that are large
270 lists or generator methods to the detail view. Replace magic attribute names
285 lists or generator methods to the detail view. Replace magic attribute names
271 and _attrname() and _getattr() with "descriptors": For each type of magic
286 and _attrname() and _getattr() with "descriptors": For each type of magic
272 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
287 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
273 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
288 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
274 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
289 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
275 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
290 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
276 are still supported.
291 are still supported.
277
292
278 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
293 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
279 fails in ibrowse.fetch(), the exception object is added as the last item
294 fails in ibrowse.fetch(), the exception object is added as the last item
280 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
295 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
281 a generator throws an exception midway through execution.
296 a generator throws an exception midway through execution.
282
297
283 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
298 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
284 encoding into methods.
299 encoding into methods.
285
300
286 2006-07-26 Ville Vainio <vivainio@gmail.com>
301 2006-07-26 Ville Vainio <vivainio@gmail.com>
287
302
288 * iplib.py: history now stores multiline input as single
303 * iplib.py: history now stores multiline input as single
289 history entries. Patch by Jorgen Cederlof.
304 history entries. Patch by Jorgen Cederlof.
290
305
291 2006-07-18 Walter Doerwald <walter@livinglogic.de>
306 2006-07-18 Walter Doerwald <walter@livinglogic.de>
292
307
293 * IPython/Extensions/ibrowse.py: Make cursor visible over
308 * IPython/Extensions/ibrowse.py: Make cursor visible over
294 non existing attributes.
309 non existing attributes.
295
310
296 2006-07-14 Walter Doerwald <walter@livinglogic.de>
311 2006-07-14 Walter Doerwald <walter@livinglogic.de>
297
312
298 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
313 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
299 error output of the running command doesn't mess up the screen.
314 error output of the running command doesn't mess up the screen.
300
315
301 2006-07-13 Walter Doerwald <walter@livinglogic.de>
316 2006-07-13 Walter Doerwald <walter@livinglogic.de>
302
317
303 * IPython/Extensions/ipipe.py (isort): Make isort usable without
318 * IPython/Extensions/ipipe.py (isort): Make isort usable without
304 argument. This sorts the items themselves.
319 argument. This sorts the items themselves.
305
320
306 2006-07-12 Walter Doerwald <walter@livinglogic.de>
321 2006-07-12 Walter Doerwald <walter@livinglogic.de>
307
322
308 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
323 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
309 Compile expression strings into code objects. This should speed
324 Compile expression strings into code objects. This should speed
310 up ifilter and friends somewhat.
325 up ifilter and friends somewhat.
311
326
312 2006-07-08 Ville Vainio <vivainio@gmail.com>
327 2006-07-08 Ville Vainio <vivainio@gmail.com>
313
328
314 * Magic.py: %cpaste now strips > from the beginning of lines
329 * Magic.py: %cpaste now strips > from the beginning of lines
315 to ease pasting quoted code from emails. Contributed by
330 to ease pasting quoted code from emails. Contributed by
316 Stefan van der Walt.
331 Stefan van der Walt.
317
332
318 2006-06-29 Ville Vainio <vivainio@gmail.com>
333 2006-06-29 Ville Vainio <vivainio@gmail.com>
319
334
320 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
335 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
321 mode, patch contributed by Darren Dale. NEEDS TESTING!
336 mode, patch contributed by Darren Dale. NEEDS TESTING!
322
337
323 2006-06-28 Walter Doerwald <walter@livinglogic.de>
338 2006-06-28 Walter Doerwald <walter@livinglogic.de>
324
339
325 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
340 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
326 a blue background. Fix fetching new display rows when the browser
341 a blue background. Fix fetching new display rows when the browser
327 scrolls more than a screenful (e.g. by using the goto command).
342 scrolls more than a screenful (e.g. by using the goto command).
328
343
329 2006-06-27 Ville Vainio <vivainio@gmail.com>
344 2006-06-27 Ville Vainio <vivainio@gmail.com>
330
345
331 * Magic.py (_inspect, _ofind) Apply David Huard's
346 * Magic.py (_inspect, _ofind) Apply David Huard's
332 patch for displaying the correct docstring for 'property'
347 patch for displaying the correct docstring for 'property'
333 attributes.
348 attributes.
334
349
335 2006-06-23 Walter Doerwald <walter@livinglogic.de>
350 2006-06-23 Walter Doerwald <walter@livinglogic.de>
336
351
337 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
352 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
338 commands into the methods implementing them.
353 commands into the methods implementing them.
339
354
340 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
355 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
341
356
342 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
357 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
343 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
358 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
344 autoindent support was authored by Jin Liu.
359 autoindent support was authored by Jin Liu.
345
360
346 2006-06-22 Walter Doerwald <walter@livinglogic.de>
361 2006-06-22 Walter Doerwald <walter@livinglogic.de>
347
362
348 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
363 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
349 for keymaps with a custom class that simplifies handling.
364 for keymaps with a custom class that simplifies handling.
350
365
351 2006-06-19 Walter Doerwald <walter@livinglogic.de>
366 2006-06-19 Walter Doerwald <walter@livinglogic.de>
352
367
353 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
368 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
354 resizing. This requires Python 2.5 to work.
369 resizing. This requires Python 2.5 to work.
355
370
356 2006-06-16 Walter Doerwald <walter@livinglogic.de>
371 2006-06-16 Walter Doerwald <walter@livinglogic.de>
357
372
358 * IPython/Extensions/ibrowse.py: Add two new commands to
373 * IPython/Extensions/ibrowse.py: Add two new commands to
359 ibrowse: "hideattr" (mapped to "h") hides the attribute under
374 ibrowse: "hideattr" (mapped to "h") hides the attribute under
360 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
375 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
361 attributes again. Remapped the help command to "?". Display
376 attributes again. Remapped the help command to "?". Display
362 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
377 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
363 as keys for the "home" and "end" commands. Add three new commands
378 as keys for the "home" and "end" commands. Add three new commands
364 to the input mode for "find" and friends: "delend" (CTRL-K)
379 to the input mode for "find" and friends: "delend" (CTRL-K)
365 deletes to the end of line. "incsearchup" searches upwards in the
380 deletes to the end of line. "incsearchup" searches upwards in the
366 command history for an input that starts with the text before the cursor.
381 command history for an input that starts with the text before the cursor.
367 "incsearchdown" does the same downwards. Removed a bogus mapping of
382 "incsearchdown" does the same downwards. Removed a bogus mapping of
368 the x key to "delete".
383 the x key to "delete".
369
384
370 2006-06-15 Ville Vainio <vivainio@gmail.com>
385 2006-06-15 Ville Vainio <vivainio@gmail.com>
371
386
372 * iplib.py, hooks.py: Added new generate_prompt hook that can be
387 * iplib.py, hooks.py: Added new generate_prompt hook that can be
373 used to create prompts dynamically, instead of the "old" way of
388 used to create prompts dynamically, instead of the "old" way of
374 assigning "magic" strings to prompt_in1 and prompt_in2. The old
389 assigning "magic" strings to prompt_in1 and prompt_in2. The old
375 way still works (it's invoked by the default hook), of course.
390 way still works (it's invoked by the default hook), of course.
376
391
377 * Prompts.py: added generate_output_prompt hook for altering output
392 * Prompts.py: added generate_output_prompt hook for altering output
378 prompt
393 prompt
379
394
380 * Release.py: Changed version string to 0.7.3.svn.
395 * Release.py: Changed version string to 0.7.3.svn.
381
396
382 2006-06-15 Walter Doerwald <walter@livinglogic.de>
397 2006-06-15 Walter Doerwald <walter@livinglogic.de>
383
398
384 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
399 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
385 the call to fetch() always tries to fetch enough data for at least one
400 the call to fetch() always tries to fetch enough data for at least one
386 full screen. This makes it possible to simply call moveto(0,0,True) in
401 full screen. This makes it possible to simply call moveto(0,0,True) in
387 the constructor. Fix typos and removed the obsolete goto attribute.
402 the constructor. Fix typos and removed the obsolete goto attribute.
388
403
389 2006-06-12 Ville Vainio <vivainio@gmail.com>
404 2006-06-12 Ville Vainio <vivainio@gmail.com>
390
405
391 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
406 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
392 allowing $variable interpolation within multiline statements,
407 allowing $variable interpolation within multiline statements,
393 though so far only with "sh" profile for a testing period.
408 though so far only with "sh" profile for a testing period.
394 The patch also enables splitting long commands with \ but it
409 The patch also enables splitting long commands with \ but it
395 doesn't work properly yet.
410 doesn't work properly yet.
396
411
397 2006-06-12 Walter Doerwald <walter@livinglogic.de>
412 2006-06-12 Walter Doerwald <walter@livinglogic.de>
398
413
399 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
414 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
400 input history and the position of the cursor in the input history for
415 input history and the position of the cursor in the input history for
401 the find, findbackwards and goto command.
416 the find, findbackwards and goto command.
402
417
403 2006-06-10 Walter Doerwald <walter@livinglogic.de>
418 2006-06-10 Walter Doerwald <walter@livinglogic.de>
404
419
405 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
420 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
406 implements the basic functionality of browser commands that require
421 implements the basic functionality of browser commands that require
407 input. Reimplement the goto, find and findbackwards commands as
422 input. Reimplement the goto, find and findbackwards commands as
408 subclasses of _CommandInput. Add an input history and keymaps to those
423 subclasses of _CommandInput. Add an input history and keymaps to those
409 commands. Add "\r" as a keyboard shortcut for the enterdefault and
424 commands. Add "\r" as a keyboard shortcut for the enterdefault and
410 execute commands.
425 execute commands.
411
426
412 2006-06-07 Ville Vainio <vivainio@gmail.com>
427 2006-06-07 Ville Vainio <vivainio@gmail.com>
413
428
414 * iplib.py: ipython mybatch.ipy exits ipython immediately after
429 * iplib.py: ipython mybatch.ipy exits ipython immediately after
415 running the batch files instead of leaving the session open.
430 running the batch files instead of leaving the session open.
416
431
417 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
432 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
418
433
419 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
434 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
420 the original fix was incomplete. Patch submitted by W. Maier.
435 the original fix was incomplete. Patch submitted by W. Maier.
421
436
422 2006-06-07 Ville Vainio <vivainio@gmail.com>
437 2006-06-07 Ville Vainio <vivainio@gmail.com>
423
438
424 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
439 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
425 Confirmation prompts can be supressed by 'quiet' option.
440 Confirmation prompts can be supressed by 'quiet' option.
426 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
441 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
427
442
428 2006-06-06 *** Released version 0.7.2
443 2006-06-06 *** Released version 0.7.2
429
444
430 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
445 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
431
446
432 * IPython/Release.py (version): Made 0.7.2 final for release.
447 * IPython/Release.py (version): Made 0.7.2 final for release.
433 Repo tagged and release cut.
448 Repo tagged and release cut.
434
449
435 2006-06-05 Ville Vainio <vivainio@gmail.com>
450 2006-06-05 Ville Vainio <vivainio@gmail.com>
436
451
437 * Magic.py (magic_rehashx): Honor no_alias list earlier in
452 * Magic.py (magic_rehashx): Honor no_alias list earlier in
438 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
453 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
439
454
440 * upgrade_dir.py: try import 'path' module a bit harder
455 * upgrade_dir.py: try import 'path' module a bit harder
441 (for %upgrade)
456 (for %upgrade)
442
457
443 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
458 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
444
459
445 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
460 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
446 instead of looping 20 times.
461 instead of looping 20 times.
447
462
448 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
463 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
449 correctly at initialization time. Bug reported by Krishna Mohan
464 correctly at initialization time. Bug reported by Krishna Mohan
450 Gundu <gkmohan-AT-gmail.com> on the user list.
465 Gundu <gkmohan-AT-gmail.com> on the user list.
451
466
452 * IPython/Release.py (version): Mark 0.7.2 version to start
467 * IPython/Release.py (version): Mark 0.7.2 version to start
453 testing for release on 06/06.
468 testing for release on 06/06.
454
469
455 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
470 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
456
471
457 * scripts/irunner: thin script interface so users don't have to
472 * scripts/irunner: thin script interface so users don't have to
458 find the module and call it as an executable, since modules rarely
473 find the module and call it as an executable, since modules rarely
459 live in people's PATH.
474 live in people's PATH.
460
475
461 * IPython/irunner.py (InteractiveRunner.__init__): added
476 * IPython/irunner.py (InteractiveRunner.__init__): added
462 delaybeforesend attribute to control delays with newer versions of
477 delaybeforesend attribute to control delays with newer versions of
463 pexpect. Thanks to detailed help from pexpect's author, Noah
478 pexpect. Thanks to detailed help from pexpect's author, Noah
464 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
479 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
465 correctly (it works in NoColor mode).
480 correctly (it works in NoColor mode).
466
481
467 * IPython/iplib.py (handle_normal): fix nasty crash reported on
482 * IPython/iplib.py (handle_normal): fix nasty crash reported on
468 SAGE list, from improper log() calls.
483 SAGE list, from improper log() calls.
469
484
470 2006-05-31 Ville Vainio <vivainio@gmail.com>
485 2006-05-31 Ville Vainio <vivainio@gmail.com>
471
486
472 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
487 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
473 with args in parens to work correctly with dirs that have spaces.
488 with args in parens to work correctly with dirs that have spaces.
474
489
475 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
490 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
476
491
477 * IPython/Logger.py (Logger.logstart): add option to log raw input
492 * IPython/Logger.py (Logger.logstart): add option to log raw input
478 instead of the processed one. A -r flag was added to the
493 instead of the processed one. A -r flag was added to the
479 %logstart magic used for controlling logging.
494 %logstart magic used for controlling logging.
480
495
481 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
496 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
482
497
483 * IPython/iplib.py (InteractiveShell.__init__): add check for the
498 * IPython/iplib.py (InteractiveShell.__init__): add check for the
484 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
499 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
485 recognize the option. After a bug report by Will Maier. This
500 recognize the option. After a bug report by Will Maier. This
486 closes #64 (will do it after confirmation from W. Maier).
501 closes #64 (will do it after confirmation from W. Maier).
487
502
488 * IPython/irunner.py: New module to run scripts as if manually
503 * IPython/irunner.py: New module to run scripts as if manually
489 typed into an interactive environment, based on pexpect. After a
504 typed into an interactive environment, based on pexpect. After a
490 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
505 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
491 ipython-user list. Simple unittests in the tests/ directory.
506 ipython-user list. Simple unittests in the tests/ directory.
492
507
493 * tools/release: add Will Maier, OpenBSD port maintainer, to
508 * tools/release: add Will Maier, OpenBSD port maintainer, to
494 recepients list. We are now officially part of the OpenBSD ports:
509 recepients list. We are now officially part of the OpenBSD ports:
495 http://www.openbsd.org/ports.html ! Many thanks to Will for the
510 http://www.openbsd.org/ports.html ! Many thanks to Will for the
496 work.
511 work.
497
512
498 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
513 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
499
514
500 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
515 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
501 so that it doesn't break tkinter apps.
516 so that it doesn't break tkinter apps.
502
517
503 * IPython/iplib.py (_prefilter): fix bug where aliases would
518 * IPython/iplib.py (_prefilter): fix bug where aliases would
504 shadow variables when autocall was fully off. Reported by SAGE
519 shadow variables when autocall was fully off. Reported by SAGE
505 author William Stein.
520 author William Stein.
506
521
507 * IPython/OInspect.py (Inspector.__init__): add a flag to control
522 * IPython/OInspect.py (Inspector.__init__): add a flag to control
508 at what detail level strings are computed when foo? is requested.
523 at what detail level strings are computed when foo? is requested.
509 This allows users to ask for example that the string form of an
524 This allows users to ask for example that the string form of an
510 object is only computed when foo?? is called, or even never, by
525 object is only computed when foo?? is called, or even never, by
511 setting the object_info_string_level >= 2 in the configuration
526 setting the object_info_string_level >= 2 in the configuration
512 file. This new option has been added and documented. After a
527 file. This new option has been added and documented. After a
513 request by SAGE to be able to control the printing of very large
528 request by SAGE to be able to control the printing of very large
514 objects more easily.
529 objects more easily.
515
530
516 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
531 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
517
532
518 * IPython/ipmaker.py (make_IPython): remove the ipython call path
533 * IPython/ipmaker.py (make_IPython): remove the ipython call path
519 from sys.argv, to be 100% consistent with how Python itself works
534 from sys.argv, to be 100% consistent with how Python itself works
520 (as seen for example with python -i file.py). After a bug report
535 (as seen for example with python -i file.py). After a bug report
521 by Jeffrey Collins.
536 by Jeffrey Collins.
522
537
523 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
538 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
524 nasty bug which was preventing custom namespaces with -pylab,
539 nasty bug which was preventing custom namespaces with -pylab,
525 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
540 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
526 compatibility (long gone from mpl).
541 compatibility (long gone from mpl).
527
542
528 * IPython/ipapi.py (make_session): name change: create->make. We
543 * IPython/ipapi.py (make_session): name change: create->make. We
529 use make in other places (ipmaker,...), it's shorter and easier to
544 use make in other places (ipmaker,...), it's shorter and easier to
530 type and say, etc. I'm trying to clean things before 0.7.2 so
545 type and say, etc. I'm trying to clean things before 0.7.2 so
531 that I can keep things stable wrt to ipapi in the chainsaw branch.
546 that I can keep things stable wrt to ipapi in the chainsaw branch.
532
547
533 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
548 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
534 python-mode recognizes our debugger mode. Add support for
549 python-mode recognizes our debugger mode. Add support for
535 autoindent inside (X)emacs. After a patch sent in by Jin Liu
550 autoindent inside (X)emacs. After a patch sent in by Jin Liu
536 <m.liu.jin-AT-gmail.com> originally written by
551 <m.liu.jin-AT-gmail.com> originally written by
537 doxgen-AT-newsmth.net (with minor modifications for xemacs
552 doxgen-AT-newsmth.net (with minor modifications for xemacs
538 compatibility)
553 compatibility)
539
554
540 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
555 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
541 tracebacks when walking the stack so that the stack tracking system
556 tracebacks when walking the stack so that the stack tracking system
542 in emacs' python-mode can identify the frames correctly.
557 in emacs' python-mode can identify the frames correctly.
543
558
544 * IPython/ipmaker.py (make_IPython): make the internal (and
559 * IPython/ipmaker.py (make_IPython): make the internal (and
545 default config) autoedit_syntax value false by default. Too many
560 default config) autoedit_syntax value false by default. Too many
546 users have complained to me (both on and off-list) about problems
561 users have complained to me (both on and off-list) about problems
547 with this option being on by default, so I'm making it default to
562 with this option being on by default, so I'm making it default to
548 off. It can still be enabled by anyone via the usual mechanisms.
563 off. It can still be enabled by anyone via the usual mechanisms.
549
564
550 * IPython/completer.py (Completer.attr_matches): add support for
565 * IPython/completer.py (Completer.attr_matches): add support for
551 PyCrust-style _getAttributeNames magic method. Patch contributed
566 PyCrust-style _getAttributeNames magic method. Patch contributed
552 by <mscott-AT-goldenspud.com>. Closes #50.
567 by <mscott-AT-goldenspud.com>. Closes #50.
553
568
554 * IPython/iplib.py (InteractiveShell.__init__): remove the
569 * IPython/iplib.py (InteractiveShell.__init__): remove the
555 deletion of exit/quit from __builtin__, which can break
570 deletion of exit/quit from __builtin__, which can break
556 third-party tools like the Zope debugging console. The
571 third-party tools like the Zope debugging console. The
557 %exit/%quit magics remain. In general, it's probably a good idea
572 %exit/%quit magics remain. In general, it's probably a good idea
558 not to delete anything from __builtin__, since we never know what
573 not to delete anything from __builtin__, since we never know what
559 that will break. In any case, python now (for 2.5) will support
574 that will break. In any case, python now (for 2.5) will support
560 'real' exit/quit, so this issue is moot. Closes #55.
575 'real' exit/quit, so this issue is moot. Closes #55.
561
576
562 * IPython/genutils.py (with_obj): rename the 'with' function to
577 * IPython/genutils.py (with_obj): rename the 'with' function to
563 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
578 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
564 becomes a language keyword. Closes #53.
579 becomes a language keyword. Closes #53.
565
580
566 * IPython/FakeModule.py (FakeModule.__init__): add a proper
581 * IPython/FakeModule.py (FakeModule.__init__): add a proper
567 __file__ attribute to this so it fools more things into thinking
582 __file__ attribute to this so it fools more things into thinking
568 it is a real module. Closes #59.
583 it is a real module. Closes #59.
569
584
570 * IPython/Magic.py (magic_edit): add -n option to open the editor
585 * IPython/Magic.py (magic_edit): add -n option to open the editor
571 at a specific line number. After a patch by Stefan van der Walt.
586 at a specific line number. After a patch by Stefan van der Walt.
572
587
573 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
588 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
574
589
575 * IPython/iplib.py (edit_syntax_error): fix crash when for some
590 * IPython/iplib.py (edit_syntax_error): fix crash when for some
576 reason the file could not be opened. After automatic crash
591 reason the file could not be opened. After automatic crash
577 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
592 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
578 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
593 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
579 (_should_recompile): Don't fire editor if using %bg, since there
594 (_should_recompile): Don't fire editor if using %bg, since there
580 is no file in the first place. From the same report as above.
595 is no file in the first place. From the same report as above.
581 (raw_input): protect against faulty third-party prefilters. After
596 (raw_input): protect against faulty third-party prefilters. After
582 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
597 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
583 while running under SAGE.
598 while running under SAGE.
584
599
585 2006-05-23 Ville Vainio <vivainio@gmail.com>
600 2006-05-23 Ville Vainio <vivainio@gmail.com>
586
601
587 * ipapi.py: Stripped down ip.to_user_ns() to work only as
602 * ipapi.py: Stripped down ip.to_user_ns() to work only as
588 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
603 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
589 now returns None (again), unless dummy is specifically allowed by
604 now returns None (again), unless dummy is specifically allowed by
590 ipapi.get(allow_dummy=True).
605 ipapi.get(allow_dummy=True).
591
606
592 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
607 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
593
608
594 * IPython: remove all 2.2-compatibility objects and hacks from
609 * IPython: remove all 2.2-compatibility objects and hacks from
595 everywhere, since we only support 2.3 at this point. Docs
610 everywhere, since we only support 2.3 at this point. Docs
596 updated.
611 updated.
597
612
598 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
613 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
599 Anything requiring extra validation can be turned into a Python
614 Anything requiring extra validation can be turned into a Python
600 property in the future. I used a property for the db one b/c
615 property in the future. I used a property for the db one b/c
601 there was a nasty circularity problem with the initialization
616 there was a nasty circularity problem with the initialization
602 order, which right now I don't have time to clean up.
617 order, which right now I don't have time to clean up.
603
618
604 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
619 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
605 another locking bug reported by Jorgen. I'm not 100% sure though,
620 another locking bug reported by Jorgen. I'm not 100% sure though,
606 so more testing is needed...
621 so more testing is needed...
607
622
608 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
623 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
609
624
610 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
625 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
611 local variables from any routine in user code (typically executed
626 local variables from any routine in user code (typically executed
612 with %run) directly into the interactive namespace. Very useful
627 with %run) directly into the interactive namespace. Very useful
613 when doing complex debugging.
628 when doing complex debugging.
614 (IPythonNotRunning): Changed the default None object to a dummy
629 (IPythonNotRunning): Changed the default None object to a dummy
615 whose attributes can be queried as well as called without
630 whose attributes can be queried as well as called without
616 exploding, to ease writing code which works transparently both in
631 exploding, to ease writing code which works transparently both in
617 and out of ipython and uses some of this API.
632 and out of ipython and uses some of this API.
618
633
619 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
634 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
620
635
621 * IPython/hooks.py (result_display): Fix the fact that our display
636 * IPython/hooks.py (result_display): Fix the fact that our display
622 hook was using str() instead of repr(), as the default python
637 hook was using str() instead of repr(), as the default python
623 console does. This had gone unnoticed b/c it only happened if
638 console does. This had gone unnoticed b/c it only happened if
624 %Pprint was off, but the inconsistency was there.
639 %Pprint was off, but the inconsistency was there.
625
640
626 2006-05-15 Ville Vainio <vivainio@gmail.com>
641 2006-05-15 Ville Vainio <vivainio@gmail.com>
627
642
628 * Oinspect.py: Only show docstring for nonexisting/binary files
643 * Oinspect.py: Only show docstring for nonexisting/binary files
629 when doing object??, closing ticket #62
644 when doing object??, closing ticket #62
630
645
631 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
646 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
632
647
633 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
648 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
634 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
649 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
635 was being released in a routine which hadn't checked if it had
650 was being released in a routine which hadn't checked if it had
636 been the one to acquire it.
651 been the one to acquire it.
637
652
638 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
653 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
639
654
640 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
655 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
641
656
642 2006-04-11 Ville Vainio <vivainio@gmail.com>
657 2006-04-11 Ville Vainio <vivainio@gmail.com>
643
658
644 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
659 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
645 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
660 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
646 prefilters, allowing stuff like magics and aliases in the file.
661 prefilters, allowing stuff like magics and aliases in the file.
647
662
648 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
663 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
649 added. Supported now are "%clear in" and "%clear out" (clear input and
664 added. Supported now are "%clear in" and "%clear out" (clear input and
650 output history, respectively). Also fixed CachedOutput.flush to
665 output history, respectively). Also fixed CachedOutput.flush to
651 properly flush the output cache.
666 properly flush the output cache.
652
667
653 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
668 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
654 half-success (and fail explicitly).
669 half-success (and fail explicitly).
655
670
656 2006-03-28 Ville Vainio <vivainio@gmail.com>
671 2006-03-28 Ville Vainio <vivainio@gmail.com>
657
672
658 * iplib.py: Fix quoting of aliases so that only argless ones
673 * iplib.py: Fix quoting of aliases so that only argless ones
659 are quoted
674 are quoted
660
675
661 2006-03-28 Ville Vainio <vivainio@gmail.com>
676 2006-03-28 Ville Vainio <vivainio@gmail.com>
662
677
663 * iplib.py: Quote aliases with spaces in the name.
678 * iplib.py: Quote aliases with spaces in the name.
664 "c:\program files\blah\bin" is now legal alias target.
679 "c:\program files\blah\bin" is now legal alias target.
665
680
666 * ext_rehashdir.py: Space no longer allowed as arg
681 * ext_rehashdir.py: Space no longer allowed as arg
667 separator, since space is legal in path names.
682 separator, since space is legal in path names.
668
683
669 2006-03-16 Ville Vainio <vivainio@gmail.com>
684 2006-03-16 Ville Vainio <vivainio@gmail.com>
670
685
671 * upgrade_dir.py: Take path.py from Extensions, correcting
686 * upgrade_dir.py: Take path.py from Extensions, correcting
672 %upgrade magic
687 %upgrade magic
673
688
674 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
689 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
675
690
676 * hooks.py: Only enclose editor binary in quotes if legal and
691 * hooks.py: Only enclose editor binary in quotes if legal and
677 necessary (space in the name, and is an existing file). Fixes a bug
692 necessary (space in the name, and is an existing file). Fixes a bug
678 reported by Zachary Pincus.
693 reported by Zachary Pincus.
679
694
680 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
695 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
681
696
682 * Manual: thanks to a tip on proper color handling for Emacs, by
697 * Manual: thanks to a tip on proper color handling for Emacs, by
683 Eric J Haywiser <ejh1-AT-MIT.EDU>.
698 Eric J Haywiser <ejh1-AT-MIT.EDU>.
684
699
685 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
700 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
686 by applying the provided patch. Thanks to Liu Jin
701 by applying the provided patch. Thanks to Liu Jin
687 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
702 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
688 XEmacs/Linux, I'm trusting the submitter that it actually helps
703 XEmacs/Linux, I'm trusting the submitter that it actually helps
689 under win32/GNU Emacs. Will revisit if any problems are reported.
704 under win32/GNU Emacs. Will revisit if any problems are reported.
690
705
691 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
706 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
692
707
693 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
708 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
694 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
709 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
695
710
696 2006-03-12 Ville Vainio <vivainio@gmail.com>
711 2006-03-12 Ville Vainio <vivainio@gmail.com>
697
712
698 * Magic.py (magic_timeit): Added %timeit magic, contributed by
713 * Magic.py (magic_timeit): Added %timeit magic, contributed by
699 Torsten Marek.
714 Torsten Marek.
700
715
701 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
716 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
702
717
703 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
718 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
704 line ranges works again.
719 line ranges works again.
705
720
706 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
721 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
707
722
708 * IPython/iplib.py (showtraceback): add back sys.last_traceback
723 * IPython/iplib.py (showtraceback): add back sys.last_traceback
709 and friends, after a discussion with Zach Pincus on ipython-user.
724 and friends, after a discussion with Zach Pincus on ipython-user.
710 I'm not 100% sure, but after thinking about it quite a bit, it may
725 I'm not 100% sure, but after thinking about it quite a bit, it may
711 be OK. Testing with the multithreaded shells didn't reveal any
726 be OK. Testing with the multithreaded shells didn't reveal any
712 problems, but let's keep an eye out.
727 problems, but let's keep an eye out.
713
728
714 In the process, I fixed a few things which were calling
729 In the process, I fixed a few things which were calling
715 self.InteractiveTB() directly (like safe_execfile), which is a
730 self.InteractiveTB() directly (like safe_execfile), which is a
716 mistake: ALL exception reporting should be done by calling
731 mistake: ALL exception reporting should be done by calling
717 self.showtraceback(), which handles state and tab-completion and
732 self.showtraceback(), which handles state and tab-completion and
718 more.
733 more.
719
734
720 2006-03-01 Ville Vainio <vivainio@gmail.com>
735 2006-03-01 Ville Vainio <vivainio@gmail.com>
721
736
722 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
737 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
723 To use, do "from ipipe import *".
738 To use, do "from ipipe import *".
724
739
725 2006-02-24 Ville Vainio <vivainio@gmail.com>
740 2006-02-24 Ville Vainio <vivainio@gmail.com>
726
741
727 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
742 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
728 "cleanly" and safely than the older upgrade mechanism.
743 "cleanly" and safely than the older upgrade mechanism.
729
744
730 2006-02-21 Ville Vainio <vivainio@gmail.com>
745 2006-02-21 Ville Vainio <vivainio@gmail.com>
731
746
732 * Magic.py: %save works again.
747 * Magic.py: %save works again.
733
748
734 2006-02-15 Ville Vainio <vivainio@gmail.com>
749 2006-02-15 Ville Vainio <vivainio@gmail.com>
735
750
736 * Magic.py: %Pprint works again
751 * Magic.py: %Pprint works again
737
752
738 * Extensions/ipy_sane_defaults.py: Provide everything provided
753 * Extensions/ipy_sane_defaults.py: Provide everything provided
739 in default ipythonrc, to make it possible to have a completely empty
754 in default ipythonrc, to make it possible to have a completely empty
740 ipythonrc (and thus completely rc-file free configuration)
755 ipythonrc (and thus completely rc-file free configuration)
741
756
742 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
757 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
743
758
744 * IPython/hooks.py (editor): quote the call to the editor command,
759 * IPython/hooks.py (editor): quote the call to the editor command,
745 to allow commands with spaces in them. Problem noted by watching
760 to allow commands with spaces in them. Problem noted by watching
746 Ian Oswald's video about textpad under win32 at
761 Ian Oswald's video about textpad under win32 at
747 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
762 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
748
763
749 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
764 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
750 describing magics (we haven't used @ for a loong time).
765 describing magics (we haven't used @ for a loong time).
751
766
752 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
767 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
753 contributed by marienz to close
768 contributed by marienz to close
754 http://www.scipy.net/roundup/ipython/issue53.
769 http://www.scipy.net/roundup/ipython/issue53.
755
770
756 2006-02-10 Ville Vainio <vivainio@gmail.com>
771 2006-02-10 Ville Vainio <vivainio@gmail.com>
757
772
758 * genutils.py: getoutput now works in win32 too
773 * genutils.py: getoutput now works in win32 too
759
774
760 * completer.py: alias and magic completion only invoked
775 * completer.py: alias and magic completion only invoked
761 at the first "item" in the line, to avoid "cd %store"
776 at the first "item" in the line, to avoid "cd %store"
762 nonsense.
777 nonsense.
763
778
764 2006-02-09 Ville Vainio <vivainio@gmail.com>
779 2006-02-09 Ville Vainio <vivainio@gmail.com>
765
780
766 * test/*: Added a unit testing framework (finally).
781 * test/*: Added a unit testing framework (finally).
767 '%run runtests.py' to run test_*.
782 '%run runtests.py' to run test_*.
768
783
769 * ipapi.py: Exposed runlines and set_custom_exc
784 * ipapi.py: Exposed runlines and set_custom_exc
770
785
771 2006-02-07 Ville Vainio <vivainio@gmail.com>
786 2006-02-07 Ville Vainio <vivainio@gmail.com>
772
787
773 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
788 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
774 instead use "f(1 2)" as before.
789 instead use "f(1 2)" as before.
775
790
776 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
791 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
777
792
778 * IPython/demo.py (IPythonDemo): Add new classes to the demo
793 * IPython/demo.py (IPythonDemo): Add new classes to the demo
779 facilities, for demos processed by the IPython input filter
794 facilities, for demos processed by the IPython input filter
780 (IPythonDemo), and for running a script one-line-at-a-time as a
795 (IPythonDemo), and for running a script one-line-at-a-time as a
781 demo, both for pure Python (LineDemo) and for IPython-processed
796 demo, both for pure Python (LineDemo) and for IPython-processed
782 input (IPythonLineDemo). After a request by Dave Kohel, from the
797 input (IPythonLineDemo). After a request by Dave Kohel, from the
783 SAGE team.
798 SAGE team.
784 (Demo.edit): added an edit() method to the demo objects, to edit
799 (Demo.edit): added an edit() method to the demo objects, to edit
785 the in-memory copy of the last executed block.
800 the in-memory copy of the last executed block.
786
801
787 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
802 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
788 processing to %edit, %macro and %save. These commands can now be
803 processing to %edit, %macro and %save. These commands can now be
789 invoked on the unprocessed input as it was typed by the user
804 invoked on the unprocessed input as it was typed by the user
790 (without any prefilters applied). After requests by the SAGE team
805 (without any prefilters applied). After requests by the SAGE team
791 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
806 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
792
807
793 2006-02-01 Ville Vainio <vivainio@gmail.com>
808 2006-02-01 Ville Vainio <vivainio@gmail.com>
794
809
795 * setup.py, eggsetup.py: easy_install ipython==dev works
810 * setup.py, eggsetup.py: easy_install ipython==dev works
796 correctly now (on Linux)
811 correctly now (on Linux)
797
812
798 * ipy_user_conf,ipmaker: user config changes, removed spurious
813 * ipy_user_conf,ipmaker: user config changes, removed spurious
799 warnings
814 warnings
800
815
801 * iplib: if rc.banner is string, use it as is.
816 * iplib: if rc.banner is string, use it as is.
802
817
803 * Magic: %pycat accepts a string argument and pages it's contents.
818 * Magic: %pycat accepts a string argument and pages it's contents.
804
819
805
820
806 2006-01-30 Ville Vainio <vivainio@gmail.com>
821 2006-01-30 Ville Vainio <vivainio@gmail.com>
807
822
808 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
823 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
809 Now %store and bookmarks work through PickleShare, meaning that
824 Now %store and bookmarks work through PickleShare, meaning that
810 concurrent access is possible and all ipython sessions see the
825 concurrent access is possible and all ipython sessions see the
811 same database situation all the time, instead of snapshot of
826 same database situation all the time, instead of snapshot of
812 the situation when the session was started. Hence, %bookmark
827 the situation when the session was started. Hence, %bookmark
813 results are immediately accessible from othes sessions. The database
828 results are immediately accessible from othes sessions. The database
814 is also available for use by user extensions. See:
829 is also available for use by user extensions. See:
815 http://www.python.org/pypi/pickleshare
830 http://www.python.org/pypi/pickleshare
816
831
817 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
832 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
818
833
819 * aliases can now be %store'd
834 * aliases can now be %store'd
820
835
821 * path.py moved to Extensions so that pickleshare does not need
836 * path.py moved to Extensions so that pickleshare does not need
822 IPython-specific import. Extensions added to pythonpath right
837 IPython-specific import. Extensions added to pythonpath right
823 at __init__.
838 at __init__.
824
839
825 * iplib.py: ipalias deprecated/redundant; aliases are converted and
840 * iplib.py: ipalias deprecated/redundant; aliases are converted and
826 called with _ip.system and the pre-transformed command string.
841 called with _ip.system and the pre-transformed command string.
827
842
828 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
843 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
829
844
830 * IPython/iplib.py (interact): Fix that we were not catching
845 * IPython/iplib.py (interact): Fix that we were not catching
831 KeyboardInterrupt exceptions properly. I'm not quite sure why the
846 KeyboardInterrupt exceptions properly. I'm not quite sure why the
832 logic here had to change, but it's fixed now.
847 logic here had to change, but it's fixed now.
833
848
834 2006-01-29 Ville Vainio <vivainio@gmail.com>
849 2006-01-29 Ville Vainio <vivainio@gmail.com>
835
850
836 * iplib.py: Try to import pyreadline on Windows.
851 * iplib.py: Try to import pyreadline on Windows.
837
852
838 2006-01-27 Ville Vainio <vivainio@gmail.com>
853 2006-01-27 Ville Vainio <vivainio@gmail.com>
839
854
840 * iplib.py: Expose ipapi as _ip in builtin namespace.
855 * iplib.py: Expose ipapi as _ip in builtin namespace.
841 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
856 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
842 and ip_set_hook (-> _ip.set_hook) redundant. % and !
857 and ip_set_hook (-> _ip.set_hook) redundant. % and !
843 syntax now produce _ip.* variant of the commands.
858 syntax now produce _ip.* variant of the commands.
844
859
845 * "_ip.options().autoedit_syntax = 2" automatically throws
860 * "_ip.options().autoedit_syntax = 2" automatically throws
846 user to editor for syntax error correction without prompting.
861 user to editor for syntax error correction without prompting.
847
862
848 2006-01-27 Ville Vainio <vivainio@gmail.com>
863 2006-01-27 Ville Vainio <vivainio@gmail.com>
849
864
850 * ipmaker.py: Give "realistic" sys.argv for scripts (without
865 * ipmaker.py: Give "realistic" sys.argv for scripts (without
851 'ipython' at argv[0]) executed through command line.
866 'ipython' at argv[0]) executed through command line.
852 NOTE: this DEPRECATES calling ipython with multiple scripts
867 NOTE: this DEPRECATES calling ipython with multiple scripts
853 ("ipython a.py b.py c.py")
868 ("ipython a.py b.py c.py")
854
869
855 * iplib.py, hooks.py: Added configurable input prefilter,
870 * iplib.py, hooks.py: Added configurable input prefilter,
856 named 'input_prefilter'. See ext_rescapture.py for example
871 named 'input_prefilter'. See ext_rescapture.py for example
857 usage.
872 usage.
858
873
859 * ext_rescapture.py, Magic.py: Better system command output capture
874 * ext_rescapture.py, Magic.py: Better system command output capture
860 through 'var = !ls' (deprecates user-visible %sc). Same notation
875 through 'var = !ls' (deprecates user-visible %sc). Same notation
861 applies for magics, 'var = %alias' assigns alias list to var.
876 applies for magics, 'var = %alias' assigns alias list to var.
862
877
863 * ipapi.py: added meta() for accessing extension-usable data store.
878 * ipapi.py: added meta() for accessing extension-usable data store.
864
879
865 * iplib.py: added InteractiveShell.getapi(). New magics should be
880 * iplib.py: added InteractiveShell.getapi(). New magics should be
866 written doing self.getapi() instead of using the shell directly.
881 written doing self.getapi() instead of using the shell directly.
867
882
868 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
883 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
869 %store foo >> ~/myfoo.txt to store variables to files (in clean
884 %store foo >> ~/myfoo.txt to store variables to files (in clean
870 textual form, not a restorable pickle).
885 textual form, not a restorable pickle).
871
886
872 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
887 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
873
888
874 * usage.py, Magic.py: added %quickref
889 * usage.py, Magic.py: added %quickref
875
890
876 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
891 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
877
892
878 * GetoptErrors when invoking magics etc. with wrong args
893 * GetoptErrors when invoking magics etc. with wrong args
879 are now more helpful:
894 are now more helpful:
880 GetoptError: option -l not recognized (allowed: "qb" )
895 GetoptError: option -l not recognized (allowed: "qb" )
881
896
882 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
897 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
883
898
884 * IPython/demo.py (Demo.show): Flush stdout after each block, so
899 * IPython/demo.py (Demo.show): Flush stdout after each block, so
885 computationally intensive blocks don't appear to stall the demo.
900 computationally intensive blocks don't appear to stall the demo.
886
901
887 2006-01-24 Ville Vainio <vivainio@gmail.com>
902 2006-01-24 Ville Vainio <vivainio@gmail.com>
888
903
889 * iplib.py, hooks.py: 'result_display' hook can return a non-None
904 * iplib.py, hooks.py: 'result_display' hook can return a non-None
890 value to manipulate resulting history entry.
905 value to manipulate resulting history entry.
891
906
892 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
907 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
893 to instance methods of IPApi class, to make extending an embedded
908 to instance methods of IPApi class, to make extending an embedded
894 IPython feasible. See ext_rehashdir.py for example usage.
909 IPython feasible. See ext_rehashdir.py for example usage.
895
910
896 * Merged 1071-1076 from branches/0.7.1
911 * Merged 1071-1076 from branches/0.7.1
897
912
898
913
899 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
914 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
900
915
901 * tools/release (daystamp): Fix build tools to use the new
916 * tools/release (daystamp): Fix build tools to use the new
902 eggsetup.py script to build lightweight eggs.
917 eggsetup.py script to build lightweight eggs.
903
918
904 * Applied changesets 1062 and 1064 before 0.7.1 release.
919 * Applied changesets 1062 and 1064 before 0.7.1 release.
905
920
906 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
921 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
907 see the raw input history (without conversions like %ls ->
922 see the raw input history (without conversions like %ls ->
908 ipmagic("ls")). After a request from W. Stein, SAGE
923 ipmagic("ls")). After a request from W. Stein, SAGE
909 (http://modular.ucsd.edu/sage) developer. This information is
924 (http://modular.ucsd.edu/sage) developer. This information is
910 stored in the input_hist_raw attribute of the IPython instance, so
925 stored in the input_hist_raw attribute of the IPython instance, so
911 developers can access it if needed (it's an InputList instance).
926 developers can access it if needed (it's an InputList instance).
912
927
913 * Versionstring = 0.7.2.svn
928 * Versionstring = 0.7.2.svn
914
929
915 * eggsetup.py: A separate script for constructing eggs, creates
930 * eggsetup.py: A separate script for constructing eggs, creates
916 proper launch scripts even on Windows (an .exe file in
931 proper launch scripts even on Windows (an .exe file in
917 \python24\scripts).
932 \python24\scripts).
918
933
919 * ipapi.py: launch_new_instance, launch entry point needed for the
934 * ipapi.py: launch_new_instance, launch entry point needed for the
920 egg.
935 egg.
921
936
922 2006-01-23 Ville Vainio <vivainio@gmail.com>
937 2006-01-23 Ville Vainio <vivainio@gmail.com>
923
938
924 * Added %cpaste magic for pasting python code
939 * Added %cpaste magic for pasting python code
925
940
926 2006-01-22 Ville Vainio <vivainio@gmail.com>
941 2006-01-22 Ville Vainio <vivainio@gmail.com>
927
942
928 * Merge from branches/0.7.1 into trunk, revs 1052-1057
943 * Merge from branches/0.7.1 into trunk, revs 1052-1057
929
944
930 * Versionstring = 0.7.2.svn
945 * Versionstring = 0.7.2.svn
931
946
932 * eggsetup.py: A separate script for constructing eggs, creates
947 * eggsetup.py: A separate script for constructing eggs, creates
933 proper launch scripts even on Windows (an .exe file in
948 proper launch scripts even on Windows (an .exe file in
934 \python24\scripts).
949 \python24\scripts).
935
950
936 * ipapi.py: launch_new_instance, launch entry point needed for the
951 * ipapi.py: launch_new_instance, launch entry point needed for the
937 egg.
952 egg.
938
953
939 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
954 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
940
955
941 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
956 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
942 %pfile foo would print the file for foo even if it was a binary.
957 %pfile foo would print the file for foo even if it was a binary.
943 Now, extensions '.so' and '.dll' are skipped.
958 Now, extensions '.so' and '.dll' are skipped.
944
959
945 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
960 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
946 bug, where macros would fail in all threaded modes. I'm not 100%
961 bug, where macros would fail in all threaded modes. I'm not 100%
947 sure, so I'm going to put out an rc instead of making a release
962 sure, so I'm going to put out an rc instead of making a release
948 today, and wait for feedback for at least a few days.
963 today, and wait for feedback for at least a few days.
949
964
950 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
965 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
951 it...) the handling of pasting external code with autoindent on.
966 it...) the handling of pasting external code with autoindent on.
952 To get out of a multiline input, the rule will appear for most
967 To get out of a multiline input, the rule will appear for most
953 users unchanged: two blank lines or change the indent level
968 users unchanged: two blank lines or change the indent level
954 proposed by IPython. But there is a twist now: you can
969 proposed by IPython. But there is a twist now: you can
955 add/subtract only *one or two spaces*. If you add/subtract three
970 add/subtract only *one or two spaces*. If you add/subtract three
956 or more (unless you completely delete the line), IPython will
971 or more (unless you completely delete the line), IPython will
957 accept that line, and you'll need to enter a second one of pure
972 accept that line, and you'll need to enter a second one of pure
958 whitespace. I know it sounds complicated, but I can't find a
973 whitespace. I know it sounds complicated, but I can't find a
959 different solution that covers all the cases, with the right
974 different solution that covers all the cases, with the right
960 heuristics. Hopefully in actual use, nobody will really notice
975 heuristics. Hopefully in actual use, nobody will really notice
961 all these strange rules and things will 'just work'.
976 all these strange rules and things will 'just work'.
962
977
963 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
978 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
964
979
965 * IPython/iplib.py (interact): catch exceptions which can be
980 * IPython/iplib.py (interact): catch exceptions which can be
966 triggered asynchronously by signal handlers. Thanks to an
981 triggered asynchronously by signal handlers. Thanks to an
967 automatic crash report, submitted by Colin Kingsley
982 automatic crash report, submitted by Colin Kingsley
968 <tercel-AT-gentoo.org>.
983 <tercel-AT-gentoo.org>.
969
984
970 2006-01-20 Ville Vainio <vivainio@gmail.com>
985 2006-01-20 Ville Vainio <vivainio@gmail.com>
971
986
972 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
987 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
973 (%rehashdir, very useful, try it out) of how to extend ipython
988 (%rehashdir, very useful, try it out) of how to extend ipython
974 with new magics. Also added Extensions dir to pythonpath to make
989 with new magics. Also added Extensions dir to pythonpath to make
975 importing extensions easy.
990 importing extensions easy.
976
991
977 * %store now complains when trying to store interactively declared
992 * %store now complains when trying to store interactively declared
978 classes / instances of those classes.
993 classes / instances of those classes.
979
994
980 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
995 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
981 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
996 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
982 if they exist, and ipy_user_conf.py with some defaults is created for
997 if they exist, and ipy_user_conf.py with some defaults is created for
983 the user.
998 the user.
984
999
985 * Startup rehashing done by the config file, not InterpreterExec.
1000 * Startup rehashing done by the config file, not InterpreterExec.
986 This means system commands are available even without selecting the
1001 This means system commands are available even without selecting the
987 pysh profile. It's the sensible default after all.
1002 pysh profile. It's the sensible default after all.
988
1003
989 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1004 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
990
1005
991 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1006 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
992 multiline code with autoindent on working. But I am really not
1007 multiline code with autoindent on working. But I am really not
993 sure, so this needs more testing. Will commit a debug-enabled
1008 sure, so this needs more testing. Will commit a debug-enabled
994 version for now, while I test it some more, so that Ville and
1009 version for now, while I test it some more, so that Ville and
995 others may also catch any problems. Also made
1010 others may also catch any problems. Also made
996 self.indent_current_str() a method, to ensure that there's no
1011 self.indent_current_str() a method, to ensure that there's no
997 chance of the indent space count and the corresponding string
1012 chance of the indent space count and the corresponding string
998 falling out of sync. All code needing the string should just call
1013 falling out of sync. All code needing the string should just call
999 the method.
1014 the method.
1000
1015
1001 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1016 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1002
1017
1003 * IPython/Magic.py (magic_edit): fix check for when users don't
1018 * IPython/Magic.py (magic_edit): fix check for when users don't
1004 save their output files, the try/except was in the wrong section.
1019 save their output files, the try/except was in the wrong section.
1005
1020
1006 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1021 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1007
1022
1008 * IPython/Magic.py (magic_run): fix __file__ global missing from
1023 * IPython/Magic.py (magic_run): fix __file__ global missing from
1009 script's namespace when executed via %run. After a report by
1024 script's namespace when executed via %run. After a report by
1010 Vivian.
1025 Vivian.
1011
1026
1012 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1027 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1013 when using python 2.4. The parent constructor changed in 2.4, and
1028 when using python 2.4. The parent constructor changed in 2.4, and
1014 we need to track it directly (we can't call it, as it messes up
1029 we need to track it directly (we can't call it, as it messes up
1015 readline and tab-completion inside our pdb would stop working).
1030 readline and tab-completion inside our pdb would stop working).
1016 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1031 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1017
1032
1018 2006-01-16 Ville Vainio <vivainio@gmail.com>
1033 2006-01-16 Ville Vainio <vivainio@gmail.com>
1019
1034
1020 * Ipython/magic.py: Reverted back to old %edit functionality
1035 * Ipython/magic.py: Reverted back to old %edit functionality
1021 that returns file contents on exit.
1036 that returns file contents on exit.
1022
1037
1023 * IPython/path.py: Added Jason Orendorff's "path" module to
1038 * IPython/path.py: Added Jason Orendorff's "path" module to
1024 IPython tree, http://www.jorendorff.com/articles/python/path/.
1039 IPython tree, http://www.jorendorff.com/articles/python/path/.
1025 You can get path objects conveniently through %sc, and !!, e.g.:
1040 You can get path objects conveniently through %sc, and !!, e.g.:
1026 sc files=ls
1041 sc files=ls
1027 for p in files.paths: # or files.p
1042 for p in files.paths: # or files.p
1028 print p,p.mtime
1043 print p,p.mtime
1029
1044
1030 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1045 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1031 now work again without considering the exclusion regexp -
1046 now work again without considering the exclusion regexp -
1032 hence, things like ',foo my/path' turn to 'foo("my/path")'
1047 hence, things like ',foo my/path' turn to 'foo("my/path")'
1033 instead of syntax error.
1048 instead of syntax error.
1034
1049
1035
1050
1036 2006-01-14 Ville Vainio <vivainio@gmail.com>
1051 2006-01-14 Ville Vainio <vivainio@gmail.com>
1037
1052
1038 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1053 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1039 ipapi decorators for python 2.4 users, options() provides access to rc
1054 ipapi decorators for python 2.4 users, options() provides access to rc
1040 data.
1055 data.
1041
1056
1042 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1057 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1043 as path separators (even on Linux ;-). Space character after
1058 as path separators (even on Linux ;-). Space character after
1044 backslash (as yielded by tab completer) is still space;
1059 backslash (as yielded by tab completer) is still space;
1045 "%cd long\ name" works as expected.
1060 "%cd long\ name" works as expected.
1046
1061
1047 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1062 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1048 as "chain of command", with priority. API stays the same,
1063 as "chain of command", with priority. API stays the same,
1049 TryNext exception raised by a hook function signals that
1064 TryNext exception raised by a hook function signals that
1050 current hook failed and next hook should try handling it, as
1065 current hook failed and next hook should try handling it, as
1051 suggested by Walter Dörwald <walter@livinglogic.de>. Walter also
1066 suggested by Walter Dörwald <walter@livinglogic.de>. Walter also
1052 requested configurable display hook, which is now implemented.
1067 requested configurable display hook, which is now implemented.
1053
1068
1054 2006-01-13 Ville Vainio <vivainio@gmail.com>
1069 2006-01-13 Ville Vainio <vivainio@gmail.com>
1055
1070
1056 * IPython/platutils*.py: platform specific utility functions,
1071 * IPython/platutils*.py: platform specific utility functions,
1057 so far only set_term_title is implemented (change terminal
1072 so far only set_term_title is implemented (change terminal
1058 label in windowing systems). %cd now changes the title to
1073 label in windowing systems). %cd now changes the title to
1059 current dir.
1074 current dir.
1060
1075
1061 * IPython/Release.py: Added myself to "authors" list,
1076 * IPython/Release.py: Added myself to "authors" list,
1062 had to create new files.
1077 had to create new files.
1063
1078
1064 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1079 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1065 shell escape; not a known bug but had potential to be one in the
1080 shell escape; not a known bug but had potential to be one in the
1066 future.
1081 future.
1067
1082
1068 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1083 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1069 extension API for IPython! See the module for usage example. Fix
1084 extension API for IPython! See the module for usage example. Fix
1070 OInspect for docstring-less magic functions.
1085 OInspect for docstring-less magic functions.
1071
1086
1072
1087
1073 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1088 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1074
1089
1075 * IPython/iplib.py (raw_input): temporarily deactivate all
1090 * IPython/iplib.py (raw_input): temporarily deactivate all
1076 attempts at allowing pasting of code with autoindent on. It
1091 attempts at allowing pasting of code with autoindent on. It
1077 introduced bugs (reported by Prabhu) and I can't seem to find a
1092 introduced bugs (reported by Prabhu) and I can't seem to find a
1078 robust combination which works in all cases. Will have to revisit
1093 robust combination which works in all cases. Will have to revisit
1079 later.
1094 later.
1080
1095
1081 * IPython/genutils.py: remove isspace() function. We've dropped
1096 * IPython/genutils.py: remove isspace() function. We've dropped
1082 2.2 compatibility, so it's OK to use the string method.
1097 2.2 compatibility, so it's OK to use the string method.
1083
1098
1084 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1099 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1085
1100
1086 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1101 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1087 matching what NOT to autocall on, to include all python binary
1102 matching what NOT to autocall on, to include all python binary
1088 operators (including things like 'and', 'or', 'is' and 'in').
1103 operators (including things like 'and', 'or', 'is' and 'in').
1089 Prompted by a bug report on 'foo & bar', but I realized we had
1104 Prompted by a bug report on 'foo & bar', but I realized we had
1090 many more potential bug cases with other operators. The regexp is
1105 many more potential bug cases with other operators. The regexp is
1091 self.re_exclude_auto, it's fairly commented.
1106 self.re_exclude_auto, it's fairly commented.
1092
1107
1093 2006-01-12 Ville Vainio <vivainio@gmail.com>
1108 2006-01-12 Ville Vainio <vivainio@gmail.com>
1094
1109
1095 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1110 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1096 Prettified and hardened string/backslash quoting with ipsystem(),
1111 Prettified and hardened string/backslash quoting with ipsystem(),
1097 ipalias() and ipmagic(). Now even \ characters are passed to
1112 ipalias() and ipmagic(). Now even \ characters are passed to
1098 %magics, !shell escapes and aliases exactly as they are in the
1113 %magics, !shell escapes and aliases exactly as they are in the
1099 ipython command line. Should improve backslash experience,
1114 ipython command line. Should improve backslash experience,
1100 particularly in Windows (path delimiter for some commands that
1115 particularly in Windows (path delimiter for some commands that
1101 won't understand '/'), but Unix benefits as well (regexps). %cd
1116 won't understand '/'), but Unix benefits as well (regexps). %cd
1102 magic still doesn't support backslash path delimiters, though. Also
1117 magic still doesn't support backslash path delimiters, though. Also
1103 deleted all pretense of supporting multiline command strings in
1118 deleted all pretense of supporting multiline command strings in
1104 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1119 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1105
1120
1106 * doc/build_doc_instructions.txt added. Documentation on how to
1121 * doc/build_doc_instructions.txt added. Documentation on how to
1107 use doc/update_manual.py, added yesterday. Both files contributed
1122 use doc/update_manual.py, added yesterday. Both files contributed
1108 by Jörgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1123 by Jörgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1109 doc/*.sh for deprecation at a later date.
1124 doc/*.sh for deprecation at a later date.
1110
1125
1111 * /ipython.py Added ipython.py to root directory for
1126 * /ipython.py Added ipython.py to root directory for
1112 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1127 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1113 ipython.py) and development convenience (no need to keep doing
1128 ipython.py) and development convenience (no need to keep doing
1114 "setup.py install" between changes).
1129 "setup.py install" between changes).
1115
1130
1116 * Made ! and !! shell escapes work (again) in multiline expressions:
1131 * Made ! and !! shell escapes work (again) in multiline expressions:
1117 if 1:
1132 if 1:
1118 !ls
1133 !ls
1119 !!ls
1134 !!ls
1120
1135
1121 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1136 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1122
1137
1123 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1138 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1124 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1139 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1125 module in case-insensitive installation. Was causing crashes
1140 module in case-insensitive installation. Was causing crashes
1126 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1141 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1127
1142
1128 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1143 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1129 <marienz-AT-gentoo.org>, closes
1144 <marienz-AT-gentoo.org>, closes
1130 http://www.scipy.net/roundup/ipython/issue51.
1145 http://www.scipy.net/roundup/ipython/issue51.
1131
1146
1132 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1147 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1133
1148
1134 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1149 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1135 problem of excessive CPU usage under *nix and keyboard lag under
1150 problem of excessive CPU usage under *nix and keyboard lag under
1136 win32.
1151 win32.
1137
1152
1138 2006-01-10 *** Released version 0.7.0
1153 2006-01-10 *** Released version 0.7.0
1139
1154
1140 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1155 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1141
1156
1142 * IPython/Release.py (revision): tag version number to 0.7.0,
1157 * IPython/Release.py (revision): tag version number to 0.7.0,
1143 ready for release.
1158 ready for release.
1144
1159
1145 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1160 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1146 it informs the user of the name of the temp. file used. This can
1161 it informs the user of the name of the temp. file used. This can
1147 help if you decide later to reuse that same file, so you know
1162 help if you decide later to reuse that same file, so you know
1148 where to copy the info from.
1163 where to copy the info from.
1149
1164
1150 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1165 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1151
1166
1152 * setup_bdist_egg.py: little script to build an egg. Added
1167 * setup_bdist_egg.py: little script to build an egg. Added
1153 support in the release tools as well.
1168 support in the release tools as well.
1154
1169
1155 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1170 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1156
1171
1157 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1172 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1158 version selection (new -wxversion command line and ipythonrc
1173 version selection (new -wxversion command line and ipythonrc
1159 parameter). Patch contributed by Arnd Baecker
1174 parameter). Patch contributed by Arnd Baecker
1160 <arnd.baecker-AT-web.de>.
1175 <arnd.baecker-AT-web.de>.
1161
1176
1162 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1177 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1163 embedded instances, for variables defined at the interactive
1178 embedded instances, for variables defined at the interactive
1164 prompt of the embedded ipython. Reported by Arnd.
1179 prompt of the embedded ipython. Reported by Arnd.
1165
1180
1166 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1181 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1167 it can be used as a (stateful) toggle, or with a direct parameter.
1182 it can be used as a (stateful) toggle, or with a direct parameter.
1168
1183
1169 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1184 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1170 could be triggered in certain cases and cause the traceback
1185 could be triggered in certain cases and cause the traceback
1171 printer not to work.
1186 printer not to work.
1172
1187
1173 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1188 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1174
1189
1175 * IPython/iplib.py (_should_recompile): Small fix, closes
1190 * IPython/iplib.py (_should_recompile): Small fix, closes
1176 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1191 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1177
1192
1178 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1193 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1179
1194
1180 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1195 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1181 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1196 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1182 Moad for help with tracking it down.
1197 Moad for help with tracking it down.
1183
1198
1184 * IPython/iplib.py (handle_auto): fix autocall handling for
1199 * IPython/iplib.py (handle_auto): fix autocall handling for
1185 objects which support BOTH __getitem__ and __call__ (so that f [x]
1200 objects which support BOTH __getitem__ and __call__ (so that f [x]
1186 is left alone, instead of becoming f([x]) automatically).
1201 is left alone, instead of becoming f([x]) automatically).
1187
1202
1188 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1203 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1189 Ville's patch.
1204 Ville's patch.
1190
1205
1191 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1206 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1192
1207
1193 * IPython/iplib.py (handle_auto): changed autocall semantics to
1208 * IPython/iplib.py (handle_auto): changed autocall semantics to
1194 include 'smart' mode, where the autocall transformation is NOT
1209 include 'smart' mode, where the autocall transformation is NOT
1195 applied if there are no arguments on the line. This allows you to
1210 applied if there are no arguments on the line. This allows you to
1196 just type 'foo' if foo is a callable to see its internal form,
1211 just type 'foo' if foo is a callable to see its internal form,
1197 instead of having it called with no arguments (typically a
1212 instead of having it called with no arguments (typically a
1198 mistake). The old 'full' autocall still exists: for that, you
1213 mistake). The old 'full' autocall still exists: for that, you
1199 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1214 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1200
1215
1201 * IPython/completer.py (Completer.attr_matches): add
1216 * IPython/completer.py (Completer.attr_matches): add
1202 tab-completion support for Enthoughts' traits. After a report by
1217 tab-completion support for Enthoughts' traits. After a report by
1203 Arnd and a patch by Prabhu.
1218 Arnd and a patch by Prabhu.
1204
1219
1205 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1220 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1206
1221
1207 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1222 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1208 Schmolck's patch to fix inspect.getinnerframes().
1223 Schmolck's patch to fix inspect.getinnerframes().
1209
1224
1210 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1225 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1211 for embedded instances, regarding handling of namespaces and items
1226 for embedded instances, regarding handling of namespaces and items
1212 added to the __builtin__ one. Multiple embedded instances and
1227 added to the __builtin__ one. Multiple embedded instances and
1213 recursive embeddings should work better now (though I'm not sure
1228 recursive embeddings should work better now (though I'm not sure
1214 I've got all the corner cases fixed, that code is a bit of a brain
1229 I've got all the corner cases fixed, that code is a bit of a brain
1215 twister).
1230 twister).
1216
1231
1217 * IPython/Magic.py (magic_edit): added support to edit in-memory
1232 * IPython/Magic.py (magic_edit): added support to edit in-memory
1218 macros (automatically creates the necessary temp files). %edit
1233 macros (automatically creates the necessary temp files). %edit
1219 also doesn't return the file contents anymore, it's just noise.
1234 also doesn't return the file contents anymore, it's just noise.
1220
1235
1221 * IPython/completer.py (Completer.attr_matches): revert change to
1236 * IPython/completer.py (Completer.attr_matches): revert change to
1222 complete only on attributes listed in __all__. I realized it
1237 complete only on attributes listed in __all__. I realized it
1223 cripples the tab-completion system as a tool for exploring the
1238 cripples the tab-completion system as a tool for exploring the
1224 internals of unknown libraries (it renders any non-__all__
1239 internals of unknown libraries (it renders any non-__all__
1225 attribute off-limits). I got bit by this when trying to see
1240 attribute off-limits). I got bit by this when trying to see
1226 something inside the dis module.
1241 something inside the dis module.
1227
1242
1228 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1243 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1229
1244
1230 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1245 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1231 namespace for users and extension writers to hold data in. This
1246 namespace for users and extension writers to hold data in. This
1232 follows the discussion in
1247 follows the discussion in
1233 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1248 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1234
1249
1235 * IPython/completer.py (IPCompleter.complete): small patch to help
1250 * IPython/completer.py (IPCompleter.complete): small patch to help
1236 tab-completion under Emacs, after a suggestion by John Barnard
1251 tab-completion under Emacs, after a suggestion by John Barnard
1237 <barnarj-AT-ccf.org>.
1252 <barnarj-AT-ccf.org>.
1238
1253
1239 * IPython/Magic.py (Magic.extract_input_slices): added support for
1254 * IPython/Magic.py (Magic.extract_input_slices): added support for
1240 the slice notation in magics to use N-M to represent numbers N...M
1255 the slice notation in magics to use N-M to represent numbers N...M
1241 (closed endpoints). This is used by %macro and %save.
1256 (closed endpoints). This is used by %macro and %save.
1242
1257
1243 * IPython/completer.py (Completer.attr_matches): for modules which
1258 * IPython/completer.py (Completer.attr_matches): for modules which
1244 define __all__, complete only on those. After a patch by Jeffrey
1259 define __all__, complete only on those. After a patch by Jeffrey
1245 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1260 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1246 speed up this routine.
1261 speed up this routine.
1247
1262
1248 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1263 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1249 don't know if this is the end of it, but the behavior now is
1264 don't know if this is the end of it, but the behavior now is
1250 certainly much more correct. Note that coupled with macros,
1265 certainly much more correct. Note that coupled with macros,
1251 slightly surprising (at first) behavior may occur: a macro will in
1266 slightly surprising (at first) behavior may occur: a macro will in
1252 general expand to multiple lines of input, so upon exiting, the
1267 general expand to multiple lines of input, so upon exiting, the
1253 in/out counters will both be bumped by the corresponding amount
1268 in/out counters will both be bumped by the corresponding amount
1254 (as if the macro's contents had been typed interactively). Typing
1269 (as if the macro's contents had been typed interactively). Typing
1255 %hist will reveal the intermediate (silently processed) lines.
1270 %hist will reveal the intermediate (silently processed) lines.
1256
1271
1257 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1272 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1258 pickle to fail (%run was overwriting __main__ and not restoring
1273 pickle to fail (%run was overwriting __main__ and not restoring
1259 it, but pickle relies on __main__ to operate).
1274 it, but pickle relies on __main__ to operate).
1260
1275
1261 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1276 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1262 using properties, but forgot to make the main InteractiveShell
1277 using properties, but forgot to make the main InteractiveShell
1263 class a new-style class. Properties fail silently, and
1278 class a new-style class. Properties fail silently, and
1264 mysteriously, with old-style class (getters work, but
1279 mysteriously, with old-style class (getters work, but
1265 setters don't do anything).
1280 setters don't do anything).
1266
1281
1267 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1282 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1268
1283
1269 * IPython/Magic.py (magic_history): fix history reporting bug (I
1284 * IPython/Magic.py (magic_history): fix history reporting bug (I
1270 know some nasties are still there, I just can't seem to find a
1285 know some nasties are still there, I just can't seem to find a
1271 reproducible test case to track them down; the input history is
1286 reproducible test case to track them down; the input history is
1272 falling out of sync...)
1287 falling out of sync...)
1273
1288
1274 * IPython/iplib.py (handle_shell_escape): fix bug where both
1289 * IPython/iplib.py (handle_shell_escape): fix bug where both
1275 aliases and system accesses where broken for indented code (such
1290 aliases and system accesses where broken for indented code (such
1276 as loops).
1291 as loops).
1277
1292
1278 * IPython/genutils.py (shell): fix small but critical bug for
1293 * IPython/genutils.py (shell): fix small but critical bug for
1279 win32 system access.
1294 win32 system access.
1280
1295
1281 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1296 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1282
1297
1283 * IPython/iplib.py (showtraceback): remove use of the
1298 * IPython/iplib.py (showtraceback): remove use of the
1284 sys.last_{type/value/traceback} structures, which are non
1299 sys.last_{type/value/traceback} structures, which are non
1285 thread-safe.
1300 thread-safe.
1286 (_prefilter): change control flow to ensure that we NEVER
1301 (_prefilter): change control flow to ensure that we NEVER
1287 introspect objects when autocall is off. This will guarantee that
1302 introspect objects when autocall is off. This will guarantee that
1288 having an input line of the form 'x.y', where access to attribute
1303 having an input line of the form 'x.y', where access to attribute
1289 'y' has side effects, doesn't trigger the side effect TWICE. It
1304 'y' has side effects, doesn't trigger the side effect TWICE. It
1290 is important to note that, with autocall on, these side effects
1305 is important to note that, with autocall on, these side effects
1291 can still happen.
1306 can still happen.
1292 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1307 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1293 trio. IPython offers these three kinds of special calls which are
1308 trio. IPython offers these three kinds of special calls which are
1294 not python code, and it's a good thing to have their call method
1309 not python code, and it's a good thing to have their call method
1295 be accessible as pure python functions (not just special syntax at
1310 be accessible as pure python functions (not just special syntax at
1296 the command line). It gives us a better internal implementation
1311 the command line). It gives us a better internal implementation
1297 structure, as well as exposing these for user scripting more
1312 structure, as well as exposing these for user scripting more
1298 cleanly.
1313 cleanly.
1299
1314
1300 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1315 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1301 file. Now that they'll be more likely to be used with the
1316 file. Now that they'll be more likely to be used with the
1302 persistance system (%store), I want to make sure their module path
1317 persistance system (%store), I want to make sure their module path
1303 doesn't change in the future, so that we don't break things for
1318 doesn't change in the future, so that we don't break things for
1304 users' persisted data.
1319 users' persisted data.
1305
1320
1306 * IPython/iplib.py (autoindent_update): move indentation
1321 * IPython/iplib.py (autoindent_update): move indentation
1307 management into the _text_ processing loop, not the keyboard
1322 management into the _text_ processing loop, not the keyboard
1308 interactive one. This is necessary to correctly process non-typed
1323 interactive one. This is necessary to correctly process non-typed
1309 multiline input (such as macros).
1324 multiline input (such as macros).
1310
1325
1311 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1326 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1312 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1327 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1313 which was producing problems in the resulting manual.
1328 which was producing problems in the resulting manual.
1314 (magic_whos): improve reporting of instances (show their class,
1329 (magic_whos): improve reporting of instances (show their class,
1315 instead of simply printing 'instance' which isn't terribly
1330 instead of simply printing 'instance' which isn't terribly
1316 informative).
1331 informative).
1317
1332
1318 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1333 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1319 (minor mods) to support network shares under win32.
1334 (minor mods) to support network shares under win32.
1320
1335
1321 * IPython/winconsole.py (get_console_size): add new winconsole
1336 * IPython/winconsole.py (get_console_size): add new winconsole
1322 module and fixes to page_dumb() to improve its behavior under
1337 module and fixes to page_dumb() to improve its behavior under
1323 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1338 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1324
1339
1325 * IPython/Magic.py (Macro): simplified Macro class to just
1340 * IPython/Magic.py (Macro): simplified Macro class to just
1326 subclass list. We've had only 2.2 compatibility for a very long
1341 subclass list. We've had only 2.2 compatibility for a very long
1327 time, yet I was still avoiding subclassing the builtin types. No
1342 time, yet I was still avoiding subclassing the builtin types. No
1328 more (I'm also starting to use properties, though I won't shift to
1343 more (I'm also starting to use properties, though I won't shift to
1329 2.3-specific features quite yet).
1344 2.3-specific features quite yet).
1330 (magic_store): added Ville's patch for lightweight variable
1345 (magic_store): added Ville's patch for lightweight variable
1331 persistence, after a request on the user list by Matt Wilkie
1346 persistence, after a request on the user list by Matt Wilkie
1332 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1347 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1333 details.
1348 details.
1334
1349
1335 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1350 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1336 changed the default logfile name from 'ipython.log' to
1351 changed the default logfile name from 'ipython.log' to
1337 'ipython_log.py'. These logs are real python files, and now that
1352 'ipython_log.py'. These logs are real python files, and now that
1338 we have much better multiline support, people are more likely to
1353 we have much better multiline support, people are more likely to
1339 want to use them as such. Might as well name them correctly.
1354 want to use them as such. Might as well name them correctly.
1340
1355
1341 * IPython/Magic.py: substantial cleanup. While we can't stop
1356 * IPython/Magic.py: substantial cleanup. While we can't stop
1342 using magics as mixins, due to the existing customizations 'out
1357 using magics as mixins, due to the existing customizations 'out
1343 there' which rely on the mixin naming conventions, at least I
1358 there' which rely on the mixin naming conventions, at least I
1344 cleaned out all cross-class name usage. So once we are OK with
1359 cleaned out all cross-class name usage. So once we are OK with
1345 breaking compatibility, the two systems can be separated.
1360 breaking compatibility, the two systems can be separated.
1346
1361
1347 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1362 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1348 anymore, and the class is a fair bit less hideous as well. New
1363 anymore, and the class is a fair bit less hideous as well. New
1349 features were also introduced: timestamping of input, and logging
1364 features were also introduced: timestamping of input, and logging
1350 of output results. These are user-visible with the -t and -o
1365 of output results. These are user-visible with the -t and -o
1351 options to %logstart. Closes
1366 options to %logstart. Closes
1352 http://www.scipy.net/roundup/ipython/issue11 and a request by
1367 http://www.scipy.net/roundup/ipython/issue11 and a request by
1353 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1368 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1354
1369
1355 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1370 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1356
1371
1357 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1372 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1358 better handle backslashes in paths. See the thread 'More Windows
1373 better handle backslashes in paths. See the thread 'More Windows
1359 questions part 2 - \/ characters revisited' on the iypthon user
1374 questions part 2 - \/ characters revisited' on the iypthon user
1360 list:
1375 list:
1361 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1376 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1362
1377
1363 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1378 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1364
1379
1365 (InteractiveShell.__init__): change threaded shells to not use the
1380 (InteractiveShell.__init__): change threaded shells to not use the
1366 ipython crash handler. This was causing more problems than not,
1381 ipython crash handler. This was causing more problems than not,
1367 as exceptions in the main thread (GUI code, typically) would
1382 as exceptions in the main thread (GUI code, typically) would
1368 always show up as a 'crash', when they really weren't.
1383 always show up as a 'crash', when they really weren't.
1369
1384
1370 The colors and exception mode commands (%colors/%xmode) have been
1385 The colors and exception mode commands (%colors/%xmode) have been
1371 synchronized to also take this into account, so users can get
1386 synchronized to also take this into account, so users can get
1372 verbose exceptions for their threaded code as well. I also added
1387 verbose exceptions for their threaded code as well. I also added
1373 support for activating pdb inside this exception handler as well,
1388 support for activating pdb inside this exception handler as well,
1374 so now GUI authors can use IPython's enhanced pdb at runtime.
1389 so now GUI authors can use IPython's enhanced pdb at runtime.
1375
1390
1376 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1391 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1377 true by default, and add it to the shipped ipythonrc file. Since
1392 true by default, and add it to the shipped ipythonrc file. Since
1378 this asks the user before proceeding, I think it's OK to make it
1393 this asks the user before proceeding, I think it's OK to make it
1379 true by default.
1394 true by default.
1380
1395
1381 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1396 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1382 of the previous special-casing of input in the eval loop. I think
1397 of the previous special-casing of input in the eval loop. I think
1383 this is cleaner, as they really are commands and shouldn't have
1398 this is cleaner, as they really are commands and shouldn't have
1384 a special role in the middle of the core code.
1399 a special role in the middle of the core code.
1385
1400
1386 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1401 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1387
1402
1388 * IPython/iplib.py (edit_syntax_error): added support for
1403 * IPython/iplib.py (edit_syntax_error): added support for
1389 automatically reopening the editor if the file had a syntax error
1404 automatically reopening the editor if the file had a syntax error
1390 in it. Thanks to scottt who provided the patch at:
1405 in it. Thanks to scottt who provided the patch at:
1391 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1406 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1392 version committed).
1407 version committed).
1393
1408
1394 * IPython/iplib.py (handle_normal): add suport for multi-line
1409 * IPython/iplib.py (handle_normal): add suport for multi-line
1395 input with emtpy lines. This fixes
1410 input with emtpy lines. This fixes
1396 http://www.scipy.net/roundup/ipython/issue43 and a similar
1411 http://www.scipy.net/roundup/ipython/issue43 and a similar
1397 discussion on the user list.
1412 discussion on the user list.
1398
1413
1399 WARNING: a behavior change is necessarily introduced to support
1414 WARNING: a behavior change is necessarily introduced to support
1400 blank lines: now a single blank line with whitespace does NOT
1415 blank lines: now a single blank line with whitespace does NOT
1401 break the input loop, which means that when autoindent is on, by
1416 break the input loop, which means that when autoindent is on, by
1402 default hitting return on the next (indented) line does NOT exit.
1417 default hitting return on the next (indented) line does NOT exit.
1403
1418
1404 Instead, to exit a multiline input you can either have:
1419 Instead, to exit a multiline input you can either have:
1405
1420
1406 - TWO whitespace lines (just hit return again), or
1421 - TWO whitespace lines (just hit return again), or
1407 - a single whitespace line of a different length than provided
1422 - a single whitespace line of a different length than provided
1408 by the autoindent (add or remove a space).
1423 by the autoindent (add or remove a space).
1409
1424
1410 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1425 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1411 module to better organize all readline-related functionality.
1426 module to better organize all readline-related functionality.
1412 I've deleted FlexCompleter and put all completion clases here.
1427 I've deleted FlexCompleter and put all completion clases here.
1413
1428
1414 * IPython/iplib.py (raw_input): improve indentation management.
1429 * IPython/iplib.py (raw_input): improve indentation management.
1415 It is now possible to paste indented code with autoindent on, and
1430 It is now possible to paste indented code with autoindent on, and
1416 the code is interpreted correctly (though it still looks bad on
1431 the code is interpreted correctly (though it still looks bad on
1417 screen, due to the line-oriented nature of ipython).
1432 screen, due to the line-oriented nature of ipython).
1418 (MagicCompleter.complete): change behavior so that a TAB key on an
1433 (MagicCompleter.complete): change behavior so that a TAB key on an
1419 otherwise empty line actually inserts a tab, instead of completing
1434 otherwise empty line actually inserts a tab, instead of completing
1420 on the entire global namespace. This makes it easier to use the
1435 on the entire global namespace. This makes it easier to use the
1421 TAB key for indentation. After a request by Hans Meine
1436 TAB key for indentation. After a request by Hans Meine
1422 <hans_meine-AT-gmx.net>
1437 <hans_meine-AT-gmx.net>
1423 (_prefilter): add support so that typing plain 'exit' or 'quit'
1438 (_prefilter): add support so that typing plain 'exit' or 'quit'
1424 does a sensible thing. Originally I tried to deviate as little as
1439 does a sensible thing. Originally I tried to deviate as little as
1425 possible from the default python behavior, but even that one may
1440 possible from the default python behavior, but even that one may
1426 change in this direction (thread on python-dev to that effect).
1441 change in this direction (thread on python-dev to that effect).
1427 Regardless, ipython should do the right thing even if CPython's
1442 Regardless, ipython should do the right thing even if CPython's
1428 '>>>' prompt doesn't.
1443 '>>>' prompt doesn't.
1429 (InteractiveShell): removed subclassing code.InteractiveConsole
1444 (InteractiveShell): removed subclassing code.InteractiveConsole
1430 class. By now we'd overridden just about all of its methods: I've
1445 class. By now we'd overridden just about all of its methods: I've
1431 copied the remaining two over, and now ipython is a standalone
1446 copied the remaining two over, and now ipython is a standalone
1432 class. This will provide a clearer picture for the chainsaw
1447 class. This will provide a clearer picture for the chainsaw
1433 branch refactoring.
1448 branch refactoring.
1434
1449
1435 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1450 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1436
1451
1437 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1452 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1438 failures for objects which break when dir() is called on them.
1453 failures for objects which break when dir() is called on them.
1439
1454
1440 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1455 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1441 distinct local and global namespaces in the completer API. This
1456 distinct local and global namespaces in the completer API. This
1442 change allows us to properly handle completion with distinct
1457 change allows us to properly handle completion with distinct
1443 scopes, including in embedded instances (this had never really
1458 scopes, including in embedded instances (this had never really
1444 worked correctly).
1459 worked correctly).
1445
1460
1446 Note: this introduces a change in the constructor for
1461 Note: this introduces a change in the constructor for
1447 MagicCompleter, as a new global_namespace parameter is now the
1462 MagicCompleter, as a new global_namespace parameter is now the
1448 second argument (the others were bumped one position).
1463 second argument (the others were bumped one position).
1449
1464
1450 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1465 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1451
1466
1452 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1467 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1453 embedded instances (which can be done now thanks to Vivian's
1468 embedded instances (which can be done now thanks to Vivian's
1454 frame-handling fixes for pdb).
1469 frame-handling fixes for pdb).
1455 (InteractiveShell.__init__): Fix namespace handling problem in
1470 (InteractiveShell.__init__): Fix namespace handling problem in
1456 embedded instances. We were overwriting __main__ unconditionally,
1471 embedded instances. We were overwriting __main__ unconditionally,
1457 and this should only be done for 'full' (non-embedded) IPython;
1472 and this should only be done for 'full' (non-embedded) IPython;
1458 embedded instances must respect the caller's __main__. Thanks to
1473 embedded instances must respect the caller's __main__. Thanks to
1459 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1474 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1460
1475
1461 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1476 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1462
1477
1463 * setup.py: added download_url to setup(). This registers the
1478 * setup.py: added download_url to setup(). This registers the
1464 download address at PyPI, which is not only useful to humans
1479 download address at PyPI, which is not only useful to humans
1465 browsing the site, but is also picked up by setuptools (the Eggs
1480 browsing the site, but is also picked up by setuptools (the Eggs
1466 machinery). Thanks to Ville and R. Kern for the info/discussion
1481 machinery). Thanks to Ville and R. Kern for the info/discussion
1467 on this.
1482 on this.
1468
1483
1469 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1484 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1470
1485
1471 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1486 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1472 This brings a lot of nice functionality to the pdb mode, which now
1487 This brings a lot of nice functionality to the pdb mode, which now
1473 has tab-completion, syntax highlighting, and better stack handling
1488 has tab-completion, syntax highlighting, and better stack handling
1474 than before. Many thanks to Vivian De Smedt
1489 than before. Many thanks to Vivian De Smedt
1475 <vivian-AT-vdesmedt.com> for the original patches.
1490 <vivian-AT-vdesmedt.com> for the original patches.
1476
1491
1477 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1492 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1478
1493
1479 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1494 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1480 sequence to consistently accept the banner argument. The
1495 sequence to consistently accept the banner argument. The
1481 inconsistency was tripping SAGE, thanks to Gary Zablackis
1496 inconsistency was tripping SAGE, thanks to Gary Zablackis
1482 <gzabl-AT-yahoo.com> for the report.
1497 <gzabl-AT-yahoo.com> for the report.
1483
1498
1484 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1499 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1485
1500
1486 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1501 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1487 Fix bug where a naked 'alias' call in the ipythonrc file would
1502 Fix bug where a naked 'alias' call in the ipythonrc file would
1488 cause a crash. Bug reported by Jorgen Stenarson.
1503 cause a crash. Bug reported by Jorgen Stenarson.
1489
1504
1490 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1505 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1491
1506
1492 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1507 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1493 startup time.
1508 startup time.
1494
1509
1495 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1510 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1496 instances had introduced a bug with globals in normal code. Now
1511 instances had introduced a bug with globals in normal code. Now
1497 it's working in all cases.
1512 it's working in all cases.
1498
1513
1499 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1514 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1500 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1515 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1501 has been introduced to set the default case sensitivity of the
1516 has been introduced to set the default case sensitivity of the
1502 searches. Users can still select either mode at runtime on a
1517 searches. Users can still select either mode at runtime on a
1503 per-search basis.
1518 per-search basis.
1504
1519
1505 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1520 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1506
1521
1507 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1522 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1508 attributes in wildcard searches for subclasses. Modified version
1523 attributes in wildcard searches for subclasses. Modified version
1509 of a patch by Jorgen.
1524 of a patch by Jorgen.
1510
1525
1511 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1526 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1512
1527
1513 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1528 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1514 embedded instances. I added a user_global_ns attribute to the
1529 embedded instances. I added a user_global_ns attribute to the
1515 InteractiveShell class to handle this.
1530 InteractiveShell class to handle this.
1516
1531
1517 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1532 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1518
1533
1519 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1534 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1520 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1535 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1521 (reported under win32, but may happen also in other platforms).
1536 (reported under win32, but may happen also in other platforms).
1522 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1537 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1523
1538
1524 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1539 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1525
1540
1526 * IPython/Magic.py (magic_psearch): new support for wildcard
1541 * IPython/Magic.py (magic_psearch): new support for wildcard
1527 patterns. Now, typing ?a*b will list all names which begin with a
1542 patterns. Now, typing ?a*b will list all names which begin with a
1528 and end in b, for example. The %psearch magic has full
1543 and end in b, for example. The %psearch magic has full
1529 docstrings. Many thanks to Jörgen Stenarson
1544 docstrings. Many thanks to Jörgen Stenarson
1530 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1545 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1531 implementing this functionality.
1546 implementing this functionality.
1532
1547
1533 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1548 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1534
1549
1535 * Manual: fixed long-standing annoyance of double-dashes (as in
1550 * Manual: fixed long-standing annoyance of double-dashes (as in
1536 --prefix=~, for example) being stripped in the HTML version. This
1551 --prefix=~, for example) being stripped in the HTML version. This
1537 is a latex2html bug, but a workaround was provided. Many thanks
1552 is a latex2html bug, but a workaround was provided. Many thanks
1538 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1553 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1539 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1554 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1540 rolling. This seemingly small issue had tripped a number of users
1555 rolling. This seemingly small issue had tripped a number of users
1541 when first installing, so I'm glad to see it gone.
1556 when first installing, so I'm glad to see it gone.
1542
1557
1543 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1558 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1544
1559
1545 * IPython/Extensions/numeric_formats.py: fix missing import,
1560 * IPython/Extensions/numeric_formats.py: fix missing import,
1546 reported by Stephen Walton.
1561 reported by Stephen Walton.
1547
1562
1548 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1563 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1549
1564
1550 * IPython/demo.py: finish demo module, fully documented now.
1565 * IPython/demo.py: finish demo module, fully documented now.
1551
1566
1552 * IPython/genutils.py (file_read): simple little utility to read a
1567 * IPython/genutils.py (file_read): simple little utility to read a
1553 file and ensure it's closed afterwards.
1568 file and ensure it's closed afterwards.
1554
1569
1555 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1570 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1556
1571
1557 * IPython/demo.py (Demo.__init__): added support for individually
1572 * IPython/demo.py (Demo.__init__): added support for individually
1558 tagging blocks for automatic execution.
1573 tagging blocks for automatic execution.
1559
1574
1560 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1575 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1561 syntax-highlighted python sources, requested by John.
1576 syntax-highlighted python sources, requested by John.
1562
1577
1563 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1578 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1564
1579
1565 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1580 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1566 finishing.
1581 finishing.
1567
1582
1568 * IPython/genutils.py (shlex_split): moved from Magic to here,
1583 * IPython/genutils.py (shlex_split): moved from Magic to here,
1569 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1584 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1570
1585
1571 * IPython/demo.py (Demo.__init__): added support for silent
1586 * IPython/demo.py (Demo.__init__): added support for silent
1572 blocks, improved marks as regexps, docstrings written.
1587 blocks, improved marks as regexps, docstrings written.
1573 (Demo.__init__): better docstring, added support for sys.argv.
1588 (Demo.__init__): better docstring, added support for sys.argv.
1574
1589
1575 * IPython/genutils.py (marquee): little utility used by the demo
1590 * IPython/genutils.py (marquee): little utility used by the demo
1576 code, handy in general.
1591 code, handy in general.
1577
1592
1578 * IPython/demo.py (Demo.__init__): new class for interactive
1593 * IPython/demo.py (Demo.__init__): new class for interactive
1579 demos. Not documented yet, I just wrote it in a hurry for
1594 demos. Not documented yet, I just wrote it in a hurry for
1580 scipy'05. Will docstring later.
1595 scipy'05. Will docstring later.
1581
1596
1582 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1597 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1583
1598
1584 * IPython/Shell.py (sigint_handler): Drastic simplification which
1599 * IPython/Shell.py (sigint_handler): Drastic simplification which
1585 also seems to make Ctrl-C work correctly across threads! This is
1600 also seems to make Ctrl-C work correctly across threads! This is
1586 so simple, that I can't beleive I'd missed it before. Needs more
1601 so simple, that I can't beleive I'd missed it before. Needs more
1587 testing, though.
1602 testing, though.
1588 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1603 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1589 like this before...
1604 like this before...
1590
1605
1591 * IPython/genutils.py (get_home_dir): add protection against
1606 * IPython/genutils.py (get_home_dir): add protection against
1592 non-dirs in win32 registry.
1607 non-dirs in win32 registry.
1593
1608
1594 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1609 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1595 bug where dict was mutated while iterating (pysh crash).
1610 bug where dict was mutated while iterating (pysh crash).
1596
1611
1597 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1612 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1598
1613
1599 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1614 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1600 spurious newlines added by this routine. After a report by
1615 spurious newlines added by this routine. After a report by
1601 F. Mantegazza.
1616 F. Mantegazza.
1602
1617
1603 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1618 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1604
1619
1605 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1620 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1606 calls. These were a leftover from the GTK 1.x days, and can cause
1621 calls. These were a leftover from the GTK 1.x days, and can cause
1607 problems in certain cases (after a report by John Hunter).
1622 problems in certain cases (after a report by John Hunter).
1608
1623
1609 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1624 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1610 os.getcwd() fails at init time. Thanks to patch from David Remahl
1625 os.getcwd() fails at init time. Thanks to patch from David Remahl
1611 <chmod007-AT-mac.com>.
1626 <chmod007-AT-mac.com>.
1612 (InteractiveShell.__init__): prevent certain special magics from
1627 (InteractiveShell.__init__): prevent certain special magics from
1613 being shadowed by aliases. Closes
1628 being shadowed by aliases. Closes
1614 http://www.scipy.net/roundup/ipython/issue41.
1629 http://www.scipy.net/roundup/ipython/issue41.
1615
1630
1616 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1631 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1617
1632
1618 * IPython/iplib.py (InteractiveShell.complete): Added new
1633 * IPython/iplib.py (InteractiveShell.complete): Added new
1619 top-level completion method to expose the completion mechanism
1634 top-level completion method to expose the completion mechanism
1620 beyond readline-based environments.
1635 beyond readline-based environments.
1621
1636
1622 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1637 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1623
1638
1624 * tools/ipsvnc (svnversion): fix svnversion capture.
1639 * tools/ipsvnc (svnversion): fix svnversion capture.
1625
1640
1626 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1641 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1627 attribute to self, which was missing. Before, it was set by a
1642 attribute to self, which was missing. Before, it was set by a
1628 routine which in certain cases wasn't being called, so the
1643 routine which in certain cases wasn't being called, so the
1629 instance could end up missing the attribute. This caused a crash.
1644 instance could end up missing the attribute. This caused a crash.
1630 Closes http://www.scipy.net/roundup/ipython/issue40.
1645 Closes http://www.scipy.net/roundup/ipython/issue40.
1631
1646
1632 2005-08-16 Fernando Perez <fperez@colorado.edu>
1647 2005-08-16 Fernando Perez <fperez@colorado.edu>
1633
1648
1634 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1649 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1635 contains non-string attribute. Closes
1650 contains non-string attribute. Closes
1636 http://www.scipy.net/roundup/ipython/issue38.
1651 http://www.scipy.net/roundup/ipython/issue38.
1637
1652
1638 2005-08-14 Fernando Perez <fperez@colorado.edu>
1653 2005-08-14 Fernando Perez <fperez@colorado.edu>
1639
1654
1640 * tools/ipsvnc: Minor improvements, to add changeset info.
1655 * tools/ipsvnc: Minor improvements, to add changeset info.
1641
1656
1642 2005-08-12 Fernando Perez <fperez@colorado.edu>
1657 2005-08-12 Fernando Perez <fperez@colorado.edu>
1643
1658
1644 * IPython/iplib.py (runsource): remove self.code_to_run_src
1659 * IPython/iplib.py (runsource): remove self.code_to_run_src
1645 attribute. I realized this is nothing more than
1660 attribute. I realized this is nothing more than
1646 '\n'.join(self.buffer), and having the same data in two different
1661 '\n'.join(self.buffer), and having the same data in two different
1647 places is just asking for synchronization bugs. This may impact
1662 places is just asking for synchronization bugs. This may impact
1648 people who have custom exception handlers, so I need to warn
1663 people who have custom exception handlers, so I need to warn
1649 ipython-dev about it (F. Mantegazza may use them).
1664 ipython-dev about it (F. Mantegazza may use them).
1650
1665
1651 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1666 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1652
1667
1653 * IPython/genutils.py: fix 2.2 compatibility (generators)
1668 * IPython/genutils.py: fix 2.2 compatibility (generators)
1654
1669
1655 2005-07-18 Fernando Perez <fperez@colorado.edu>
1670 2005-07-18 Fernando Perez <fperez@colorado.edu>
1656
1671
1657 * IPython/genutils.py (get_home_dir): fix to help users with
1672 * IPython/genutils.py (get_home_dir): fix to help users with
1658 invalid $HOME under win32.
1673 invalid $HOME under win32.
1659
1674
1660 2005-07-17 Fernando Perez <fperez@colorado.edu>
1675 2005-07-17 Fernando Perez <fperez@colorado.edu>
1661
1676
1662 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1677 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1663 some old hacks and clean up a bit other routines; code should be
1678 some old hacks and clean up a bit other routines; code should be
1664 simpler and a bit faster.
1679 simpler and a bit faster.
1665
1680
1666 * IPython/iplib.py (interact): removed some last-resort attempts
1681 * IPython/iplib.py (interact): removed some last-resort attempts
1667 to survive broken stdout/stderr. That code was only making it
1682 to survive broken stdout/stderr. That code was only making it
1668 harder to abstract out the i/o (necessary for gui integration),
1683 harder to abstract out the i/o (necessary for gui integration),
1669 and the crashes it could prevent were extremely rare in practice
1684 and the crashes it could prevent were extremely rare in practice
1670 (besides being fully user-induced in a pretty violent manner).
1685 (besides being fully user-induced in a pretty violent manner).
1671
1686
1672 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1687 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1673 Nothing major yet, but the code is simpler to read; this should
1688 Nothing major yet, but the code is simpler to read; this should
1674 make it easier to do more serious modifications in the future.
1689 make it easier to do more serious modifications in the future.
1675
1690
1676 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1691 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1677 which broke in .15 (thanks to a report by Ville).
1692 which broke in .15 (thanks to a report by Ville).
1678
1693
1679 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1694 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1680 be quite correct, I know next to nothing about unicode). This
1695 be quite correct, I know next to nothing about unicode). This
1681 will allow unicode strings to be used in prompts, amongst other
1696 will allow unicode strings to be used in prompts, amongst other
1682 cases. It also will prevent ipython from crashing when unicode
1697 cases. It also will prevent ipython from crashing when unicode
1683 shows up unexpectedly in many places. If ascii encoding fails, we
1698 shows up unexpectedly in many places. If ascii encoding fails, we
1684 assume utf_8. Currently the encoding is not a user-visible
1699 assume utf_8. Currently the encoding is not a user-visible
1685 setting, though it could be made so if there is demand for it.
1700 setting, though it could be made so if there is demand for it.
1686
1701
1687 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1702 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1688
1703
1689 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1704 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1690
1705
1691 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1706 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1692
1707
1693 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1708 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1694 code can work transparently for 2.2/2.3.
1709 code can work transparently for 2.2/2.3.
1695
1710
1696 2005-07-16 Fernando Perez <fperez@colorado.edu>
1711 2005-07-16 Fernando Perez <fperez@colorado.edu>
1697
1712
1698 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1713 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1699 out of the color scheme table used for coloring exception
1714 out of the color scheme table used for coloring exception
1700 tracebacks. This allows user code to add new schemes at runtime.
1715 tracebacks. This allows user code to add new schemes at runtime.
1701 This is a minimally modified version of the patch at
1716 This is a minimally modified version of the patch at
1702 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1717 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1703 for the contribution.
1718 for the contribution.
1704
1719
1705 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1720 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1706 slightly modified version of the patch in
1721 slightly modified version of the patch in
1707 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1722 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1708 to remove the previous try/except solution (which was costlier).
1723 to remove the previous try/except solution (which was costlier).
1709 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1724 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1710
1725
1711 2005-06-08 Fernando Perez <fperez@colorado.edu>
1726 2005-06-08 Fernando Perez <fperez@colorado.edu>
1712
1727
1713 * IPython/iplib.py (write/write_err): Add methods to abstract all
1728 * IPython/iplib.py (write/write_err): Add methods to abstract all
1714 I/O a bit more.
1729 I/O a bit more.
1715
1730
1716 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1731 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1717 warning, reported by Aric Hagberg, fix by JD Hunter.
1732 warning, reported by Aric Hagberg, fix by JD Hunter.
1718
1733
1719 2005-06-02 *** Released version 0.6.15
1734 2005-06-02 *** Released version 0.6.15
1720
1735
1721 2005-06-01 Fernando Perez <fperez@colorado.edu>
1736 2005-06-01 Fernando Perez <fperez@colorado.edu>
1722
1737
1723 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1738 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1724 tab-completion of filenames within open-quoted strings. Note that
1739 tab-completion of filenames within open-quoted strings. Note that
1725 this requires that in ~/.ipython/ipythonrc, users change the
1740 this requires that in ~/.ipython/ipythonrc, users change the
1726 readline delimiters configuration to read:
1741 readline delimiters configuration to read:
1727
1742
1728 readline_remove_delims -/~
1743 readline_remove_delims -/~
1729
1744
1730
1745
1731 2005-05-31 *** Released version 0.6.14
1746 2005-05-31 *** Released version 0.6.14
1732
1747
1733 2005-05-29 Fernando Perez <fperez@colorado.edu>
1748 2005-05-29 Fernando Perez <fperez@colorado.edu>
1734
1749
1735 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1750 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1736 with files not on the filesystem. Reported by Eliyahu Sandler
1751 with files not on the filesystem. Reported by Eliyahu Sandler
1737 <eli@gondolin.net>
1752 <eli@gondolin.net>
1738
1753
1739 2005-05-22 Fernando Perez <fperez@colorado.edu>
1754 2005-05-22 Fernando Perez <fperez@colorado.edu>
1740
1755
1741 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1756 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1742 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1757 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1743
1758
1744 2005-05-19 Fernando Perez <fperez@colorado.edu>
1759 2005-05-19 Fernando Perez <fperez@colorado.edu>
1745
1760
1746 * IPython/iplib.py (safe_execfile): close a file which could be
1761 * IPython/iplib.py (safe_execfile): close a file which could be
1747 left open (causing problems in win32, which locks open files).
1762 left open (causing problems in win32, which locks open files).
1748 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1763 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1749
1764
1750 2005-05-18 Fernando Perez <fperez@colorado.edu>
1765 2005-05-18 Fernando Perez <fperez@colorado.edu>
1751
1766
1752 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1767 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1753 keyword arguments correctly to safe_execfile().
1768 keyword arguments correctly to safe_execfile().
1754
1769
1755 2005-05-13 Fernando Perez <fperez@colorado.edu>
1770 2005-05-13 Fernando Perez <fperez@colorado.edu>
1756
1771
1757 * ipython.1: Added info about Qt to manpage, and threads warning
1772 * ipython.1: Added info about Qt to manpage, and threads warning
1758 to usage page (invoked with --help).
1773 to usage page (invoked with --help).
1759
1774
1760 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1775 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1761 new matcher (it goes at the end of the priority list) to do
1776 new matcher (it goes at the end of the priority list) to do
1762 tab-completion on named function arguments. Submitted by George
1777 tab-completion on named function arguments. Submitted by George
1763 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1778 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1764 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1779 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1765 for more details.
1780 for more details.
1766
1781
1767 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1782 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1768 SystemExit exceptions in the script being run. Thanks to a report
1783 SystemExit exceptions in the script being run. Thanks to a report
1769 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1784 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1770 producing very annoying behavior when running unit tests.
1785 producing very annoying behavior when running unit tests.
1771
1786
1772 2005-05-12 Fernando Perez <fperez@colorado.edu>
1787 2005-05-12 Fernando Perez <fperez@colorado.edu>
1773
1788
1774 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1789 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1775 which I'd broken (again) due to a changed regexp. In the process,
1790 which I'd broken (again) due to a changed regexp. In the process,
1776 added ';' as an escape to auto-quote the whole line without
1791 added ';' as an escape to auto-quote the whole line without
1777 splitting its arguments. Thanks to a report by Jerry McRae
1792 splitting its arguments. Thanks to a report by Jerry McRae
1778 <qrs0xyc02-AT-sneakemail.com>.
1793 <qrs0xyc02-AT-sneakemail.com>.
1779
1794
1780 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1795 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1781 possible crashes caused by a TokenError. Reported by Ed Schofield
1796 possible crashes caused by a TokenError. Reported by Ed Schofield
1782 <schofield-AT-ftw.at>.
1797 <schofield-AT-ftw.at>.
1783
1798
1784 2005-05-06 Fernando Perez <fperez@colorado.edu>
1799 2005-05-06 Fernando Perez <fperez@colorado.edu>
1785
1800
1786 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1801 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1787
1802
1788 2005-04-29 Fernando Perez <fperez@colorado.edu>
1803 2005-04-29 Fernando Perez <fperez@colorado.edu>
1789
1804
1790 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1805 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1791 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1806 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1792 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1807 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1793 which provides support for Qt interactive usage (similar to the
1808 which provides support for Qt interactive usage (similar to the
1794 existing one for WX and GTK). This had been often requested.
1809 existing one for WX and GTK). This had been often requested.
1795
1810
1796 2005-04-14 *** Released version 0.6.13
1811 2005-04-14 *** Released version 0.6.13
1797
1812
1798 2005-04-08 Fernando Perez <fperez@colorado.edu>
1813 2005-04-08 Fernando Perez <fperez@colorado.edu>
1799
1814
1800 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1815 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1801 from _ofind, which gets called on almost every input line. Now,
1816 from _ofind, which gets called on almost every input line. Now,
1802 we only try to get docstrings if they are actually going to be
1817 we only try to get docstrings if they are actually going to be
1803 used (the overhead of fetching unnecessary docstrings can be
1818 used (the overhead of fetching unnecessary docstrings can be
1804 noticeable for certain objects, such as Pyro proxies).
1819 noticeable for certain objects, such as Pyro proxies).
1805
1820
1806 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1821 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1807 for completers. For some reason I had been passing them the state
1822 for completers. For some reason I had been passing them the state
1808 variable, which completers never actually need, and was in
1823 variable, which completers never actually need, and was in
1809 conflict with the rlcompleter API. Custom completers ONLY need to
1824 conflict with the rlcompleter API. Custom completers ONLY need to
1810 take the text parameter.
1825 take the text parameter.
1811
1826
1812 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1827 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1813 work correctly in pysh. I've also moved all the logic which used
1828 work correctly in pysh. I've also moved all the logic which used
1814 to be in pysh.py here, which will prevent problems with future
1829 to be in pysh.py here, which will prevent problems with future
1815 upgrades. However, this time I must warn users to update their
1830 upgrades. However, this time I must warn users to update their
1816 pysh profile to include the line
1831 pysh profile to include the line
1817
1832
1818 import_all IPython.Extensions.InterpreterExec
1833 import_all IPython.Extensions.InterpreterExec
1819
1834
1820 because otherwise things won't work for them. They MUST also
1835 because otherwise things won't work for them. They MUST also
1821 delete pysh.py and the line
1836 delete pysh.py and the line
1822
1837
1823 execfile pysh.py
1838 execfile pysh.py
1824
1839
1825 from their ipythonrc-pysh.
1840 from their ipythonrc-pysh.
1826
1841
1827 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1842 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1828 robust in the face of objects whose dir() returns non-strings
1843 robust in the face of objects whose dir() returns non-strings
1829 (which it shouldn't, but some broken libs like ITK do). Thanks to
1844 (which it shouldn't, but some broken libs like ITK do). Thanks to
1830 a patch by John Hunter (implemented differently, though). Also
1845 a patch by John Hunter (implemented differently, though). Also
1831 minor improvements by using .extend instead of + on lists.
1846 minor improvements by using .extend instead of + on lists.
1832
1847
1833 * pysh.py:
1848 * pysh.py:
1834
1849
1835 2005-04-06 Fernando Perez <fperez@colorado.edu>
1850 2005-04-06 Fernando Perez <fperez@colorado.edu>
1836
1851
1837 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1852 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1838 by default, so that all users benefit from it. Those who don't
1853 by default, so that all users benefit from it. Those who don't
1839 want it can still turn it off.
1854 want it can still turn it off.
1840
1855
1841 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1856 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1842 config file, I'd forgotten about this, so users were getting it
1857 config file, I'd forgotten about this, so users were getting it
1843 off by default.
1858 off by default.
1844
1859
1845 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1860 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1846 consistency. Now magics can be called in multiline statements,
1861 consistency. Now magics can be called in multiline statements,
1847 and python variables can be expanded in magic calls via $var.
1862 and python variables can be expanded in magic calls via $var.
1848 This makes the magic system behave just like aliases or !system
1863 This makes the magic system behave just like aliases or !system
1849 calls.
1864 calls.
1850
1865
1851 2005-03-28 Fernando Perez <fperez@colorado.edu>
1866 2005-03-28 Fernando Perez <fperez@colorado.edu>
1852
1867
1853 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1868 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1854 expensive string additions for building command. Add support for
1869 expensive string additions for building command. Add support for
1855 trailing ';' when autocall is used.
1870 trailing ';' when autocall is used.
1856
1871
1857 2005-03-26 Fernando Perez <fperez@colorado.edu>
1872 2005-03-26 Fernando Perez <fperez@colorado.edu>
1858
1873
1859 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1874 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1860 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1875 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1861 ipython.el robust against prompts with any number of spaces
1876 ipython.el robust against prompts with any number of spaces
1862 (including 0) after the ':' character.
1877 (including 0) after the ':' character.
1863
1878
1864 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1879 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1865 continuation prompt, which misled users to think the line was
1880 continuation prompt, which misled users to think the line was
1866 already indented. Closes debian Bug#300847, reported to me by
1881 already indented. Closes debian Bug#300847, reported to me by
1867 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1882 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1868
1883
1869 2005-03-23 Fernando Perez <fperez@colorado.edu>
1884 2005-03-23 Fernando Perez <fperez@colorado.edu>
1870
1885
1871 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1886 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1872 properly aligned if they have embedded newlines.
1887 properly aligned if they have embedded newlines.
1873
1888
1874 * IPython/iplib.py (runlines): Add a public method to expose
1889 * IPython/iplib.py (runlines): Add a public method to expose
1875 IPython's code execution machinery, so that users can run strings
1890 IPython's code execution machinery, so that users can run strings
1876 as if they had been typed at the prompt interactively.
1891 as if they had been typed at the prompt interactively.
1877 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1892 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1878 methods which can call the system shell, but with python variable
1893 methods which can call the system shell, but with python variable
1879 expansion. The three such methods are: __IPYTHON__.system,
1894 expansion. The three such methods are: __IPYTHON__.system,
1880 .getoutput and .getoutputerror. These need to be documented in a
1895 .getoutput and .getoutputerror. These need to be documented in a
1881 'public API' section (to be written) of the manual.
1896 'public API' section (to be written) of the manual.
1882
1897
1883 2005-03-20 Fernando Perez <fperez@colorado.edu>
1898 2005-03-20 Fernando Perez <fperez@colorado.edu>
1884
1899
1885 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1900 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1886 for custom exception handling. This is quite powerful, and it
1901 for custom exception handling. This is quite powerful, and it
1887 allows for user-installable exception handlers which can trap
1902 allows for user-installable exception handlers which can trap
1888 custom exceptions at runtime and treat them separately from
1903 custom exceptions at runtime and treat them separately from
1889 IPython's default mechanisms. At the request of Frédéric
1904 IPython's default mechanisms. At the request of Frédéric
1890 Mantegazza <mantegazza-AT-ill.fr>.
1905 Mantegazza <mantegazza-AT-ill.fr>.
1891 (InteractiveShell.set_custom_completer): public API function to
1906 (InteractiveShell.set_custom_completer): public API function to
1892 add new completers at runtime.
1907 add new completers at runtime.
1893
1908
1894 2005-03-19 Fernando Perez <fperez@colorado.edu>
1909 2005-03-19 Fernando Perez <fperez@colorado.edu>
1895
1910
1896 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1911 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1897 allow objects which provide their docstrings via non-standard
1912 allow objects which provide their docstrings via non-standard
1898 mechanisms (like Pyro proxies) to still be inspected by ipython's
1913 mechanisms (like Pyro proxies) to still be inspected by ipython's
1899 ? system.
1914 ? system.
1900
1915
1901 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1916 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1902 automatic capture system. I tried quite hard to make it work
1917 automatic capture system. I tried quite hard to make it work
1903 reliably, and simply failed. I tried many combinations with the
1918 reliably, and simply failed. I tried many combinations with the
1904 subprocess module, but eventually nothing worked in all needed
1919 subprocess module, but eventually nothing worked in all needed
1905 cases (not blocking stdin for the child, duplicating stdout
1920 cases (not blocking stdin for the child, duplicating stdout
1906 without blocking, etc). The new %sc/%sx still do capture to these
1921 without blocking, etc). The new %sc/%sx still do capture to these
1907 magical list/string objects which make shell use much more
1922 magical list/string objects which make shell use much more
1908 conveninent, so not all is lost.
1923 conveninent, so not all is lost.
1909
1924
1910 XXX - FIX MANUAL for the change above!
1925 XXX - FIX MANUAL for the change above!
1911
1926
1912 (runsource): I copied code.py's runsource() into ipython to modify
1927 (runsource): I copied code.py's runsource() into ipython to modify
1913 it a bit. Now the code object and source to be executed are
1928 it a bit. Now the code object and source to be executed are
1914 stored in ipython. This makes this info accessible to third-party
1929 stored in ipython. This makes this info accessible to third-party
1915 tools, like custom exception handlers. After a request by Frédéric
1930 tools, like custom exception handlers. After a request by Frédéric
1916 Mantegazza <mantegazza-AT-ill.fr>.
1931 Mantegazza <mantegazza-AT-ill.fr>.
1917
1932
1918 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1933 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1919 history-search via readline (like C-p/C-n). I'd wanted this for a
1934 history-search via readline (like C-p/C-n). I'd wanted this for a
1920 long time, but only recently found out how to do it. For users
1935 long time, but only recently found out how to do it. For users
1921 who already have their ipythonrc files made and want this, just
1936 who already have their ipythonrc files made and want this, just
1922 add:
1937 add:
1923
1938
1924 readline_parse_and_bind "\e[A": history-search-backward
1939 readline_parse_and_bind "\e[A": history-search-backward
1925 readline_parse_and_bind "\e[B": history-search-forward
1940 readline_parse_and_bind "\e[B": history-search-forward
1926
1941
1927 2005-03-18 Fernando Perez <fperez@colorado.edu>
1942 2005-03-18 Fernando Perez <fperez@colorado.edu>
1928
1943
1929 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1944 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1930 LSString and SList classes which allow transparent conversions
1945 LSString and SList classes which allow transparent conversions
1931 between list mode and whitespace-separated string.
1946 between list mode and whitespace-separated string.
1932 (magic_r): Fix recursion problem in %r.
1947 (magic_r): Fix recursion problem in %r.
1933
1948
1934 * IPython/genutils.py (LSString): New class to be used for
1949 * IPython/genutils.py (LSString): New class to be used for
1935 automatic storage of the results of all alias/system calls in _o
1950 automatic storage of the results of all alias/system calls in _o
1936 and _e (stdout/err). These provide a .l/.list attribute which
1951 and _e (stdout/err). These provide a .l/.list attribute which
1937 does automatic splitting on newlines. This means that for most
1952 does automatic splitting on newlines. This means that for most
1938 uses, you'll never need to do capturing of output with %sc/%sx
1953 uses, you'll never need to do capturing of output with %sc/%sx
1939 anymore, since ipython keeps this always done for you. Note that
1954 anymore, since ipython keeps this always done for you. Note that
1940 only the LAST results are stored, the _o/e variables are
1955 only the LAST results are stored, the _o/e variables are
1941 overwritten on each call. If you need to save their contents
1956 overwritten on each call. If you need to save their contents
1942 further, simply bind them to any other name.
1957 further, simply bind them to any other name.
1943
1958
1944 2005-03-17 Fernando Perez <fperez@colorado.edu>
1959 2005-03-17 Fernando Perez <fperez@colorado.edu>
1945
1960
1946 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1961 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1947 prompt namespace handling.
1962 prompt namespace handling.
1948
1963
1949 2005-03-16 Fernando Perez <fperez@colorado.edu>
1964 2005-03-16 Fernando Perez <fperez@colorado.edu>
1950
1965
1951 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1966 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1952 classic prompts to be '>>> ' (final space was missing, and it
1967 classic prompts to be '>>> ' (final space was missing, and it
1953 trips the emacs python mode).
1968 trips the emacs python mode).
1954 (BasePrompt.__str__): Added safe support for dynamic prompt
1969 (BasePrompt.__str__): Added safe support for dynamic prompt
1955 strings. Now you can set your prompt string to be '$x', and the
1970 strings. Now you can set your prompt string to be '$x', and the
1956 value of x will be printed from your interactive namespace. The
1971 value of x will be printed from your interactive namespace. The
1957 interpolation syntax includes the full Itpl support, so
1972 interpolation syntax includes the full Itpl support, so
1958 ${foo()+x+bar()} is a valid prompt string now, and the function
1973 ${foo()+x+bar()} is a valid prompt string now, and the function
1959 calls will be made at runtime.
1974 calls will be made at runtime.
1960
1975
1961 2005-03-15 Fernando Perez <fperez@colorado.edu>
1976 2005-03-15 Fernando Perez <fperez@colorado.edu>
1962
1977
1963 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1978 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1964 avoid name clashes in pylab. %hist still works, it just forwards
1979 avoid name clashes in pylab. %hist still works, it just forwards
1965 the call to %history.
1980 the call to %history.
1966
1981
1967 2005-03-02 *** Released version 0.6.12
1982 2005-03-02 *** Released version 0.6.12
1968
1983
1969 2005-03-02 Fernando Perez <fperez@colorado.edu>
1984 2005-03-02 Fernando Perez <fperez@colorado.edu>
1970
1985
1971 * IPython/iplib.py (handle_magic): log magic calls properly as
1986 * IPython/iplib.py (handle_magic): log magic calls properly as
1972 ipmagic() function calls.
1987 ipmagic() function calls.
1973
1988
1974 * IPython/Magic.py (magic_time): Improved %time to support
1989 * IPython/Magic.py (magic_time): Improved %time to support
1975 statements and provide wall-clock as well as CPU time.
1990 statements and provide wall-clock as well as CPU time.
1976
1991
1977 2005-02-27 Fernando Perez <fperez@colorado.edu>
1992 2005-02-27 Fernando Perez <fperez@colorado.edu>
1978
1993
1979 * IPython/hooks.py: New hooks module, to expose user-modifiable
1994 * IPython/hooks.py: New hooks module, to expose user-modifiable
1980 IPython functionality in a clean manner. For now only the editor
1995 IPython functionality in a clean manner. For now only the editor
1981 hook is actually written, and other thigns which I intend to turn
1996 hook is actually written, and other thigns which I intend to turn
1982 into proper hooks aren't yet there. The display and prefilter
1997 into proper hooks aren't yet there. The display and prefilter
1983 stuff, for example, should be hooks. But at least now the
1998 stuff, for example, should be hooks. But at least now the
1984 framework is in place, and the rest can be moved here with more
1999 framework is in place, and the rest can be moved here with more
1985 time later. IPython had had a .hooks variable for a long time for
2000 time later. IPython had had a .hooks variable for a long time for
1986 this purpose, but I'd never actually used it for anything.
2001 this purpose, but I'd never actually used it for anything.
1987
2002
1988 2005-02-26 Fernando Perez <fperez@colorado.edu>
2003 2005-02-26 Fernando Perez <fperez@colorado.edu>
1989
2004
1990 * IPython/ipmaker.py (make_IPython): make the default ipython
2005 * IPython/ipmaker.py (make_IPython): make the default ipython
1991 directory be called _ipython under win32, to follow more the
2006 directory be called _ipython under win32, to follow more the
1992 naming peculiarities of that platform (where buggy software like
2007 naming peculiarities of that platform (where buggy software like
1993 Visual Sourcesafe breaks with .named directories). Reported by
2008 Visual Sourcesafe breaks with .named directories). Reported by
1994 Ville Vainio.
2009 Ville Vainio.
1995
2010
1996 2005-02-23 Fernando Perez <fperez@colorado.edu>
2011 2005-02-23 Fernando Perez <fperez@colorado.edu>
1997
2012
1998 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2013 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1999 auto_aliases for win32 which were causing problems. Users can
2014 auto_aliases for win32 which were causing problems. Users can
2000 define the ones they personally like.
2015 define the ones they personally like.
2001
2016
2002 2005-02-21 Fernando Perez <fperez@colorado.edu>
2017 2005-02-21 Fernando Perez <fperez@colorado.edu>
2003
2018
2004 * IPython/Magic.py (magic_time): new magic to time execution of
2019 * IPython/Magic.py (magic_time): new magic to time execution of
2005 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2020 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2006
2021
2007 2005-02-19 Fernando Perez <fperez@colorado.edu>
2022 2005-02-19 Fernando Perez <fperez@colorado.edu>
2008
2023
2009 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2024 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2010 into keys (for prompts, for example).
2025 into keys (for prompts, for example).
2011
2026
2012 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2027 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2013 prompts in case users want them. This introduces a small behavior
2028 prompts in case users want them. This introduces a small behavior
2014 change: ipython does not automatically add a space to all prompts
2029 change: ipython does not automatically add a space to all prompts
2015 anymore. To get the old prompts with a space, users should add it
2030 anymore. To get the old prompts with a space, users should add it
2016 manually to their ipythonrc file, so for example prompt_in1 should
2031 manually to their ipythonrc file, so for example prompt_in1 should
2017 now read 'In [\#]: ' instead of 'In [\#]:'.
2032 now read 'In [\#]: ' instead of 'In [\#]:'.
2018 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2033 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2019 file) to control left-padding of secondary prompts.
2034 file) to control left-padding of secondary prompts.
2020
2035
2021 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2036 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2022 the profiler can't be imported. Fix for Debian, which removed
2037 the profiler can't be imported. Fix for Debian, which removed
2023 profile.py because of License issues. I applied a slightly
2038 profile.py because of License issues. I applied a slightly
2024 modified version of the original Debian patch at
2039 modified version of the original Debian patch at
2025 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2040 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2026
2041
2027 2005-02-17 Fernando Perez <fperez@colorado.edu>
2042 2005-02-17 Fernando Perez <fperez@colorado.edu>
2028
2043
2029 * IPython/genutils.py (native_line_ends): Fix bug which would
2044 * IPython/genutils.py (native_line_ends): Fix bug which would
2030 cause improper line-ends under win32 b/c I was not opening files
2045 cause improper line-ends under win32 b/c I was not opening files
2031 in binary mode. Bug report and fix thanks to Ville.
2046 in binary mode. Bug report and fix thanks to Ville.
2032
2047
2033 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2048 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2034 trying to catch spurious foo[1] autocalls. My fix actually broke
2049 trying to catch spurious foo[1] autocalls. My fix actually broke
2035 ',/' autoquote/call with explicit escape (bad regexp).
2050 ',/' autoquote/call with explicit escape (bad regexp).
2036
2051
2037 2005-02-15 *** Released version 0.6.11
2052 2005-02-15 *** Released version 0.6.11
2038
2053
2039 2005-02-14 Fernando Perez <fperez@colorado.edu>
2054 2005-02-14 Fernando Perez <fperez@colorado.edu>
2040
2055
2041 * IPython/background_jobs.py: New background job management
2056 * IPython/background_jobs.py: New background job management
2042 subsystem. This is implemented via a new set of classes, and
2057 subsystem. This is implemented via a new set of classes, and
2043 IPython now provides a builtin 'jobs' object for background job
2058 IPython now provides a builtin 'jobs' object for background job
2044 execution. A convenience %bg magic serves as a lightweight
2059 execution. A convenience %bg magic serves as a lightweight
2045 frontend for starting the more common type of calls. This was
2060 frontend for starting the more common type of calls. This was
2046 inspired by discussions with B. Granger and the BackgroundCommand
2061 inspired by discussions with B. Granger and the BackgroundCommand
2047 class described in the book Python Scripting for Computational
2062 class described in the book Python Scripting for Computational
2048 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2063 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2049 (although ultimately no code from this text was used, as IPython's
2064 (although ultimately no code from this text was used, as IPython's
2050 system is a separate implementation).
2065 system is a separate implementation).
2051
2066
2052 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2067 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2053 to control the completion of single/double underscore names
2068 to control the completion of single/double underscore names
2054 separately. As documented in the example ipytonrc file, the
2069 separately. As documented in the example ipytonrc file, the
2055 readline_omit__names variable can now be set to 2, to omit even
2070 readline_omit__names variable can now be set to 2, to omit even
2056 single underscore names. Thanks to a patch by Brian Wong
2071 single underscore names. Thanks to a patch by Brian Wong
2057 <BrianWong-AT-AirgoNetworks.Com>.
2072 <BrianWong-AT-AirgoNetworks.Com>.
2058 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2073 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2059 be autocalled as foo([1]) if foo were callable. A problem for
2074 be autocalled as foo([1]) if foo were callable. A problem for
2060 things which are both callable and implement __getitem__.
2075 things which are both callable and implement __getitem__.
2061 (init_readline): Fix autoindentation for win32. Thanks to a patch
2076 (init_readline): Fix autoindentation for win32. Thanks to a patch
2062 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2077 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2063
2078
2064 2005-02-12 Fernando Perez <fperez@colorado.edu>
2079 2005-02-12 Fernando Perez <fperez@colorado.edu>
2065
2080
2066 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2081 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2067 which I had written long ago to sort out user error messages which
2082 which I had written long ago to sort out user error messages which
2068 may occur during startup. This seemed like a good idea initially,
2083 may occur during startup. This seemed like a good idea initially,
2069 but it has proven a disaster in retrospect. I don't want to
2084 but it has proven a disaster in retrospect. I don't want to
2070 change much code for now, so my fix is to set the internal 'debug'
2085 change much code for now, so my fix is to set the internal 'debug'
2071 flag to true everywhere, whose only job was precisely to control
2086 flag to true everywhere, whose only job was precisely to control
2072 this subsystem. This closes issue 28 (as well as avoiding all
2087 this subsystem. This closes issue 28 (as well as avoiding all
2073 sorts of strange hangups which occur from time to time).
2088 sorts of strange hangups which occur from time to time).
2074
2089
2075 2005-02-07 Fernando Perez <fperez@colorado.edu>
2090 2005-02-07 Fernando Perez <fperez@colorado.edu>
2076
2091
2077 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2092 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2078 previous call produced a syntax error.
2093 previous call produced a syntax error.
2079
2094
2080 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2095 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2081 classes without constructor.
2096 classes without constructor.
2082
2097
2083 2005-02-06 Fernando Perez <fperez@colorado.edu>
2098 2005-02-06 Fernando Perez <fperez@colorado.edu>
2084
2099
2085 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2100 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2086 completions with the results of each matcher, so we return results
2101 completions with the results of each matcher, so we return results
2087 to the user from all namespaces. This breaks with ipython
2102 to the user from all namespaces. This breaks with ipython
2088 tradition, but I think it's a nicer behavior. Now you get all
2103 tradition, but I think it's a nicer behavior. Now you get all
2089 possible completions listed, from all possible namespaces (python,
2104 possible completions listed, from all possible namespaces (python,
2090 filesystem, magics...) After a request by John Hunter
2105 filesystem, magics...) After a request by John Hunter
2091 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2106 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2092
2107
2093 2005-02-05 Fernando Perez <fperez@colorado.edu>
2108 2005-02-05 Fernando Perez <fperez@colorado.edu>
2094
2109
2095 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2110 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2096 the call had quote characters in it (the quotes were stripped).
2111 the call had quote characters in it (the quotes were stripped).
2097
2112
2098 2005-01-31 Fernando Perez <fperez@colorado.edu>
2113 2005-01-31 Fernando Perez <fperez@colorado.edu>
2099
2114
2100 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2115 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2101 Itpl.itpl() to make the code more robust against psyco
2116 Itpl.itpl() to make the code more robust against psyco
2102 optimizations.
2117 optimizations.
2103
2118
2104 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2119 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2105 of causing an exception. Quicker, cleaner.
2120 of causing an exception. Quicker, cleaner.
2106
2121
2107 2005-01-28 Fernando Perez <fperez@colorado.edu>
2122 2005-01-28 Fernando Perez <fperez@colorado.edu>
2108
2123
2109 * scripts/ipython_win_post_install.py (install): hardcode
2124 * scripts/ipython_win_post_install.py (install): hardcode
2110 sys.prefix+'python.exe' as the executable path. It turns out that
2125 sys.prefix+'python.exe' as the executable path. It turns out that
2111 during the post-installation run, sys.executable resolves to the
2126 during the post-installation run, sys.executable resolves to the
2112 name of the binary installer! I should report this as a distutils
2127 name of the binary installer! I should report this as a distutils
2113 bug, I think. I updated the .10 release with this tiny fix, to
2128 bug, I think. I updated the .10 release with this tiny fix, to
2114 avoid annoying the lists further.
2129 avoid annoying the lists further.
2115
2130
2116 2005-01-27 *** Released version 0.6.10
2131 2005-01-27 *** Released version 0.6.10
2117
2132
2118 2005-01-27 Fernando Perez <fperez@colorado.edu>
2133 2005-01-27 Fernando Perez <fperez@colorado.edu>
2119
2134
2120 * IPython/numutils.py (norm): Added 'inf' as optional name for
2135 * IPython/numutils.py (norm): Added 'inf' as optional name for
2121 L-infinity norm, included references to mathworld.com for vector
2136 L-infinity norm, included references to mathworld.com for vector
2122 norm definitions.
2137 norm definitions.
2123 (amin/amax): added amin/amax for array min/max. Similar to what
2138 (amin/amax): added amin/amax for array min/max. Similar to what
2124 pylab ships with after the recent reorganization of names.
2139 pylab ships with after the recent reorganization of names.
2125 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2140 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2126
2141
2127 * ipython.el: committed Alex's recent fixes and improvements.
2142 * ipython.el: committed Alex's recent fixes and improvements.
2128 Tested with python-mode from CVS, and it looks excellent. Since
2143 Tested with python-mode from CVS, and it looks excellent. Since
2129 python-mode hasn't released anything in a while, I'm temporarily
2144 python-mode hasn't released anything in a while, I'm temporarily
2130 putting a copy of today's CVS (v 4.70) of python-mode in:
2145 putting a copy of today's CVS (v 4.70) of python-mode in:
2131 http://ipython.scipy.org/tmp/python-mode.el
2146 http://ipython.scipy.org/tmp/python-mode.el
2132
2147
2133 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2148 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2134 sys.executable for the executable name, instead of assuming it's
2149 sys.executable for the executable name, instead of assuming it's
2135 called 'python.exe' (the post-installer would have produced broken
2150 called 'python.exe' (the post-installer would have produced broken
2136 setups on systems with a differently named python binary).
2151 setups on systems with a differently named python binary).
2137
2152
2138 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2153 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2139 references to os.linesep, to make the code more
2154 references to os.linesep, to make the code more
2140 platform-independent. This is also part of the win32 coloring
2155 platform-independent. This is also part of the win32 coloring
2141 fixes.
2156 fixes.
2142
2157
2143 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2158 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2144 lines, which actually cause coloring bugs because the length of
2159 lines, which actually cause coloring bugs because the length of
2145 the line is very difficult to correctly compute with embedded
2160 the line is very difficult to correctly compute with embedded
2146 escapes. This was the source of all the coloring problems under
2161 escapes. This was the source of all the coloring problems under
2147 Win32. I think that _finally_, Win32 users have a properly
2162 Win32. I think that _finally_, Win32 users have a properly
2148 working ipython in all respects. This would never have happened
2163 working ipython in all respects. This would never have happened
2149 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2164 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2150
2165
2151 2005-01-26 *** Released version 0.6.9
2166 2005-01-26 *** Released version 0.6.9
2152
2167
2153 2005-01-25 Fernando Perez <fperez@colorado.edu>
2168 2005-01-25 Fernando Perez <fperez@colorado.edu>
2154
2169
2155 * setup.py: finally, we have a true Windows installer, thanks to
2170 * setup.py: finally, we have a true Windows installer, thanks to
2156 the excellent work of Viktor Ransmayr
2171 the excellent work of Viktor Ransmayr
2157 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2172 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2158 Windows users. The setup routine is quite a bit cleaner thanks to
2173 Windows users. The setup routine is quite a bit cleaner thanks to
2159 this, and the post-install script uses the proper functions to
2174 this, and the post-install script uses the proper functions to
2160 allow a clean de-installation using the standard Windows Control
2175 allow a clean de-installation using the standard Windows Control
2161 Panel.
2176 Panel.
2162
2177
2163 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2178 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2164 environment variable under all OSes (including win32) if
2179 environment variable under all OSes (including win32) if
2165 available. This will give consistency to win32 users who have set
2180 available. This will give consistency to win32 users who have set
2166 this variable for any reason. If os.environ['HOME'] fails, the
2181 this variable for any reason. If os.environ['HOME'] fails, the
2167 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2182 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2168
2183
2169 2005-01-24 Fernando Perez <fperez@colorado.edu>
2184 2005-01-24 Fernando Perez <fperez@colorado.edu>
2170
2185
2171 * IPython/numutils.py (empty_like): add empty_like(), similar to
2186 * IPython/numutils.py (empty_like): add empty_like(), similar to
2172 zeros_like() but taking advantage of the new empty() Numeric routine.
2187 zeros_like() but taking advantage of the new empty() Numeric routine.
2173
2188
2174 2005-01-23 *** Released version 0.6.8
2189 2005-01-23 *** Released version 0.6.8
2175
2190
2176 2005-01-22 Fernando Perez <fperez@colorado.edu>
2191 2005-01-22 Fernando Perez <fperez@colorado.edu>
2177
2192
2178 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2193 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2179 automatic show() calls. After discussing things with JDH, it
2194 automatic show() calls. After discussing things with JDH, it
2180 turns out there are too many corner cases where this can go wrong.
2195 turns out there are too many corner cases where this can go wrong.
2181 It's best not to try to be 'too smart', and simply have ipython
2196 It's best not to try to be 'too smart', and simply have ipython
2182 reproduce as much as possible the default behavior of a normal
2197 reproduce as much as possible the default behavior of a normal
2183 python shell.
2198 python shell.
2184
2199
2185 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2200 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2186 line-splitting regexp and _prefilter() to avoid calling getattr()
2201 line-splitting regexp and _prefilter() to avoid calling getattr()
2187 on assignments. This closes
2202 on assignments. This closes
2188 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2203 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2189 readline uses getattr(), so a simple <TAB> keypress is still
2204 readline uses getattr(), so a simple <TAB> keypress is still
2190 enough to trigger getattr() calls on an object.
2205 enough to trigger getattr() calls on an object.
2191
2206
2192 2005-01-21 Fernando Perez <fperez@colorado.edu>
2207 2005-01-21 Fernando Perez <fperez@colorado.edu>
2193
2208
2194 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2209 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2195 docstring under pylab so it doesn't mask the original.
2210 docstring under pylab so it doesn't mask the original.
2196
2211
2197 2005-01-21 *** Released version 0.6.7
2212 2005-01-21 *** Released version 0.6.7
2198
2213
2199 2005-01-21 Fernando Perez <fperez@colorado.edu>
2214 2005-01-21 Fernando Perez <fperez@colorado.edu>
2200
2215
2201 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2216 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2202 signal handling for win32 users in multithreaded mode.
2217 signal handling for win32 users in multithreaded mode.
2203
2218
2204 2005-01-17 Fernando Perez <fperez@colorado.edu>
2219 2005-01-17 Fernando Perez <fperez@colorado.edu>
2205
2220
2206 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2221 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2207 instances with no __init__. After a crash report by Norbert Nemec
2222 instances with no __init__. After a crash report by Norbert Nemec
2208 <Norbert-AT-nemec-online.de>.
2223 <Norbert-AT-nemec-online.de>.
2209
2224
2210 2005-01-14 Fernando Perez <fperez@colorado.edu>
2225 2005-01-14 Fernando Perez <fperez@colorado.edu>
2211
2226
2212 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2227 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2213 names for verbose exceptions, when multiple dotted names and the
2228 names for verbose exceptions, when multiple dotted names and the
2214 'parent' object were present on the same line.
2229 'parent' object were present on the same line.
2215
2230
2216 2005-01-11 Fernando Perez <fperez@colorado.edu>
2231 2005-01-11 Fernando Perez <fperez@colorado.edu>
2217
2232
2218 * IPython/genutils.py (flag_calls): new utility to trap and flag
2233 * IPython/genutils.py (flag_calls): new utility to trap and flag
2219 calls in functions. I need it to clean up matplotlib support.
2234 calls in functions. I need it to clean up matplotlib support.
2220 Also removed some deprecated code in genutils.
2235 Also removed some deprecated code in genutils.
2221
2236
2222 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2237 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2223 that matplotlib scripts called with %run, which don't call show()
2238 that matplotlib scripts called with %run, which don't call show()
2224 themselves, still have their plotting windows open.
2239 themselves, still have their plotting windows open.
2225
2240
2226 2005-01-05 Fernando Perez <fperez@colorado.edu>
2241 2005-01-05 Fernando Perez <fperez@colorado.edu>
2227
2242
2228 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2243 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2229 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2244 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2230
2245
2231 2004-12-19 Fernando Perez <fperez@colorado.edu>
2246 2004-12-19 Fernando Perez <fperez@colorado.edu>
2232
2247
2233 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2248 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2234 parent_runcode, which was an eyesore. The same result can be
2249 parent_runcode, which was an eyesore. The same result can be
2235 obtained with Python's regular superclass mechanisms.
2250 obtained with Python's regular superclass mechanisms.
2236
2251
2237 2004-12-17 Fernando Perez <fperez@colorado.edu>
2252 2004-12-17 Fernando Perez <fperez@colorado.edu>
2238
2253
2239 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2254 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2240 reported by Prabhu.
2255 reported by Prabhu.
2241 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2256 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2242 sys.stderr) instead of explicitly calling sys.stderr. This helps
2257 sys.stderr) instead of explicitly calling sys.stderr. This helps
2243 maintain our I/O abstractions clean, for future GUI embeddings.
2258 maintain our I/O abstractions clean, for future GUI embeddings.
2244
2259
2245 * IPython/genutils.py (info): added new utility for sys.stderr
2260 * IPython/genutils.py (info): added new utility for sys.stderr
2246 unified info message handling (thin wrapper around warn()).
2261 unified info message handling (thin wrapper around warn()).
2247
2262
2248 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2263 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2249 composite (dotted) names on verbose exceptions.
2264 composite (dotted) names on verbose exceptions.
2250 (VerboseTB.nullrepr): harden against another kind of errors which
2265 (VerboseTB.nullrepr): harden against another kind of errors which
2251 Python's inspect module can trigger, and which were crashing
2266 Python's inspect module can trigger, and which were crashing
2252 IPython. Thanks to a report by Marco Lombardi
2267 IPython. Thanks to a report by Marco Lombardi
2253 <mlombard-AT-ma010192.hq.eso.org>.
2268 <mlombard-AT-ma010192.hq.eso.org>.
2254
2269
2255 2004-12-13 *** Released version 0.6.6
2270 2004-12-13 *** Released version 0.6.6
2256
2271
2257 2004-12-12 Fernando Perez <fperez@colorado.edu>
2272 2004-12-12 Fernando Perez <fperez@colorado.edu>
2258
2273
2259 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2274 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2260 generated by pygtk upon initialization if it was built without
2275 generated by pygtk upon initialization if it was built without
2261 threads (for matplotlib users). After a crash reported by
2276 threads (for matplotlib users). After a crash reported by
2262 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2277 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2263
2278
2264 * IPython/ipmaker.py (make_IPython): fix small bug in the
2279 * IPython/ipmaker.py (make_IPython): fix small bug in the
2265 import_some parameter for multiple imports.
2280 import_some parameter for multiple imports.
2266
2281
2267 * IPython/iplib.py (ipmagic): simplified the interface of
2282 * IPython/iplib.py (ipmagic): simplified the interface of
2268 ipmagic() to take a single string argument, just as it would be
2283 ipmagic() to take a single string argument, just as it would be
2269 typed at the IPython cmd line.
2284 typed at the IPython cmd line.
2270 (ipalias): Added new ipalias() with an interface identical to
2285 (ipalias): Added new ipalias() with an interface identical to
2271 ipmagic(). This completes exposing a pure python interface to the
2286 ipmagic(). This completes exposing a pure python interface to the
2272 alias and magic system, which can be used in loops or more complex
2287 alias and magic system, which can be used in loops or more complex
2273 code where IPython's automatic line mangling is not active.
2288 code where IPython's automatic line mangling is not active.
2274
2289
2275 * IPython/genutils.py (timing): changed interface of timing to
2290 * IPython/genutils.py (timing): changed interface of timing to
2276 simply run code once, which is the most common case. timings()
2291 simply run code once, which is the most common case. timings()
2277 remains unchanged, for the cases where you want multiple runs.
2292 remains unchanged, for the cases where you want multiple runs.
2278
2293
2279 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2294 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2280 bug where Python2.2 crashes with exec'ing code which does not end
2295 bug where Python2.2 crashes with exec'ing code which does not end
2281 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2296 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2282 before.
2297 before.
2283
2298
2284 2004-12-10 Fernando Perez <fperez@colorado.edu>
2299 2004-12-10 Fernando Perez <fperez@colorado.edu>
2285
2300
2286 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2301 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2287 -t to -T, to accomodate the new -t flag in %run (the %run and
2302 -t to -T, to accomodate the new -t flag in %run (the %run and
2288 %prun options are kind of intermixed, and it's not easy to change
2303 %prun options are kind of intermixed, and it's not easy to change
2289 this with the limitations of python's getopt).
2304 this with the limitations of python's getopt).
2290
2305
2291 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2306 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2292 the execution of scripts. It's not as fine-tuned as timeit.py,
2307 the execution of scripts. It's not as fine-tuned as timeit.py,
2293 but it works from inside ipython (and under 2.2, which lacks
2308 but it works from inside ipython (and under 2.2, which lacks
2294 timeit.py). Optionally a number of runs > 1 can be given for
2309 timeit.py). Optionally a number of runs > 1 can be given for
2295 timing very short-running code.
2310 timing very short-running code.
2296
2311
2297 * IPython/genutils.py (uniq_stable): new routine which returns a
2312 * IPython/genutils.py (uniq_stable): new routine which returns a
2298 list of unique elements in any iterable, but in stable order of
2313 list of unique elements in any iterable, but in stable order of
2299 appearance. I needed this for the ultraTB fixes, and it's a handy
2314 appearance. I needed this for the ultraTB fixes, and it's a handy
2300 utility.
2315 utility.
2301
2316
2302 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2317 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2303 dotted names in Verbose exceptions. This had been broken since
2318 dotted names in Verbose exceptions. This had been broken since
2304 the very start, now x.y will properly be printed in a Verbose
2319 the very start, now x.y will properly be printed in a Verbose
2305 traceback, instead of x being shown and y appearing always as an
2320 traceback, instead of x being shown and y appearing always as an
2306 'undefined global'. Getting this to work was a bit tricky,
2321 'undefined global'. Getting this to work was a bit tricky,
2307 because by default python tokenizers are stateless. Saved by
2322 because by default python tokenizers are stateless. Saved by
2308 python's ability to easily add a bit of state to an arbitrary
2323 python's ability to easily add a bit of state to an arbitrary
2309 function (without needing to build a full-blown callable object).
2324 function (without needing to build a full-blown callable object).
2310
2325
2311 Also big cleanup of this code, which had horrendous runtime
2326 Also big cleanup of this code, which had horrendous runtime
2312 lookups of zillions of attributes for colorization. Moved all
2327 lookups of zillions of attributes for colorization. Moved all
2313 this code into a few templates, which make it cleaner and quicker.
2328 this code into a few templates, which make it cleaner and quicker.
2314
2329
2315 Printout quality was also improved for Verbose exceptions: one
2330 Printout quality was also improved for Verbose exceptions: one
2316 variable per line, and memory addresses are printed (this can be
2331 variable per line, and memory addresses are printed (this can be
2317 quite handy in nasty debugging situations, which is what Verbose
2332 quite handy in nasty debugging situations, which is what Verbose
2318 is for).
2333 is for).
2319
2334
2320 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2335 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2321 the command line as scripts to be loaded by embedded instances.
2336 the command line as scripts to be loaded by embedded instances.
2322 Doing so has the potential for an infinite recursion if there are
2337 Doing so has the potential for an infinite recursion if there are
2323 exceptions thrown in the process. This fixes a strange crash
2338 exceptions thrown in the process. This fixes a strange crash
2324 reported by Philippe MULLER <muller-AT-irit.fr>.
2339 reported by Philippe MULLER <muller-AT-irit.fr>.
2325
2340
2326 2004-12-09 Fernando Perez <fperez@colorado.edu>
2341 2004-12-09 Fernando Perez <fperez@colorado.edu>
2327
2342
2328 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2343 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2329 to reflect new names in matplotlib, which now expose the
2344 to reflect new names in matplotlib, which now expose the
2330 matlab-compatible interface via a pylab module instead of the
2345 matlab-compatible interface via a pylab module instead of the
2331 'matlab' name. The new code is backwards compatible, so users of
2346 'matlab' name. The new code is backwards compatible, so users of
2332 all matplotlib versions are OK. Patch by J. Hunter.
2347 all matplotlib versions are OK. Patch by J. Hunter.
2333
2348
2334 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2349 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2335 of __init__ docstrings for instances (class docstrings are already
2350 of __init__ docstrings for instances (class docstrings are already
2336 automatically printed). Instances with customized docstrings
2351 automatically printed). Instances with customized docstrings
2337 (indep. of the class) are also recognized and all 3 separate
2352 (indep. of the class) are also recognized and all 3 separate
2338 docstrings are printed (instance, class, constructor). After some
2353 docstrings are printed (instance, class, constructor). After some
2339 comments/suggestions by J. Hunter.
2354 comments/suggestions by J. Hunter.
2340
2355
2341 2004-12-05 Fernando Perez <fperez@colorado.edu>
2356 2004-12-05 Fernando Perez <fperez@colorado.edu>
2342
2357
2343 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2358 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2344 warnings when tab-completion fails and triggers an exception.
2359 warnings when tab-completion fails and triggers an exception.
2345
2360
2346 2004-12-03 Fernando Perez <fperez@colorado.edu>
2361 2004-12-03 Fernando Perez <fperez@colorado.edu>
2347
2362
2348 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2363 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2349 be triggered when using 'run -p'. An incorrect option flag was
2364 be triggered when using 'run -p'. An incorrect option flag was
2350 being set ('d' instead of 'D').
2365 being set ('d' instead of 'D').
2351 (manpage): fix missing escaped \- sign.
2366 (manpage): fix missing escaped \- sign.
2352
2367
2353 2004-11-30 *** Released version 0.6.5
2368 2004-11-30 *** Released version 0.6.5
2354
2369
2355 2004-11-30 Fernando Perez <fperez@colorado.edu>
2370 2004-11-30 Fernando Perez <fperez@colorado.edu>
2356
2371
2357 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2372 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2358 setting with -d option.
2373 setting with -d option.
2359
2374
2360 * setup.py (docfiles): Fix problem where the doc glob I was using
2375 * setup.py (docfiles): Fix problem where the doc glob I was using
2361 was COMPLETELY BROKEN. It was giving the right files by pure
2376 was COMPLETELY BROKEN. It was giving the right files by pure
2362 accident, but failed once I tried to include ipython.el. Note:
2377 accident, but failed once I tried to include ipython.el. Note:
2363 glob() does NOT allow you to do exclusion on multiple endings!
2378 glob() does NOT allow you to do exclusion on multiple endings!
2364
2379
2365 2004-11-29 Fernando Perez <fperez@colorado.edu>
2380 2004-11-29 Fernando Perez <fperez@colorado.edu>
2366
2381
2367 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2382 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2368 the manpage as the source. Better formatting & consistency.
2383 the manpage as the source. Better formatting & consistency.
2369
2384
2370 * IPython/Magic.py (magic_run): Added new -d option, to run
2385 * IPython/Magic.py (magic_run): Added new -d option, to run
2371 scripts under the control of the python pdb debugger. Note that
2386 scripts under the control of the python pdb debugger. Note that
2372 this required changing the %prun option -d to -D, to avoid a clash
2387 this required changing the %prun option -d to -D, to avoid a clash
2373 (since %run must pass options to %prun, and getopt is too dumb to
2388 (since %run must pass options to %prun, and getopt is too dumb to
2374 handle options with string values with embedded spaces). Thanks
2389 handle options with string values with embedded spaces). Thanks
2375 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2390 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2376 (magic_who_ls): added type matching to %who and %whos, so that one
2391 (magic_who_ls): added type matching to %who and %whos, so that one
2377 can filter their output to only include variables of certain
2392 can filter their output to only include variables of certain
2378 types. Another suggestion by Matthew.
2393 types. Another suggestion by Matthew.
2379 (magic_whos): Added memory summaries in kb and Mb for arrays.
2394 (magic_whos): Added memory summaries in kb and Mb for arrays.
2380 (magic_who): Improve formatting (break lines every 9 vars).
2395 (magic_who): Improve formatting (break lines every 9 vars).
2381
2396
2382 2004-11-28 Fernando Perez <fperez@colorado.edu>
2397 2004-11-28 Fernando Perez <fperez@colorado.edu>
2383
2398
2384 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2399 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2385 cache when empty lines were present.
2400 cache when empty lines were present.
2386
2401
2387 2004-11-24 Fernando Perez <fperez@colorado.edu>
2402 2004-11-24 Fernando Perez <fperez@colorado.edu>
2388
2403
2389 * IPython/usage.py (__doc__): document the re-activated threading
2404 * IPython/usage.py (__doc__): document the re-activated threading
2390 options for WX and GTK.
2405 options for WX and GTK.
2391
2406
2392 2004-11-23 Fernando Perez <fperez@colorado.edu>
2407 2004-11-23 Fernando Perez <fperez@colorado.edu>
2393
2408
2394 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2409 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2395 the -wthread and -gthread options, along with a new -tk one to try
2410 the -wthread and -gthread options, along with a new -tk one to try
2396 and coordinate Tk threading with wx/gtk. The tk support is very
2411 and coordinate Tk threading with wx/gtk. The tk support is very
2397 platform dependent, since it seems to require Tcl and Tk to be
2412 platform dependent, since it seems to require Tcl and Tk to be
2398 built with threads (Fedora1/2 appears NOT to have it, but in
2413 built with threads (Fedora1/2 appears NOT to have it, but in
2399 Prabhu's Debian boxes it works OK). But even with some Tk
2414 Prabhu's Debian boxes it works OK). But even with some Tk
2400 limitations, this is a great improvement.
2415 limitations, this is a great improvement.
2401
2416
2402 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2417 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2403 info in user prompts. Patch by Prabhu.
2418 info in user prompts. Patch by Prabhu.
2404
2419
2405 2004-11-18 Fernando Perez <fperez@colorado.edu>
2420 2004-11-18 Fernando Perez <fperez@colorado.edu>
2406
2421
2407 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2422 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2408 EOFErrors and bail, to avoid infinite loops if a non-terminating
2423 EOFErrors and bail, to avoid infinite loops if a non-terminating
2409 file is fed into ipython. Patch submitted in issue 19 by user,
2424 file is fed into ipython. Patch submitted in issue 19 by user,
2410 many thanks.
2425 many thanks.
2411
2426
2412 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2427 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2413 autoquote/parens in continuation prompts, which can cause lots of
2428 autoquote/parens in continuation prompts, which can cause lots of
2414 problems. Closes roundup issue 20.
2429 problems. Closes roundup issue 20.
2415
2430
2416 2004-11-17 Fernando Perez <fperez@colorado.edu>
2431 2004-11-17 Fernando Perez <fperez@colorado.edu>
2417
2432
2418 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2433 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2419 reported as debian bug #280505. I'm not sure my local changelog
2434 reported as debian bug #280505. I'm not sure my local changelog
2420 entry has the proper debian format (Jack?).
2435 entry has the proper debian format (Jack?).
2421
2436
2422 2004-11-08 *** Released version 0.6.4
2437 2004-11-08 *** Released version 0.6.4
2423
2438
2424 2004-11-08 Fernando Perez <fperez@colorado.edu>
2439 2004-11-08 Fernando Perez <fperez@colorado.edu>
2425
2440
2426 * IPython/iplib.py (init_readline): Fix exit message for Windows
2441 * IPython/iplib.py (init_readline): Fix exit message for Windows
2427 when readline is active. Thanks to a report by Eric Jones
2442 when readline is active. Thanks to a report by Eric Jones
2428 <eric-AT-enthought.com>.
2443 <eric-AT-enthought.com>.
2429
2444
2430 2004-11-07 Fernando Perez <fperez@colorado.edu>
2445 2004-11-07 Fernando Perez <fperez@colorado.edu>
2431
2446
2432 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2447 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2433 sometimes seen by win2k/cygwin users.
2448 sometimes seen by win2k/cygwin users.
2434
2449
2435 2004-11-06 Fernando Perez <fperez@colorado.edu>
2450 2004-11-06 Fernando Perez <fperez@colorado.edu>
2436
2451
2437 * IPython/iplib.py (interact): Change the handling of %Exit from
2452 * IPython/iplib.py (interact): Change the handling of %Exit from
2438 trying to propagate a SystemExit to an internal ipython flag.
2453 trying to propagate a SystemExit to an internal ipython flag.
2439 This is less elegant than using Python's exception mechanism, but
2454 This is less elegant than using Python's exception mechanism, but
2440 I can't get that to work reliably with threads, so under -pylab
2455 I can't get that to work reliably with threads, so under -pylab
2441 %Exit was hanging IPython. Cross-thread exception handling is
2456 %Exit was hanging IPython. Cross-thread exception handling is
2442 really a bitch. Thaks to a bug report by Stephen Walton
2457 really a bitch. Thaks to a bug report by Stephen Walton
2443 <stephen.walton-AT-csun.edu>.
2458 <stephen.walton-AT-csun.edu>.
2444
2459
2445 2004-11-04 Fernando Perez <fperez@colorado.edu>
2460 2004-11-04 Fernando Perez <fperez@colorado.edu>
2446
2461
2447 * IPython/iplib.py (raw_input_original): store a pointer to the
2462 * IPython/iplib.py (raw_input_original): store a pointer to the
2448 true raw_input to harden against code which can modify it
2463 true raw_input to harden against code which can modify it
2449 (wx.py.PyShell does this and would otherwise crash ipython).
2464 (wx.py.PyShell does this and would otherwise crash ipython).
2450 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2465 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2451
2466
2452 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2467 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2453 Ctrl-C problem, which does not mess up the input line.
2468 Ctrl-C problem, which does not mess up the input line.
2454
2469
2455 2004-11-03 Fernando Perez <fperez@colorado.edu>
2470 2004-11-03 Fernando Perez <fperez@colorado.edu>
2456
2471
2457 * IPython/Release.py: Changed licensing to BSD, in all files.
2472 * IPython/Release.py: Changed licensing to BSD, in all files.
2458 (name): lowercase name for tarball/RPM release.
2473 (name): lowercase name for tarball/RPM release.
2459
2474
2460 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2475 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2461 use throughout ipython.
2476 use throughout ipython.
2462
2477
2463 * IPython/Magic.py (Magic._ofind): Switch to using the new
2478 * IPython/Magic.py (Magic._ofind): Switch to using the new
2464 OInspect.getdoc() function.
2479 OInspect.getdoc() function.
2465
2480
2466 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2481 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2467 of the line currently being canceled via Ctrl-C. It's extremely
2482 of the line currently being canceled via Ctrl-C. It's extremely
2468 ugly, but I don't know how to do it better (the problem is one of
2483 ugly, but I don't know how to do it better (the problem is one of
2469 handling cross-thread exceptions).
2484 handling cross-thread exceptions).
2470
2485
2471 2004-10-28 Fernando Perez <fperez@colorado.edu>
2486 2004-10-28 Fernando Perez <fperez@colorado.edu>
2472
2487
2473 * IPython/Shell.py (signal_handler): add signal handlers to trap
2488 * IPython/Shell.py (signal_handler): add signal handlers to trap
2474 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2489 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2475 report by Francesc Alted.
2490 report by Francesc Alted.
2476
2491
2477 2004-10-21 Fernando Perez <fperez@colorado.edu>
2492 2004-10-21 Fernando Perez <fperez@colorado.edu>
2478
2493
2479 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2494 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2480 to % for pysh syntax extensions.
2495 to % for pysh syntax extensions.
2481
2496
2482 2004-10-09 Fernando Perez <fperez@colorado.edu>
2497 2004-10-09 Fernando Perez <fperez@colorado.edu>
2483
2498
2484 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2499 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2485 arrays to print a more useful summary, without calling str(arr).
2500 arrays to print a more useful summary, without calling str(arr).
2486 This avoids the problem of extremely lengthy computations which
2501 This avoids the problem of extremely lengthy computations which
2487 occur if arr is large, and appear to the user as a system lockup
2502 occur if arr is large, and appear to the user as a system lockup
2488 with 100% cpu activity. After a suggestion by Kristian Sandberg
2503 with 100% cpu activity. After a suggestion by Kristian Sandberg
2489 <Kristian.Sandberg@colorado.edu>.
2504 <Kristian.Sandberg@colorado.edu>.
2490 (Magic.__init__): fix bug in global magic escapes not being
2505 (Magic.__init__): fix bug in global magic escapes not being
2491 correctly set.
2506 correctly set.
2492
2507
2493 2004-10-08 Fernando Perez <fperez@colorado.edu>
2508 2004-10-08 Fernando Perez <fperez@colorado.edu>
2494
2509
2495 * IPython/Magic.py (__license__): change to absolute imports of
2510 * IPython/Magic.py (__license__): change to absolute imports of
2496 ipython's own internal packages, to start adapting to the absolute
2511 ipython's own internal packages, to start adapting to the absolute
2497 import requirement of PEP-328.
2512 import requirement of PEP-328.
2498
2513
2499 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2514 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2500 files, and standardize author/license marks through the Release
2515 files, and standardize author/license marks through the Release
2501 module instead of having per/file stuff (except for files with
2516 module instead of having per/file stuff (except for files with
2502 particular licenses, like the MIT/PSF-licensed codes).
2517 particular licenses, like the MIT/PSF-licensed codes).
2503
2518
2504 * IPython/Debugger.py: remove dead code for python 2.1
2519 * IPython/Debugger.py: remove dead code for python 2.1
2505
2520
2506 2004-10-04 Fernando Perez <fperez@colorado.edu>
2521 2004-10-04 Fernando Perez <fperez@colorado.edu>
2507
2522
2508 * IPython/iplib.py (ipmagic): New function for accessing magics
2523 * IPython/iplib.py (ipmagic): New function for accessing magics
2509 via a normal python function call.
2524 via a normal python function call.
2510
2525
2511 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2526 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2512 from '@' to '%', to accomodate the new @decorator syntax of python
2527 from '@' to '%', to accomodate the new @decorator syntax of python
2513 2.4.
2528 2.4.
2514
2529
2515 2004-09-29 Fernando Perez <fperez@colorado.edu>
2530 2004-09-29 Fernando Perez <fperez@colorado.edu>
2516
2531
2517 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2532 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2518 matplotlib.use to prevent running scripts which try to switch
2533 matplotlib.use to prevent running scripts which try to switch
2519 interactive backends from within ipython. This will just crash
2534 interactive backends from within ipython. This will just crash
2520 the python interpreter, so we can't allow it (but a detailed error
2535 the python interpreter, so we can't allow it (but a detailed error
2521 is given to the user).
2536 is given to the user).
2522
2537
2523 2004-09-28 Fernando Perez <fperez@colorado.edu>
2538 2004-09-28 Fernando Perez <fperez@colorado.edu>
2524
2539
2525 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2540 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2526 matplotlib-related fixes so that using @run with non-matplotlib
2541 matplotlib-related fixes so that using @run with non-matplotlib
2527 scripts doesn't pop up spurious plot windows. This requires
2542 scripts doesn't pop up spurious plot windows. This requires
2528 matplotlib >= 0.63, where I had to make some changes as well.
2543 matplotlib >= 0.63, where I had to make some changes as well.
2529
2544
2530 * IPython/ipmaker.py (make_IPython): update version requirement to
2545 * IPython/ipmaker.py (make_IPython): update version requirement to
2531 python 2.2.
2546 python 2.2.
2532
2547
2533 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2548 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2534 banner arg for embedded customization.
2549 banner arg for embedded customization.
2535
2550
2536 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2551 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2537 explicit uses of __IP as the IPython's instance name. Now things
2552 explicit uses of __IP as the IPython's instance name. Now things
2538 are properly handled via the shell.name value. The actual code
2553 are properly handled via the shell.name value. The actual code
2539 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2554 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2540 is much better than before. I'll clean things completely when the
2555 is much better than before. I'll clean things completely when the
2541 magic stuff gets a real overhaul.
2556 magic stuff gets a real overhaul.
2542
2557
2543 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2558 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2544 minor changes to debian dir.
2559 minor changes to debian dir.
2545
2560
2546 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2561 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2547 pointer to the shell itself in the interactive namespace even when
2562 pointer to the shell itself in the interactive namespace even when
2548 a user-supplied dict is provided. This is needed for embedding
2563 a user-supplied dict is provided. This is needed for embedding
2549 purposes (found by tests with Michel Sanner).
2564 purposes (found by tests with Michel Sanner).
2550
2565
2551 2004-09-27 Fernando Perez <fperez@colorado.edu>
2566 2004-09-27 Fernando Perez <fperez@colorado.edu>
2552
2567
2553 * IPython/UserConfig/ipythonrc: remove []{} from
2568 * IPython/UserConfig/ipythonrc: remove []{} from
2554 readline_remove_delims, so that things like [modname.<TAB> do
2569 readline_remove_delims, so that things like [modname.<TAB> do
2555 proper completion. This disables [].TAB, but that's a less common
2570 proper completion. This disables [].TAB, but that's a less common
2556 case than module names in list comprehensions, for example.
2571 case than module names in list comprehensions, for example.
2557 Thanks to a report by Andrea Riciputi.
2572 Thanks to a report by Andrea Riciputi.
2558
2573
2559 2004-09-09 Fernando Perez <fperez@colorado.edu>
2574 2004-09-09 Fernando Perez <fperez@colorado.edu>
2560
2575
2561 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2576 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2562 blocking problems in win32 and osx. Fix by John.
2577 blocking problems in win32 and osx. Fix by John.
2563
2578
2564 2004-09-08 Fernando Perez <fperez@colorado.edu>
2579 2004-09-08 Fernando Perez <fperez@colorado.edu>
2565
2580
2566 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2581 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2567 for Win32 and OSX. Fix by John Hunter.
2582 for Win32 and OSX. Fix by John Hunter.
2568
2583
2569 2004-08-30 *** Released version 0.6.3
2584 2004-08-30 *** Released version 0.6.3
2570
2585
2571 2004-08-30 Fernando Perez <fperez@colorado.edu>
2586 2004-08-30 Fernando Perez <fperez@colorado.edu>
2572
2587
2573 * setup.py (isfile): Add manpages to list of dependent files to be
2588 * setup.py (isfile): Add manpages to list of dependent files to be
2574 updated.
2589 updated.
2575
2590
2576 2004-08-27 Fernando Perez <fperez@colorado.edu>
2591 2004-08-27 Fernando Perez <fperez@colorado.edu>
2577
2592
2578 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2593 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2579 for now. They don't really work with standalone WX/GTK code
2594 for now. They don't really work with standalone WX/GTK code
2580 (though matplotlib IS working fine with both of those backends).
2595 (though matplotlib IS working fine with both of those backends).
2581 This will neeed much more testing. I disabled most things with
2596 This will neeed much more testing. I disabled most things with
2582 comments, so turning it back on later should be pretty easy.
2597 comments, so turning it back on later should be pretty easy.
2583
2598
2584 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2599 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2585 autocalling of expressions like r'foo', by modifying the line
2600 autocalling of expressions like r'foo', by modifying the line
2586 split regexp. Closes
2601 split regexp. Closes
2587 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2602 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2588 Riley <ipythonbugs-AT-sabi.net>.
2603 Riley <ipythonbugs-AT-sabi.net>.
2589 (InteractiveShell.mainloop): honor --nobanner with banner
2604 (InteractiveShell.mainloop): honor --nobanner with banner
2590 extensions.
2605 extensions.
2591
2606
2592 * IPython/Shell.py: Significant refactoring of all classes, so
2607 * IPython/Shell.py: Significant refactoring of all classes, so
2593 that we can really support ALL matplotlib backends and threading
2608 that we can really support ALL matplotlib backends and threading
2594 models (John spotted a bug with Tk which required this). Now we
2609 models (John spotted a bug with Tk which required this). Now we
2595 should support single-threaded, WX-threads and GTK-threads, both
2610 should support single-threaded, WX-threads and GTK-threads, both
2596 for generic code and for matplotlib.
2611 for generic code and for matplotlib.
2597
2612
2598 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2613 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2599 -pylab, to simplify things for users. Will also remove the pylab
2614 -pylab, to simplify things for users. Will also remove the pylab
2600 profile, since now all of matplotlib configuration is directly
2615 profile, since now all of matplotlib configuration is directly
2601 handled here. This also reduces startup time.
2616 handled here. This also reduces startup time.
2602
2617
2603 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2618 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2604 shell wasn't being correctly called. Also in IPShellWX.
2619 shell wasn't being correctly called. Also in IPShellWX.
2605
2620
2606 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2621 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2607 fine-tune banner.
2622 fine-tune banner.
2608
2623
2609 * IPython/numutils.py (spike): Deprecate these spike functions,
2624 * IPython/numutils.py (spike): Deprecate these spike functions,
2610 delete (long deprecated) gnuplot_exec handler.
2625 delete (long deprecated) gnuplot_exec handler.
2611
2626
2612 2004-08-26 Fernando Perez <fperez@colorado.edu>
2627 2004-08-26 Fernando Perez <fperez@colorado.edu>
2613
2628
2614 * ipython.1: Update for threading options, plus some others which
2629 * ipython.1: Update for threading options, plus some others which
2615 were missing.
2630 were missing.
2616
2631
2617 * IPython/ipmaker.py (__call__): Added -wthread option for
2632 * IPython/ipmaker.py (__call__): Added -wthread option for
2618 wxpython thread handling. Make sure threading options are only
2633 wxpython thread handling. Make sure threading options are only
2619 valid at the command line.
2634 valid at the command line.
2620
2635
2621 * scripts/ipython: moved shell selection into a factory function
2636 * scripts/ipython: moved shell selection into a factory function
2622 in Shell.py, to keep the starter script to a minimum.
2637 in Shell.py, to keep the starter script to a minimum.
2623
2638
2624 2004-08-25 Fernando Perez <fperez@colorado.edu>
2639 2004-08-25 Fernando Perez <fperez@colorado.edu>
2625
2640
2626 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2641 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2627 John. Along with some recent changes he made to matplotlib, the
2642 John. Along with some recent changes he made to matplotlib, the
2628 next versions of both systems should work very well together.
2643 next versions of both systems should work very well together.
2629
2644
2630 2004-08-24 Fernando Perez <fperez@colorado.edu>
2645 2004-08-24 Fernando Perez <fperez@colorado.edu>
2631
2646
2632 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2647 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2633 tried to switch the profiling to using hotshot, but I'm getting
2648 tried to switch the profiling to using hotshot, but I'm getting
2634 strange errors from prof.runctx() there. I may be misreading the
2649 strange errors from prof.runctx() there. I may be misreading the
2635 docs, but it looks weird. For now the profiling code will
2650 docs, but it looks weird. For now the profiling code will
2636 continue to use the standard profiler.
2651 continue to use the standard profiler.
2637
2652
2638 2004-08-23 Fernando Perez <fperez@colorado.edu>
2653 2004-08-23 Fernando Perez <fperez@colorado.edu>
2639
2654
2640 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2655 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2641 threaded shell, by John Hunter. It's not quite ready yet, but
2656 threaded shell, by John Hunter. It's not quite ready yet, but
2642 close.
2657 close.
2643
2658
2644 2004-08-22 Fernando Perez <fperez@colorado.edu>
2659 2004-08-22 Fernando Perez <fperez@colorado.edu>
2645
2660
2646 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2661 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2647 in Magic and ultraTB.
2662 in Magic and ultraTB.
2648
2663
2649 * ipython.1: document threading options in manpage.
2664 * ipython.1: document threading options in manpage.
2650
2665
2651 * scripts/ipython: Changed name of -thread option to -gthread,
2666 * scripts/ipython: Changed name of -thread option to -gthread,
2652 since this is GTK specific. I want to leave the door open for a
2667 since this is GTK specific. I want to leave the door open for a
2653 -wthread option for WX, which will most likely be necessary. This
2668 -wthread option for WX, which will most likely be necessary. This
2654 change affects usage and ipmaker as well.
2669 change affects usage and ipmaker as well.
2655
2670
2656 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2671 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2657 handle the matplotlib shell issues. Code by John Hunter
2672 handle the matplotlib shell issues. Code by John Hunter
2658 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2673 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2659 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2674 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2660 broken (and disabled for end users) for now, but it puts the
2675 broken (and disabled for end users) for now, but it puts the
2661 infrastructure in place.
2676 infrastructure in place.
2662
2677
2663 2004-08-21 Fernando Perez <fperez@colorado.edu>
2678 2004-08-21 Fernando Perez <fperez@colorado.edu>
2664
2679
2665 * ipythonrc-pylab: Add matplotlib support.
2680 * ipythonrc-pylab: Add matplotlib support.
2666
2681
2667 * matplotlib_config.py: new files for matplotlib support, part of
2682 * matplotlib_config.py: new files for matplotlib support, part of
2668 the pylab profile.
2683 the pylab profile.
2669
2684
2670 * IPython/usage.py (__doc__): documented the threading options.
2685 * IPython/usage.py (__doc__): documented the threading options.
2671
2686
2672 2004-08-20 Fernando Perez <fperez@colorado.edu>
2687 2004-08-20 Fernando Perez <fperez@colorado.edu>
2673
2688
2674 * ipython: Modified the main calling routine to handle the -thread
2689 * ipython: Modified the main calling routine to handle the -thread
2675 and -mpthread options. This needs to be done as a top-level hack,
2690 and -mpthread options. This needs to be done as a top-level hack,
2676 because it determines which class to instantiate for IPython
2691 because it determines which class to instantiate for IPython
2677 itself.
2692 itself.
2678
2693
2679 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2694 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2680 classes to support multithreaded GTK operation without blocking,
2695 classes to support multithreaded GTK operation without blocking,
2681 and matplotlib with all backends. This is a lot of still very
2696 and matplotlib with all backends. This is a lot of still very
2682 experimental code, and threads are tricky. So it may still have a
2697 experimental code, and threads are tricky. So it may still have a
2683 few rough edges... This code owes a lot to
2698 few rough edges... This code owes a lot to
2684 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2699 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2685 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2700 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2686 to John Hunter for all the matplotlib work.
2701 to John Hunter for all the matplotlib work.
2687
2702
2688 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2703 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2689 options for gtk thread and matplotlib support.
2704 options for gtk thread and matplotlib support.
2690
2705
2691 2004-08-16 Fernando Perez <fperez@colorado.edu>
2706 2004-08-16 Fernando Perez <fperez@colorado.edu>
2692
2707
2693 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2708 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2694 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2709 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2695 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2710 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2696
2711
2697 2004-08-11 Fernando Perez <fperez@colorado.edu>
2712 2004-08-11 Fernando Perez <fperez@colorado.edu>
2698
2713
2699 * setup.py (isfile): Fix build so documentation gets updated for
2714 * setup.py (isfile): Fix build so documentation gets updated for
2700 rpms (it was only done for .tgz builds).
2715 rpms (it was only done for .tgz builds).
2701
2716
2702 2004-08-10 Fernando Perez <fperez@colorado.edu>
2717 2004-08-10 Fernando Perez <fperez@colorado.edu>
2703
2718
2704 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2719 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2705
2720
2706 * iplib.py : Silence syntax error exceptions in tab-completion.
2721 * iplib.py : Silence syntax error exceptions in tab-completion.
2707
2722
2708 2004-08-05 Fernando Perez <fperez@colorado.edu>
2723 2004-08-05 Fernando Perez <fperez@colorado.edu>
2709
2724
2710 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2725 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2711 'color off' mark for continuation prompts. This was causing long
2726 'color off' mark for continuation prompts. This was causing long
2712 continuation lines to mis-wrap.
2727 continuation lines to mis-wrap.
2713
2728
2714 2004-08-01 Fernando Perez <fperez@colorado.edu>
2729 2004-08-01 Fernando Perez <fperez@colorado.edu>
2715
2730
2716 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2731 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2717 for building ipython to be a parameter. All this is necessary
2732 for building ipython to be a parameter. All this is necessary
2718 right now to have a multithreaded version, but this insane
2733 right now to have a multithreaded version, but this insane
2719 non-design will be cleaned up soon. For now, it's a hack that
2734 non-design will be cleaned up soon. For now, it's a hack that
2720 works.
2735 works.
2721
2736
2722 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2737 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2723 args in various places. No bugs so far, but it's a dangerous
2738 args in various places. No bugs so far, but it's a dangerous
2724 practice.
2739 practice.
2725
2740
2726 2004-07-31 Fernando Perez <fperez@colorado.edu>
2741 2004-07-31 Fernando Perez <fperez@colorado.edu>
2727
2742
2728 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2743 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2729 fix completion of files with dots in their names under most
2744 fix completion of files with dots in their names under most
2730 profiles (pysh was OK because the completion order is different).
2745 profiles (pysh was OK because the completion order is different).
2731
2746
2732 2004-07-27 Fernando Perez <fperez@colorado.edu>
2747 2004-07-27 Fernando Perez <fperez@colorado.edu>
2733
2748
2734 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2749 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2735 keywords manually, b/c the one in keyword.py was removed in python
2750 keywords manually, b/c the one in keyword.py was removed in python
2736 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2751 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2737 This is NOT a bug under python 2.3 and earlier.
2752 This is NOT a bug under python 2.3 and earlier.
2738
2753
2739 2004-07-26 Fernando Perez <fperez@colorado.edu>
2754 2004-07-26 Fernando Perez <fperez@colorado.edu>
2740
2755
2741 * IPython/ultraTB.py (VerboseTB.text): Add another
2756 * IPython/ultraTB.py (VerboseTB.text): Add another
2742 linecache.checkcache() call to try to prevent inspect.py from
2757 linecache.checkcache() call to try to prevent inspect.py from
2743 crashing under python 2.3. I think this fixes
2758 crashing under python 2.3. I think this fixes
2744 http://www.scipy.net/roundup/ipython/issue17.
2759 http://www.scipy.net/roundup/ipython/issue17.
2745
2760
2746 2004-07-26 *** Released version 0.6.2
2761 2004-07-26 *** Released version 0.6.2
2747
2762
2748 2004-07-26 Fernando Perez <fperez@colorado.edu>
2763 2004-07-26 Fernando Perez <fperez@colorado.edu>
2749
2764
2750 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2765 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2751 fail for any number.
2766 fail for any number.
2752 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2767 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2753 empty bookmarks.
2768 empty bookmarks.
2754
2769
2755 2004-07-26 *** Released version 0.6.1
2770 2004-07-26 *** Released version 0.6.1
2756
2771
2757 2004-07-26 Fernando Perez <fperez@colorado.edu>
2772 2004-07-26 Fernando Perez <fperez@colorado.edu>
2758
2773
2759 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2774 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2760
2775
2761 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2776 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2762 escaping '()[]{}' in filenames.
2777 escaping '()[]{}' in filenames.
2763
2778
2764 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2779 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2765 Python 2.2 users who lack a proper shlex.split.
2780 Python 2.2 users who lack a proper shlex.split.
2766
2781
2767 2004-07-19 Fernando Perez <fperez@colorado.edu>
2782 2004-07-19 Fernando Perez <fperez@colorado.edu>
2768
2783
2769 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2784 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2770 for reading readline's init file. I follow the normal chain:
2785 for reading readline's init file. I follow the normal chain:
2771 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2786 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2772 report by Mike Heeter. This closes
2787 report by Mike Heeter. This closes
2773 http://www.scipy.net/roundup/ipython/issue16.
2788 http://www.scipy.net/roundup/ipython/issue16.
2774
2789
2775 2004-07-18 Fernando Perez <fperez@colorado.edu>
2790 2004-07-18 Fernando Perez <fperez@colorado.edu>
2776
2791
2777 * IPython/iplib.py (__init__): Add better handling of '\' under
2792 * IPython/iplib.py (__init__): Add better handling of '\' under
2778 Win32 for filenames. After a patch by Ville.
2793 Win32 for filenames. After a patch by Ville.
2779
2794
2780 2004-07-17 Fernando Perez <fperez@colorado.edu>
2795 2004-07-17 Fernando Perez <fperez@colorado.edu>
2781
2796
2782 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2797 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2783 autocalling would be triggered for 'foo is bar' if foo is
2798 autocalling would be triggered for 'foo is bar' if foo is
2784 callable. I also cleaned up the autocall detection code to use a
2799 callable. I also cleaned up the autocall detection code to use a
2785 regexp, which is faster. Bug reported by Alexander Schmolck.
2800 regexp, which is faster. Bug reported by Alexander Schmolck.
2786
2801
2787 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2802 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2788 '?' in them would confuse the help system. Reported by Alex
2803 '?' in them would confuse the help system. Reported by Alex
2789 Schmolck.
2804 Schmolck.
2790
2805
2791 2004-07-16 Fernando Perez <fperez@colorado.edu>
2806 2004-07-16 Fernando Perez <fperez@colorado.edu>
2792
2807
2793 * IPython/GnuplotInteractive.py (__all__): added plot2.
2808 * IPython/GnuplotInteractive.py (__all__): added plot2.
2794
2809
2795 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2810 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2796 plotting dictionaries, lists or tuples of 1d arrays.
2811 plotting dictionaries, lists or tuples of 1d arrays.
2797
2812
2798 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2813 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2799 optimizations.
2814 optimizations.
2800
2815
2801 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2816 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2802 the information which was there from Janko's original IPP code:
2817 the information which was there from Janko's original IPP code:
2803
2818
2804 03.05.99 20:53 porto.ifm.uni-kiel.de
2819 03.05.99 20:53 porto.ifm.uni-kiel.de
2805 --Started changelog.
2820 --Started changelog.
2806 --make clear do what it say it does
2821 --make clear do what it say it does
2807 --added pretty output of lines from inputcache
2822 --added pretty output of lines from inputcache
2808 --Made Logger a mixin class, simplifies handling of switches
2823 --Made Logger a mixin class, simplifies handling of switches
2809 --Added own completer class. .string<TAB> expands to last history
2824 --Added own completer class. .string<TAB> expands to last history
2810 line which starts with string. The new expansion is also present
2825 line which starts with string. The new expansion is also present
2811 with Ctrl-r from the readline library. But this shows, who this
2826 with Ctrl-r from the readline library. But this shows, who this
2812 can be done for other cases.
2827 can be done for other cases.
2813 --Added convention that all shell functions should accept a
2828 --Added convention that all shell functions should accept a
2814 parameter_string This opens the door for different behaviour for
2829 parameter_string This opens the door for different behaviour for
2815 each function. @cd is a good example of this.
2830 each function. @cd is a good example of this.
2816
2831
2817 04.05.99 12:12 porto.ifm.uni-kiel.de
2832 04.05.99 12:12 porto.ifm.uni-kiel.de
2818 --added logfile rotation
2833 --added logfile rotation
2819 --added new mainloop method which freezes first the namespace
2834 --added new mainloop method which freezes first the namespace
2820
2835
2821 07.05.99 21:24 porto.ifm.uni-kiel.de
2836 07.05.99 21:24 porto.ifm.uni-kiel.de
2822 --added the docreader classes. Now there is a help system.
2837 --added the docreader classes. Now there is a help system.
2823 -This is only a first try. Currently it's not easy to put new
2838 -This is only a first try. Currently it's not easy to put new
2824 stuff in the indices. But this is the way to go. Info would be
2839 stuff in the indices. But this is the way to go. Info would be
2825 better, but HTML is every where and not everybody has an info
2840 better, but HTML is every where and not everybody has an info
2826 system installed and it's not so easy to change html-docs to info.
2841 system installed and it's not so easy to change html-docs to info.
2827 --added global logfile option
2842 --added global logfile option
2828 --there is now a hook for object inspection method pinfo needs to
2843 --there is now a hook for object inspection method pinfo needs to
2829 be provided for this. Can be reached by two '??'.
2844 be provided for this. Can be reached by two '??'.
2830
2845
2831 08.05.99 20:51 porto.ifm.uni-kiel.de
2846 08.05.99 20:51 porto.ifm.uni-kiel.de
2832 --added a README
2847 --added a README
2833 --bug in rc file. Something has changed so functions in the rc
2848 --bug in rc file. Something has changed so functions in the rc
2834 file need to reference the shell and not self. Not clear if it's a
2849 file need to reference the shell and not self. Not clear if it's a
2835 bug or feature.
2850 bug or feature.
2836 --changed rc file for new behavior
2851 --changed rc file for new behavior
2837
2852
2838 2004-07-15 Fernando Perez <fperez@colorado.edu>
2853 2004-07-15 Fernando Perez <fperez@colorado.edu>
2839
2854
2840 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2855 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2841 cache was falling out of sync in bizarre manners when multi-line
2856 cache was falling out of sync in bizarre manners when multi-line
2842 input was present. Minor optimizations and cleanup.
2857 input was present. Minor optimizations and cleanup.
2843
2858
2844 (Logger): Remove old Changelog info for cleanup. This is the
2859 (Logger): Remove old Changelog info for cleanup. This is the
2845 information which was there from Janko's original code:
2860 information which was there from Janko's original code:
2846
2861
2847 Changes to Logger: - made the default log filename a parameter
2862 Changes to Logger: - made the default log filename a parameter
2848
2863
2849 - put a check for lines beginning with !@? in log(). Needed
2864 - put a check for lines beginning with !@? in log(). Needed
2850 (even if the handlers properly log their lines) for mid-session
2865 (even if the handlers properly log their lines) for mid-session
2851 logging activation to work properly. Without this, lines logged
2866 logging activation to work properly. Without this, lines logged
2852 in mid session, which get read from the cache, would end up
2867 in mid session, which get read from the cache, would end up
2853 'bare' (with !@? in the open) in the log. Now they are caught
2868 'bare' (with !@? in the open) in the log. Now they are caught
2854 and prepended with a #.
2869 and prepended with a #.
2855
2870
2856 * IPython/iplib.py (InteractiveShell.init_readline): added check
2871 * IPython/iplib.py (InteractiveShell.init_readline): added check
2857 in case MagicCompleter fails to be defined, so we don't crash.
2872 in case MagicCompleter fails to be defined, so we don't crash.
2858
2873
2859 2004-07-13 Fernando Perez <fperez@colorado.edu>
2874 2004-07-13 Fernando Perez <fperez@colorado.edu>
2860
2875
2861 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2876 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2862 of EPS if the requested filename ends in '.eps'.
2877 of EPS if the requested filename ends in '.eps'.
2863
2878
2864 2004-07-04 Fernando Perez <fperez@colorado.edu>
2879 2004-07-04 Fernando Perez <fperez@colorado.edu>
2865
2880
2866 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2881 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2867 escaping of quotes when calling the shell.
2882 escaping of quotes when calling the shell.
2868
2883
2869 2004-07-02 Fernando Perez <fperez@colorado.edu>
2884 2004-07-02 Fernando Perez <fperez@colorado.edu>
2870
2885
2871 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2886 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2872 gettext not working because we were clobbering '_'. Fixes
2887 gettext not working because we were clobbering '_'. Fixes
2873 http://www.scipy.net/roundup/ipython/issue6.
2888 http://www.scipy.net/roundup/ipython/issue6.
2874
2889
2875 2004-07-01 Fernando Perez <fperez@colorado.edu>
2890 2004-07-01 Fernando Perez <fperez@colorado.edu>
2876
2891
2877 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2892 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2878 into @cd. Patch by Ville.
2893 into @cd. Patch by Ville.
2879
2894
2880 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2895 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2881 new function to store things after ipmaker runs. Patch by Ville.
2896 new function to store things after ipmaker runs. Patch by Ville.
2882 Eventually this will go away once ipmaker is removed and the class
2897 Eventually this will go away once ipmaker is removed and the class
2883 gets cleaned up, but for now it's ok. Key functionality here is
2898 gets cleaned up, but for now it's ok. Key functionality here is
2884 the addition of the persistent storage mechanism, a dict for
2899 the addition of the persistent storage mechanism, a dict for
2885 keeping data across sessions (for now just bookmarks, but more can
2900 keeping data across sessions (for now just bookmarks, but more can
2886 be implemented later).
2901 be implemented later).
2887
2902
2888 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2903 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2889 persistent across sections. Patch by Ville, I modified it
2904 persistent across sections. Patch by Ville, I modified it
2890 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2905 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2891 added a '-l' option to list all bookmarks.
2906 added a '-l' option to list all bookmarks.
2892
2907
2893 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2908 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2894 center for cleanup. Registered with atexit.register(). I moved
2909 center for cleanup. Registered with atexit.register(). I moved
2895 here the old exit_cleanup(). After a patch by Ville.
2910 here the old exit_cleanup(). After a patch by Ville.
2896
2911
2897 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2912 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2898 characters in the hacked shlex_split for python 2.2.
2913 characters in the hacked shlex_split for python 2.2.
2899
2914
2900 * IPython/iplib.py (file_matches): more fixes to filenames with
2915 * IPython/iplib.py (file_matches): more fixes to filenames with
2901 whitespace in them. It's not perfect, but limitations in python's
2916 whitespace in them. It's not perfect, but limitations in python's
2902 readline make it impossible to go further.
2917 readline make it impossible to go further.
2903
2918
2904 2004-06-29 Fernando Perez <fperez@colorado.edu>
2919 2004-06-29 Fernando Perez <fperez@colorado.edu>
2905
2920
2906 * IPython/iplib.py (file_matches): escape whitespace correctly in
2921 * IPython/iplib.py (file_matches): escape whitespace correctly in
2907 filename completions. Bug reported by Ville.
2922 filename completions. Bug reported by Ville.
2908
2923
2909 2004-06-28 Fernando Perez <fperez@colorado.edu>
2924 2004-06-28 Fernando Perez <fperez@colorado.edu>
2910
2925
2911 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2926 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2912 the history file will be called 'history-PROFNAME' (or just
2927 the history file will be called 'history-PROFNAME' (or just
2913 'history' if no profile is loaded). I was getting annoyed at
2928 'history' if no profile is loaded). I was getting annoyed at
2914 getting my Numerical work history clobbered by pysh sessions.
2929 getting my Numerical work history clobbered by pysh sessions.
2915
2930
2916 * IPython/iplib.py (InteractiveShell.__init__): Internal
2931 * IPython/iplib.py (InteractiveShell.__init__): Internal
2917 getoutputerror() function so that we can honor the system_verbose
2932 getoutputerror() function so that we can honor the system_verbose
2918 flag for _all_ system calls. I also added escaping of #
2933 flag for _all_ system calls. I also added escaping of #
2919 characters here to avoid confusing Itpl.
2934 characters here to avoid confusing Itpl.
2920
2935
2921 * IPython/Magic.py (shlex_split): removed call to shell in
2936 * IPython/Magic.py (shlex_split): removed call to shell in
2922 parse_options and replaced it with shlex.split(). The annoying
2937 parse_options and replaced it with shlex.split(). The annoying
2923 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2938 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2924 to backport it from 2.3, with several frail hacks (the shlex
2939 to backport it from 2.3, with several frail hacks (the shlex
2925 module is rather limited in 2.2). Thanks to a suggestion by Ville
2940 module is rather limited in 2.2). Thanks to a suggestion by Ville
2926 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2941 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2927 problem.
2942 problem.
2928
2943
2929 (Magic.magic_system_verbose): new toggle to print the actual
2944 (Magic.magic_system_verbose): new toggle to print the actual
2930 system calls made by ipython. Mainly for debugging purposes.
2945 system calls made by ipython. Mainly for debugging purposes.
2931
2946
2932 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2947 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2933 doesn't support persistence. Reported (and fix suggested) by
2948 doesn't support persistence. Reported (and fix suggested) by
2934 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2949 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2935
2950
2936 2004-06-26 Fernando Perez <fperez@colorado.edu>
2951 2004-06-26 Fernando Perez <fperez@colorado.edu>
2937
2952
2938 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2953 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2939 continue prompts.
2954 continue prompts.
2940
2955
2941 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2956 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2942 function (basically a big docstring) and a few more things here to
2957 function (basically a big docstring) and a few more things here to
2943 speedup startup. pysh.py is now very lightweight. We want because
2958 speedup startup. pysh.py is now very lightweight. We want because
2944 it gets execfile'd, while InterpreterExec gets imported, so
2959 it gets execfile'd, while InterpreterExec gets imported, so
2945 byte-compilation saves time.
2960 byte-compilation saves time.
2946
2961
2947 2004-06-25 Fernando Perez <fperez@colorado.edu>
2962 2004-06-25 Fernando Perez <fperez@colorado.edu>
2948
2963
2949 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2964 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2950 -NUM', which was recently broken.
2965 -NUM', which was recently broken.
2951
2966
2952 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2967 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2953 in multi-line input (but not !!, which doesn't make sense there).
2968 in multi-line input (but not !!, which doesn't make sense there).
2954
2969
2955 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2970 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2956 It's just too useful, and people can turn it off in the less
2971 It's just too useful, and people can turn it off in the less
2957 common cases where it's a problem.
2972 common cases where it's a problem.
2958
2973
2959 2004-06-24 Fernando Perez <fperez@colorado.edu>
2974 2004-06-24 Fernando Perez <fperez@colorado.edu>
2960
2975
2961 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2976 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2962 special syntaxes (like alias calling) is now allied in multi-line
2977 special syntaxes (like alias calling) is now allied in multi-line
2963 input. This is still _very_ experimental, but it's necessary for
2978 input. This is still _very_ experimental, but it's necessary for
2964 efficient shell usage combining python looping syntax with system
2979 efficient shell usage combining python looping syntax with system
2965 calls. For now it's restricted to aliases, I don't think it
2980 calls. For now it's restricted to aliases, I don't think it
2966 really even makes sense to have this for magics.
2981 really even makes sense to have this for magics.
2967
2982
2968 2004-06-23 Fernando Perez <fperez@colorado.edu>
2983 2004-06-23 Fernando Perez <fperez@colorado.edu>
2969
2984
2970 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2985 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2971 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2986 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2972
2987
2973 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2988 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2974 extensions under Windows (after code sent by Gary Bishop). The
2989 extensions under Windows (after code sent by Gary Bishop). The
2975 extensions considered 'executable' are stored in IPython's rc
2990 extensions considered 'executable' are stored in IPython's rc
2976 structure as win_exec_ext.
2991 structure as win_exec_ext.
2977
2992
2978 * IPython/genutils.py (shell): new function, like system() but
2993 * IPython/genutils.py (shell): new function, like system() but
2979 without return value. Very useful for interactive shell work.
2994 without return value. Very useful for interactive shell work.
2980
2995
2981 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2996 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2982 delete aliases.
2997 delete aliases.
2983
2998
2984 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2999 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2985 sure that the alias table doesn't contain python keywords.
3000 sure that the alias table doesn't contain python keywords.
2986
3001
2987 2004-06-21 Fernando Perez <fperez@colorado.edu>
3002 2004-06-21 Fernando Perez <fperez@colorado.edu>
2988
3003
2989 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3004 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2990 non-existent items are found in $PATH. Reported by Thorsten.
3005 non-existent items are found in $PATH. Reported by Thorsten.
2991
3006
2992 2004-06-20 Fernando Perez <fperez@colorado.edu>
3007 2004-06-20 Fernando Perez <fperez@colorado.edu>
2993
3008
2994 * IPython/iplib.py (complete): modified the completer so that the
3009 * IPython/iplib.py (complete): modified the completer so that the
2995 order of priorities can be easily changed at runtime.
3010 order of priorities can be easily changed at runtime.
2996
3011
2997 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3012 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2998 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3013 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2999
3014
3000 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3015 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3001 expand Python variables prepended with $ in all system calls. The
3016 expand Python variables prepended with $ in all system calls. The
3002 same was done to InteractiveShell.handle_shell_escape. Now all
3017 same was done to InteractiveShell.handle_shell_escape. Now all
3003 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3018 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3004 expansion of python variables and expressions according to the
3019 expansion of python variables and expressions according to the
3005 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3020 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3006
3021
3007 Though PEP-215 has been rejected, a similar (but simpler) one
3022 Though PEP-215 has been rejected, a similar (but simpler) one
3008 seems like it will go into Python 2.4, PEP-292 -
3023 seems like it will go into Python 2.4, PEP-292 -
3009 http://www.python.org/peps/pep-0292.html.
3024 http://www.python.org/peps/pep-0292.html.
3010
3025
3011 I'll keep the full syntax of PEP-215, since IPython has since the
3026 I'll keep the full syntax of PEP-215, since IPython has since the
3012 start used Ka-Ping Yee's reference implementation discussed there
3027 start used Ka-Ping Yee's reference implementation discussed there
3013 (Itpl), and I actually like the powerful semantics it offers.
3028 (Itpl), and I actually like the powerful semantics it offers.
3014
3029
3015 In order to access normal shell variables, the $ has to be escaped
3030 In order to access normal shell variables, the $ has to be escaped
3016 via an extra $. For example:
3031 via an extra $. For example:
3017
3032
3018 In [7]: PATH='a python variable'
3033 In [7]: PATH='a python variable'
3019
3034
3020 In [8]: !echo $PATH
3035 In [8]: !echo $PATH
3021 a python variable
3036 a python variable
3022
3037
3023 In [9]: !echo $$PATH
3038 In [9]: !echo $$PATH
3024 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3039 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3025
3040
3026 (Magic.parse_options): escape $ so the shell doesn't evaluate
3041 (Magic.parse_options): escape $ so the shell doesn't evaluate
3027 things prematurely.
3042 things prematurely.
3028
3043
3029 * IPython/iplib.py (InteractiveShell.call_alias): added the
3044 * IPython/iplib.py (InteractiveShell.call_alias): added the
3030 ability for aliases to expand python variables via $.
3045 ability for aliases to expand python variables via $.
3031
3046
3032 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3047 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3033 system, now there's a @rehash/@rehashx pair of magics. These work
3048 system, now there's a @rehash/@rehashx pair of magics. These work
3034 like the csh rehash command, and can be invoked at any time. They
3049 like the csh rehash command, and can be invoked at any time. They
3035 build a table of aliases to everything in the user's $PATH
3050 build a table of aliases to everything in the user's $PATH
3036 (@rehash uses everything, @rehashx is slower but only adds
3051 (@rehash uses everything, @rehashx is slower but only adds
3037 executable files). With this, the pysh.py-based shell profile can
3052 executable files). With this, the pysh.py-based shell profile can
3038 now simply call rehash upon startup, and full access to all
3053 now simply call rehash upon startup, and full access to all
3039 programs in the user's path is obtained.
3054 programs in the user's path is obtained.
3040
3055
3041 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3056 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3042 functionality is now fully in place. I removed the old dynamic
3057 functionality is now fully in place. I removed the old dynamic
3043 code generation based approach, in favor of a much lighter one
3058 code generation based approach, in favor of a much lighter one
3044 based on a simple dict. The advantage is that this allows me to
3059 based on a simple dict. The advantage is that this allows me to
3045 now have thousands of aliases with negligible cost (unthinkable
3060 now have thousands of aliases with negligible cost (unthinkable
3046 with the old system).
3061 with the old system).
3047
3062
3048 2004-06-19 Fernando Perez <fperez@colorado.edu>
3063 2004-06-19 Fernando Perez <fperez@colorado.edu>
3049
3064
3050 * IPython/iplib.py (__init__): extended MagicCompleter class to
3065 * IPython/iplib.py (__init__): extended MagicCompleter class to
3051 also complete (last in priority) on user aliases.
3066 also complete (last in priority) on user aliases.
3052
3067
3053 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3068 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3054 call to eval.
3069 call to eval.
3055 (ItplNS.__init__): Added a new class which functions like Itpl,
3070 (ItplNS.__init__): Added a new class which functions like Itpl,
3056 but allows configuring the namespace for the evaluation to occur
3071 but allows configuring the namespace for the evaluation to occur
3057 in.
3072 in.
3058
3073
3059 2004-06-18 Fernando Perez <fperez@colorado.edu>
3074 2004-06-18 Fernando Perez <fperez@colorado.edu>
3060
3075
3061 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3076 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3062 better message when 'exit' or 'quit' are typed (a common newbie
3077 better message when 'exit' or 'quit' are typed (a common newbie
3063 confusion).
3078 confusion).
3064
3079
3065 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3080 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3066 check for Windows users.
3081 check for Windows users.
3067
3082
3068 * IPython/iplib.py (InteractiveShell.user_setup): removed
3083 * IPython/iplib.py (InteractiveShell.user_setup): removed
3069 disabling of colors for Windows. I'll test at runtime and issue a
3084 disabling of colors for Windows. I'll test at runtime and issue a
3070 warning if Gary's readline isn't found, as to nudge users to
3085 warning if Gary's readline isn't found, as to nudge users to
3071 download it.
3086 download it.
3072
3087
3073 2004-06-16 Fernando Perez <fperez@colorado.edu>
3088 2004-06-16 Fernando Perez <fperez@colorado.edu>
3074
3089
3075 * IPython/genutils.py (Stream.__init__): changed to print errors
3090 * IPython/genutils.py (Stream.__init__): changed to print errors
3076 to sys.stderr. I had a circular dependency here. Now it's
3091 to sys.stderr. I had a circular dependency here. Now it's
3077 possible to run ipython as IDLE's shell (consider this pre-alpha,
3092 possible to run ipython as IDLE's shell (consider this pre-alpha,
3078 since true stdout things end up in the starting terminal instead
3093 since true stdout things end up in the starting terminal instead
3079 of IDLE's out).
3094 of IDLE's out).
3080
3095
3081 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3096 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3082 users who haven't # updated their prompt_in2 definitions. Remove
3097 users who haven't # updated their prompt_in2 definitions. Remove
3083 eventually.
3098 eventually.
3084 (multiple_replace): added credit to original ASPN recipe.
3099 (multiple_replace): added credit to original ASPN recipe.
3085
3100
3086 2004-06-15 Fernando Perez <fperez@colorado.edu>
3101 2004-06-15 Fernando Perez <fperez@colorado.edu>
3087
3102
3088 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3103 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3089 list of auto-defined aliases.
3104 list of auto-defined aliases.
3090
3105
3091 2004-06-13 Fernando Perez <fperez@colorado.edu>
3106 2004-06-13 Fernando Perez <fperez@colorado.edu>
3092
3107
3093 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3108 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3094 install was really requested (so setup.py can be used for other
3109 install was really requested (so setup.py can be used for other
3095 things under Windows).
3110 things under Windows).
3096
3111
3097 2004-06-10 Fernando Perez <fperez@colorado.edu>
3112 2004-06-10 Fernando Perez <fperez@colorado.edu>
3098
3113
3099 * IPython/Logger.py (Logger.create_log): Manually remove any old
3114 * IPython/Logger.py (Logger.create_log): Manually remove any old
3100 backup, since os.remove may fail under Windows. Fixes bug
3115 backup, since os.remove may fail under Windows. Fixes bug
3101 reported by Thorsten.
3116 reported by Thorsten.
3102
3117
3103 2004-06-09 Fernando Perez <fperez@colorado.edu>
3118 2004-06-09 Fernando Perez <fperez@colorado.edu>
3104
3119
3105 * examples/example-embed.py: fixed all references to %n (replaced
3120 * examples/example-embed.py: fixed all references to %n (replaced
3106 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3121 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3107 for all examples and the manual as well.
3122 for all examples and the manual as well.
3108
3123
3109 2004-06-08 Fernando Perez <fperez@colorado.edu>
3124 2004-06-08 Fernando Perez <fperez@colorado.edu>
3110
3125
3111 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3126 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3112 alignment and color management. All 3 prompt subsystems now
3127 alignment and color management. All 3 prompt subsystems now
3113 inherit from BasePrompt.
3128 inherit from BasePrompt.
3114
3129
3115 * tools/release: updates for windows installer build and tag rpms
3130 * tools/release: updates for windows installer build and tag rpms
3116 with python version (since paths are fixed).
3131 with python version (since paths are fixed).
3117
3132
3118 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3133 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3119 which will become eventually obsolete. Also fixed the default
3134 which will become eventually obsolete. Also fixed the default
3120 prompt_in2 to use \D, so at least new users start with the correct
3135 prompt_in2 to use \D, so at least new users start with the correct
3121 defaults.
3136 defaults.
3122 WARNING: Users with existing ipythonrc files will need to apply
3137 WARNING: Users with existing ipythonrc files will need to apply
3123 this fix manually!
3138 this fix manually!
3124
3139
3125 * setup.py: make windows installer (.exe). This is finally the
3140 * setup.py: make windows installer (.exe). This is finally the
3126 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3141 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3127 which I hadn't included because it required Python 2.3 (or recent
3142 which I hadn't included because it required Python 2.3 (or recent
3128 distutils).
3143 distutils).
3129
3144
3130 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3145 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3131 usage of new '\D' escape.
3146 usage of new '\D' escape.
3132
3147
3133 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3148 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3134 lacks os.getuid())
3149 lacks os.getuid())
3135 (CachedOutput.set_colors): Added the ability to turn coloring
3150 (CachedOutput.set_colors): Added the ability to turn coloring
3136 on/off with @colors even for manually defined prompt colors. It
3151 on/off with @colors even for manually defined prompt colors. It
3137 uses a nasty global, but it works safely and via the generic color
3152 uses a nasty global, but it works safely and via the generic color
3138 handling mechanism.
3153 handling mechanism.
3139 (Prompt2.__init__): Introduced new escape '\D' for continuation
3154 (Prompt2.__init__): Introduced new escape '\D' for continuation
3140 prompts. It represents the counter ('\#') as dots.
3155 prompts. It represents the counter ('\#') as dots.
3141 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3156 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3142 need to update their ipythonrc files and replace '%n' with '\D' in
3157 need to update their ipythonrc files and replace '%n' with '\D' in
3143 their prompt_in2 settings everywhere. Sorry, but there's
3158 their prompt_in2 settings everywhere. Sorry, but there's
3144 otherwise no clean way to get all prompts to properly align. The
3159 otherwise no clean way to get all prompts to properly align. The
3145 ipythonrc shipped with IPython has been updated.
3160 ipythonrc shipped with IPython has been updated.
3146
3161
3147 2004-06-07 Fernando Perez <fperez@colorado.edu>
3162 2004-06-07 Fernando Perez <fperez@colorado.edu>
3148
3163
3149 * setup.py (isfile): Pass local_icons option to latex2html, so the
3164 * setup.py (isfile): Pass local_icons option to latex2html, so the
3150 resulting HTML file is self-contained. Thanks to
3165 resulting HTML file is self-contained. Thanks to
3151 dryice-AT-liu.com.cn for the tip.
3166 dryice-AT-liu.com.cn for the tip.
3152
3167
3153 * pysh.py: I created a new profile 'shell', which implements a
3168 * pysh.py: I created a new profile 'shell', which implements a
3154 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3169 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3155 system shell, nor will it become one anytime soon. It's mainly
3170 system shell, nor will it become one anytime soon. It's mainly
3156 meant to illustrate the use of the new flexible bash-like prompts.
3171 meant to illustrate the use of the new flexible bash-like prompts.
3157 I guess it could be used by hardy souls for true shell management,
3172 I guess it could be used by hardy souls for true shell management,
3158 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3173 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3159 profile. This uses the InterpreterExec extension provided by
3174 profile. This uses the InterpreterExec extension provided by
3160 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3175 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3161
3176
3162 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3177 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3163 auto-align itself with the length of the previous input prompt
3178 auto-align itself with the length of the previous input prompt
3164 (taking into account the invisible color escapes).
3179 (taking into account the invisible color escapes).
3165 (CachedOutput.__init__): Large restructuring of this class. Now
3180 (CachedOutput.__init__): Large restructuring of this class. Now
3166 all three prompts (primary1, primary2, output) are proper objects,
3181 all three prompts (primary1, primary2, output) are proper objects,
3167 managed by the 'parent' CachedOutput class. The code is still a
3182 managed by the 'parent' CachedOutput class. The code is still a
3168 bit hackish (all prompts share state via a pointer to the cache),
3183 bit hackish (all prompts share state via a pointer to the cache),
3169 but it's overall far cleaner than before.
3184 but it's overall far cleaner than before.
3170
3185
3171 * IPython/genutils.py (getoutputerror): modified to add verbose,
3186 * IPython/genutils.py (getoutputerror): modified to add verbose,
3172 debug and header options. This makes the interface of all getout*
3187 debug and header options. This makes the interface of all getout*
3173 functions uniform.
3188 functions uniform.
3174 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3189 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3175
3190
3176 * IPython/Magic.py (Magic.default_option): added a function to
3191 * IPython/Magic.py (Magic.default_option): added a function to
3177 allow registering default options for any magic command. This
3192 allow registering default options for any magic command. This
3178 makes it easy to have profiles which customize the magics globally
3193 makes it easy to have profiles which customize the magics globally
3179 for a certain use. The values set through this function are
3194 for a certain use. The values set through this function are
3180 picked up by the parse_options() method, which all magics should
3195 picked up by the parse_options() method, which all magics should
3181 use to parse their options.
3196 use to parse their options.
3182
3197
3183 * IPython/genutils.py (warn): modified the warnings framework to
3198 * IPython/genutils.py (warn): modified the warnings framework to
3184 use the Term I/O class. I'm trying to slowly unify all of
3199 use the Term I/O class. I'm trying to slowly unify all of
3185 IPython's I/O operations to pass through Term.
3200 IPython's I/O operations to pass through Term.
3186
3201
3187 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3202 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3188 the secondary prompt to correctly match the length of the primary
3203 the secondary prompt to correctly match the length of the primary
3189 one for any prompt. Now multi-line code will properly line up
3204 one for any prompt. Now multi-line code will properly line up
3190 even for path dependent prompts, such as the new ones available
3205 even for path dependent prompts, such as the new ones available
3191 via the prompt_specials.
3206 via the prompt_specials.
3192
3207
3193 2004-06-06 Fernando Perez <fperez@colorado.edu>
3208 2004-06-06 Fernando Perez <fperez@colorado.edu>
3194
3209
3195 * IPython/Prompts.py (prompt_specials): Added the ability to have
3210 * IPython/Prompts.py (prompt_specials): Added the ability to have
3196 bash-like special sequences in the prompts, which get
3211 bash-like special sequences in the prompts, which get
3197 automatically expanded. Things like hostname, current working
3212 automatically expanded. Things like hostname, current working
3198 directory and username are implemented already, but it's easy to
3213 directory and username are implemented already, but it's easy to
3199 add more in the future. Thanks to a patch by W.J. van der Laan
3214 add more in the future. Thanks to a patch by W.J. van der Laan
3200 <gnufnork-AT-hetdigitalegat.nl>
3215 <gnufnork-AT-hetdigitalegat.nl>
3201 (prompt_specials): Added color support for prompt strings, so
3216 (prompt_specials): Added color support for prompt strings, so
3202 users can define arbitrary color setups for their prompts.
3217 users can define arbitrary color setups for their prompts.
3203
3218
3204 2004-06-05 Fernando Perez <fperez@colorado.edu>
3219 2004-06-05 Fernando Perez <fperez@colorado.edu>
3205
3220
3206 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3221 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3207 code to load Gary Bishop's readline and configure it
3222 code to load Gary Bishop's readline and configure it
3208 automatically. Thanks to Gary for help on this.
3223 automatically. Thanks to Gary for help on this.
3209
3224
3210 2004-06-01 Fernando Perez <fperez@colorado.edu>
3225 2004-06-01 Fernando Perez <fperez@colorado.edu>
3211
3226
3212 * IPython/Logger.py (Logger.create_log): fix bug for logging
3227 * IPython/Logger.py (Logger.create_log): fix bug for logging
3213 with no filename (previous fix was incomplete).
3228 with no filename (previous fix was incomplete).
3214
3229
3215 2004-05-25 Fernando Perez <fperez@colorado.edu>
3230 2004-05-25 Fernando Perez <fperez@colorado.edu>
3216
3231
3217 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3232 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3218 parens would get passed to the shell.
3233 parens would get passed to the shell.
3219
3234
3220 2004-05-20 Fernando Perez <fperez@colorado.edu>
3235 2004-05-20 Fernando Perez <fperez@colorado.edu>
3221
3236
3222 * IPython/Magic.py (Magic.magic_prun): changed default profile
3237 * IPython/Magic.py (Magic.magic_prun): changed default profile
3223 sort order to 'time' (the more common profiling need).
3238 sort order to 'time' (the more common profiling need).
3224
3239
3225 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3240 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3226 so that source code shown is guaranteed in sync with the file on
3241 so that source code shown is guaranteed in sync with the file on
3227 disk (also changed in psource). Similar fix to the one for
3242 disk (also changed in psource). Similar fix to the one for
3228 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3243 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3229 <yann.ledu-AT-noos.fr>.
3244 <yann.ledu-AT-noos.fr>.
3230
3245
3231 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3246 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3232 with a single option would not be correctly parsed. Closes
3247 with a single option would not be correctly parsed. Closes
3233 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3248 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3234 introduced in 0.6.0 (on 2004-05-06).
3249 introduced in 0.6.0 (on 2004-05-06).
3235
3250
3236 2004-05-13 *** Released version 0.6.0
3251 2004-05-13 *** Released version 0.6.0
3237
3252
3238 2004-05-13 Fernando Perez <fperez@colorado.edu>
3253 2004-05-13 Fernando Perez <fperez@colorado.edu>
3239
3254
3240 * debian/: Added debian/ directory to CVS, so that debian support
3255 * debian/: Added debian/ directory to CVS, so that debian support
3241 is publicly accessible. The debian package is maintained by Jack
3256 is publicly accessible. The debian package is maintained by Jack
3242 Moffit <jack-AT-xiph.org>.
3257 Moffit <jack-AT-xiph.org>.
3243
3258
3244 * Documentation: included the notes about an ipython-based system
3259 * Documentation: included the notes about an ipython-based system
3245 shell (the hypothetical 'pysh') into the new_design.pdf document,
3260 shell (the hypothetical 'pysh') into the new_design.pdf document,
3246 so that these ideas get distributed to users along with the
3261 so that these ideas get distributed to users along with the
3247 official documentation.
3262 official documentation.
3248
3263
3249 2004-05-10 Fernando Perez <fperez@colorado.edu>
3264 2004-05-10 Fernando Perez <fperez@colorado.edu>
3250
3265
3251 * IPython/Logger.py (Logger.create_log): fix recently introduced
3266 * IPython/Logger.py (Logger.create_log): fix recently introduced
3252 bug (misindented line) where logstart would fail when not given an
3267 bug (misindented line) where logstart would fail when not given an
3253 explicit filename.
3268 explicit filename.
3254
3269
3255 2004-05-09 Fernando Perez <fperez@colorado.edu>
3270 2004-05-09 Fernando Perez <fperez@colorado.edu>
3256
3271
3257 * IPython/Magic.py (Magic.parse_options): skip system call when
3272 * IPython/Magic.py (Magic.parse_options): skip system call when
3258 there are no options to look for. Faster, cleaner for the common
3273 there are no options to look for. Faster, cleaner for the common
3259 case.
3274 case.
3260
3275
3261 * Documentation: many updates to the manual: describing Windows
3276 * Documentation: many updates to the manual: describing Windows
3262 support better, Gnuplot updates, credits, misc small stuff. Also
3277 support better, Gnuplot updates, credits, misc small stuff. Also
3263 updated the new_design doc a bit.
3278 updated the new_design doc a bit.
3264
3279
3265 2004-05-06 *** Released version 0.6.0.rc1
3280 2004-05-06 *** Released version 0.6.0.rc1
3266
3281
3267 2004-05-06 Fernando Perez <fperez@colorado.edu>
3282 2004-05-06 Fernando Perez <fperez@colorado.edu>
3268
3283
3269 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3284 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3270 operations to use the vastly more efficient list/''.join() method.
3285 operations to use the vastly more efficient list/''.join() method.
3271 (FormattedTB.text): Fix
3286 (FormattedTB.text): Fix
3272 http://www.scipy.net/roundup/ipython/issue12 - exception source
3287 http://www.scipy.net/roundup/ipython/issue12 - exception source
3273 extract not updated after reload. Thanks to Mike Salib
3288 extract not updated after reload. Thanks to Mike Salib
3274 <msalib-AT-mit.edu> for pinning the source of the problem.
3289 <msalib-AT-mit.edu> for pinning the source of the problem.
3275 Fortunately, the solution works inside ipython and doesn't require
3290 Fortunately, the solution works inside ipython and doesn't require
3276 any changes to python proper.
3291 any changes to python proper.
3277
3292
3278 * IPython/Magic.py (Magic.parse_options): Improved to process the
3293 * IPython/Magic.py (Magic.parse_options): Improved to process the
3279 argument list as a true shell would (by actually using the
3294 argument list as a true shell would (by actually using the
3280 underlying system shell). This way, all @magics automatically get
3295 underlying system shell). This way, all @magics automatically get
3281 shell expansion for variables. Thanks to a comment by Alex
3296 shell expansion for variables. Thanks to a comment by Alex
3282 Schmolck.
3297 Schmolck.
3283
3298
3284 2004-04-04 Fernando Perez <fperez@colorado.edu>
3299 2004-04-04 Fernando Perez <fperez@colorado.edu>
3285
3300
3286 * IPython/iplib.py (InteractiveShell.interact): Added a special
3301 * IPython/iplib.py (InteractiveShell.interact): Added a special
3287 trap for a debugger quit exception, which is basically impossible
3302 trap for a debugger quit exception, which is basically impossible
3288 to handle by normal mechanisms, given what pdb does to the stack.
3303 to handle by normal mechanisms, given what pdb does to the stack.
3289 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3304 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3290
3305
3291 2004-04-03 Fernando Perez <fperez@colorado.edu>
3306 2004-04-03 Fernando Perez <fperez@colorado.edu>
3292
3307
3293 * IPython/genutils.py (Term): Standardized the names of the Term
3308 * IPython/genutils.py (Term): Standardized the names of the Term
3294 class streams to cin/cout/cerr, following C++ naming conventions
3309 class streams to cin/cout/cerr, following C++ naming conventions
3295 (I can't use in/out/err because 'in' is not a valid attribute
3310 (I can't use in/out/err because 'in' is not a valid attribute
3296 name).
3311 name).
3297
3312
3298 * IPython/iplib.py (InteractiveShell.interact): don't increment
3313 * IPython/iplib.py (InteractiveShell.interact): don't increment
3299 the prompt if there's no user input. By Daniel 'Dang' Griffith
3314 the prompt if there's no user input. By Daniel 'Dang' Griffith
3300 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3315 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3301 Francois Pinard.
3316 Francois Pinard.
3302
3317
3303 2004-04-02 Fernando Perez <fperez@colorado.edu>
3318 2004-04-02 Fernando Perez <fperez@colorado.edu>
3304
3319
3305 * IPython/genutils.py (Stream.__init__): Modified to survive at
3320 * IPython/genutils.py (Stream.__init__): Modified to survive at
3306 least importing in contexts where stdin/out/err aren't true file
3321 least importing in contexts where stdin/out/err aren't true file
3307 objects, such as PyCrust (they lack fileno() and mode). However,
3322 objects, such as PyCrust (they lack fileno() and mode). However,
3308 the recovery facilities which rely on these things existing will
3323 the recovery facilities which rely on these things existing will
3309 not work.
3324 not work.
3310
3325
3311 2004-04-01 Fernando Perez <fperez@colorado.edu>
3326 2004-04-01 Fernando Perez <fperez@colorado.edu>
3312
3327
3313 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3328 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3314 use the new getoutputerror() function, so it properly
3329 use the new getoutputerror() function, so it properly
3315 distinguishes stdout/err.
3330 distinguishes stdout/err.
3316
3331
3317 * IPython/genutils.py (getoutputerror): added a function to
3332 * IPython/genutils.py (getoutputerror): added a function to
3318 capture separately the standard output and error of a command.
3333 capture separately the standard output and error of a command.
3319 After a comment from dang on the mailing lists. This code is
3334 After a comment from dang on the mailing lists. This code is
3320 basically a modified version of commands.getstatusoutput(), from
3335 basically a modified version of commands.getstatusoutput(), from
3321 the standard library.
3336 the standard library.
3322
3337
3323 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3338 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3324 '!!' as a special syntax (shorthand) to access @sx.
3339 '!!' as a special syntax (shorthand) to access @sx.
3325
3340
3326 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3341 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3327 command and return its output as a list split on '\n'.
3342 command and return its output as a list split on '\n'.
3328
3343
3329 2004-03-31 Fernando Perez <fperez@colorado.edu>
3344 2004-03-31 Fernando Perez <fperez@colorado.edu>
3330
3345
3331 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3346 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3332 method to dictionaries used as FakeModule instances if they lack
3347 method to dictionaries used as FakeModule instances if they lack
3333 it. At least pydoc in python2.3 breaks for runtime-defined
3348 it. At least pydoc in python2.3 breaks for runtime-defined
3334 functions without this hack. At some point I need to _really_
3349 functions without this hack. At some point I need to _really_
3335 understand what FakeModule is doing, because it's a gross hack.
3350 understand what FakeModule is doing, because it's a gross hack.
3336 But it solves Arnd's problem for now...
3351 But it solves Arnd's problem for now...
3337
3352
3338 2004-02-27 Fernando Perez <fperez@colorado.edu>
3353 2004-02-27 Fernando Perez <fperez@colorado.edu>
3339
3354
3340 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3355 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3341 mode would behave erratically. Also increased the number of
3356 mode would behave erratically. Also increased the number of
3342 possible logs in rotate mod to 999. Thanks to Rod Holland
3357 possible logs in rotate mod to 999. Thanks to Rod Holland
3343 <rhh@StructureLABS.com> for the report and fixes.
3358 <rhh@StructureLABS.com> for the report and fixes.
3344
3359
3345 2004-02-26 Fernando Perez <fperez@colorado.edu>
3360 2004-02-26 Fernando Perez <fperez@colorado.edu>
3346
3361
3347 * IPython/genutils.py (page): Check that the curses module really
3362 * IPython/genutils.py (page): Check that the curses module really
3348 has the initscr attribute before trying to use it. For some
3363 has the initscr attribute before trying to use it. For some
3349 reason, the Solaris curses module is missing this. I think this
3364 reason, the Solaris curses module is missing this. I think this
3350 should be considered a Solaris python bug, but I'm not sure.
3365 should be considered a Solaris python bug, but I'm not sure.
3351
3366
3352 2004-01-17 Fernando Perez <fperez@colorado.edu>
3367 2004-01-17 Fernando Perez <fperez@colorado.edu>
3353
3368
3354 * IPython/genutils.py (Stream.__init__): Changes to try to make
3369 * IPython/genutils.py (Stream.__init__): Changes to try to make
3355 ipython robust against stdin/out/err being closed by the user.
3370 ipython robust against stdin/out/err being closed by the user.
3356 This is 'user error' (and blocks a normal python session, at least
3371 This is 'user error' (and blocks a normal python session, at least
3357 the stdout case). However, Ipython should be able to survive such
3372 the stdout case). However, Ipython should be able to survive such
3358 instances of abuse as gracefully as possible. To simplify the
3373 instances of abuse as gracefully as possible. To simplify the
3359 coding and maintain compatibility with Gary Bishop's Term
3374 coding and maintain compatibility with Gary Bishop's Term
3360 contributions, I've made use of classmethods for this. I think
3375 contributions, I've made use of classmethods for this. I think
3361 this introduces a dependency on python 2.2.
3376 this introduces a dependency on python 2.2.
3362
3377
3363 2004-01-13 Fernando Perez <fperez@colorado.edu>
3378 2004-01-13 Fernando Perez <fperez@colorado.edu>
3364
3379
3365 * IPython/numutils.py (exp_safe): simplified the code a bit and
3380 * IPython/numutils.py (exp_safe): simplified the code a bit and
3366 removed the need for importing the kinds module altogether.
3381 removed the need for importing the kinds module altogether.
3367
3382
3368 2004-01-06 Fernando Perez <fperez@colorado.edu>
3383 2004-01-06 Fernando Perez <fperez@colorado.edu>
3369
3384
3370 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3385 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3371 a magic function instead, after some community feedback. No
3386 a magic function instead, after some community feedback. No
3372 special syntax will exist for it, but its name is deliberately
3387 special syntax will exist for it, but its name is deliberately
3373 very short.
3388 very short.
3374
3389
3375 2003-12-20 Fernando Perez <fperez@colorado.edu>
3390 2003-12-20 Fernando Perez <fperez@colorado.edu>
3376
3391
3377 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3392 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3378 new functionality, to automagically assign the result of a shell
3393 new functionality, to automagically assign the result of a shell
3379 command to a variable. I'll solicit some community feedback on
3394 command to a variable. I'll solicit some community feedback on
3380 this before making it permanent.
3395 this before making it permanent.
3381
3396
3382 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3397 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3383 requested about callables for which inspect couldn't obtain a
3398 requested about callables for which inspect couldn't obtain a
3384 proper argspec. Thanks to a crash report sent by Etienne
3399 proper argspec. Thanks to a crash report sent by Etienne
3385 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3400 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3386
3401
3387 2003-12-09 Fernando Perez <fperez@colorado.edu>
3402 2003-12-09 Fernando Perez <fperez@colorado.edu>
3388
3403
3389 * IPython/genutils.py (page): patch for the pager to work across
3404 * IPython/genutils.py (page): patch for the pager to work across
3390 various versions of Windows. By Gary Bishop.
3405 various versions of Windows. By Gary Bishop.
3391
3406
3392 2003-12-04 Fernando Perez <fperez@colorado.edu>
3407 2003-12-04 Fernando Perez <fperez@colorado.edu>
3393
3408
3394 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3409 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3395 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3410 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3396 While I tested this and it looks ok, there may still be corner
3411 While I tested this and it looks ok, there may still be corner
3397 cases I've missed.
3412 cases I've missed.
3398
3413
3399 2003-12-01 Fernando Perez <fperez@colorado.edu>
3414 2003-12-01 Fernando Perez <fperez@colorado.edu>
3400
3415
3401 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3416 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3402 where a line like 'p,q=1,2' would fail because the automagic
3417 where a line like 'p,q=1,2' would fail because the automagic
3403 system would be triggered for @p.
3418 system would be triggered for @p.
3404
3419
3405 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3420 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3406 cleanups, code unmodified.
3421 cleanups, code unmodified.
3407
3422
3408 * IPython/genutils.py (Term): added a class for IPython to handle
3423 * IPython/genutils.py (Term): added a class for IPython to handle
3409 output. In most cases it will just be a proxy for stdout/err, but
3424 output. In most cases it will just be a proxy for stdout/err, but
3410 having this allows modifications to be made for some platforms,
3425 having this allows modifications to be made for some platforms,
3411 such as handling color escapes under Windows. All of this code
3426 such as handling color escapes under Windows. All of this code
3412 was contributed by Gary Bishop, with minor modifications by me.
3427 was contributed by Gary Bishop, with minor modifications by me.
3413 The actual changes affect many files.
3428 The actual changes affect many files.
3414
3429
3415 2003-11-30 Fernando Perez <fperez@colorado.edu>
3430 2003-11-30 Fernando Perez <fperez@colorado.edu>
3416
3431
3417 * IPython/iplib.py (file_matches): new completion code, courtesy
3432 * IPython/iplib.py (file_matches): new completion code, courtesy
3418 of Jeff Collins. This enables filename completion again under
3433 of Jeff Collins. This enables filename completion again under
3419 python 2.3, which disabled it at the C level.
3434 python 2.3, which disabled it at the C level.
3420
3435
3421 2003-11-11 Fernando Perez <fperez@colorado.edu>
3436 2003-11-11 Fernando Perez <fperez@colorado.edu>
3422
3437
3423 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3438 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3424 for Numeric.array(map(...)), but often convenient.
3439 for Numeric.array(map(...)), but often convenient.
3425
3440
3426 2003-11-05 Fernando Perez <fperez@colorado.edu>
3441 2003-11-05 Fernando Perez <fperez@colorado.edu>
3427
3442
3428 * IPython/numutils.py (frange): Changed a call from int() to
3443 * IPython/numutils.py (frange): Changed a call from int() to
3429 int(round()) to prevent a problem reported with arange() in the
3444 int(round()) to prevent a problem reported with arange() in the
3430 numpy list.
3445 numpy list.
3431
3446
3432 2003-10-06 Fernando Perez <fperez@colorado.edu>
3447 2003-10-06 Fernando Perez <fperez@colorado.edu>
3433
3448
3434 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3449 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3435 prevent crashes if sys lacks an argv attribute (it happens with
3450 prevent crashes if sys lacks an argv attribute (it happens with
3436 embedded interpreters which build a bare-bones sys module).
3451 embedded interpreters which build a bare-bones sys module).
3437 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3452 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3438
3453
3439 2003-09-24 Fernando Perez <fperez@colorado.edu>
3454 2003-09-24 Fernando Perez <fperez@colorado.edu>
3440
3455
3441 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3456 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3442 to protect against poorly written user objects where __getattr__
3457 to protect against poorly written user objects where __getattr__
3443 raises exceptions other than AttributeError. Thanks to a bug
3458 raises exceptions other than AttributeError. Thanks to a bug
3444 report by Oliver Sander <osander-AT-gmx.de>.
3459 report by Oliver Sander <osander-AT-gmx.de>.
3445
3460
3446 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3461 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3447 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3462 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3448
3463
3449 2003-09-09 Fernando Perez <fperez@colorado.edu>
3464 2003-09-09 Fernando Perez <fperez@colorado.edu>
3450
3465
3451 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3466 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3452 unpacking a list whith a callable as first element would
3467 unpacking a list whith a callable as first element would
3453 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3468 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3454 Collins.
3469 Collins.
3455
3470
3456 2003-08-25 *** Released version 0.5.0
3471 2003-08-25 *** Released version 0.5.0
3457
3472
3458 2003-08-22 Fernando Perez <fperez@colorado.edu>
3473 2003-08-22 Fernando Perez <fperez@colorado.edu>
3459
3474
3460 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3475 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3461 improperly defined user exceptions. Thanks to feedback from Mark
3476 improperly defined user exceptions. Thanks to feedback from Mark
3462 Russell <mrussell-AT-verio.net>.
3477 Russell <mrussell-AT-verio.net>.
3463
3478
3464 2003-08-20 Fernando Perez <fperez@colorado.edu>
3479 2003-08-20 Fernando Perez <fperez@colorado.edu>
3465
3480
3466 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3481 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3467 printing so that it would print multi-line string forms starting
3482 printing so that it would print multi-line string forms starting
3468 with a new line. This way the formatting is better respected for
3483 with a new line. This way the formatting is better respected for
3469 objects which work hard to make nice string forms.
3484 objects which work hard to make nice string forms.
3470
3485
3471 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3486 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3472 autocall would overtake data access for objects with both
3487 autocall would overtake data access for objects with both
3473 __getitem__ and __call__.
3488 __getitem__ and __call__.
3474
3489
3475 2003-08-19 *** Released version 0.5.0-rc1
3490 2003-08-19 *** Released version 0.5.0-rc1
3476
3491
3477 2003-08-19 Fernando Perez <fperez@colorado.edu>
3492 2003-08-19 Fernando Perez <fperez@colorado.edu>
3478
3493
3479 * IPython/deep_reload.py (load_tail): single tiny change here
3494 * IPython/deep_reload.py (load_tail): single tiny change here
3480 seems to fix the long-standing bug of dreload() failing to work
3495 seems to fix the long-standing bug of dreload() failing to work
3481 for dotted names. But this module is pretty tricky, so I may have
3496 for dotted names. But this module is pretty tricky, so I may have
3482 missed some subtlety. Needs more testing!.
3497 missed some subtlety. Needs more testing!.
3483
3498
3484 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3499 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3485 exceptions which have badly implemented __str__ methods.
3500 exceptions which have badly implemented __str__ methods.
3486 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3501 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3487 which I've been getting reports about from Python 2.3 users. I
3502 which I've been getting reports about from Python 2.3 users. I
3488 wish I had a simple test case to reproduce the problem, so I could
3503 wish I had a simple test case to reproduce the problem, so I could
3489 either write a cleaner workaround or file a bug report if
3504 either write a cleaner workaround or file a bug report if
3490 necessary.
3505 necessary.
3491
3506
3492 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3507 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3493 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3508 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3494 a bug report by Tjabo Kloppenburg.
3509 a bug report by Tjabo Kloppenburg.
3495
3510
3496 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3511 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3497 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3512 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3498 seems rather unstable. Thanks to a bug report by Tjabo
3513 seems rather unstable. Thanks to a bug report by Tjabo
3499 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3514 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3500
3515
3501 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3516 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3502 this out soon because of the critical fixes in the inner loop for
3517 this out soon because of the critical fixes in the inner loop for
3503 generators.
3518 generators.
3504
3519
3505 * IPython/Magic.py (Magic.getargspec): removed. This (and
3520 * IPython/Magic.py (Magic.getargspec): removed. This (and
3506 _get_def) have been obsoleted by OInspect for a long time, I
3521 _get_def) have been obsoleted by OInspect for a long time, I
3507 hadn't noticed that they were dead code.
3522 hadn't noticed that they were dead code.
3508 (Magic._ofind): restored _ofind functionality for a few literals
3523 (Magic._ofind): restored _ofind functionality for a few literals
3509 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3524 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3510 for things like "hello".capitalize?, since that would require a
3525 for things like "hello".capitalize?, since that would require a
3511 potentially dangerous eval() again.
3526 potentially dangerous eval() again.
3512
3527
3513 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3528 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3514 logic a bit more to clean up the escapes handling and minimize the
3529 logic a bit more to clean up the escapes handling and minimize the
3515 use of _ofind to only necessary cases. The interactive 'feel' of
3530 use of _ofind to only necessary cases. The interactive 'feel' of
3516 IPython should have improved quite a bit with the changes in
3531 IPython should have improved quite a bit with the changes in
3517 _prefilter and _ofind (besides being far safer than before).
3532 _prefilter and _ofind (besides being far safer than before).
3518
3533
3519 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3534 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3520 obscure, never reported). Edit would fail to find the object to
3535 obscure, never reported). Edit would fail to find the object to
3521 edit under some circumstances.
3536 edit under some circumstances.
3522 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3537 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3523 which were causing double-calling of generators. Those eval calls
3538 which were causing double-calling of generators. Those eval calls
3524 were _very_ dangerous, since code with side effects could be
3539 were _very_ dangerous, since code with side effects could be
3525 triggered. As they say, 'eval is evil'... These were the
3540 triggered. As they say, 'eval is evil'... These were the
3526 nastiest evals in IPython. Besides, _ofind is now far simpler,
3541 nastiest evals in IPython. Besides, _ofind is now far simpler,
3527 and it should also be quite a bit faster. Its use of inspect is
3542 and it should also be quite a bit faster. Its use of inspect is
3528 also safer, so perhaps some of the inspect-related crashes I've
3543 also safer, so perhaps some of the inspect-related crashes I've
3529 seen lately with Python 2.3 might be taken care of. That will
3544 seen lately with Python 2.3 might be taken care of. That will
3530 need more testing.
3545 need more testing.
3531
3546
3532 2003-08-17 Fernando Perez <fperez@colorado.edu>
3547 2003-08-17 Fernando Perez <fperez@colorado.edu>
3533
3548
3534 * IPython/iplib.py (InteractiveShell._prefilter): significant
3549 * IPython/iplib.py (InteractiveShell._prefilter): significant
3535 simplifications to the logic for handling user escapes. Faster
3550 simplifications to the logic for handling user escapes. Faster
3536 and simpler code.
3551 and simpler code.
3537
3552
3538 2003-08-14 Fernando Perez <fperez@colorado.edu>
3553 2003-08-14 Fernando Perez <fperez@colorado.edu>
3539
3554
3540 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3555 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3541 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3556 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3542 but it should be quite a bit faster. And the recursive version
3557 but it should be quite a bit faster. And the recursive version
3543 generated O(log N) intermediate storage for all rank>1 arrays,
3558 generated O(log N) intermediate storage for all rank>1 arrays,
3544 even if they were contiguous.
3559 even if they were contiguous.
3545 (l1norm): Added this function.
3560 (l1norm): Added this function.
3546 (norm): Added this function for arbitrary norms (including
3561 (norm): Added this function for arbitrary norms (including
3547 l-infinity). l1 and l2 are still special cases for convenience
3562 l-infinity). l1 and l2 are still special cases for convenience
3548 and speed.
3563 and speed.
3549
3564
3550 2003-08-03 Fernando Perez <fperez@colorado.edu>
3565 2003-08-03 Fernando Perez <fperez@colorado.edu>
3551
3566
3552 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3567 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3553 exceptions, which now raise PendingDeprecationWarnings in Python
3568 exceptions, which now raise PendingDeprecationWarnings in Python
3554 2.3. There were some in Magic and some in Gnuplot2.
3569 2.3. There were some in Magic and some in Gnuplot2.
3555
3570
3556 2003-06-30 Fernando Perez <fperez@colorado.edu>
3571 2003-06-30 Fernando Perez <fperez@colorado.edu>
3557
3572
3558 * IPython/genutils.py (page): modified to call curses only for
3573 * IPython/genutils.py (page): modified to call curses only for
3559 terminals where TERM=='xterm'. After problems under many other
3574 terminals where TERM=='xterm'. After problems under many other
3560 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3575 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3561
3576
3562 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3577 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3563 would be triggered when readline was absent. This was just an old
3578 would be triggered when readline was absent. This was just an old
3564 debugging statement I'd forgotten to take out.
3579 debugging statement I'd forgotten to take out.
3565
3580
3566 2003-06-20 Fernando Perez <fperez@colorado.edu>
3581 2003-06-20 Fernando Perez <fperez@colorado.edu>
3567
3582
3568 * IPython/genutils.py (clock): modified to return only user time
3583 * IPython/genutils.py (clock): modified to return only user time
3569 (not counting system time), after a discussion on scipy. While
3584 (not counting system time), after a discussion on scipy. While
3570 system time may be a useful quantity occasionally, it may much
3585 system time may be a useful quantity occasionally, it may much
3571 more easily be skewed by occasional swapping or other similar
3586 more easily be skewed by occasional swapping or other similar
3572 activity.
3587 activity.
3573
3588
3574 2003-06-05 Fernando Perez <fperez@colorado.edu>
3589 2003-06-05 Fernando Perez <fperez@colorado.edu>
3575
3590
3576 * IPython/numutils.py (identity): new function, for building
3591 * IPython/numutils.py (identity): new function, for building
3577 arbitrary rank Kronecker deltas (mostly backwards compatible with
3592 arbitrary rank Kronecker deltas (mostly backwards compatible with
3578 Numeric.identity)
3593 Numeric.identity)
3579
3594
3580 2003-06-03 Fernando Perez <fperez@colorado.edu>
3595 2003-06-03 Fernando Perez <fperez@colorado.edu>
3581
3596
3582 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3597 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3583 arguments passed to magics with spaces, to allow trailing '\' to
3598 arguments passed to magics with spaces, to allow trailing '\' to
3584 work normally (mainly for Windows users).
3599 work normally (mainly for Windows users).
3585
3600
3586 2003-05-29 Fernando Perez <fperez@colorado.edu>
3601 2003-05-29 Fernando Perez <fperez@colorado.edu>
3587
3602
3588 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3603 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3589 instead of pydoc.help. This fixes a bizarre behavior where
3604 instead of pydoc.help. This fixes a bizarre behavior where
3590 printing '%s' % locals() would trigger the help system. Now
3605 printing '%s' % locals() would trigger the help system. Now
3591 ipython behaves like normal python does.
3606 ipython behaves like normal python does.
3592
3607
3593 Note that if one does 'from pydoc import help', the bizarre
3608 Note that if one does 'from pydoc import help', the bizarre
3594 behavior returns, but this will also happen in normal python, so
3609 behavior returns, but this will also happen in normal python, so
3595 it's not an ipython bug anymore (it has to do with how pydoc.help
3610 it's not an ipython bug anymore (it has to do with how pydoc.help
3596 is implemented).
3611 is implemented).
3597
3612
3598 2003-05-22 Fernando Perez <fperez@colorado.edu>
3613 2003-05-22 Fernando Perez <fperez@colorado.edu>
3599
3614
3600 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3615 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3601 return [] instead of None when nothing matches, also match to end
3616 return [] instead of None when nothing matches, also match to end
3602 of line. Patch by Gary Bishop.
3617 of line. Patch by Gary Bishop.
3603
3618
3604 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3619 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3605 protection as before, for files passed on the command line. This
3620 protection as before, for files passed on the command line. This
3606 prevents the CrashHandler from kicking in if user files call into
3621 prevents the CrashHandler from kicking in if user files call into
3607 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3622 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3608 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3623 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3609
3624
3610 2003-05-20 *** Released version 0.4.0
3625 2003-05-20 *** Released version 0.4.0
3611
3626
3612 2003-05-20 Fernando Perez <fperez@colorado.edu>
3627 2003-05-20 Fernando Perez <fperez@colorado.edu>
3613
3628
3614 * setup.py: added support for manpages. It's a bit hackish b/c of
3629 * setup.py: added support for manpages. It's a bit hackish b/c of
3615 a bug in the way the bdist_rpm distutils target handles gzipped
3630 a bug in the way the bdist_rpm distutils target handles gzipped
3616 manpages, but it works. After a patch by Jack.
3631 manpages, but it works. After a patch by Jack.
3617
3632
3618 2003-05-19 Fernando Perez <fperez@colorado.edu>
3633 2003-05-19 Fernando Perez <fperez@colorado.edu>
3619
3634
3620 * IPython/numutils.py: added a mockup of the kinds module, since
3635 * IPython/numutils.py: added a mockup of the kinds module, since
3621 it was recently removed from Numeric. This way, numutils will
3636 it was recently removed from Numeric. This way, numutils will
3622 work for all users even if they are missing kinds.
3637 work for all users even if they are missing kinds.
3623
3638
3624 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3639 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3625 failure, which can occur with SWIG-wrapped extensions. After a
3640 failure, which can occur with SWIG-wrapped extensions. After a
3626 crash report from Prabhu.
3641 crash report from Prabhu.
3627
3642
3628 2003-05-16 Fernando Perez <fperez@colorado.edu>
3643 2003-05-16 Fernando Perez <fperez@colorado.edu>
3629
3644
3630 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3645 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3631 protect ipython from user code which may call directly
3646 protect ipython from user code which may call directly
3632 sys.excepthook (this looks like an ipython crash to the user, even
3647 sys.excepthook (this looks like an ipython crash to the user, even
3633 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3648 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3634 This is especially important to help users of WxWindows, but may
3649 This is especially important to help users of WxWindows, but may
3635 also be useful in other cases.
3650 also be useful in other cases.
3636
3651
3637 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3652 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3638 an optional tb_offset to be specified, and to preserve exception
3653 an optional tb_offset to be specified, and to preserve exception
3639 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3654 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3640
3655
3641 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3656 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3642
3657
3643 2003-05-15 Fernando Perez <fperez@colorado.edu>
3658 2003-05-15 Fernando Perez <fperez@colorado.edu>
3644
3659
3645 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3660 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3646 installing for a new user under Windows.
3661 installing for a new user under Windows.
3647
3662
3648 2003-05-12 Fernando Perez <fperez@colorado.edu>
3663 2003-05-12 Fernando Perez <fperez@colorado.edu>
3649
3664
3650 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3665 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3651 handler for Emacs comint-based lines. Currently it doesn't do
3666 handler for Emacs comint-based lines. Currently it doesn't do
3652 much (but importantly, it doesn't update the history cache). In
3667 much (but importantly, it doesn't update the history cache). In
3653 the future it may be expanded if Alex needs more functionality
3668 the future it may be expanded if Alex needs more functionality
3654 there.
3669 there.
3655
3670
3656 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3671 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3657 info to crash reports.
3672 info to crash reports.
3658
3673
3659 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3674 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3660 just like Python's -c. Also fixed crash with invalid -color
3675 just like Python's -c. Also fixed crash with invalid -color
3661 option value at startup. Thanks to Will French
3676 option value at startup. Thanks to Will French
3662 <wfrench-AT-bestweb.net> for the bug report.
3677 <wfrench-AT-bestweb.net> for the bug report.
3663
3678
3664 2003-05-09 Fernando Perez <fperez@colorado.edu>
3679 2003-05-09 Fernando Perez <fperez@colorado.edu>
3665
3680
3666 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3681 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3667 to EvalDict (it's a mapping, after all) and simplified its code
3682 to EvalDict (it's a mapping, after all) and simplified its code
3668 quite a bit, after a nice discussion on c.l.py where Gustavo
3683 quite a bit, after a nice discussion on c.l.py where Gustavo
3669 Córdova <gcordova-AT-sismex.com> suggested the new version.
3684 Córdova <gcordova-AT-sismex.com> suggested the new version.
3670
3685
3671 2003-04-30 Fernando Perez <fperez@colorado.edu>
3686 2003-04-30 Fernando Perez <fperez@colorado.edu>
3672
3687
3673 * IPython/genutils.py (timings_out): modified it to reduce its
3688 * IPython/genutils.py (timings_out): modified it to reduce its
3674 overhead in the common reps==1 case.
3689 overhead in the common reps==1 case.
3675
3690
3676 2003-04-29 Fernando Perez <fperez@colorado.edu>
3691 2003-04-29 Fernando Perez <fperez@colorado.edu>
3677
3692
3678 * IPython/genutils.py (timings_out): Modified to use the resource
3693 * IPython/genutils.py (timings_out): Modified to use the resource
3679 module, which avoids the wraparound problems of time.clock().
3694 module, which avoids the wraparound problems of time.clock().
3680
3695
3681 2003-04-17 *** Released version 0.2.15pre4
3696 2003-04-17 *** Released version 0.2.15pre4
3682
3697
3683 2003-04-17 Fernando Perez <fperez@colorado.edu>
3698 2003-04-17 Fernando Perez <fperez@colorado.edu>
3684
3699
3685 * setup.py (scriptfiles): Split windows-specific stuff over to a
3700 * setup.py (scriptfiles): Split windows-specific stuff over to a
3686 separate file, in an attempt to have a Windows GUI installer.
3701 separate file, in an attempt to have a Windows GUI installer.
3687 That didn't work, but part of the groundwork is done.
3702 That didn't work, but part of the groundwork is done.
3688
3703
3689 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3704 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3690 indent/unindent with 4 spaces. Particularly useful in combination
3705 indent/unindent with 4 spaces. Particularly useful in combination
3691 with the new auto-indent option.
3706 with the new auto-indent option.
3692
3707
3693 2003-04-16 Fernando Perez <fperez@colorado.edu>
3708 2003-04-16 Fernando Perez <fperez@colorado.edu>
3694
3709
3695 * IPython/Magic.py: various replacements of self.rc for
3710 * IPython/Magic.py: various replacements of self.rc for
3696 self.shell.rc. A lot more remains to be done to fully disentangle
3711 self.shell.rc. A lot more remains to be done to fully disentangle
3697 this class from the main Shell class.
3712 this class from the main Shell class.
3698
3713
3699 * IPython/GnuplotRuntime.py: added checks for mouse support so
3714 * IPython/GnuplotRuntime.py: added checks for mouse support so
3700 that we don't try to enable it if the current gnuplot doesn't
3715 that we don't try to enable it if the current gnuplot doesn't
3701 really support it. Also added checks so that we don't try to
3716 really support it. Also added checks so that we don't try to
3702 enable persist under Windows (where Gnuplot doesn't recognize the
3717 enable persist under Windows (where Gnuplot doesn't recognize the
3703 option).
3718 option).
3704
3719
3705 * IPython/iplib.py (InteractiveShell.interact): Added optional
3720 * IPython/iplib.py (InteractiveShell.interact): Added optional
3706 auto-indenting code, after a patch by King C. Shu
3721 auto-indenting code, after a patch by King C. Shu
3707 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3722 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3708 get along well with pasting indented code. If I ever figure out
3723 get along well with pasting indented code. If I ever figure out
3709 how to make that part go well, it will become on by default.
3724 how to make that part go well, it will become on by default.
3710
3725
3711 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3726 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3712 crash ipython if there was an unmatched '%' in the user's prompt
3727 crash ipython if there was an unmatched '%' in the user's prompt
3713 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3728 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3714
3729
3715 * IPython/iplib.py (InteractiveShell.interact): removed the
3730 * IPython/iplib.py (InteractiveShell.interact): removed the
3716 ability to ask the user whether he wants to crash or not at the
3731 ability to ask the user whether he wants to crash or not at the
3717 'last line' exception handler. Calling functions at that point
3732 'last line' exception handler. Calling functions at that point
3718 changes the stack, and the error reports would have incorrect
3733 changes the stack, and the error reports would have incorrect
3719 tracebacks.
3734 tracebacks.
3720
3735
3721 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3736 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3722 pass through a peger a pretty-printed form of any object. After a
3737 pass through a peger a pretty-printed form of any object. After a
3723 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3738 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3724
3739
3725 2003-04-14 Fernando Perez <fperez@colorado.edu>
3740 2003-04-14 Fernando Perez <fperez@colorado.edu>
3726
3741
3727 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3742 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3728 all files in ~ would be modified at first install (instead of
3743 all files in ~ would be modified at first install (instead of
3729 ~/.ipython). This could be potentially disastrous, as the
3744 ~/.ipython). This could be potentially disastrous, as the
3730 modification (make line-endings native) could damage binary files.
3745 modification (make line-endings native) could damage binary files.
3731
3746
3732 2003-04-10 Fernando Perez <fperez@colorado.edu>
3747 2003-04-10 Fernando Perez <fperez@colorado.edu>
3733
3748
3734 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3749 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3735 handle only lines which are invalid python. This now means that
3750 handle only lines which are invalid python. This now means that
3736 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3751 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3737 for the bug report.
3752 for the bug report.
3738
3753
3739 2003-04-01 Fernando Perez <fperez@colorado.edu>
3754 2003-04-01 Fernando Perez <fperez@colorado.edu>
3740
3755
3741 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3756 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3742 where failing to set sys.last_traceback would crash pdb.pm().
3757 where failing to set sys.last_traceback would crash pdb.pm().
3743 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3758 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3744 report.
3759 report.
3745
3760
3746 2003-03-25 Fernando Perez <fperez@colorado.edu>
3761 2003-03-25 Fernando Perez <fperez@colorado.edu>
3747
3762
3748 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3763 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3749 before printing it (it had a lot of spurious blank lines at the
3764 before printing it (it had a lot of spurious blank lines at the
3750 end).
3765 end).
3751
3766
3752 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3767 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3753 output would be sent 21 times! Obviously people don't use this
3768 output would be sent 21 times! Obviously people don't use this
3754 too often, or I would have heard about it.
3769 too often, or I would have heard about it.
3755
3770
3756 2003-03-24 Fernando Perez <fperez@colorado.edu>
3771 2003-03-24 Fernando Perez <fperez@colorado.edu>
3757
3772
3758 * setup.py (scriptfiles): renamed the data_files parameter from
3773 * setup.py (scriptfiles): renamed the data_files parameter from
3759 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3774 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3760 for the patch.
3775 for the patch.
3761
3776
3762 2003-03-20 Fernando Perez <fperez@colorado.edu>
3777 2003-03-20 Fernando Perez <fperez@colorado.edu>
3763
3778
3764 * IPython/genutils.py (error): added error() and fatal()
3779 * IPython/genutils.py (error): added error() and fatal()
3765 functions.
3780 functions.
3766
3781
3767 2003-03-18 *** Released version 0.2.15pre3
3782 2003-03-18 *** Released version 0.2.15pre3
3768
3783
3769 2003-03-18 Fernando Perez <fperez@colorado.edu>
3784 2003-03-18 Fernando Perez <fperez@colorado.edu>
3770
3785
3771 * setupext/install_data_ext.py
3786 * setupext/install_data_ext.py
3772 (install_data_ext.initialize_options): Class contributed by Jack
3787 (install_data_ext.initialize_options): Class contributed by Jack
3773 Moffit for fixing the old distutils hack. He is sending this to
3788 Moffit for fixing the old distutils hack. He is sending this to
3774 the distutils folks so in the future we may not need it as a
3789 the distutils folks so in the future we may not need it as a
3775 private fix.
3790 private fix.
3776
3791
3777 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3792 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3778 changes for Debian packaging. See his patch for full details.
3793 changes for Debian packaging. See his patch for full details.
3779 The old distutils hack of making the ipythonrc* files carry a
3794 The old distutils hack of making the ipythonrc* files carry a
3780 bogus .py extension is gone, at last. Examples were moved to a
3795 bogus .py extension is gone, at last. Examples were moved to a
3781 separate subdir under doc/, and the separate executable scripts
3796 separate subdir under doc/, and the separate executable scripts
3782 now live in their own directory. Overall a great cleanup. The
3797 now live in their own directory. Overall a great cleanup. The
3783 manual was updated to use the new files, and setup.py has been
3798 manual was updated to use the new files, and setup.py has been
3784 fixed for this setup.
3799 fixed for this setup.
3785
3800
3786 * IPython/PyColorize.py (Parser.usage): made non-executable and
3801 * IPython/PyColorize.py (Parser.usage): made non-executable and
3787 created a pycolor wrapper around it to be included as a script.
3802 created a pycolor wrapper around it to be included as a script.
3788
3803
3789 2003-03-12 *** Released version 0.2.15pre2
3804 2003-03-12 *** Released version 0.2.15pre2
3790
3805
3791 2003-03-12 Fernando Perez <fperez@colorado.edu>
3806 2003-03-12 Fernando Perez <fperez@colorado.edu>
3792
3807
3793 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3808 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3794 long-standing problem with garbage characters in some terminals.
3809 long-standing problem with garbage characters in some terminals.
3795 The issue was really that the \001 and \002 escapes must _only_ be
3810 The issue was really that the \001 and \002 escapes must _only_ be
3796 passed to input prompts (which call readline), but _never_ to
3811 passed to input prompts (which call readline), but _never_ to
3797 normal text to be printed on screen. I changed ColorANSI to have
3812 normal text to be printed on screen. I changed ColorANSI to have
3798 two classes: TermColors and InputTermColors, each with the
3813 two classes: TermColors and InputTermColors, each with the
3799 appropriate escapes for input prompts or normal text. The code in
3814 appropriate escapes for input prompts or normal text. The code in
3800 Prompts.py got slightly more complicated, but this very old and
3815 Prompts.py got slightly more complicated, but this very old and
3801 annoying bug is finally fixed.
3816 annoying bug is finally fixed.
3802
3817
3803 All the credit for nailing down the real origin of this problem
3818 All the credit for nailing down the real origin of this problem
3804 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3819 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3805 *Many* thanks to him for spending quite a bit of effort on this.
3820 *Many* thanks to him for spending quite a bit of effort on this.
3806
3821
3807 2003-03-05 *** Released version 0.2.15pre1
3822 2003-03-05 *** Released version 0.2.15pre1
3808
3823
3809 2003-03-03 Fernando Perez <fperez@colorado.edu>
3824 2003-03-03 Fernando Perez <fperez@colorado.edu>
3810
3825
3811 * IPython/FakeModule.py: Moved the former _FakeModule to a
3826 * IPython/FakeModule.py: Moved the former _FakeModule to a
3812 separate file, because it's also needed by Magic (to fix a similar
3827 separate file, because it's also needed by Magic (to fix a similar
3813 pickle-related issue in @run).
3828 pickle-related issue in @run).
3814
3829
3815 2003-03-02 Fernando Perez <fperez@colorado.edu>
3830 2003-03-02 Fernando Perez <fperez@colorado.edu>
3816
3831
3817 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3832 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3818 the autocall option at runtime.
3833 the autocall option at runtime.
3819 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3834 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3820 across Magic.py to start separating Magic from InteractiveShell.
3835 across Magic.py to start separating Magic from InteractiveShell.
3821 (Magic._ofind): Fixed to return proper namespace for dotted
3836 (Magic._ofind): Fixed to return proper namespace for dotted
3822 names. Before, a dotted name would always return 'not currently
3837 names. Before, a dotted name would always return 'not currently
3823 defined', because it would find the 'parent'. s.x would be found,
3838 defined', because it would find the 'parent'. s.x would be found,
3824 but since 'x' isn't defined by itself, it would get confused.
3839 but since 'x' isn't defined by itself, it would get confused.
3825 (Magic.magic_run): Fixed pickling problems reported by Ralf
3840 (Magic.magic_run): Fixed pickling problems reported by Ralf
3826 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3841 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3827 that I'd used when Mike Heeter reported similar issues at the
3842 that I'd used when Mike Heeter reported similar issues at the
3828 top-level, but now for @run. It boils down to injecting the
3843 top-level, but now for @run. It boils down to injecting the
3829 namespace where code is being executed with something that looks
3844 namespace where code is being executed with something that looks
3830 enough like a module to fool pickle.dump(). Since a pickle stores
3845 enough like a module to fool pickle.dump(). Since a pickle stores
3831 a named reference to the importing module, we need this for
3846 a named reference to the importing module, we need this for
3832 pickles to save something sensible.
3847 pickles to save something sensible.
3833
3848
3834 * IPython/ipmaker.py (make_IPython): added an autocall option.
3849 * IPython/ipmaker.py (make_IPython): added an autocall option.
3835
3850
3836 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3851 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3837 the auto-eval code. Now autocalling is an option, and the code is
3852 the auto-eval code. Now autocalling is an option, and the code is
3838 also vastly safer. There is no more eval() involved at all.
3853 also vastly safer. There is no more eval() involved at all.
3839
3854
3840 2003-03-01 Fernando Perez <fperez@colorado.edu>
3855 2003-03-01 Fernando Perez <fperez@colorado.edu>
3841
3856
3842 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3857 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3843 dict with named keys instead of a tuple.
3858 dict with named keys instead of a tuple.
3844
3859
3845 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3860 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3846
3861
3847 * setup.py (make_shortcut): Fixed message about directories
3862 * setup.py (make_shortcut): Fixed message about directories
3848 created during Windows installation (the directories were ok, just
3863 created during Windows installation (the directories were ok, just
3849 the printed message was misleading). Thanks to Chris Liechti
3864 the printed message was misleading). Thanks to Chris Liechti
3850 <cliechti-AT-gmx.net> for the heads up.
3865 <cliechti-AT-gmx.net> for the heads up.
3851
3866
3852 2003-02-21 Fernando Perez <fperez@colorado.edu>
3867 2003-02-21 Fernando Perez <fperez@colorado.edu>
3853
3868
3854 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3869 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3855 of ValueError exception when checking for auto-execution. This
3870 of ValueError exception when checking for auto-execution. This
3856 one is raised by things like Numeric arrays arr.flat when the
3871 one is raised by things like Numeric arrays arr.flat when the
3857 array is non-contiguous.
3872 array is non-contiguous.
3858
3873
3859 2003-01-31 Fernando Perez <fperez@colorado.edu>
3874 2003-01-31 Fernando Perez <fperez@colorado.edu>
3860
3875
3861 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3876 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3862 not return any value at all (even though the command would get
3877 not return any value at all (even though the command would get
3863 executed).
3878 executed).
3864 (xsys): Flush stdout right after printing the command to ensure
3879 (xsys): Flush stdout right after printing the command to ensure
3865 proper ordering of commands and command output in the total
3880 proper ordering of commands and command output in the total
3866 output.
3881 output.
3867 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3882 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3868 system/getoutput as defaults. The old ones are kept for
3883 system/getoutput as defaults. The old ones are kept for
3869 compatibility reasons, so no code which uses this library needs
3884 compatibility reasons, so no code which uses this library needs
3870 changing.
3885 changing.
3871
3886
3872 2003-01-27 *** Released version 0.2.14
3887 2003-01-27 *** Released version 0.2.14
3873
3888
3874 2003-01-25 Fernando Perez <fperez@colorado.edu>
3889 2003-01-25 Fernando Perez <fperez@colorado.edu>
3875
3890
3876 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3891 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3877 functions defined in previous edit sessions could not be re-edited
3892 functions defined in previous edit sessions could not be re-edited
3878 (because the temp files were immediately removed). Now temp files
3893 (because the temp files were immediately removed). Now temp files
3879 are removed only at IPython's exit.
3894 are removed only at IPython's exit.
3880 (Magic.magic_run): Improved @run to perform shell-like expansions
3895 (Magic.magic_run): Improved @run to perform shell-like expansions
3881 on its arguments (~users and $VARS). With this, @run becomes more
3896 on its arguments (~users and $VARS). With this, @run becomes more
3882 like a normal command-line.
3897 like a normal command-line.
3883
3898
3884 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3899 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3885 bugs related to embedding and cleaned up that code. A fairly
3900 bugs related to embedding and cleaned up that code. A fairly
3886 important one was the impossibility to access the global namespace
3901 important one was the impossibility to access the global namespace
3887 through the embedded IPython (only local variables were visible).
3902 through the embedded IPython (only local variables were visible).
3888
3903
3889 2003-01-14 Fernando Perez <fperez@colorado.edu>
3904 2003-01-14 Fernando Perez <fperez@colorado.edu>
3890
3905
3891 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3906 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3892 auto-calling to be a bit more conservative. Now it doesn't get
3907 auto-calling to be a bit more conservative. Now it doesn't get
3893 triggered if any of '!=()<>' are in the rest of the input line, to
3908 triggered if any of '!=()<>' are in the rest of the input line, to
3894 allow comparing callables. Thanks to Alex for the heads up.
3909 allow comparing callables. Thanks to Alex for the heads up.
3895
3910
3896 2003-01-07 Fernando Perez <fperez@colorado.edu>
3911 2003-01-07 Fernando Perez <fperez@colorado.edu>
3897
3912
3898 * IPython/genutils.py (page): fixed estimation of the number of
3913 * IPython/genutils.py (page): fixed estimation of the number of
3899 lines in a string to be paged to simply count newlines. This
3914 lines in a string to be paged to simply count newlines. This
3900 prevents over-guessing due to embedded escape sequences. A better
3915 prevents over-guessing due to embedded escape sequences. A better
3901 long-term solution would involve stripping out the control chars
3916 long-term solution would involve stripping out the control chars
3902 for the count, but it's potentially so expensive I just don't
3917 for the count, but it's potentially so expensive I just don't
3903 think it's worth doing.
3918 think it's worth doing.
3904
3919
3905 2002-12-19 *** Released version 0.2.14pre50
3920 2002-12-19 *** Released version 0.2.14pre50
3906
3921
3907 2002-12-19 Fernando Perez <fperez@colorado.edu>
3922 2002-12-19 Fernando Perez <fperez@colorado.edu>
3908
3923
3909 * tools/release (version): Changed release scripts to inform
3924 * tools/release (version): Changed release scripts to inform
3910 Andrea and build a NEWS file with a list of recent changes.
3925 Andrea and build a NEWS file with a list of recent changes.
3911
3926
3912 * IPython/ColorANSI.py (__all__): changed terminal detection
3927 * IPython/ColorANSI.py (__all__): changed terminal detection
3913 code. Seems to work better for xterms without breaking
3928 code. Seems to work better for xterms without breaking
3914 konsole. Will need more testing to determine if WinXP and Mac OSX
3929 konsole. Will need more testing to determine if WinXP and Mac OSX
3915 also work ok.
3930 also work ok.
3916
3931
3917 2002-12-18 *** Released version 0.2.14pre49
3932 2002-12-18 *** Released version 0.2.14pre49
3918
3933
3919 2002-12-18 Fernando Perez <fperez@colorado.edu>
3934 2002-12-18 Fernando Perez <fperez@colorado.edu>
3920
3935
3921 * Docs: added new info about Mac OSX, from Andrea.
3936 * Docs: added new info about Mac OSX, from Andrea.
3922
3937
3923 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3938 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3924 allow direct plotting of python strings whose format is the same
3939 allow direct plotting of python strings whose format is the same
3925 of gnuplot data files.
3940 of gnuplot data files.
3926
3941
3927 2002-12-16 Fernando Perez <fperez@colorado.edu>
3942 2002-12-16 Fernando Perez <fperez@colorado.edu>
3928
3943
3929 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3944 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3930 value of exit question to be acknowledged.
3945 value of exit question to be acknowledged.
3931
3946
3932 2002-12-03 Fernando Perez <fperez@colorado.edu>
3947 2002-12-03 Fernando Perez <fperez@colorado.edu>
3933
3948
3934 * IPython/ipmaker.py: removed generators, which had been added
3949 * IPython/ipmaker.py: removed generators, which had been added
3935 by mistake in an earlier debugging run. This was causing trouble
3950 by mistake in an earlier debugging run. This was causing trouble
3936 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3951 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3937 for pointing this out.
3952 for pointing this out.
3938
3953
3939 2002-11-17 Fernando Perez <fperez@colorado.edu>
3954 2002-11-17 Fernando Perez <fperez@colorado.edu>
3940
3955
3941 * Manual: updated the Gnuplot section.
3956 * Manual: updated the Gnuplot section.
3942
3957
3943 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3958 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3944 a much better split of what goes in Runtime and what goes in
3959 a much better split of what goes in Runtime and what goes in
3945 Interactive.
3960 Interactive.
3946
3961
3947 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3962 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3948 being imported from iplib.
3963 being imported from iplib.
3949
3964
3950 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3965 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3951 for command-passing. Now the global Gnuplot instance is called
3966 for command-passing. Now the global Gnuplot instance is called
3952 'gp' instead of 'g', which was really a far too fragile and
3967 'gp' instead of 'g', which was really a far too fragile and
3953 common name.
3968 common name.
3954
3969
3955 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3970 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3956 bounding boxes generated by Gnuplot for square plots.
3971 bounding boxes generated by Gnuplot for square plots.
3957
3972
3958 * IPython/genutils.py (popkey): new function added. I should
3973 * IPython/genutils.py (popkey): new function added. I should
3959 suggest this on c.l.py as a dict method, it seems useful.
3974 suggest this on c.l.py as a dict method, it seems useful.
3960
3975
3961 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3976 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3962 to transparently handle PostScript generation. MUCH better than
3977 to transparently handle PostScript generation. MUCH better than
3963 the previous plot_eps/replot_eps (which I removed now). The code
3978 the previous plot_eps/replot_eps (which I removed now). The code
3964 is also fairly clean and well documented now (including
3979 is also fairly clean and well documented now (including
3965 docstrings).
3980 docstrings).
3966
3981
3967 2002-11-13 Fernando Perez <fperez@colorado.edu>
3982 2002-11-13 Fernando Perez <fperez@colorado.edu>
3968
3983
3969 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3984 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3970 (inconsistent with options).
3985 (inconsistent with options).
3971
3986
3972 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3987 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3973 manually disabled, I don't know why. Fixed it.
3988 manually disabled, I don't know why. Fixed it.
3974 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3989 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3975 eps output.
3990 eps output.
3976
3991
3977 2002-11-12 Fernando Perez <fperez@colorado.edu>
3992 2002-11-12 Fernando Perez <fperez@colorado.edu>
3978
3993
3979 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3994 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3980 don't propagate up to caller. Fixes crash reported by François
3995 don't propagate up to caller. Fixes crash reported by François
3981 Pinard.
3996 Pinard.
3982
3997
3983 2002-11-09 Fernando Perez <fperez@colorado.edu>
3998 2002-11-09 Fernando Perez <fperez@colorado.edu>
3984
3999
3985 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4000 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3986 history file for new users.
4001 history file for new users.
3987 (make_IPython): fixed bug where initial install would leave the
4002 (make_IPython): fixed bug where initial install would leave the
3988 user running in the .ipython dir.
4003 user running in the .ipython dir.
3989 (make_IPython): fixed bug where config dir .ipython would be
4004 (make_IPython): fixed bug where config dir .ipython would be
3990 created regardless of the given -ipythondir option. Thanks to Cory
4005 created regardless of the given -ipythondir option. Thanks to Cory
3991 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4006 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3992
4007
3993 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4008 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3994 type confirmations. Will need to use it in all of IPython's code
4009 type confirmations. Will need to use it in all of IPython's code
3995 consistently.
4010 consistently.
3996
4011
3997 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4012 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3998 context to print 31 lines instead of the default 5. This will make
4013 context to print 31 lines instead of the default 5. This will make
3999 the crash reports extremely detailed in case the problem is in
4014 the crash reports extremely detailed in case the problem is in
4000 libraries I don't have access to.
4015 libraries I don't have access to.
4001
4016
4002 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4017 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4003 line of defense' code to still crash, but giving users fair
4018 line of defense' code to still crash, but giving users fair
4004 warning. I don't want internal errors to go unreported: if there's
4019 warning. I don't want internal errors to go unreported: if there's
4005 an internal problem, IPython should crash and generate a full
4020 an internal problem, IPython should crash and generate a full
4006 report.
4021 report.
4007
4022
4008 2002-11-08 Fernando Perez <fperez@colorado.edu>
4023 2002-11-08 Fernando Perez <fperez@colorado.edu>
4009
4024
4010 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4025 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4011 otherwise uncaught exceptions which can appear if people set
4026 otherwise uncaught exceptions which can appear if people set
4012 sys.stdout to something badly broken. Thanks to a crash report
4027 sys.stdout to something badly broken. Thanks to a crash report
4013 from henni-AT-mail.brainbot.com.
4028 from henni-AT-mail.brainbot.com.
4014
4029
4015 2002-11-04 Fernando Perez <fperez@colorado.edu>
4030 2002-11-04 Fernando Perez <fperez@colorado.edu>
4016
4031
4017 * IPython/iplib.py (InteractiveShell.interact): added
4032 * IPython/iplib.py (InteractiveShell.interact): added
4018 __IPYTHON__active to the builtins. It's a flag which goes on when
4033 __IPYTHON__active to the builtins. It's a flag which goes on when
4019 the interaction starts and goes off again when it stops. This
4034 the interaction starts and goes off again when it stops. This
4020 allows embedding code to detect being inside IPython. Before this
4035 allows embedding code to detect being inside IPython. Before this
4021 was done via __IPYTHON__, but that only shows that an IPython
4036 was done via __IPYTHON__, but that only shows that an IPython
4022 instance has been created.
4037 instance has been created.
4023
4038
4024 * IPython/Magic.py (Magic.magic_env): I realized that in a
4039 * IPython/Magic.py (Magic.magic_env): I realized that in a
4025 UserDict, instance.data holds the data as a normal dict. So I
4040 UserDict, instance.data holds the data as a normal dict. So I
4026 modified @env to return os.environ.data instead of rebuilding a
4041 modified @env to return os.environ.data instead of rebuilding a
4027 dict by hand.
4042 dict by hand.
4028
4043
4029 2002-11-02 Fernando Perez <fperez@colorado.edu>
4044 2002-11-02 Fernando Perez <fperez@colorado.edu>
4030
4045
4031 * IPython/genutils.py (warn): changed so that level 1 prints no
4046 * IPython/genutils.py (warn): changed so that level 1 prints no
4032 header. Level 2 is now the default (with 'WARNING' header, as
4047 header. Level 2 is now the default (with 'WARNING' header, as
4033 before). I think I tracked all places where changes were needed in
4048 before). I think I tracked all places where changes were needed in
4034 IPython, but outside code using the old level numbering may have
4049 IPython, but outside code using the old level numbering may have
4035 broken.
4050 broken.
4036
4051
4037 * IPython/iplib.py (InteractiveShell.runcode): added this to
4052 * IPython/iplib.py (InteractiveShell.runcode): added this to
4038 handle the tracebacks in SystemExit traps correctly. The previous
4053 handle the tracebacks in SystemExit traps correctly. The previous
4039 code (through interact) was printing more of the stack than
4054 code (through interact) was printing more of the stack than
4040 necessary, showing IPython internal code to the user.
4055 necessary, showing IPython internal code to the user.
4041
4056
4042 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4057 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4043 default. Now that the default at the confirmation prompt is yes,
4058 default. Now that the default at the confirmation prompt is yes,
4044 it's not so intrusive. François' argument that ipython sessions
4059 it's not so intrusive. François' argument that ipython sessions
4045 tend to be complex enough not to lose them from an accidental C-d,
4060 tend to be complex enough not to lose them from an accidental C-d,
4046 is a valid one.
4061 is a valid one.
4047
4062
4048 * IPython/iplib.py (InteractiveShell.interact): added a
4063 * IPython/iplib.py (InteractiveShell.interact): added a
4049 showtraceback() call to the SystemExit trap, and modified the exit
4064 showtraceback() call to the SystemExit trap, and modified the exit
4050 confirmation to have yes as the default.
4065 confirmation to have yes as the default.
4051
4066
4052 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4067 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4053 this file. It's been gone from the code for a long time, this was
4068 this file. It's been gone from the code for a long time, this was
4054 simply leftover junk.
4069 simply leftover junk.
4055
4070
4056 2002-11-01 Fernando Perez <fperez@colorado.edu>
4071 2002-11-01 Fernando Perez <fperez@colorado.edu>
4057
4072
4058 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4073 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4059 added. If set, IPython now traps EOF and asks for
4074 added. If set, IPython now traps EOF and asks for
4060 confirmation. After a request by François Pinard.
4075 confirmation. After a request by François Pinard.
4061
4076
4062 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4077 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4063 of @abort, and with a new (better) mechanism for handling the
4078 of @abort, and with a new (better) mechanism for handling the
4064 exceptions.
4079 exceptions.
4065
4080
4066 2002-10-27 Fernando Perez <fperez@colorado.edu>
4081 2002-10-27 Fernando Perez <fperez@colorado.edu>
4067
4082
4068 * IPython/usage.py (__doc__): updated the --help information and
4083 * IPython/usage.py (__doc__): updated the --help information and
4069 the ipythonrc file to indicate that -log generates
4084 the ipythonrc file to indicate that -log generates
4070 ./ipython.log. Also fixed the corresponding info in @logstart.
4085 ./ipython.log. Also fixed the corresponding info in @logstart.
4071 This and several other fixes in the manuals thanks to reports by
4086 This and several other fixes in the manuals thanks to reports by
4072 François Pinard <pinard-AT-iro.umontreal.ca>.
4087 François Pinard <pinard-AT-iro.umontreal.ca>.
4073
4088
4074 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4089 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4075 refer to @logstart (instead of @log, which doesn't exist).
4090 refer to @logstart (instead of @log, which doesn't exist).
4076
4091
4077 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4092 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4078 AttributeError crash. Thanks to Christopher Armstrong
4093 AttributeError crash. Thanks to Christopher Armstrong
4079 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4094 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4080 introduced recently (in 0.2.14pre37) with the fix to the eval
4095 introduced recently (in 0.2.14pre37) with the fix to the eval
4081 problem mentioned below.
4096 problem mentioned below.
4082
4097
4083 2002-10-17 Fernando Perez <fperez@colorado.edu>
4098 2002-10-17 Fernando Perez <fperez@colorado.edu>
4084
4099
4085 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4100 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4086 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4101 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4087
4102
4088 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4103 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4089 this function to fix a problem reported by Alex Schmolck. He saw
4104 this function to fix a problem reported by Alex Schmolck. He saw
4090 it with list comprehensions and generators, which were getting
4105 it with list comprehensions and generators, which were getting
4091 called twice. The real problem was an 'eval' call in testing for
4106 called twice. The real problem was an 'eval' call in testing for
4092 automagic which was evaluating the input line silently.
4107 automagic which was evaluating the input line silently.
4093
4108
4094 This is a potentially very nasty bug, if the input has side
4109 This is a potentially very nasty bug, if the input has side
4095 effects which must not be repeated. The code is much cleaner now,
4110 effects which must not be repeated. The code is much cleaner now,
4096 without any blanket 'except' left and with a regexp test for
4111 without any blanket 'except' left and with a regexp test for
4097 actual function names.
4112 actual function names.
4098
4113
4099 But an eval remains, which I'm not fully comfortable with. I just
4114 But an eval remains, which I'm not fully comfortable with. I just
4100 don't know how to find out if an expression could be a callable in
4115 don't know how to find out if an expression could be a callable in
4101 the user's namespace without doing an eval on the string. However
4116 the user's namespace without doing an eval on the string. However
4102 that string is now much more strictly checked so that no code
4117 that string is now much more strictly checked so that no code
4103 slips by, so the eval should only happen for things that can
4118 slips by, so the eval should only happen for things that can
4104 really be only function/method names.
4119 really be only function/method names.
4105
4120
4106 2002-10-15 Fernando Perez <fperez@colorado.edu>
4121 2002-10-15 Fernando Perez <fperez@colorado.edu>
4107
4122
4108 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4123 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4109 OSX information to main manual, removed README_Mac_OSX file from
4124 OSX information to main manual, removed README_Mac_OSX file from
4110 distribution. Also updated credits for recent additions.
4125 distribution. Also updated credits for recent additions.
4111
4126
4112 2002-10-10 Fernando Perez <fperez@colorado.edu>
4127 2002-10-10 Fernando Perez <fperez@colorado.edu>
4113
4128
4114 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4129 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4115 terminal-related issues. Many thanks to Andrea Riciputi
4130 terminal-related issues. Many thanks to Andrea Riciputi
4116 <andrea.riciputi-AT-libero.it> for writing it.
4131 <andrea.riciputi-AT-libero.it> for writing it.
4117
4132
4118 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4133 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4119 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4134 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4120
4135
4121 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4136 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4122 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4137 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4123 <syver-en-AT-online.no> who both submitted patches for this problem.
4138 <syver-en-AT-online.no> who both submitted patches for this problem.
4124
4139
4125 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4140 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4126 global embedding to make sure that things don't overwrite user
4141 global embedding to make sure that things don't overwrite user
4127 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4142 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4128
4143
4129 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4144 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4130 compatibility. Thanks to Hayden Callow
4145 compatibility. Thanks to Hayden Callow
4131 <h.callow-AT-elec.canterbury.ac.nz>
4146 <h.callow-AT-elec.canterbury.ac.nz>
4132
4147
4133 2002-10-04 Fernando Perez <fperez@colorado.edu>
4148 2002-10-04 Fernando Perez <fperez@colorado.edu>
4134
4149
4135 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4150 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4136 Gnuplot.File objects.
4151 Gnuplot.File objects.
4137
4152
4138 2002-07-23 Fernando Perez <fperez@colorado.edu>
4153 2002-07-23 Fernando Perez <fperez@colorado.edu>
4139
4154
4140 * IPython/genutils.py (timing): Added timings() and timing() for
4155 * IPython/genutils.py (timing): Added timings() and timing() for
4141 quick access to the most commonly needed data, the execution
4156 quick access to the most commonly needed data, the execution
4142 times. Old timing() renamed to timings_out().
4157 times. Old timing() renamed to timings_out().
4143
4158
4144 2002-07-18 Fernando Perez <fperez@colorado.edu>
4159 2002-07-18 Fernando Perez <fperez@colorado.edu>
4145
4160
4146 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4161 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4147 bug with nested instances disrupting the parent's tab completion.
4162 bug with nested instances disrupting the parent's tab completion.
4148
4163
4149 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4164 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4150 all_completions code to begin the emacs integration.
4165 all_completions code to begin the emacs integration.
4151
4166
4152 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4167 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4153 argument to allow titling individual arrays when plotting.
4168 argument to allow titling individual arrays when plotting.
4154
4169
4155 2002-07-15 Fernando Perez <fperez@colorado.edu>
4170 2002-07-15 Fernando Perez <fperez@colorado.edu>
4156
4171
4157 * setup.py (make_shortcut): changed to retrieve the value of
4172 * setup.py (make_shortcut): changed to retrieve the value of
4158 'Program Files' directory from the registry (this value changes in
4173 'Program Files' directory from the registry (this value changes in
4159 non-english versions of Windows). Thanks to Thomas Fanslau
4174 non-english versions of Windows). Thanks to Thomas Fanslau
4160 <tfanslau-AT-gmx.de> for the report.
4175 <tfanslau-AT-gmx.de> for the report.
4161
4176
4162 2002-07-10 Fernando Perez <fperez@colorado.edu>
4177 2002-07-10 Fernando Perez <fperez@colorado.edu>
4163
4178
4164 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4179 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4165 a bug in pdb, which crashes if a line with only whitespace is
4180 a bug in pdb, which crashes if a line with only whitespace is
4166 entered. Bug report submitted to sourceforge.
4181 entered. Bug report submitted to sourceforge.
4167
4182
4168 2002-07-09 Fernando Perez <fperez@colorado.edu>
4183 2002-07-09 Fernando Perez <fperez@colorado.edu>
4169
4184
4170 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4185 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4171 reporting exceptions (it's a bug in inspect.py, I just set a
4186 reporting exceptions (it's a bug in inspect.py, I just set a
4172 workaround).
4187 workaround).
4173
4188
4174 2002-07-08 Fernando Perez <fperez@colorado.edu>
4189 2002-07-08 Fernando Perez <fperez@colorado.edu>
4175
4190
4176 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4191 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4177 __IPYTHON__ in __builtins__ to show up in user_ns.
4192 __IPYTHON__ in __builtins__ to show up in user_ns.
4178
4193
4179 2002-07-03 Fernando Perez <fperez@colorado.edu>
4194 2002-07-03 Fernando Perez <fperez@colorado.edu>
4180
4195
4181 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4196 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4182 name from @gp_set_instance to @gp_set_default.
4197 name from @gp_set_instance to @gp_set_default.
4183
4198
4184 * IPython/ipmaker.py (make_IPython): default editor value set to
4199 * IPython/ipmaker.py (make_IPython): default editor value set to
4185 '0' (a string), to match the rc file. Otherwise will crash when
4200 '0' (a string), to match the rc file. Otherwise will crash when
4186 .strip() is called on it.
4201 .strip() is called on it.
4187
4202
4188
4203
4189 2002-06-28 Fernando Perez <fperez@colorado.edu>
4204 2002-06-28 Fernando Perez <fperez@colorado.edu>
4190
4205
4191 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4206 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4192 of files in current directory when a file is executed via
4207 of files in current directory when a file is executed via
4193 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4208 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4194
4209
4195 * setup.py (manfiles): fix for rpm builds, submitted by RA
4210 * setup.py (manfiles): fix for rpm builds, submitted by RA
4196 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4211 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4197
4212
4198 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4213 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4199 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4214 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4200 string!). A. Schmolck caught this one.
4215 string!). A. Schmolck caught this one.
4201
4216
4202 2002-06-27 Fernando Perez <fperez@colorado.edu>
4217 2002-06-27 Fernando Perez <fperez@colorado.edu>
4203
4218
4204 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4219 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4205 defined files at the cmd line. __name__ wasn't being set to
4220 defined files at the cmd line. __name__ wasn't being set to
4206 __main__.
4221 __main__.
4207
4222
4208 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4223 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4209 regular lists and tuples besides Numeric arrays.
4224 regular lists and tuples besides Numeric arrays.
4210
4225
4211 * IPython/Prompts.py (CachedOutput.__call__): Added output
4226 * IPython/Prompts.py (CachedOutput.__call__): Added output
4212 supression for input ending with ';'. Similar to Mathematica and
4227 supression for input ending with ';'. Similar to Mathematica and
4213 Matlab. The _* vars and Out[] list are still updated, just like
4228 Matlab. The _* vars and Out[] list are still updated, just like
4214 Mathematica behaves.
4229 Mathematica behaves.
4215
4230
4216 2002-06-25 Fernando Perez <fperez@colorado.edu>
4231 2002-06-25 Fernando Perez <fperez@colorado.edu>
4217
4232
4218 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4233 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4219 .ini extensions for profiels under Windows.
4234 .ini extensions for profiels under Windows.
4220
4235
4221 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4236 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4222 string form. Fix contributed by Alexander Schmolck
4237 string form. Fix contributed by Alexander Schmolck
4223 <a.schmolck-AT-gmx.net>
4238 <a.schmolck-AT-gmx.net>
4224
4239
4225 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4240 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4226 pre-configured Gnuplot instance.
4241 pre-configured Gnuplot instance.
4227
4242
4228 2002-06-21 Fernando Perez <fperez@colorado.edu>
4243 2002-06-21 Fernando Perez <fperez@colorado.edu>
4229
4244
4230 * IPython/numutils.py (exp_safe): new function, works around the
4245 * IPython/numutils.py (exp_safe): new function, works around the
4231 underflow problems in Numeric.
4246 underflow problems in Numeric.
4232 (log2): New fn. Safe log in base 2: returns exact integer answer
4247 (log2): New fn. Safe log in base 2: returns exact integer answer
4233 for exact integer powers of 2.
4248 for exact integer powers of 2.
4234
4249
4235 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4250 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4236 properly.
4251 properly.
4237
4252
4238 2002-06-20 Fernando Perez <fperez@colorado.edu>
4253 2002-06-20 Fernando Perez <fperez@colorado.edu>
4239
4254
4240 * IPython/genutils.py (timing): new function like
4255 * IPython/genutils.py (timing): new function like
4241 Mathematica's. Similar to time_test, but returns more info.
4256 Mathematica's. Similar to time_test, but returns more info.
4242
4257
4243 2002-06-18 Fernando Perez <fperez@colorado.edu>
4258 2002-06-18 Fernando Perez <fperez@colorado.edu>
4244
4259
4245 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4260 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4246 according to Mike Heeter's suggestions.
4261 according to Mike Heeter's suggestions.
4247
4262
4248 2002-06-16 Fernando Perez <fperez@colorado.edu>
4263 2002-06-16 Fernando Perez <fperez@colorado.edu>
4249
4264
4250 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4265 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4251 system. GnuplotMagic is gone as a user-directory option. New files
4266 system. GnuplotMagic is gone as a user-directory option. New files
4252 make it easier to use all the gnuplot stuff both from external
4267 make it easier to use all the gnuplot stuff both from external
4253 programs as well as from IPython. Had to rewrite part of
4268 programs as well as from IPython. Had to rewrite part of
4254 hardcopy() b/c of a strange bug: often the ps files simply don't
4269 hardcopy() b/c of a strange bug: often the ps files simply don't
4255 get created, and require a repeat of the command (often several
4270 get created, and require a repeat of the command (often several
4256 times).
4271 times).
4257
4272
4258 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4273 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4259 resolve output channel at call time, so that if sys.stderr has
4274 resolve output channel at call time, so that if sys.stderr has
4260 been redirected by user this gets honored.
4275 been redirected by user this gets honored.
4261
4276
4262 2002-06-13 Fernando Perez <fperez@colorado.edu>
4277 2002-06-13 Fernando Perez <fperez@colorado.edu>
4263
4278
4264 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4279 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4265 IPShell. Kept a copy with the old names to avoid breaking people's
4280 IPShell. Kept a copy with the old names to avoid breaking people's
4266 embedded code.
4281 embedded code.
4267
4282
4268 * IPython/ipython: simplified it to the bare minimum after
4283 * IPython/ipython: simplified it to the bare minimum after
4269 Holger's suggestions. Added info about how to use it in
4284 Holger's suggestions. Added info about how to use it in
4270 PYTHONSTARTUP.
4285 PYTHONSTARTUP.
4271
4286
4272 * IPython/Shell.py (IPythonShell): changed the options passing
4287 * IPython/Shell.py (IPythonShell): changed the options passing
4273 from a string with funky %s replacements to a straight list. Maybe
4288 from a string with funky %s replacements to a straight list. Maybe
4274 a bit more typing, but it follows sys.argv conventions, so there's
4289 a bit more typing, but it follows sys.argv conventions, so there's
4275 less special-casing to remember.
4290 less special-casing to remember.
4276
4291
4277 2002-06-12 Fernando Perez <fperez@colorado.edu>
4292 2002-06-12 Fernando Perez <fperez@colorado.edu>
4278
4293
4279 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4294 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4280 command. Thanks to a suggestion by Mike Heeter.
4295 command. Thanks to a suggestion by Mike Heeter.
4281 (Magic.magic_pfile): added behavior to look at filenames if given
4296 (Magic.magic_pfile): added behavior to look at filenames if given
4282 arg is not a defined object.
4297 arg is not a defined object.
4283 (Magic.magic_save): New @save function to save code snippets. Also
4298 (Magic.magic_save): New @save function to save code snippets. Also
4284 a Mike Heeter idea.
4299 a Mike Heeter idea.
4285
4300
4286 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4301 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4287 plot() and replot(). Much more convenient now, especially for
4302 plot() and replot(). Much more convenient now, especially for
4288 interactive use.
4303 interactive use.
4289
4304
4290 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4305 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4291 filenames.
4306 filenames.
4292
4307
4293 2002-06-02 Fernando Perez <fperez@colorado.edu>
4308 2002-06-02 Fernando Perez <fperez@colorado.edu>
4294
4309
4295 * IPython/Struct.py (Struct.__init__): modified to admit
4310 * IPython/Struct.py (Struct.__init__): modified to admit
4296 initialization via another struct.
4311 initialization via another struct.
4297
4312
4298 * IPython/genutils.py (SystemExec.__init__): New stateful
4313 * IPython/genutils.py (SystemExec.__init__): New stateful
4299 interface to xsys and bq. Useful for writing system scripts.
4314 interface to xsys and bq. Useful for writing system scripts.
4300
4315
4301 2002-05-30 Fernando Perez <fperez@colorado.edu>
4316 2002-05-30 Fernando Perez <fperez@colorado.edu>
4302
4317
4303 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4318 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4304 documents. This will make the user download smaller (it's getting
4319 documents. This will make the user download smaller (it's getting
4305 too big).
4320 too big).
4306
4321
4307 2002-05-29 Fernando Perez <fperez@colorado.edu>
4322 2002-05-29 Fernando Perez <fperez@colorado.edu>
4308
4323
4309 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4324 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4310 fix problems with shelve and pickle. Seems to work, but I don't
4325 fix problems with shelve and pickle. Seems to work, but I don't
4311 know if corner cases break it. Thanks to Mike Heeter
4326 know if corner cases break it. Thanks to Mike Heeter
4312 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4327 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4313
4328
4314 2002-05-24 Fernando Perez <fperez@colorado.edu>
4329 2002-05-24 Fernando Perez <fperez@colorado.edu>
4315
4330
4316 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4331 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4317 macros having broken.
4332 macros having broken.
4318
4333
4319 2002-05-21 Fernando Perez <fperez@colorado.edu>
4334 2002-05-21 Fernando Perez <fperez@colorado.edu>
4320
4335
4321 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4336 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4322 introduced logging bug: all history before logging started was
4337 introduced logging bug: all history before logging started was
4323 being written one character per line! This came from the redesign
4338 being written one character per line! This came from the redesign
4324 of the input history as a special list which slices to strings,
4339 of the input history as a special list which slices to strings,
4325 not to lists.
4340 not to lists.
4326
4341
4327 2002-05-20 Fernando Perez <fperez@colorado.edu>
4342 2002-05-20 Fernando Perez <fperez@colorado.edu>
4328
4343
4329 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4344 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4330 be an attribute of all classes in this module. The design of these
4345 be an attribute of all classes in this module. The design of these
4331 classes needs some serious overhauling.
4346 classes needs some serious overhauling.
4332
4347
4333 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4348 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4334 which was ignoring '_' in option names.
4349 which was ignoring '_' in option names.
4335
4350
4336 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4351 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4337 'Verbose_novars' to 'Context' and made it the new default. It's a
4352 'Verbose_novars' to 'Context' and made it the new default. It's a
4338 bit more readable and also safer than verbose.
4353 bit more readable and also safer than verbose.
4339
4354
4340 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4355 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4341 triple-quoted strings.
4356 triple-quoted strings.
4342
4357
4343 * IPython/OInspect.py (__all__): new module exposing the object
4358 * IPython/OInspect.py (__all__): new module exposing the object
4344 introspection facilities. Now the corresponding magics are dummy
4359 introspection facilities. Now the corresponding magics are dummy
4345 wrappers around this. Having this module will make it much easier
4360 wrappers around this. Having this module will make it much easier
4346 to put these functions into our modified pdb.
4361 to put these functions into our modified pdb.
4347 This new object inspector system uses the new colorizing module,
4362 This new object inspector system uses the new colorizing module,
4348 so source code and other things are nicely syntax highlighted.
4363 so source code and other things are nicely syntax highlighted.
4349
4364
4350 2002-05-18 Fernando Perez <fperez@colorado.edu>
4365 2002-05-18 Fernando Perez <fperez@colorado.edu>
4351
4366
4352 * IPython/ColorANSI.py: Split the coloring tools into a separate
4367 * IPython/ColorANSI.py: Split the coloring tools into a separate
4353 module so I can use them in other code easier (they were part of
4368 module so I can use them in other code easier (they were part of
4354 ultraTB).
4369 ultraTB).
4355
4370
4356 2002-05-17 Fernando Perez <fperez@colorado.edu>
4371 2002-05-17 Fernando Perez <fperez@colorado.edu>
4357
4372
4358 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4373 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4359 fixed it to set the global 'g' also to the called instance, as
4374 fixed it to set the global 'g' also to the called instance, as
4360 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4375 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4361 user's 'g' variables).
4376 user's 'g' variables).
4362
4377
4363 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4378 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4364 global variables (aliases to _ih,_oh) so that users which expect
4379 global variables (aliases to _ih,_oh) so that users which expect
4365 In[5] or Out[7] to work aren't unpleasantly surprised.
4380 In[5] or Out[7] to work aren't unpleasantly surprised.
4366 (InputList.__getslice__): new class to allow executing slices of
4381 (InputList.__getslice__): new class to allow executing slices of
4367 input history directly. Very simple class, complements the use of
4382 input history directly. Very simple class, complements the use of
4368 macros.
4383 macros.
4369
4384
4370 2002-05-16 Fernando Perez <fperez@colorado.edu>
4385 2002-05-16 Fernando Perez <fperez@colorado.edu>
4371
4386
4372 * setup.py (docdirbase): make doc directory be just doc/IPython
4387 * setup.py (docdirbase): make doc directory be just doc/IPython
4373 without version numbers, it will reduce clutter for users.
4388 without version numbers, it will reduce clutter for users.
4374
4389
4375 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4390 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4376 execfile call to prevent possible memory leak. See for details:
4391 execfile call to prevent possible memory leak. See for details:
4377 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4392 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4378
4393
4379 2002-05-15 Fernando Perez <fperez@colorado.edu>
4394 2002-05-15 Fernando Perez <fperez@colorado.edu>
4380
4395
4381 * IPython/Magic.py (Magic.magic_psource): made the object
4396 * IPython/Magic.py (Magic.magic_psource): made the object
4382 introspection names be more standard: pdoc, pdef, pfile and
4397 introspection names be more standard: pdoc, pdef, pfile and
4383 psource. They all print/page their output, and it makes
4398 psource. They all print/page their output, and it makes
4384 remembering them easier. Kept old names for compatibility as
4399 remembering them easier. Kept old names for compatibility as
4385 aliases.
4400 aliases.
4386
4401
4387 2002-05-14 Fernando Perez <fperez@colorado.edu>
4402 2002-05-14 Fernando Perez <fperez@colorado.edu>
4388
4403
4389 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4404 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4390 what the mouse problem was. The trick is to use gnuplot with temp
4405 what the mouse problem was. The trick is to use gnuplot with temp
4391 files and NOT with pipes (for data communication), because having
4406 files and NOT with pipes (for data communication), because having
4392 both pipes and the mouse on is bad news.
4407 both pipes and the mouse on is bad news.
4393
4408
4394 2002-05-13 Fernando Perez <fperez@colorado.edu>
4409 2002-05-13 Fernando Perez <fperez@colorado.edu>
4395
4410
4396 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4411 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4397 bug. Information would be reported about builtins even when
4412 bug. Information would be reported about builtins even when
4398 user-defined functions overrode them.
4413 user-defined functions overrode them.
4399
4414
4400 2002-05-11 Fernando Perez <fperez@colorado.edu>
4415 2002-05-11 Fernando Perez <fperez@colorado.edu>
4401
4416
4402 * IPython/__init__.py (__all__): removed FlexCompleter from
4417 * IPython/__init__.py (__all__): removed FlexCompleter from
4403 __all__ so that things don't fail in platforms without readline.
4418 __all__ so that things don't fail in platforms without readline.
4404
4419
4405 2002-05-10 Fernando Perez <fperez@colorado.edu>
4420 2002-05-10 Fernando Perez <fperez@colorado.edu>
4406
4421
4407 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4422 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4408 it requires Numeric, effectively making Numeric a dependency for
4423 it requires Numeric, effectively making Numeric a dependency for
4409 IPython.
4424 IPython.
4410
4425
4411 * Released 0.2.13
4426 * Released 0.2.13
4412
4427
4413 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4428 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4414 profiler interface. Now all the major options from the profiler
4429 profiler interface. Now all the major options from the profiler
4415 module are directly supported in IPython, both for single
4430 module are directly supported in IPython, both for single
4416 expressions (@prun) and for full programs (@run -p).
4431 expressions (@prun) and for full programs (@run -p).
4417
4432
4418 2002-05-09 Fernando Perez <fperez@colorado.edu>
4433 2002-05-09 Fernando Perez <fperez@colorado.edu>
4419
4434
4420 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4435 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4421 magic properly formatted for screen.
4436 magic properly formatted for screen.
4422
4437
4423 * setup.py (make_shortcut): Changed things to put pdf version in
4438 * setup.py (make_shortcut): Changed things to put pdf version in
4424 doc/ instead of doc/manual (had to change lyxport a bit).
4439 doc/ instead of doc/manual (had to change lyxport a bit).
4425
4440
4426 * IPython/Magic.py (Profile.string_stats): made profile runs go
4441 * IPython/Magic.py (Profile.string_stats): made profile runs go
4427 through pager (they are long and a pager allows searching, saving,
4442 through pager (they are long and a pager allows searching, saving,
4428 etc.)
4443 etc.)
4429
4444
4430 2002-05-08 Fernando Perez <fperez@colorado.edu>
4445 2002-05-08 Fernando Perez <fperez@colorado.edu>
4431
4446
4432 * Released 0.2.12
4447 * Released 0.2.12
4433
4448
4434 2002-05-06 Fernando Perez <fperez@colorado.edu>
4449 2002-05-06 Fernando Perez <fperez@colorado.edu>
4435
4450
4436 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4451 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4437 introduced); 'hist n1 n2' was broken.
4452 introduced); 'hist n1 n2' was broken.
4438 (Magic.magic_pdb): added optional on/off arguments to @pdb
4453 (Magic.magic_pdb): added optional on/off arguments to @pdb
4439 (Magic.magic_run): added option -i to @run, which executes code in
4454 (Magic.magic_run): added option -i to @run, which executes code in
4440 the IPython namespace instead of a clean one. Also added @irun as
4455 the IPython namespace instead of a clean one. Also added @irun as
4441 an alias to @run -i.
4456 an alias to @run -i.
4442
4457
4443 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4458 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4444 fixed (it didn't really do anything, the namespaces were wrong).
4459 fixed (it didn't really do anything, the namespaces were wrong).
4445
4460
4446 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4461 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4447
4462
4448 * IPython/__init__.py (__all__): Fixed package namespace, now
4463 * IPython/__init__.py (__all__): Fixed package namespace, now
4449 'import IPython' does give access to IPython.<all> as
4464 'import IPython' does give access to IPython.<all> as
4450 expected. Also renamed __release__ to Release.
4465 expected. Also renamed __release__ to Release.
4451
4466
4452 * IPython/Debugger.py (__license__): created new Pdb class which
4467 * IPython/Debugger.py (__license__): created new Pdb class which
4453 functions like a drop-in for the normal pdb.Pdb but does NOT
4468 functions like a drop-in for the normal pdb.Pdb but does NOT
4454 import readline by default. This way it doesn't muck up IPython's
4469 import readline by default. This way it doesn't muck up IPython's
4455 readline handling, and now tab-completion finally works in the
4470 readline handling, and now tab-completion finally works in the
4456 debugger -- sort of. It completes things globally visible, but the
4471 debugger -- sort of. It completes things globally visible, but the
4457 completer doesn't track the stack as pdb walks it. That's a bit
4472 completer doesn't track the stack as pdb walks it. That's a bit
4458 tricky, and I'll have to implement it later.
4473 tricky, and I'll have to implement it later.
4459
4474
4460 2002-05-05 Fernando Perez <fperez@colorado.edu>
4475 2002-05-05 Fernando Perez <fperez@colorado.edu>
4461
4476
4462 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4477 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4463 magic docstrings when printed via ? (explicit \'s were being
4478 magic docstrings when printed via ? (explicit \'s were being
4464 printed).
4479 printed).
4465
4480
4466 * IPython/ipmaker.py (make_IPython): fixed namespace
4481 * IPython/ipmaker.py (make_IPython): fixed namespace
4467 identification bug. Now variables loaded via logs or command-line
4482 identification bug. Now variables loaded via logs or command-line
4468 files are recognized in the interactive namespace by @who.
4483 files are recognized in the interactive namespace by @who.
4469
4484
4470 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4485 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4471 log replay system stemming from the string form of Structs.
4486 log replay system stemming from the string form of Structs.
4472
4487
4473 * IPython/Magic.py (Macro.__init__): improved macros to properly
4488 * IPython/Magic.py (Macro.__init__): improved macros to properly
4474 handle magic commands in them.
4489 handle magic commands in them.
4475 (Magic.magic_logstart): usernames are now expanded so 'logstart
4490 (Magic.magic_logstart): usernames are now expanded so 'logstart
4476 ~/mylog' now works.
4491 ~/mylog' now works.
4477
4492
4478 * IPython/iplib.py (complete): fixed bug where paths starting with
4493 * IPython/iplib.py (complete): fixed bug where paths starting with
4479 '/' would be completed as magic names.
4494 '/' would be completed as magic names.
4480
4495
4481 2002-05-04 Fernando Perez <fperez@colorado.edu>
4496 2002-05-04 Fernando Perez <fperez@colorado.edu>
4482
4497
4483 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4498 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4484 allow running full programs under the profiler's control.
4499 allow running full programs under the profiler's control.
4485
4500
4486 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4501 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4487 mode to report exceptions verbosely but without formatting
4502 mode to report exceptions verbosely but without formatting
4488 variables. This addresses the issue of ipython 'freezing' (it's
4503 variables. This addresses the issue of ipython 'freezing' (it's
4489 not frozen, but caught in an expensive formatting loop) when huge
4504 not frozen, but caught in an expensive formatting loop) when huge
4490 variables are in the context of an exception.
4505 variables are in the context of an exception.
4491 (VerboseTB.text): Added '--->' markers at line where exception was
4506 (VerboseTB.text): Added '--->' markers at line where exception was
4492 triggered. Much clearer to read, especially in NoColor modes.
4507 triggered. Much clearer to read, especially in NoColor modes.
4493
4508
4494 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4509 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4495 implemented in reverse when changing to the new parse_options().
4510 implemented in reverse when changing to the new parse_options().
4496
4511
4497 2002-05-03 Fernando Perez <fperez@colorado.edu>
4512 2002-05-03 Fernando Perez <fperez@colorado.edu>
4498
4513
4499 * IPython/Magic.py (Magic.parse_options): new function so that
4514 * IPython/Magic.py (Magic.parse_options): new function so that
4500 magics can parse options easier.
4515 magics can parse options easier.
4501 (Magic.magic_prun): new function similar to profile.run(),
4516 (Magic.magic_prun): new function similar to profile.run(),
4502 suggested by Chris Hart.
4517 suggested by Chris Hart.
4503 (Magic.magic_cd): fixed behavior so that it only changes if
4518 (Magic.magic_cd): fixed behavior so that it only changes if
4504 directory actually is in history.
4519 directory actually is in history.
4505
4520
4506 * IPython/usage.py (__doc__): added information about potential
4521 * IPython/usage.py (__doc__): added information about potential
4507 slowness of Verbose exception mode when there are huge data
4522 slowness of Verbose exception mode when there are huge data
4508 structures to be formatted (thanks to Archie Paulson).
4523 structures to be formatted (thanks to Archie Paulson).
4509
4524
4510 * IPython/ipmaker.py (make_IPython): Changed default logging
4525 * IPython/ipmaker.py (make_IPython): Changed default logging
4511 (when simply called with -log) to use curr_dir/ipython.log in
4526 (when simply called with -log) to use curr_dir/ipython.log in
4512 rotate mode. Fixed crash which was occuring with -log before
4527 rotate mode. Fixed crash which was occuring with -log before
4513 (thanks to Jim Boyle).
4528 (thanks to Jim Boyle).
4514
4529
4515 2002-05-01 Fernando Perez <fperez@colorado.edu>
4530 2002-05-01 Fernando Perez <fperez@colorado.edu>
4516
4531
4517 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4532 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4518 was nasty -- though somewhat of a corner case).
4533 was nasty -- though somewhat of a corner case).
4519
4534
4520 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4535 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4521 text (was a bug).
4536 text (was a bug).
4522
4537
4523 2002-04-30 Fernando Perez <fperez@colorado.edu>
4538 2002-04-30 Fernando Perez <fperez@colorado.edu>
4524
4539
4525 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4540 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4526 a print after ^D or ^C from the user so that the In[] prompt
4541 a print after ^D or ^C from the user so that the In[] prompt
4527 doesn't over-run the gnuplot one.
4542 doesn't over-run the gnuplot one.
4528
4543
4529 2002-04-29 Fernando Perez <fperez@colorado.edu>
4544 2002-04-29 Fernando Perez <fperez@colorado.edu>
4530
4545
4531 * Released 0.2.10
4546 * Released 0.2.10
4532
4547
4533 * IPython/__release__.py (version): get date dynamically.
4548 * IPython/__release__.py (version): get date dynamically.
4534
4549
4535 * Misc. documentation updates thanks to Arnd's comments. Also ran
4550 * Misc. documentation updates thanks to Arnd's comments. Also ran
4536 a full spellcheck on the manual (hadn't been done in a while).
4551 a full spellcheck on the manual (hadn't been done in a while).
4537
4552
4538 2002-04-27 Fernando Perez <fperez@colorado.edu>
4553 2002-04-27 Fernando Perez <fperez@colorado.edu>
4539
4554
4540 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4555 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4541 starting a log in mid-session would reset the input history list.
4556 starting a log in mid-session would reset the input history list.
4542
4557
4543 2002-04-26 Fernando Perez <fperez@colorado.edu>
4558 2002-04-26 Fernando Perez <fperez@colorado.edu>
4544
4559
4545 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4560 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4546 all files were being included in an update. Now anything in
4561 all files were being included in an update. Now anything in
4547 UserConfig that matches [A-Za-z]*.py will go (this excludes
4562 UserConfig that matches [A-Za-z]*.py will go (this excludes
4548 __init__.py)
4563 __init__.py)
4549
4564
4550 2002-04-25 Fernando Perez <fperez@colorado.edu>
4565 2002-04-25 Fernando Perez <fperez@colorado.edu>
4551
4566
4552 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4567 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4553 to __builtins__ so that any form of embedded or imported code can
4568 to __builtins__ so that any form of embedded or imported code can
4554 test for being inside IPython.
4569 test for being inside IPython.
4555
4570
4556 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4571 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4557 changed to GnuplotMagic because it's now an importable module,
4572 changed to GnuplotMagic because it's now an importable module,
4558 this makes the name follow that of the standard Gnuplot module.
4573 this makes the name follow that of the standard Gnuplot module.
4559 GnuplotMagic can now be loaded at any time in mid-session.
4574 GnuplotMagic can now be loaded at any time in mid-session.
4560
4575
4561 2002-04-24 Fernando Perez <fperez@colorado.edu>
4576 2002-04-24 Fernando Perez <fperez@colorado.edu>
4562
4577
4563 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4578 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4564 the globals (IPython has its own namespace) and the
4579 the globals (IPython has its own namespace) and the
4565 PhysicalQuantity stuff is much better anyway.
4580 PhysicalQuantity stuff is much better anyway.
4566
4581
4567 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4582 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4568 embedding example to standard user directory for
4583 embedding example to standard user directory for
4569 distribution. Also put it in the manual.
4584 distribution. Also put it in the manual.
4570
4585
4571 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4586 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4572 instance as first argument (so it doesn't rely on some obscure
4587 instance as first argument (so it doesn't rely on some obscure
4573 hidden global).
4588 hidden global).
4574
4589
4575 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4590 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4576 delimiters. While it prevents ().TAB from working, it allows
4591 delimiters. While it prevents ().TAB from working, it allows
4577 completions in open (... expressions. This is by far a more common
4592 completions in open (... expressions. This is by far a more common
4578 case.
4593 case.
4579
4594
4580 2002-04-23 Fernando Perez <fperez@colorado.edu>
4595 2002-04-23 Fernando Perez <fperez@colorado.edu>
4581
4596
4582 * IPython/Extensions/InterpreterPasteInput.py: new
4597 * IPython/Extensions/InterpreterPasteInput.py: new
4583 syntax-processing module for pasting lines with >>> or ... at the
4598 syntax-processing module for pasting lines with >>> or ... at the
4584 start.
4599 start.
4585
4600
4586 * IPython/Extensions/PhysicalQ_Interactive.py
4601 * IPython/Extensions/PhysicalQ_Interactive.py
4587 (PhysicalQuantityInteractive.__int__): fixed to work with either
4602 (PhysicalQuantityInteractive.__int__): fixed to work with either
4588 Numeric or math.
4603 Numeric or math.
4589
4604
4590 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4605 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4591 provided profiles. Now we have:
4606 provided profiles. Now we have:
4592 -math -> math module as * and cmath with its own namespace.
4607 -math -> math module as * and cmath with its own namespace.
4593 -numeric -> Numeric as *, plus gnuplot & grace
4608 -numeric -> Numeric as *, plus gnuplot & grace
4594 -physics -> same as before
4609 -physics -> same as before
4595
4610
4596 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4611 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4597 user-defined magics wouldn't be found by @magic if they were
4612 user-defined magics wouldn't be found by @magic if they were
4598 defined as class methods. Also cleaned up the namespace search
4613 defined as class methods. Also cleaned up the namespace search
4599 logic and the string building (to use %s instead of many repeated
4614 logic and the string building (to use %s instead of many repeated
4600 string adds).
4615 string adds).
4601
4616
4602 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4617 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4603 of user-defined magics to operate with class methods (cleaner, in
4618 of user-defined magics to operate with class methods (cleaner, in
4604 line with the gnuplot code).
4619 line with the gnuplot code).
4605
4620
4606 2002-04-22 Fernando Perez <fperez@colorado.edu>
4621 2002-04-22 Fernando Perez <fperez@colorado.edu>
4607
4622
4608 * setup.py: updated dependency list so that manual is updated when
4623 * setup.py: updated dependency list so that manual is updated when
4609 all included files change.
4624 all included files change.
4610
4625
4611 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4626 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4612 the delimiter removal option (the fix is ugly right now).
4627 the delimiter removal option (the fix is ugly right now).
4613
4628
4614 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4629 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4615 all of the math profile (quicker loading, no conflict between
4630 all of the math profile (quicker loading, no conflict between
4616 g-9.8 and g-gnuplot).
4631 g-9.8 and g-gnuplot).
4617
4632
4618 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4633 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4619 name of post-mortem files to IPython_crash_report.txt.
4634 name of post-mortem files to IPython_crash_report.txt.
4620
4635
4621 * Cleanup/update of the docs. Added all the new readline info and
4636 * Cleanup/update of the docs. Added all the new readline info and
4622 formatted all lists as 'real lists'.
4637 formatted all lists as 'real lists'.
4623
4638
4624 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4639 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4625 tab-completion options, since the full readline parse_and_bind is
4640 tab-completion options, since the full readline parse_and_bind is
4626 now accessible.
4641 now accessible.
4627
4642
4628 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4643 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4629 handling of readline options. Now users can specify any string to
4644 handling of readline options. Now users can specify any string to
4630 be passed to parse_and_bind(), as well as the delimiters to be
4645 be passed to parse_and_bind(), as well as the delimiters to be
4631 removed.
4646 removed.
4632 (InteractiveShell.__init__): Added __name__ to the global
4647 (InteractiveShell.__init__): Added __name__ to the global
4633 namespace so that things like Itpl which rely on its existence
4648 namespace so that things like Itpl which rely on its existence
4634 don't crash.
4649 don't crash.
4635 (InteractiveShell._prefilter): Defined the default with a _ so
4650 (InteractiveShell._prefilter): Defined the default with a _ so
4636 that prefilter() is easier to override, while the default one
4651 that prefilter() is easier to override, while the default one
4637 remains available.
4652 remains available.
4638
4653
4639 2002-04-18 Fernando Perez <fperez@colorado.edu>
4654 2002-04-18 Fernando Perez <fperez@colorado.edu>
4640
4655
4641 * Added information about pdb in the docs.
4656 * Added information about pdb in the docs.
4642
4657
4643 2002-04-17 Fernando Perez <fperez@colorado.edu>
4658 2002-04-17 Fernando Perez <fperez@colorado.edu>
4644
4659
4645 * IPython/ipmaker.py (make_IPython): added rc_override option to
4660 * IPython/ipmaker.py (make_IPython): added rc_override option to
4646 allow passing config options at creation time which may override
4661 allow passing config options at creation time which may override
4647 anything set in the config files or command line. This is
4662 anything set in the config files or command line. This is
4648 particularly useful for configuring embedded instances.
4663 particularly useful for configuring embedded instances.
4649
4664
4650 2002-04-15 Fernando Perez <fperez@colorado.edu>
4665 2002-04-15 Fernando Perez <fperez@colorado.edu>
4651
4666
4652 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4667 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4653 crash embedded instances because of the input cache falling out of
4668 crash embedded instances because of the input cache falling out of
4654 sync with the output counter.
4669 sync with the output counter.
4655
4670
4656 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4671 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4657 mode which calls pdb after an uncaught exception in IPython itself.
4672 mode which calls pdb after an uncaught exception in IPython itself.
4658
4673
4659 2002-04-14 Fernando Perez <fperez@colorado.edu>
4674 2002-04-14 Fernando Perez <fperez@colorado.edu>
4660
4675
4661 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4676 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4662 readline, fix it back after each call.
4677 readline, fix it back after each call.
4663
4678
4664 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4679 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4665 method to force all access via __call__(), which guarantees that
4680 method to force all access via __call__(), which guarantees that
4666 traceback references are properly deleted.
4681 traceback references are properly deleted.
4667
4682
4668 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4683 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4669 improve printing when pprint is in use.
4684 improve printing when pprint is in use.
4670
4685
4671 2002-04-13 Fernando Perez <fperez@colorado.edu>
4686 2002-04-13 Fernando Perez <fperez@colorado.edu>
4672
4687
4673 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4688 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4674 exceptions aren't caught anymore. If the user triggers one, he
4689 exceptions aren't caught anymore. If the user triggers one, he
4675 should know why he's doing it and it should go all the way up,
4690 should know why he's doing it and it should go all the way up,
4676 just like any other exception. So now @abort will fully kill the
4691 just like any other exception. So now @abort will fully kill the
4677 embedded interpreter and the embedding code (unless that happens
4692 embedded interpreter and the embedding code (unless that happens
4678 to catch SystemExit).
4693 to catch SystemExit).
4679
4694
4680 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4695 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4681 and a debugger() method to invoke the interactive pdb debugger
4696 and a debugger() method to invoke the interactive pdb debugger
4682 after printing exception information. Also added the corresponding
4697 after printing exception information. Also added the corresponding
4683 -pdb option and @pdb magic to control this feature, and updated
4698 -pdb option and @pdb magic to control this feature, and updated
4684 the docs. After a suggestion from Christopher Hart
4699 the docs. After a suggestion from Christopher Hart
4685 (hart-AT-caltech.edu).
4700 (hart-AT-caltech.edu).
4686
4701
4687 2002-04-12 Fernando Perez <fperez@colorado.edu>
4702 2002-04-12 Fernando Perez <fperez@colorado.edu>
4688
4703
4689 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4704 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4690 the exception handlers defined by the user (not the CrashHandler)
4705 the exception handlers defined by the user (not the CrashHandler)
4691 so that user exceptions don't trigger an ipython bug report.
4706 so that user exceptions don't trigger an ipython bug report.
4692
4707
4693 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4708 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4694 configurable (it should have always been so).
4709 configurable (it should have always been so).
4695
4710
4696 2002-03-26 Fernando Perez <fperez@colorado.edu>
4711 2002-03-26 Fernando Perez <fperez@colorado.edu>
4697
4712
4698 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4713 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4699 and there to fix embedding namespace issues. This should all be
4714 and there to fix embedding namespace issues. This should all be
4700 done in a more elegant way.
4715 done in a more elegant way.
4701
4716
4702 2002-03-25 Fernando Perez <fperez@colorado.edu>
4717 2002-03-25 Fernando Perez <fperez@colorado.edu>
4703
4718
4704 * IPython/genutils.py (get_home_dir): Try to make it work under
4719 * IPython/genutils.py (get_home_dir): Try to make it work under
4705 win9x also.
4720 win9x also.
4706
4721
4707 2002-03-20 Fernando Perez <fperez@colorado.edu>
4722 2002-03-20 Fernando Perez <fperez@colorado.edu>
4708
4723
4709 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4724 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4710 sys.displayhook untouched upon __init__.
4725 sys.displayhook untouched upon __init__.
4711
4726
4712 2002-03-19 Fernando Perez <fperez@colorado.edu>
4727 2002-03-19 Fernando Perez <fperez@colorado.edu>
4713
4728
4714 * Released 0.2.9 (for embedding bug, basically).
4729 * Released 0.2.9 (for embedding bug, basically).
4715
4730
4716 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4731 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4717 exceptions so that enclosing shell's state can be restored.
4732 exceptions so that enclosing shell's state can be restored.
4718
4733
4719 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4734 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4720 naming conventions in the .ipython/ dir.
4735 naming conventions in the .ipython/ dir.
4721
4736
4722 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4737 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4723 from delimiters list so filenames with - in them get expanded.
4738 from delimiters list so filenames with - in them get expanded.
4724
4739
4725 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4740 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4726 sys.displayhook not being properly restored after an embedded call.
4741 sys.displayhook not being properly restored after an embedded call.
4727
4742
4728 2002-03-18 Fernando Perez <fperez@colorado.edu>
4743 2002-03-18 Fernando Perez <fperez@colorado.edu>
4729
4744
4730 * Released 0.2.8
4745 * Released 0.2.8
4731
4746
4732 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4747 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4733 some files weren't being included in a -upgrade.
4748 some files weren't being included in a -upgrade.
4734 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4749 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4735 on' so that the first tab completes.
4750 on' so that the first tab completes.
4736 (InteractiveShell.handle_magic): fixed bug with spaces around
4751 (InteractiveShell.handle_magic): fixed bug with spaces around
4737 quotes breaking many magic commands.
4752 quotes breaking many magic commands.
4738
4753
4739 * setup.py: added note about ignoring the syntax error messages at
4754 * setup.py: added note about ignoring the syntax error messages at
4740 installation.
4755 installation.
4741
4756
4742 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4757 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4743 streamlining the gnuplot interface, now there's only one magic @gp.
4758 streamlining the gnuplot interface, now there's only one magic @gp.
4744
4759
4745 2002-03-17 Fernando Perez <fperez@colorado.edu>
4760 2002-03-17 Fernando Perez <fperez@colorado.edu>
4746
4761
4747 * IPython/UserConfig/magic_gnuplot.py: new name for the
4762 * IPython/UserConfig/magic_gnuplot.py: new name for the
4748 example-magic_pm.py file. Much enhanced system, now with a shell
4763 example-magic_pm.py file. Much enhanced system, now with a shell
4749 for communicating directly with gnuplot, one command at a time.
4764 for communicating directly with gnuplot, one command at a time.
4750
4765
4751 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4766 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4752 setting __name__=='__main__'.
4767 setting __name__=='__main__'.
4753
4768
4754 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4769 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4755 mini-shell for accessing gnuplot from inside ipython. Should
4770 mini-shell for accessing gnuplot from inside ipython. Should
4756 extend it later for grace access too. Inspired by Arnd's
4771 extend it later for grace access too. Inspired by Arnd's
4757 suggestion.
4772 suggestion.
4758
4773
4759 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4774 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4760 calling magic functions with () in their arguments. Thanks to Arnd
4775 calling magic functions with () in their arguments. Thanks to Arnd
4761 Baecker for pointing this to me.
4776 Baecker for pointing this to me.
4762
4777
4763 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4778 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4764 infinitely for integer or complex arrays (only worked with floats).
4779 infinitely for integer or complex arrays (only worked with floats).
4765
4780
4766 2002-03-16 Fernando Perez <fperez@colorado.edu>
4781 2002-03-16 Fernando Perez <fperez@colorado.edu>
4767
4782
4768 * setup.py: Merged setup and setup_windows into a single script
4783 * setup.py: Merged setup and setup_windows into a single script
4769 which properly handles things for windows users.
4784 which properly handles things for windows users.
4770
4785
4771 2002-03-15 Fernando Perez <fperez@colorado.edu>
4786 2002-03-15 Fernando Perez <fperez@colorado.edu>
4772
4787
4773 * Big change to the manual: now the magics are all automatically
4788 * Big change to the manual: now the magics are all automatically
4774 documented. This information is generated from their docstrings
4789 documented. This information is generated from their docstrings
4775 and put in a latex file included by the manual lyx file. This way
4790 and put in a latex file included by the manual lyx file. This way
4776 we get always up to date information for the magics. The manual
4791 we get always up to date information for the magics. The manual
4777 now also has proper version information, also auto-synced.
4792 now also has proper version information, also auto-synced.
4778
4793
4779 For this to work, an undocumented --magic_docstrings option was added.
4794 For this to work, an undocumented --magic_docstrings option was added.
4780
4795
4781 2002-03-13 Fernando Perez <fperez@colorado.edu>
4796 2002-03-13 Fernando Perez <fperez@colorado.edu>
4782
4797
4783 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4798 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4784 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4799 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4785
4800
4786 2002-03-12 Fernando Perez <fperez@colorado.edu>
4801 2002-03-12 Fernando Perez <fperez@colorado.edu>
4787
4802
4788 * IPython/ultraTB.py (TermColors): changed color escapes again to
4803 * IPython/ultraTB.py (TermColors): changed color escapes again to
4789 fix the (old, reintroduced) line-wrapping bug. Basically, if
4804 fix the (old, reintroduced) line-wrapping bug. Basically, if
4790 \001..\002 aren't given in the color escapes, lines get wrapped
4805 \001..\002 aren't given in the color escapes, lines get wrapped
4791 weirdly. But giving those screws up old xterms and emacs terms. So
4806 weirdly. But giving those screws up old xterms and emacs terms. So
4792 I added some logic for emacs terms to be ok, but I can't identify old
4807 I added some logic for emacs terms to be ok, but I can't identify old
4793 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4808 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4794
4809
4795 2002-03-10 Fernando Perez <fperez@colorado.edu>
4810 2002-03-10 Fernando Perez <fperez@colorado.edu>
4796
4811
4797 * IPython/usage.py (__doc__): Various documentation cleanups and
4812 * IPython/usage.py (__doc__): Various documentation cleanups and
4798 updates, both in usage docstrings and in the manual.
4813 updates, both in usage docstrings and in the manual.
4799
4814
4800 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4815 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4801 handling of caching. Set minimum acceptabe value for having a
4816 handling of caching. Set minimum acceptabe value for having a
4802 cache at 20 values.
4817 cache at 20 values.
4803
4818
4804 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4819 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4805 install_first_time function to a method, renamed it and added an
4820 install_first_time function to a method, renamed it and added an
4806 'upgrade' mode. Now people can update their config directory with
4821 'upgrade' mode. Now people can update their config directory with
4807 a simple command line switch (-upgrade, also new).
4822 a simple command line switch (-upgrade, also new).
4808
4823
4809 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4824 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4810 @file (convenient for automagic users under Python >= 2.2).
4825 @file (convenient for automagic users under Python >= 2.2).
4811 Removed @files (it seemed more like a plural than an abbrev. of
4826 Removed @files (it seemed more like a plural than an abbrev. of
4812 'file show').
4827 'file show').
4813
4828
4814 * IPython/iplib.py (install_first_time): Fixed crash if there were
4829 * IPython/iplib.py (install_first_time): Fixed crash if there were
4815 backup files ('~') in .ipython/ install directory.
4830 backup files ('~') in .ipython/ install directory.
4816
4831
4817 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4832 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4818 system. Things look fine, but these changes are fairly
4833 system. Things look fine, but these changes are fairly
4819 intrusive. Test them for a few days.
4834 intrusive. Test them for a few days.
4820
4835
4821 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4836 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4822 the prompts system. Now all in/out prompt strings are user
4837 the prompts system. Now all in/out prompt strings are user
4823 controllable. This is particularly useful for embedding, as one
4838 controllable. This is particularly useful for embedding, as one
4824 can tag embedded instances with particular prompts.
4839 can tag embedded instances with particular prompts.
4825
4840
4826 Also removed global use of sys.ps1/2, which now allows nested
4841 Also removed global use of sys.ps1/2, which now allows nested
4827 embeddings without any problems. Added command-line options for
4842 embeddings without any problems. Added command-line options for
4828 the prompt strings.
4843 the prompt strings.
4829
4844
4830 2002-03-08 Fernando Perez <fperez@colorado.edu>
4845 2002-03-08 Fernando Perez <fperez@colorado.edu>
4831
4846
4832 * IPython/UserConfig/example-embed-short.py (ipshell): added
4847 * IPython/UserConfig/example-embed-short.py (ipshell): added
4833 example file with the bare minimum code for embedding.
4848 example file with the bare minimum code for embedding.
4834
4849
4835 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4850 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4836 functionality for the embeddable shell to be activated/deactivated
4851 functionality for the embeddable shell to be activated/deactivated
4837 either globally or at each call.
4852 either globally or at each call.
4838
4853
4839 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4854 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4840 rewriting the prompt with '--->' for auto-inputs with proper
4855 rewriting the prompt with '--->' for auto-inputs with proper
4841 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4856 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4842 this is handled by the prompts class itself, as it should.
4857 this is handled by the prompts class itself, as it should.
4843
4858
4844 2002-03-05 Fernando Perez <fperez@colorado.edu>
4859 2002-03-05 Fernando Perez <fperez@colorado.edu>
4845
4860
4846 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4861 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4847 @logstart to avoid name clashes with the math log function.
4862 @logstart to avoid name clashes with the math log function.
4848
4863
4849 * Big updates to X/Emacs section of the manual.
4864 * Big updates to X/Emacs section of the manual.
4850
4865
4851 * Removed ipython_emacs. Milan explained to me how to pass
4866 * Removed ipython_emacs. Milan explained to me how to pass
4852 arguments to ipython through Emacs. Some day I'm going to end up
4867 arguments to ipython through Emacs. Some day I'm going to end up
4853 learning some lisp...
4868 learning some lisp...
4854
4869
4855 2002-03-04 Fernando Perez <fperez@colorado.edu>
4870 2002-03-04 Fernando Perez <fperez@colorado.edu>
4856
4871
4857 * IPython/ipython_emacs: Created script to be used as the
4872 * IPython/ipython_emacs: Created script to be used as the
4858 py-python-command Emacs variable so we can pass IPython
4873 py-python-command Emacs variable so we can pass IPython
4859 parameters. I can't figure out how to tell Emacs directly to pass
4874 parameters. I can't figure out how to tell Emacs directly to pass
4860 parameters to IPython, so a dummy shell script will do it.
4875 parameters to IPython, so a dummy shell script will do it.
4861
4876
4862 Other enhancements made for things to work better under Emacs'
4877 Other enhancements made for things to work better under Emacs'
4863 various types of terminals. Many thanks to Milan Zamazal
4878 various types of terminals. Many thanks to Milan Zamazal
4864 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4879 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4865
4880
4866 2002-03-01 Fernando Perez <fperez@colorado.edu>
4881 2002-03-01 Fernando Perez <fperez@colorado.edu>
4867
4882
4868 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4883 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4869 that loading of readline is now optional. This gives better
4884 that loading of readline is now optional. This gives better
4870 control to emacs users.
4885 control to emacs users.
4871
4886
4872 * IPython/ultraTB.py (__date__): Modified color escape sequences
4887 * IPython/ultraTB.py (__date__): Modified color escape sequences
4873 and now things work fine under xterm and in Emacs' term buffers
4888 and now things work fine under xterm and in Emacs' term buffers
4874 (though not shell ones). Well, in emacs you get colors, but all
4889 (though not shell ones). Well, in emacs you get colors, but all
4875 seem to be 'light' colors (no difference between dark and light
4890 seem to be 'light' colors (no difference between dark and light
4876 ones). But the garbage chars are gone, and also in xterms. It
4891 ones). But the garbage chars are gone, and also in xterms. It
4877 seems that now I'm using 'cleaner' ansi sequences.
4892 seems that now I'm using 'cleaner' ansi sequences.
4878
4893
4879 2002-02-21 Fernando Perez <fperez@colorado.edu>
4894 2002-02-21 Fernando Perez <fperez@colorado.edu>
4880
4895
4881 * Released 0.2.7 (mainly to publish the scoping fix).
4896 * Released 0.2.7 (mainly to publish the scoping fix).
4882
4897
4883 * IPython/Logger.py (Logger.logstate): added. A corresponding
4898 * IPython/Logger.py (Logger.logstate): added. A corresponding
4884 @logstate magic was created.
4899 @logstate magic was created.
4885
4900
4886 * IPython/Magic.py: fixed nested scoping problem under Python
4901 * IPython/Magic.py: fixed nested scoping problem under Python
4887 2.1.x (automagic wasn't working).
4902 2.1.x (automagic wasn't working).
4888
4903
4889 2002-02-20 Fernando Perez <fperez@colorado.edu>
4904 2002-02-20 Fernando Perez <fperez@colorado.edu>
4890
4905
4891 * Released 0.2.6.
4906 * Released 0.2.6.
4892
4907
4893 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4908 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4894 option so that logs can come out without any headers at all.
4909 option so that logs can come out without any headers at all.
4895
4910
4896 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4911 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4897 SciPy.
4912 SciPy.
4898
4913
4899 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4914 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4900 that embedded IPython calls don't require vars() to be explicitly
4915 that embedded IPython calls don't require vars() to be explicitly
4901 passed. Now they are extracted from the caller's frame (code
4916 passed. Now they are extracted from the caller's frame (code
4902 snatched from Eric Jones' weave). Added better documentation to
4917 snatched from Eric Jones' weave). Added better documentation to
4903 the section on embedding and the example file.
4918 the section on embedding and the example file.
4904
4919
4905 * IPython/genutils.py (page): Changed so that under emacs, it just
4920 * IPython/genutils.py (page): Changed so that under emacs, it just
4906 prints the string. You can then page up and down in the emacs
4921 prints the string. You can then page up and down in the emacs
4907 buffer itself. This is how the builtin help() works.
4922 buffer itself. This is how the builtin help() works.
4908
4923
4909 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4924 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4910 macro scoping: macros need to be executed in the user's namespace
4925 macro scoping: macros need to be executed in the user's namespace
4911 to work as if they had been typed by the user.
4926 to work as if they had been typed by the user.
4912
4927
4913 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4928 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4914 execute automatically (no need to type 'exec...'). They then
4929 execute automatically (no need to type 'exec...'). They then
4915 behave like 'true macros'. The printing system was also modified
4930 behave like 'true macros'. The printing system was also modified
4916 for this to work.
4931 for this to work.
4917
4932
4918 2002-02-19 Fernando Perez <fperez@colorado.edu>
4933 2002-02-19 Fernando Perez <fperez@colorado.edu>
4919
4934
4920 * IPython/genutils.py (page_file): new function for paging files
4935 * IPython/genutils.py (page_file): new function for paging files
4921 in an OS-independent way. Also necessary for file viewing to work
4936 in an OS-independent way. Also necessary for file viewing to work
4922 well inside Emacs buffers.
4937 well inside Emacs buffers.
4923 (page): Added checks for being in an emacs buffer.
4938 (page): Added checks for being in an emacs buffer.
4924 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4939 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4925 same bug in iplib.
4940 same bug in iplib.
4926
4941
4927 2002-02-18 Fernando Perez <fperez@colorado.edu>
4942 2002-02-18 Fernando Perez <fperez@colorado.edu>
4928
4943
4929 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4944 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4930 of readline so that IPython can work inside an Emacs buffer.
4945 of readline so that IPython can work inside an Emacs buffer.
4931
4946
4932 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4947 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4933 method signatures (they weren't really bugs, but it looks cleaner
4948 method signatures (they weren't really bugs, but it looks cleaner
4934 and keeps PyChecker happy).
4949 and keeps PyChecker happy).
4935
4950
4936 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4951 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4937 for implementing various user-defined hooks. Currently only
4952 for implementing various user-defined hooks. Currently only
4938 display is done.
4953 display is done.
4939
4954
4940 * IPython/Prompts.py (CachedOutput._display): changed display
4955 * IPython/Prompts.py (CachedOutput._display): changed display
4941 functions so that they can be dynamically changed by users easily.
4956 functions so that they can be dynamically changed by users easily.
4942
4957
4943 * IPython/Extensions/numeric_formats.py (num_display): added an
4958 * IPython/Extensions/numeric_formats.py (num_display): added an
4944 extension for printing NumPy arrays in flexible manners. It
4959 extension for printing NumPy arrays in flexible manners. It
4945 doesn't do anything yet, but all the structure is in
4960 doesn't do anything yet, but all the structure is in
4946 place. Ultimately the plan is to implement output format control
4961 place. Ultimately the plan is to implement output format control
4947 like in Octave.
4962 like in Octave.
4948
4963
4949 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4964 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4950 methods are found at run-time by all the automatic machinery.
4965 methods are found at run-time by all the automatic machinery.
4951
4966
4952 2002-02-17 Fernando Perez <fperez@colorado.edu>
4967 2002-02-17 Fernando Perez <fperez@colorado.edu>
4953
4968
4954 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4969 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4955 whole file a little.
4970 whole file a little.
4956
4971
4957 * ToDo: closed this document. Now there's a new_design.lyx
4972 * ToDo: closed this document. Now there's a new_design.lyx
4958 document for all new ideas. Added making a pdf of it for the
4973 document for all new ideas. Added making a pdf of it for the
4959 end-user distro.
4974 end-user distro.
4960
4975
4961 * IPython/Logger.py (Logger.switch_log): Created this to replace
4976 * IPython/Logger.py (Logger.switch_log): Created this to replace
4962 logon() and logoff(). It also fixes a nasty crash reported by
4977 logon() and logoff(). It also fixes a nasty crash reported by
4963 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4978 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4964
4979
4965 * IPython/iplib.py (complete): got auto-completion to work with
4980 * IPython/iplib.py (complete): got auto-completion to work with
4966 automagic (I had wanted this for a long time).
4981 automagic (I had wanted this for a long time).
4967
4982
4968 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4983 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4969 to @file, since file() is now a builtin and clashes with automagic
4984 to @file, since file() is now a builtin and clashes with automagic
4970 for @file.
4985 for @file.
4971
4986
4972 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4987 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4973 of this was previously in iplib, which had grown to more than 2000
4988 of this was previously in iplib, which had grown to more than 2000
4974 lines, way too long. No new functionality, but it makes managing
4989 lines, way too long. No new functionality, but it makes managing
4975 the code a bit easier.
4990 the code a bit easier.
4976
4991
4977 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4992 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4978 information to crash reports.
4993 information to crash reports.
4979
4994
4980 2002-02-12 Fernando Perez <fperez@colorado.edu>
4995 2002-02-12 Fernando Perez <fperez@colorado.edu>
4981
4996
4982 * Released 0.2.5.
4997 * Released 0.2.5.
4983
4998
4984 2002-02-11 Fernando Perez <fperez@colorado.edu>
4999 2002-02-11 Fernando Perez <fperez@colorado.edu>
4985
5000
4986 * Wrote a relatively complete Windows installer. It puts
5001 * Wrote a relatively complete Windows installer. It puts
4987 everything in place, creates Start Menu entries and fixes the
5002 everything in place, creates Start Menu entries and fixes the
4988 color issues. Nothing fancy, but it works.
5003 color issues. Nothing fancy, but it works.
4989
5004
4990 2002-02-10 Fernando Perez <fperez@colorado.edu>
5005 2002-02-10 Fernando Perez <fperez@colorado.edu>
4991
5006
4992 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5007 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4993 os.path.expanduser() call so that we can type @run ~/myfile.py and
5008 os.path.expanduser() call so that we can type @run ~/myfile.py and
4994 have thigs work as expected.
5009 have thigs work as expected.
4995
5010
4996 * IPython/genutils.py (page): fixed exception handling so things
5011 * IPython/genutils.py (page): fixed exception handling so things
4997 work both in Unix and Windows correctly. Quitting a pager triggers
5012 work both in Unix and Windows correctly. Quitting a pager triggers
4998 an IOError/broken pipe in Unix, and in windows not finding a pager
5013 an IOError/broken pipe in Unix, and in windows not finding a pager
4999 is also an IOError, so I had to actually look at the return value
5014 is also an IOError, so I had to actually look at the return value
5000 of the exception, not just the exception itself. Should be ok now.
5015 of the exception, not just the exception itself. Should be ok now.
5001
5016
5002 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5017 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5003 modified to allow case-insensitive color scheme changes.
5018 modified to allow case-insensitive color scheme changes.
5004
5019
5005 2002-02-09 Fernando Perez <fperez@colorado.edu>
5020 2002-02-09 Fernando Perez <fperez@colorado.edu>
5006
5021
5007 * IPython/genutils.py (native_line_ends): new function to leave
5022 * IPython/genutils.py (native_line_ends): new function to leave
5008 user config files with os-native line-endings.
5023 user config files with os-native line-endings.
5009
5024
5010 * README and manual updates.
5025 * README and manual updates.
5011
5026
5012 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5027 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5013 instead of StringType to catch Unicode strings.
5028 instead of StringType to catch Unicode strings.
5014
5029
5015 * IPython/genutils.py (filefind): fixed bug for paths with
5030 * IPython/genutils.py (filefind): fixed bug for paths with
5016 embedded spaces (very common in Windows).
5031 embedded spaces (very common in Windows).
5017
5032
5018 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5033 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5019 files under Windows, so that they get automatically associated
5034 files under Windows, so that they get automatically associated
5020 with a text editor. Windows makes it a pain to handle
5035 with a text editor. Windows makes it a pain to handle
5021 extension-less files.
5036 extension-less files.
5022
5037
5023 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5038 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5024 warning about readline only occur for Posix. In Windows there's no
5039 warning about readline only occur for Posix. In Windows there's no
5025 way to get readline, so why bother with the warning.
5040 way to get readline, so why bother with the warning.
5026
5041
5027 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5042 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5028 for __str__ instead of dir(self), since dir() changed in 2.2.
5043 for __str__ instead of dir(self), since dir() changed in 2.2.
5029
5044
5030 * Ported to Windows! Tested on XP, I suspect it should work fine
5045 * Ported to Windows! Tested on XP, I suspect it should work fine
5031 on NT/2000, but I don't think it will work on 98 et al. That
5046 on NT/2000, but I don't think it will work on 98 et al. That
5032 series of Windows is such a piece of junk anyway that I won't try
5047 series of Windows is such a piece of junk anyway that I won't try
5033 porting it there. The XP port was straightforward, showed a few
5048 porting it there. The XP port was straightforward, showed a few
5034 bugs here and there (fixed all), in particular some string
5049 bugs here and there (fixed all), in particular some string
5035 handling stuff which required considering Unicode strings (which
5050 handling stuff which required considering Unicode strings (which
5036 Windows uses). This is good, but hasn't been too tested :) No
5051 Windows uses). This is good, but hasn't been too tested :) No
5037 fancy installer yet, I'll put a note in the manual so people at
5052 fancy installer yet, I'll put a note in the manual so people at
5038 least make manually a shortcut.
5053 least make manually a shortcut.
5039
5054
5040 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5055 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5041 into a single one, "colors". This now controls both prompt and
5056 into a single one, "colors". This now controls both prompt and
5042 exception color schemes, and can be changed both at startup
5057 exception color schemes, and can be changed both at startup
5043 (either via command-line switches or via ipythonrc files) and at
5058 (either via command-line switches or via ipythonrc files) and at
5044 runtime, with @colors.
5059 runtime, with @colors.
5045 (Magic.magic_run): renamed @prun to @run and removed the old
5060 (Magic.magic_run): renamed @prun to @run and removed the old
5046 @run. The two were too similar to warrant keeping both.
5061 @run. The two were too similar to warrant keeping both.
5047
5062
5048 2002-02-03 Fernando Perez <fperez@colorado.edu>
5063 2002-02-03 Fernando Perez <fperez@colorado.edu>
5049
5064
5050 * IPython/iplib.py (install_first_time): Added comment on how to
5065 * IPython/iplib.py (install_first_time): Added comment on how to
5051 configure the color options for first-time users. Put a <return>
5066 configure the color options for first-time users. Put a <return>
5052 request at the end so that small-terminal users get a chance to
5067 request at the end so that small-terminal users get a chance to
5053 read the startup info.
5068 read the startup info.
5054
5069
5055 2002-01-23 Fernando Perez <fperez@colorado.edu>
5070 2002-01-23 Fernando Perez <fperez@colorado.edu>
5056
5071
5057 * IPython/iplib.py (CachedOutput.update): Changed output memory
5072 * IPython/iplib.py (CachedOutput.update): Changed output memory
5058 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5073 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5059 input history we still use _i. Did this b/c these variable are
5074 input history we still use _i. Did this b/c these variable are
5060 very commonly used in interactive work, so the less we need to
5075 very commonly used in interactive work, so the less we need to
5061 type the better off we are.
5076 type the better off we are.
5062 (Magic.magic_prun): updated @prun to better handle the namespaces
5077 (Magic.magic_prun): updated @prun to better handle the namespaces
5063 the file will run in, including a fix for __name__ not being set
5078 the file will run in, including a fix for __name__ not being set
5064 before.
5079 before.
5065
5080
5066 2002-01-20 Fernando Perez <fperez@colorado.edu>
5081 2002-01-20 Fernando Perez <fperez@colorado.edu>
5067
5082
5068 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5083 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5069 extra garbage for Python 2.2. Need to look more carefully into
5084 extra garbage for Python 2.2. Need to look more carefully into
5070 this later.
5085 this later.
5071
5086
5072 2002-01-19 Fernando Perez <fperez@colorado.edu>
5087 2002-01-19 Fernando Perez <fperez@colorado.edu>
5073
5088
5074 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5089 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5075 display SyntaxError exceptions properly formatted when they occur
5090 display SyntaxError exceptions properly formatted when they occur
5076 (they can be triggered by imported code).
5091 (they can be triggered by imported code).
5077
5092
5078 2002-01-18 Fernando Perez <fperez@colorado.edu>
5093 2002-01-18 Fernando Perez <fperez@colorado.edu>
5079
5094
5080 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5095 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5081 SyntaxError exceptions are reported nicely formatted, instead of
5096 SyntaxError exceptions are reported nicely formatted, instead of
5082 spitting out only offset information as before.
5097 spitting out only offset information as before.
5083 (Magic.magic_prun): Added the @prun function for executing
5098 (Magic.magic_prun): Added the @prun function for executing
5084 programs with command line args inside IPython.
5099 programs with command line args inside IPython.
5085
5100
5086 2002-01-16 Fernando Perez <fperez@colorado.edu>
5101 2002-01-16 Fernando Perez <fperez@colorado.edu>
5087
5102
5088 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5103 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5089 to *not* include the last item given in a range. This brings their
5104 to *not* include the last item given in a range. This brings their
5090 behavior in line with Python's slicing:
5105 behavior in line with Python's slicing:
5091 a[n1:n2] -> a[n1]...a[n2-1]
5106 a[n1:n2] -> a[n1]...a[n2-1]
5092 It may be a bit less convenient, but I prefer to stick to Python's
5107 It may be a bit less convenient, but I prefer to stick to Python's
5093 conventions *everywhere*, so users never have to wonder.
5108 conventions *everywhere*, so users never have to wonder.
5094 (Magic.magic_macro): Added @macro function to ease the creation of
5109 (Magic.magic_macro): Added @macro function to ease the creation of
5095 macros.
5110 macros.
5096
5111
5097 2002-01-05 Fernando Perez <fperez@colorado.edu>
5112 2002-01-05 Fernando Perez <fperez@colorado.edu>
5098
5113
5099 * Released 0.2.4.
5114 * Released 0.2.4.
5100
5115
5101 * IPython/iplib.py (Magic.magic_pdef):
5116 * IPython/iplib.py (Magic.magic_pdef):
5102 (InteractiveShell.safe_execfile): report magic lines and error
5117 (InteractiveShell.safe_execfile): report magic lines and error
5103 lines without line numbers so one can easily copy/paste them for
5118 lines without line numbers so one can easily copy/paste them for
5104 re-execution.
5119 re-execution.
5105
5120
5106 * Updated manual with recent changes.
5121 * Updated manual with recent changes.
5107
5122
5108 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5123 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5109 docstring printing when class? is called. Very handy for knowing
5124 docstring printing when class? is called. Very handy for knowing
5110 how to create class instances (as long as __init__ is well
5125 how to create class instances (as long as __init__ is well
5111 documented, of course :)
5126 documented, of course :)
5112 (Magic.magic_doc): print both class and constructor docstrings.
5127 (Magic.magic_doc): print both class and constructor docstrings.
5113 (Magic.magic_pdef): give constructor info if passed a class and
5128 (Magic.magic_pdef): give constructor info if passed a class and
5114 __call__ info for callable object instances.
5129 __call__ info for callable object instances.
5115
5130
5116 2002-01-04 Fernando Perez <fperez@colorado.edu>
5131 2002-01-04 Fernando Perez <fperez@colorado.edu>
5117
5132
5118 * Made deep_reload() off by default. It doesn't always work
5133 * Made deep_reload() off by default. It doesn't always work
5119 exactly as intended, so it's probably safer to have it off. It's
5134 exactly as intended, so it's probably safer to have it off. It's
5120 still available as dreload() anyway, so nothing is lost.
5135 still available as dreload() anyway, so nothing is lost.
5121
5136
5122 2002-01-02 Fernando Perez <fperez@colorado.edu>
5137 2002-01-02 Fernando Perez <fperez@colorado.edu>
5123
5138
5124 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5139 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5125 so I wanted an updated release).
5140 so I wanted an updated release).
5126
5141
5127 2001-12-27 Fernando Perez <fperez@colorado.edu>
5142 2001-12-27 Fernando Perez <fperez@colorado.edu>
5128
5143
5129 * IPython/iplib.py (InteractiveShell.interact): Added the original
5144 * IPython/iplib.py (InteractiveShell.interact): Added the original
5130 code from 'code.py' for this module in order to change the
5145 code from 'code.py' for this module in order to change the
5131 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5146 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5132 the history cache would break when the user hit Ctrl-C, and
5147 the history cache would break when the user hit Ctrl-C, and
5133 interact() offers no way to add any hooks to it.
5148 interact() offers no way to add any hooks to it.
5134
5149
5135 2001-12-23 Fernando Perez <fperez@colorado.edu>
5150 2001-12-23 Fernando Perez <fperez@colorado.edu>
5136
5151
5137 * setup.py: added check for 'MANIFEST' before trying to remove
5152 * setup.py: added check for 'MANIFEST' before trying to remove
5138 it. Thanks to Sean Reifschneider.
5153 it. Thanks to Sean Reifschneider.
5139
5154
5140 2001-12-22 Fernando Perez <fperez@colorado.edu>
5155 2001-12-22 Fernando Perez <fperez@colorado.edu>
5141
5156
5142 * Released 0.2.2.
5157 * Released 0.2.2.
5143
5158
5144 * Finished (reasonably) writing the manual. Later will add the
5159 * Finished (reasonably) writing the manual. Later will add the
5145 python-standard navigation stylesheets, but for the time being
5160 python-standard navigation stylesheets, but for the time being
5146 it's fairly complete. Distribution will include html and pdf
5161 it's fairly complete. Distribution will include html and pdf
5147 versions.
5162 versions.
5148
5163
5149 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5164 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5150 (MayaVi author).
5165 (MayaVi author).
5151
5166
5152 2001-12-21 Fernando Perez <fperez@colorado.edu>
5167 2001-12-21 Fernando Perez <fperez@colorado.edu>
5153
5168
5154 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5169 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5155 good public release, I think (with the manual and the distutils
5170 good public release, I think (with the manual and the distutils
5156 installer). The manual can use some work, but that can go
5171 installer). The manual can use some work, but that can go
5157 slowly. Otherwise I think it's quite nice for end users. Next
5172 slowly. Otherwise I think it's quite nice for end users. Next
5158 summer, rewrite the guts of it...
5173 summer, rewrite the guts of it...
5159
5174
5160 * Changed format of ipythonrc files to use whitespace as the
5175 * Changed format of ipythonrc files to use whitespace as the
5161 separator instead of an explicit '='. Cleaner.
5176 separator instead of an explicit '='. Cleaner.
5162
5177
5163 2001-12-20 Fernando Perez <fperez@colorado.edu>
5178 2001-12-20 Fernando Perez <fperez@colorado.edu>
5164
5179
5165 * Started a manual in LyX. For now it's just a quick merge of the
5180 * Started a manual in LyX. For now it's just a quick merge of the
5166 various internal docstrings and READMEs. Later it may grow into a
5181 various internal docstrings and READMEs. Later it may grow into a
5167 nice, full-blown manual.
5182 nice, full-blown manual.
5168
5183
5169 * Set up a distutils based installer. Installation should now be
5184 * Set up a distutils based installer. Installation should now be
5170 trivially simple for end-users.
5185 trivially simple for end-users.
5171
5186
5172 2001-12-11 Fernando Perez <fperez@colorado.edu>
5187 2001-12-11 Fernando Perez <fperez@colorado.edu>
5173
5188
5174 * Released 0.2.0. First public release, announced it at
5189 * Released 0.2.0. First public release, announced it at
5175 comp.lang.python. From now on, just bugfixes...
5190 comp.lang.python. From now on, just bugfixes...
5176
5191
5177 * Went through all the files, set copyright/license notices and
5192 * Went through all the files, set copyright/license notices and
5178 cleaned up things. Ready for release.
5193 cleaned up things. Ready for release.
5179
5194
5180 2001-12-10 Fernando Perez <fperez@colorado.edu>
5195 2001-12-10 Fernando Perez <fperez@colorado.edu>
5181
5196
5182 * Changed the first-time installer not to use tarfiles. It's more
5197 * Changed the first-time installer not to use tarfiles. It's more
5183 robust now and less unix-dependent. Also makes it easier for
5198 robust now and less unix-dependent. Also makes it easier for
5184 people to later upgrade versions.
5199 people to later upgrade versions.
5185
5200
5186 * Changed @exit to @abort to reflect the fact that it's pretty
5201 * Changed @exit to @abort to reflect the fact that it's pretty
5187 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5202 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5188 becomes significant only when IPyhton is embedded: in that case,
5203 becomes significant only when IPyhton is embedded: in that case,
5189 C-D closes IPython only, but @abort kills the enclosing program
5204 C-D closes IPython only, but @abort kills the enclosing program
5190 too (unless it had called IPython inside a try catching
5205 too (unless it had called IPython inside a try catching
5191 SystemExit).
5206 SystemExit).
5192
5207
5193 * Created Shell module which exposes the actuall IPython Shell
5208 * Created Shell module which exposes the actuall IPython Shell
5194 classes, currently the normal and the embeddable one. This at
5209 classes, currently the normal and the embeddable one. This at
5195 least offers a stable interface we won't need to change when
5210 least offers a stable interface we won't need to change when
5196 (later) the internals are rewritten. That rewrite will be confined
5211 (later) the internals are rewritten. That rewrite will be confined
5197 to iplib and ipmaker, but the Shell interface should remain as is.
5212 to iplib and ipmaker, but the Shell interface should remain as is.
5198
5213
5199 * Added embed module which offers an embeddable IPShell object,
5214 * Added embed module which offers an embeddable IPShell object,
5200 useful to fire up IPython *inside* a running program. Great for
5215 useful to fire up IPython *inside* a running program. Great for
5201 debugging or dynamical data analysis.
5216 debugging or dynamical data analysis.
5202
5217
5203 2001-12-08 Fernando Perez <fperez@colorado.edu>
5218 2001-12-08 Fernando Perez <fperez@colorado.edu>
5204
5219
5205 * Fixed small bug preventing seeing info from methods of defined
5220 * Fixed small bug preventing seeing info from methods of defined
5206 objects (incorrect namespace in _ofind()).
5221 objects (incorrect namespace in _ofind()).
5207
5222
5208 * Documentation cleanup. Moved the main usage docstrings to a
5223 * Documentation cleanup. Moved the main usage docstrings to a
5209 separate file, usage.py (cleaner to maintain, and hopefully in the
5224 separate file, usage.py (cleaner to maintain, and hopefully in the
5210 future some perlpod-like way of producing interactive, man and
5225 future some perlpod-like way of producing interactive, man and
5211 html docs out of it will be found).
5226 html docs out of it will be found).
5212
5227
5213 * Added @profile to see your profile at any time.
5228 * Added @profile to see your profile at any time.
5214
5229
5215 * Added @p as an alias for 'print'. It's especially convenient if
5230 * Added @p as an alias for 'print'. It's especially convenient if
5216 using automagic ('p x' prints x).
5231 using automagic ('p x' prints x).
5217
5232
5218 * Small cleanups and fixes after a pychecker run.
5233 * Small cleanups and fixes after a pychecker run.
5219
5234
5220 * Changed the @cd command to handle @cd - and @cd -<n> for
5235 * Changed the @cd command to handle @cd - and @cd -<n> for
5221 visiting any directory in _dh.
5236 visiting any directory in _dh.
5222
5237
5223 * Introduced _dh, a history of visited directories. @dhist prints
5238 * Introduced _dh, a history of visited directories. @dhist prints
5224 it out with numbers.
5239 it out with numbers.
5225
5240
5226 2001-12-07 Fernando Perez <fperez@colorado.edu>
5241 2001-12-07 Fernando Perez <fperez@colorado.edu>
5227
5242
5228 * Released 0.1.22
5243 * Released 0.1.22
5229
5244
5230 * Made initialization a bit more robust against invalid color
5245 * Made initialization a bit more robust against invalid color
5231 options in user input (exit, not traceback-crash).
5246 options in user input (exit, not traceback-crash).
5232
5247
5233 * Changed the bug crash reporter to write the report only in the
5248 * Changed the bug crash reporter to write the report only in the
5234 user's .ipython directory. That way IPython won't litter people's
5249 user's .ipython directory. That way IPython won't litter people's
5235 hard disks with crash files all over the place. Also print on
5250 hard disks with crash files all over the place. Also print on
5236 screen the necessary mail command.
5251 screen the necessary mail command.
5237
5252
5238 * With the new ultraTB, implemented LightBG color scheme for light
5253 * With the new ultraTB, implemented LightBG color scheme for light
5239 background terminals. A lot of people like white backgrounds, so I
5254 background terminals. A lot of people like white backgrounds, so I
5240 guess we should at least give them something readable.
5255 guess we should at least give them something readable.
5241
5256
5242 2001-12-06 Fernando Perez <fperez@colorado.edu>
5257 2001-12-06 Fernando Perez <fperez@colorado.edu>
5243
5258
5244 * Modified the structure of ultraTB. Now there's a proper class
5259 * Modified the structure of ultraTB. Now there's a proper class
5245 for tables of color schemes which allow adding schemes easily and
5260 for tables of color schemes which allow adding schemes easily and
5246 switching the active scheme without creating a new instance every
5261 switching the active scheme without creating a new instance every
5247 time (which was ridiculous). The syntax for creating new schemes
5262 time (which was ridiculous). The syntax for creating new schemes
5248 is also cleaner. I think ultraTB is finally done, with a clean
5263 is also cleaner. I think ultraTB is finally done, with a clean
5249 class structure. Names are also much cleaner (now there's proper
5264 class structure. Names are also much cleaner (now there's proper
5250 color tables, no need for every variable to also have 'color' in
5265 color tables, no need for every variable to also have 'color' in
5251 its name).
5266 its name).
5252
5267
5253 * Broke down genutils into separate files. Now genutils only
5268 * Broke down genutils into separate files. Now genutils only
5254 contains utility functions, and classes have been moved to their
5269 contains utility functions, and classes have been moved to their
5255 own files (they had enough independent functionality to warrant
5270 own files (they had enough independent functionality to warrant
5256 it): ConfigLoader, OutputTrap, Struct.
5271 it): ConfigLoader, OutputTrap, Struct.
5257
5272
5258 2001-12-05 Fernando Perez <fperez@colorado.edu>
5273 2001-12-05 Fernando Perez <fperez@colorado.edu>
5259
5274
5260 * IPython turns 21! Released version 0.1.21, as a candidate for
5275 * IPython turns 21! Released version 0.1.21, as a candidate for
5261 public consumption. If all goes well, release in a few days.
5276 public consumption. If all goes well, release in a few days.
5262
5277
5263 * Fixed path bug (files in Extensions/ directory wouldn't be found
5278 * Fixed path bug (files in Extensions/ directory wouldn't be found
5264 unless IPython/ was explicitly in sys.path).
5279 unless IPython/ was explicitly in sys.path).
5265
5280
5266 * Extended the FlexCompleter class as MagicCompleter to allow
5281 * Extended the FlexCompleter class as MagicCompleter to allow
5267 completion of @-starting lines.
5282 completion of @-starting lines.
5268
5283
5269 * Created __release__.py file as a central repository for release
5284 * Created __release__.py file as a central repository for release
5270 info that other files can read from.
5285 info that other files can read from.
5271
5286
5272 * Fixed small bug in logging: when logging was turned on in
5287 * Fixed small bug in logging: when logging was turned on in
5273 mid-session, old lines with special meanings (!@?) were being
5288 mid-session, old lines with special meanings (!@?) were being
5274 logged without the prepended comment, which is necessary since
5289 logged without the prepended comment, which is necessary since
5275 they are not truly valid python syntax. This should make session
5290 they are not truly valid python syntax. This should make session
5276 restores produce less errors.
5291 restores produce less errors.
5277
5292
5278 * The namespace cleanup forced me to make a FlexCompleter class
5293 * The namespace cleanup forced me to make a FlexCompleter class
5279 which is nothing but a ripoff of rlcompleter, but with selectable
5294 which is nothing but a ripoff of rlcompleter, but with selectable
5280 namespace (rlcompleter only works in __main__.__dict__). I'll try
5295 namespace (rlcompleter only works in __main__.__dict__). I'll try
5281 to submit a note to the authors to see if this change can be
5296 to submit a note to the authors to see if this change can be
5282 incorporated in future rlcompleter releases (Dec.6: done)
5297 incorporated in future rlcompleter releases (Dec.6: done)
5283
5298
5284 * More fixes to namespace handling. It was a mess! Now all
5299 * More fixes to namespace handling. It was a mess! Now all
5285 explicit references to __main__.__dict__ are gone (except when
5300 explicit references to __main__.__dict__ are gone (except when
5286 really needed) and everything is handled through the namespace
5301 really needed) and everything is handled through the namespace
5287 dicts in the IPython instance. We seem to be getting somewhere
5302 dicts in the IPython instance. We seem to be getting somewhere
5288 with this, finally...
5303 with this, finally...
5289
5304
5290 * Small documentation updates.
5305 * Small documentation updates.
5291
5306
5292 * Created the Extensions directory under IPython (with an
5307 * Created the Extensions directory under IPython (with an
5293 __init__.py). Put the PhysicalQ stuff there. This directory should
5308 __init__.py). Put the PhysicalQ stuff there. This directory should
5294 be used for all special-purpose extensions.
5309 be used for all special-purpose extensions.
5295
5310
5296 * File renaming:
5311 * File renaming:
5297 ipythonlib --> ipmaker
5312 ipythonlib --> ipmaker
5298 ipplib --> iplib
5313 ipplib --> iplib
5299 This makes a bit more sense in terms of what these files actually do.
5314 This makes a bit more sense in terms of what these files actually do.
5300
5315
5301 * Moved all the classes and functions in ipythonlib to ipplib, so
5316 * Moved all the classes and functions in ipythonlib to ipplib, so
5302 now ipythonlib only has make_IPython(). This will ease up its
5317 now ipythonlib only has make_IPython(). This will ease up its
5303 splitting in smaller functional chunks later.
5318 splitting in smaller functional chunks later.
5304
5319
5305 * Cleaned up (done, I think) output of @whos. Better column
5320 * Cleaned up (done, I think) output of @whos. Better column
5306 formatting, and now shows str(var) for as much as it can, which is
5321 formatting, and now shows str(var) for as much as it can, which is
5307 typically what one gets with a 'print var'.
5322 typically what one gets with a 'print var'.
5308
5323
5309 2001-12-04 Fernando Perez <fperez@colorado.edu>
5324 2001-12-04 Fernando Perez <fperez@colorado.edu>
5310
5325
5311 * Fixed namespace problems. Now builtin/IPyhton/user names get
5326 * Fixed namespace problems. Now builtin/IPyhton/user names get
5312 properly reported in their namespace. Internal namespace handling
5327 properly reported in their namespace. Internal namespace handling
5313 is finally getting decent (not perfect yet, but much better than
5328 is finally getting decent (not perfect yet, but much better than
5314 the ad-hoc mess we had).
5329 the ad-hoc mess we had).
5315
5330
5316 * Removed -exit option. If people just want to run a python
5331 * Removed -exit option. If people just want to run a python
5317 script, that's what the normal interpreter is for. Less
5332 script, that's what the normal interpreter is for. Less
5318 unnecessary options, less chances for bugs.
5333 unnecessary options, less chances for bugs.
5319
5334
5320 * Added a crash handler which generates a complete post-mortem if
5335 * Added a crash handler which generates a complete post-mortem if
5321 IPython crashes. This will help a lot in tracking bugs down the
5336 IPython crashes. This will help a lot in tracking bugs down the
5322 road.
5337 road.
5323
5338
5324 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5339 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5325 which were boud to functions being reassigned would bypass the
5340 which were boud to functions being reassigned would bypass the
5326 logger, breaking the sync of _il with the prompt counter. This
5341 logger, breaking the sync of _il with the prompt counter. This
5327 would then crash IPython later when a new line was logged.
5342 would then crash IPython later when a new line was logged.
5328
5343
5329 2001-12-02 Fernando Perez <fperez@colorado.edu>
5344 2001-12-02 Fernando Perez <fperez@colorado.edu>
5330
5345
5331 * Made IPython a package. This means people don't have to clutter
5346 * Made IPython a package. This means people don't have to clutter
5332 their sys.path with yet another directory. Changed the INSTALL
5347 their sys.path with yet another directory. Changed the INSTALL
5333 file accordingly.
5348 file accordingly.
5334
5349
5335 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5350 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5336 sorts its output (so @who shows it sorted) and @whos formats the
5351 sorts its output (so @who shows it sorted) and @whos formats the
5337 table according to the width of the first column. Nicer, easier to
5352 table according to the width of the first column. Nicer, easier to
5338 read. Todo: write a generic table_format() which takes a list of
5353 read. Todo: write a generic table_format() which takes a list of
5339 lists and prints it nicely formatted, with optional row/column
5354 lists and prints it nicely formatted, with optional row/column
5340 separators and proper padding and justification.
5355 separators and proper padding and justification.
5341
5356
5342 * Released 0.1.20
5357 * Released 0.1.20
5343
5358
5344 * Fixed bug in @log which would reverse the inputcache list (a
5359 * Fixed bug in @log which would reverse the inputcache list (a
5345 copy operation was missing).
5360 copy operation was missing).
5346
5361
5347 * Code cleanup. @config was changed to use page(). Better, since
5362 * Code cleanup. @config was changed to use page(). Better, since
5348 its output is always quite long.
5363 its output is always quite long.
5349
5364
5350 * Itpl is back as a dependency. I was having too many problems
5365 * Itpl is back as a dependency. I was having too many problems
5351 getting the parametric aliases to work reliably, and it's just
5366 getting the parametric aliases to work reliably, and it's just
5352 easier to code weird string operations with it than playing %()s
5367 easier to code weird string operations with it than playing %()s
5353 games. It's only ~6k, so I don't think it's too big a deal.
5368 games. It's only ~6k, so I don't think it's too big a deal.
5354
5369
5355 * Found (and fixed) a very nasty bug with history. !lines weren't
5370 * Found (and fixed) a very nasty bug with history. !lines weren't
5356 getting cached, and the out of sync caches would crash
5371 getting cached, and the out of sync caches would crash
5357 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5372 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5358 division of labor a bit better. Bug fixed, cleaner structure.
5373 division of labor a bit better. Bug fixed, cleaner structure.
5359
5374
5360 2001-12-01 Fernando Perez <fperez@colorado.edu>
5375 2001-12-01 Fernando Perez <fperez@colorado.edu>
5361
5376
5362 * Released 0.1.19
5377 * Released 0.1.19
5363
5378
5364 * Added option -n to @hist to prevent line number printing. Much
5379 * Added option -n to @hist to prevent line number printing. Much
5365 easier to copy/paste code this way.
5380 easier to copy/paste code this way.
5366
5381
5367 * Created global _il to hold the input list. Allows easy
5382 * Created global _il to hold the input list. Allows easy
5368 re-execution of blocks of code by slicing it (inspired by Janko's
5383 re-execution of blocks of code by slicing it (inspired by Janko's
5369 comment on 'macros').
5384 comment on 'macros').
5370
5385
5371 * Small fixes and doc updates.
5386 * Small fixes and doc updates.
5372
5387
5373 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5388 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5374 much too fragile with automagic. Handles properly multi-line
5389 much too fragile with automagic. Handles properly multi-line
5375 statements and takes parameters.
5390 statements and takes parameters.
5376
5391
5377 2001-11-30 Fernando Perez <fperez@colorado.edu>
5392 2001-11-30 Fernando Perez <fperez@colorado.edu>
5378
5393
5379 * Version 0.1.18 released.
5394 * Version 0.1.18 released.
5380
5395
5381 * Fixed nasty namespace bug in initial module imports.
5396 * Fixed nasty namespace bug in initial module imports.
5382
5397
5383 * Added copyright/license notes to all code files (except
5398 * Added copyright/license notes to all code files (except
5384 DPyGetOpt). For the time being, LGPL. That could change.
5399 DPyGetOpt). For the time being, LGPL. That could change.
5385
5400
5386 * Rewrote a much nicer README, updated INSTALL, cleaned up
5401 * Rewrote a much nicer README, updated INSTALL, cleaned up
5387 ipythonrc-* samples.
5402 ipythonrc-* samples.
5388
5403
5389 * Overall code/documentation cleanup. Basically ready for
5404 * Overall code/documentation cleanup. Basically ready for
5390 release. Only remaining thing: licence decision (LGPL?).
5405 release. Only remaining thing: licence decision (LGPL?).
5391
5406
5392 * Converted load_config to a class, ConfigLoader. Now recursion
5407 * Converted load_config to a class, ConfigLoader. Now recursion
5393 control is better organized. Doesn't include the same file twice.
5408 control is better organized. Doesn't include the same file twice.
5394
5409
5395 2001-11-29 Fernando Perez <fperez@colorado.edu>
5410 2001-11-29 Fernando Perez <fperez@colorado.edu>
5396
5411
5397 * Got input history working. Changed output history variables from
5412 * Got input history working. Changed output history variables from
5398 _p to _o so that _i is for input and _o for output. Just cleaner
5413 _p to _o so that _i is for input and _o for output. Just cleaner
5399 convention.
5414 convention.
5400
5415
5401 * Implemented parametric aliases. This pretty much allows the
5416 * Implemented parametric aliases. This pretty much allows the
5402 alias system to offer full-blown shell convenience, I think.
5417 alias system to offer full-blown shell convenience, I think.
5403
5418
5404 * Version 0.1.17 released, 0.1.18 opened.
5419 * Version 0.1.17 released, 0.1.18 opened.
5405
5420
5406 * dot_ipython/ipythonrc (alias): added documentation.
5421 * dot_ipython/ipythonrc (alias): added documentation.
5407 (xcolor): Fixed small bug (xcolors -> xcolor)
5422 (xcolor): Fixed small bug (xcolors -> xcolor)
5408
5423
5409 * Changed the alias system. Now alias is a magic command to define
5424 * Changed the alias system. Now alias is a magic command to define
5410 aliases just like the shell. Rationale: the builtin magics should
5425 aliases just like the shell. Rationale: the builtin magics should
5411 be there for things deeply connected to IPython's
5426 be there for things deeply connected to IPython's
5412 architecture. And this is a much lighter system for what I think
5427 architecture. And this is a much lighter system for what I think
5413 is the really important feature: allowing users to define quickly
5428 is the really important feature: allowing users to define quickly
5414 magics that will do shell things for them, so they can customize
5429 magics that will do shell things for them, so they can customize
5415 IPython easily to match their work habits. If someone is really
5430 IPython easily to match their work habits. If someone is really
5416 desperate to have another name for a builtin alias, they can
5431 desperate to have another name for a builtin alias, they can
5417 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5432 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5418 works.
5433 works.
5419
5434
5420 2001-11-28 Fernando Perez <fperez@colorado.edu>
5435 2001-11-28 Fernando Perez <fperez@colorado.edu>
5421
5436
5422 * Changed @file so that it opens the source file at the proper
5437 * Changed @file so that it opens the source file at the proper
5423 line. Since it uses less, if your EDITOR environment is
5438 line. Since it uses less, if your EDITOR environment is
5424 configured, typing v will immediately open your editor of choice
5439 configured, typing v will immediately open your editor of choice
5425 right at the line where the object is defined. Not as quick as
5440 right at the line where the object is defined. Not as quick as
5426 having a direct @edit command, but for all intents and purposes it
5441 having a direct @edit command, but for all intents and purposes it
5427 works. And I don't have to worry about writing @edit to deal with
5442 works. And I don't have to worry about writing @edit to deal with
5428 all the editors, less does that.
5443 all the editors, less does that.
5429
5444
5430 * Version 0.1.16 released, 0.1.17 opened.
5445 * Version 0.1.16 released, 0.1.17 opened.
5431
5446
5432 * Fixed some nasty bugs in the page/page_dumb combo that could
5447 * Fixed some nasty bugs in the page/page_dumb combo that could
5433 crash IPython.
5448 crash IPython.
5434
5449
5435 2001-11-27 Fernando Perez <fperez@colorado.edu>
5450 2001-11-27 Fernando Perez <fperez@colorado.edu>
5436
5451
5437 * Version 0.1.15 released, 0.1.16 opened.
5452 * Version 0.1.15 released, 0.1.16 opened.
5438
5453
5439 * Finally got ? and ?? to work for undefined things: now it's
5454 * Finally got ? and ?? to work for undefined things: now it's
5440 possible to type {}.get? and get information about the get method
5455 possible to type {}.get? and get information about the get method
5441 of dicts, or os.path? even if only os is defined (so technically
5456 of dicts, or os.path? even if only os is defined (so technically
5442 os.path isn't). Works at any level. For example, after import os,
5457 os.path isn't). Works at any level. For example, after import os,
5443 os?, os.path?, os.path.abspath? all work. This is great, took some
5458 os?, os.path?, os.path.abspath? all work. This is great, took some
5444 work in _ofind.
5459 work in _ofind.
5445
5460
5446 * Fixed more bugs with logging. The sanest way to do it was to add
5461 * Fixed more bugs with logging. The sanest way to do it was to add
5447 to @log a 'mode' parameter. Killed two in one shot (this mode
5462 to @log a 'mode' parameter. Killed two in one shot (this mode
5448 option was a request of Janko's). I think it's finally clean
5463 option was a request of Janko's). I think it's finally clean
5449 (famous last words).
5464 (famous last words).
5450
5465
5451 * Added a page_dumb() pager which does a decent job of paging on
5466 * Added a page_dumb() pager which does a decent job of paging on
5452 screen, if better things (like less) aren't available. One less
5467 screen, if better things (like less) aren't available. One less
5453 unix dependency (someday maybe somebody will port this to
5468 unix dependency (someday maybe somebody will port this to
5454 windows).
5469 windows).
5455
5470
5456 * Fixed problem in magic_log: would lock of logging out if log
5471 * Fixed problem in magic_log: would lock of logging out if log
5457 creation failed (because it would still think it had succeeded).
5472 creation failed (because it would still think it had succeeded).
5458
5473
5459 * Improved the page() function using curses to auto-detect screen
5474 * Improved the page() function using curses to auto-detect screen
5460 size. Now it can make a much better decision on whether to print
5475 size. Now it can make a much better decision on whether to print
5461 or page a string. Option screen_length was modified: a value 0
5476 or page a string. Option screen_length was modified: a value 0
5462 means auto-detect, and that's the default now.
5477 means auto-detect, and that's the default now.
5463
5478
5464 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5479 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5465 go out. I'll test it for a few days, then talk to Janko about
5480 go out. I'll test it for a few days, then talk to Janko about
5466 licences and announce it.
5481 licences and announce it.
5467
5482
5468 * Fixed the length of the auto-generated ---> prompt which appears
5483 * Fixed the length of the auto-generated ---> prompt which appears
5469 for auto-parens and auto-quotes. Getting this right isn't trivial,
5484 for auto-parens and auto-quotes. Getting this right isn't trivial,
5470 with all the color escapes, different prompt types and optional
5485 with all the color escapes, different prompt types and optional
5471 separators. But it seems to be working in all the combinations.
5486 separators. But it seems to be working in all the combinations.
5472
5487
5473 2001-11-26 Fernando Perez <fperez@colorado.edu>
5488 2001-11-26 Fernando Perez <fperez@colorado.edu>
5474
5489
5475 * Wrote a regexp filter to get option types from the option names
5490 * Wrote a regexp filter to get option types from the option names
5476 string. This eliminates the need to manually keep two duplicate
5491 string. This eliminates the need to manually keep two duplicate
5477 lists.
5492 lists.
5478
5493
5479 * Removed the unneeded check_option_names. Now options are handled
5494 * Removed the unneeded check_option_names. Now options are handled
5480 in a much saner manner and it's easy to visually check that things
5495 in a much saner manner and it's easy to visually check that things
5481 are ok.
5496 are ok.
5482
5497
5483 * Updated version numbers on all files I modified to carry a
5498 * Updated version numbers on all files I modified to carry a
5484 notice so Janko and Nathan have clear version markers.
5499 notice so Janko and Nathan have clear version markers.
5485
5500
5486 * Updated docstring for ultraTB with my changes. I should send
5501 * Updated docstring for ultraTB with my changes. I should send
5487 this to Nathan.
5502 this to Nathan.
5488
5503
5489 * Lots of small fixes. Ran everything through pychecker again.
5504 * Lots of small fixes. Ran everything through pychecker again.
5490
5505
5491 * Made loading of deep_reload an cmd line option. If it's not too
5506 * Made loading of deep_reload an cmd line option. If it's not too
5492 kosher, now people can just disable it. With -nodeep_reload it's
5507 kosher, now people can just disable it. With -nodeep_reload it's
5493 still available as dreload(), it just won't overwrite reload().
5508 still available as dreload(), it just won't overwrite reload().
5494
5509
5495 * Moved many options to the no| form (-opt and -noopt
5510 * Moved many options to the no| form (-opt and -noopt
5496 accepted). Cleaner.
5511 accepted). Cleaner.
5497
5512
5498 * Changed magic_log so that if called with no parameters, it uses
5513 * Changed magic_log so that if called with no parameters, it uses
5499 'rotate' mode. That way auto-generated logs aren't automatically
5514 'rotate' mode. That way auto-generated logs aren't automatically
5500 over-written. For normal logs, now a backup is made if it exists
5515 over-written. For normal logs, now a backup is made if it exists
5501 (only 1 level of backups). A new 'backup' mode was added to the
5516 (only 1 level of backups). A new 'backup' mode was added to the
5502 Logger class to support this. This was a request by Janko.
5517 Logger class to support this. This was a request by Janko.
5503
5518
5504 * Added @logoff/@logon to stop/restart an active log.
5519 * Added @logoff/@logon to stop/restart an active log.
5505
5520
5506 * Fixed a lot of bugs in log saving/replay. It was pretty
5521 * Fixed a lot of bugs in log saving/replay. It was pretty
5507 broken. Now special lines (!@,/) appear properly in the command
5522 broken. Now special lines (!@,/) appear properly in the command
5508 history after a log replay.
5523 history after a log replay.
5509
5524
5510 * Tried and failed to implement full session saving via pickle. My
5525 * Tried and failed to implement full session saving via pickle. My
5511 idea was to pickle __main__.__dict__, but modules can't be
5526 idea was to pickle __main__.__dict__, but modules can't be
5512 pickled. This would be a better alternative to replaying logs, but
5527 pickled. This would be a better alternative to replaying logs, but
5513 seems quite tricky to get to work. Changed -session to be called
5528 seems quite tricky to get to work. Changed -session to be called
5514 -logplay, which more accurately reflects what it does. And if we
5529 -logplay, which more accurately reflects what it does. And if we
5515 ever get real session saving working, -session is now available.
5530 ever get real session saving working, -session is now available.
5516
5531
5517 * Implemented color schemes for prompts also. As for tracebacks,
5532 * Implemented color schemes for prompts also. As for tracebacks,
5518 currently only NoColor and Linux are supported. But now the
5533 currently only NoColor and Linux are supported. But now the
5519 infrastructure is in place, based on a generic ColorScheme
5534 infrastructure is in place, based on a generic ColorScheme
5520 class. So writing and activating new schemes both for the prompts
5535 class. So writing and activating new schemes both for the prompts
5521 and the tracebacks should be straightforward.
5536 and the tracebacks should be straightforward.
5522
5537
5523 * Version 0.1.13 released, 0.1.14 opened.
5538 * Version 0.1.13 released, 0.1.14 opened.
5524
5539
5525 * Changed handling of options for output cache. Now counter is
5540 * Changed handling of options for output cache. Now counter is
5526 hardwired starting at 1 and one specifies the maximum number of
5541 hardwired starting at 1 and one specifies the maximum number of
5527 entries *in the outcache* (not the max prompt counter). This is
5542 entries *in the outcache* (not the max prompt counter). This is
5528 much better, since many statements won't increase the cache
5543 much better, since many statements won't increase the cache
5529 count. It also eliminated some confusing options, now there's only
5544 count. It also eliminated some confusing options, now there's only
5530 one: cache_size.
5545 one: cache_size.
5531
5546
5532 * Added 'alias' magic function and magic_alias option in the
5547 * Added 'alias' magic function and magic_alias option in the
5533 ipythonrc file. Now the user can easily define whatever names he
5548 ipythonrc file. Now the user can easily define whatever names he
5534 wants for the magic functions without having to play weird
5549 wants for the magic functions without having to play weird
5535 namespace games. This gives IPython a real shell-like feel.
5550 namespace games. This gives IPython a real shell-like feel.
5536
5551
5537 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5552 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5538 @ or not).
5553 @ or not).
5539
5554
5540 This was one of the last remaining 'visible' bugs (that I know
5555 This was one of the last remaining 'visible' bugs (that I know
5541 of). I think if I can clean up the session loading so it works
5556 of). I think if I can clean up the session loading so it works
5542 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5557 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5543 about licensing).
5558 about licensing).
5544
5559
5545 2001-11-25 Fernando Perez <fperez@colorado.edu>
5560 2001-11-25 Fernando Perez <fperez@colorado.edu>
5546
5561
5547 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5562 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5548 there's a cleaner distinction between what ? and ?? show.
5563 there's a cleaner distinction between what ? and ?? show.
5549
5564
5550 * Added screen_length option. Now the user can define his own
5565 * Added screen_length option. Now the user can define his own
5551 screen size for page() operations.
5566 screen size for page() operations.
5552
5567
5553 * Implemented magic shell-like functions with automatic code
5568 * Implemented magic shell-like functions with automatic code
5554 generation. Now adding another function is just a matter of adding
5569 generation. Now adding another function is just a matter of adding
5555 an entry to a dict, and the function is dynamically generated at
5570 an entry to a dict, and the function is dynamically generated at
5556 run-time. Python has some really cool features!
5571 run-time. Python has some really cool features!
5557
5572
5558 * Renamed many options to cleanup conventions a little. Now all
5573 * Renamed many options to cleanup conventions a little. Now all
5559 are lowercase, and only underscores where needed. Also in the code
5574 are lowercase, and only underscores where needed. Also in the code
5560 option name tables are clearer.
5575 option name tables are clearer.
5561
5576
5562 * Changed prompts a little. Now input is 'In [n]:' instead of
5577 * Changed prompts a little. Now input is 'In [n]:' instead of
5563 'In[n]:='. This allows it the numbers to be aligned with the
5578 'In[n]:='. This allows it the numbers to be aligned with the
5564 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5579 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5565 Python (it was a Mathematica thing). The '...' continuation prompt
5580 Python (it was a Mathematica thing). The '...' continuation prompt
5566 was also changed a little to align better.
5581 was also changed a little to align better.
5567
5582
5568 * Fixed bug when flushing output cache. Not all _p<n> variables
5583 * Fixed bug when flushing output cache. Not all _p<n> variables
5569 exist, so their deletion needs to be wrapped in a try:
5584 exist, so their deletion needs to be wrapped in a try:
5570
5585
5571 * Figured out how to properly use inspect.formatargspec() (it
5586 * Figured out how to properly use inspect.formatargspec() (it
5572 requires the args preceded by *). So I removed all the code from
5587 requires the args preceded by *). So I removed all the code from
5573 _get_pdef in Magic, which was just replicating that.
5588 _get_pdef in Magic, which was just replicating that.
5574
5589
5575 * Added test to prefilter to allow redefining magic function names
5590 * Added test to prefilter to allow redefining magic function names
5576 as variables. This is ok, since the @ form is always available,
5591 as variables. This is ok, since the @ form is always available,
5577 but whe should allow the user to define a variable called 'ls' if
5592 but whe should allow the user to define a variable called 'ls' if
5578 he needs it.
5593 he needs it.
5579
5594
5580 * Moved the ToDo information from README into a separate ToDo.
5595 * Moved the ToDo information from README into a separate ToDo.
5581
5596
5582 * General code cleanup and small bugfixes. I think it's close to a
5597 * General code cleanup and small bugfixes. I think it's close to a
5583 state where it can be released, obviously with a big 'beta'
5598 state where it can be released, obviously with a big 'beta'
5584 warning on it.
5599 warning on it.
5585
5600
5586 * Got the magic function split to work. Now all magics are defined
5601 * Got the magic function split to work. Now all magics are defined
5587 in a separate class. It just organizes things a bit, and now
5602 in a separate class. It just organizes things a bit, and now
5588 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5603 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5589 was too long).
5604 was too long).
5590
5605
5591 * Changed @clear to @reset to avoid potential confusions with
5606 * Changed @clear to @reset to avoid potential confusions with
5592 the shell command clear. Also renamed @cl to @clear, which does
5607 the shell command clear. Also renamed @cl to @clear, which does
5593 exactly what people expect it to from their shell experience.
5608 exactly what people expect it to from their shell experience.
5594
5609
5595 Added a check to the @reset command (since it's so
5610 Added a check to the @reset command (since it's so
5596 destructive, it's probably a good idea to ask for confirmation).
5611 destructive, it's probably a good idea to ask for confirmation).
5597 But now reset only works for full namespace resetting. Since the
5612 But now reset only works for full namespace resetting. Since the
5598 del keyword is already there for deleting a few specific
5613 del keyword is already there for deleting a few specific
5599 variables, I don't see the point of having a redundant magic
5614 variables, I don't see the point of having a redundant magic
5600 function for the same task.
5615 function for the same task.
5601
5616
5602 2001-11-24 Fernando Perez <fperez@colorado.edu>
5617 2001-11-24 Fernando Perez <fperez@colorado.edu>
5603
5618
5604 * Updated the builtin docs (esp. the ? ones).
5619 * Updated the builtin docs (esp. the ? ones).
5605
5620
5606 * Ran all the code through pychecker. Not terribly impressed with
5621 * Ran all the code through pychecker. Not terribly impressed with
5607 it: lots of spurious warnings and didn't really find anything of
5622 it: lots of spurious warnings and didn't really find anything of
5608 substance (just a few modules being imported and not used).
5623 substance (just a few modules being imported and not used).
5609
5624
5610 * Implemented the new ultraTB functionality into IPython. New
5625 * Implemented the new ultraTB functionality into IPython. New
5611 option: xcolors. This chooses color scheme. xmode now only selects
5626 option: xcolors. This chooses color scheme. xmode now only selects
5612 between Plain and Verbose. Better orthogonality.
5627 between Plain and Verbose. Better orthogonality.
5613
5628
5614 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5629 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5615 mode and color scheme for the exception handlers. Now it's
5630 mode and color scheme for the exception handlers. Now it's
5616 possible to have the verbose traceback with no coloring.
5631 possible to have the verbose traceback with no coloring.
5617
5632
5618 2001-11-23 Fernando Perez <fperez@colorado.edu>
5633 2001-11-23 Fernando Perez <fperez@colorado.edu>
5619
5634
5620 * Version 0.1.12 released, 0.1.13 opened.
5635 * Version 0.1.12 released, 0.1.13 opened.
5621
5636
5622 * Removed option to set auto-quote and auto-paren escapes by
5637 * Removed option to set auto-quote and auto-paren escapes by
5623 user. The chances of breaking valid syntax are just too high. If
5638 user. The chances of breaking valid syntax are just too high. If
5624 someone *really* wants, they can always dig into the code.
5639 someone *really* wants, they can always dig into the code.
5625
5640
5626 * Made prompt separators configurable.
5641 * Made prompt separators configurable.
5627
5642
5628 2001-11-22 Fernando Perez <fperez@colorado.edu>
5643 2001-11-22 Fernando Perez <fperez@colorado.edu>
5629
5644
5630 * Small bugfixes in many places.
5645 * Small bugfixes in many places.
5631
5646
5632 * Removed the MyCompleter class from ipplib. It seemed redundant
5647 * Removed the MyCompleter class from ipplib. It seemed redundant
5633 with the C-p,C-n history search functionality. Less code to
5648 with the C-p,C-n history search functionality. Less code to
5634 maintain.
5649 maintain.
5635
5650
5636 * Moved all the original ipython.py code into ipythonlib.py. Right
5651 * Moved all the original ipython.py code into ipythonlib.py. Right
5637 now it's just one big dump into a function called make_IPython, so
5652 now it's just one big dump into a function called make_IPython, so
5638 no real modularity has been gained. But at least it makes the
5653 no real modularity has been gained. But at least it makes the
5639 wrapper script tiny, and since ipythonlib is a module, it gets
5654 wrapper script tiny, and since ipythonlib is a module, it gets
5640 compiled and startup is much faster.
5655 compiled and startup is much faster.
5641
5656
5642 This is a reasobably 'deep' change, so we should test it for a
5657 This is a reasobably 'deep' change, so we should test it for a
5643 while without messing too much more with the code.
5658 while without messing too much more with the code.
5644
5659
5645 2001-11-21 Fernando Perez <fperez@colorado.edu>
5660 2001-11-21 Fernando Perez <fperez@colorado.edu>
5646
5661
5647 * Version 0.1.11 released, 0.1.12 opened for further work.
5662 * Version 0.1.11 released, 0.1.12 opened for further work.
5648
5663
5649 * Removed dependency on Itpl. It was only needed in one place. It
5664 * Removed dependency on Itpl. It was only needed in one place. It
5650 would be nice if this became part of python, though. It makes life
5665 would be nice if this became part of python, though. It makes life
5651 *a lot* easier in some cases.
5666 *a lot* easier in some cases.
5652
5667
5653 * Simplified the prefilter code a bit. Now all handlers are
5668 * Simplified the prefilter code a bit. Now all handlers are
5654 expected to explicitly return a value (at least a blank string).
5669 expected to explicitly return a value (at least a blank string).
5655
5670
5656 * Heavy edits in ipplib. Removed the help system altogether. Now
5671 * Heavy edits in ipplib. Removed the help system altogether. Now
5657 obj?/?? is used for inspecting objects, a magic @doc prints
5672 obj?/?? is used for inspecting objects, a magic @doc prints
5658 docstrings, and full-blown Python help is accessed via the 'help'
5673 docstrings, and full-blown Python help is accessed via the 'help'
5659 keyword. This cleans up a lot of code (less to maintain) and does
5674 keyword. This cleans up a lot of code (less to maintain) and does
5660 the job. Since 'help' is now a standard Python component, might as
5675 the job. Since 'help' is now a standard Python component, might as
5661 well use it and remove duplicate functionality.
5676 well use it and remove duplicate functionality.
5662
5677
5663 Also removed the option to use ipplib as a standalone program. By
5678 Also removed the option to use ipplib as a standalone program. By
5664 now it's too dependent on other parts of IPython to function alone.
5679 now it's too dependent on other parts of IPython to function alone.
5665
5680
5666 * Fixed bug in genutils.pager. It would crash if the pager was
5681 * Fixed bug in genutils.pager. It would crash if the pager was
5667 exited immediately after opening (broken pipe).
5682 exited immediately after opening (broken pipe).
5668
5683
5669 * Trimmed down the VerboseTB reporting a little. The header is
5684 * Trimmed down the VerboseTB reporting a little. The header is
5670 much shorter now and the repeated exception arguments at the end
5685 much shorter now and the repeated exception arguments at the end
5671 have been removed. For interactive use the old header seemed a bit
5686 have been removed. For interactive use the old header seemed a bit
5672 excessive.
5687 excessive.
5673
5688
5674 * Fixed small bug in output of @whos for variables with multi-word
5689 * Fixed small bug in output of @whos for variables with multi-word
5675 types (only first word was displayed).
5690 types (only first word was displayed).
5676
5691
5677 2001-11-17 Fernando Perez <fperez@colorado.edu>
5692 2001-11-17 Fernando Perez <fperez@colorado.edu>
5678
5693
5679 * Version 0.1.10 released, 0.1.11 opened for further work.
5694 * Version 0.1.10 released, 0.1.11 opened for further work.
5680
5695
5681 * Modified dirs and friends. dirs now *returns* the stack (not
5696 * Modified dirs and friends. dirs now *returns* the stack (not
5682 prints), so one can manipulate it as a variable. Convenient to
5697 prints), so one can manipulate it as a variable. Convenient to
5683 travel along many directories.
5698 travel along many directories.
5684
5699
5685 * Fixed bug in magic_pdef: would only work with functions with
5700 * Fixed bug in magic_pdef: would only work with functions with
5686 arguments with default values.
5701 arguments with default values.
5687
5702
5688 2001-11-14 Fernando Perez <fperez@colorado.edu>
5703 2001-11-14 Fernando Perez <fperez@colorado.edu>
5689
5704
5690 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5705 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5691 example with IPython. Various other minor fixes and cleanups.
5706 example with IPython. Various other minor fixes and cleanups.
5692
5707
5693 * Version 0.1.9 released, 0.1.10 opened for further work.
5708 * Version 0.1.9 released, 0.1.10 opened for further work.
5694
5709
5695 * Added sys.path to the list of directories searched in the
5710 * Added sys.path to the list of directories searched in the
5696 execfile= option. It used to be the current directory and the
5711 execfile= option. It used to be the current directory and the
5697 user's IPYTHONDIR only.
5712 user's IPYTHONDIR only.
5698
5713
5699 2001-11-13 Fernando Perez <fperez@colorado.edu>
5714 2001-11-13 Fernando Perez <fperez@colorado.edu>
5700
5715
5701 * Reinstated the raw_input/prefilter separation that Janko had
5716 * Reinstated the raw_input/prefilter separation that Janko had
5702 initially. This gives a more convenient setup for extending the
5717 initially. This gives a more convenient setup for extending the
5703 pre-processor from the outside: raw_input always gets a string,
5718 pre-processor from the outside: raw_input always gets a string,
5704 and prefilter has to process it. We can then redefine prefilter
5719 and prefilter has to process it. We can then redefine prefilter
5705 from the outside and implement extensions for special
5720 from the outside and implement extensions for special
5706 purposes.
5721 purposes.
5707
5722
5708 Today I got one for inputting PhysicalQuantity objects
5723 Today I got one for inputting PhysicalQuantity objects
5709 (from Scientific) without needing any function calls at
5724 (from Scientific) without needing any function calls at
5710 all. Extremely convenient, and it's all done as a user-level
5725 all. Extremely convenient, and it's all done as a user-level
5711 extension (no IPython code was touched). Now instead of:
5726 extension (no IPython code was touched). Now instead of:
5712 a = PhysicalQuantity(4.2,'m/s**2')
5727 a = PhysicalQuantity(4.2,'m/s**2')
5713 one can simply say
5728 one can simply say
5714 a = 4.2 m/s**2
5729 a = 4.2 m/s**2
5715 or even
5730 or even
5716 a = 4.2 m/s^2
5731 a = 4.2 m/s^2
5717
5732
5718 I use this, but it's also a proof of concept: IPython really is
5733 I use this, but it's also a proof of concept: IPython really is
5719 fully user-extensible, even at the level of the parsing of the
5734 fully user-extensible, even at the level of the parsing of the
5720 command line. It's not trivial, but it's perfectly doable.
5735 command line. It's not trivial, but it's perfectly doable.
5721
5736
5722 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5737 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5723 the problem of modules being loaded in the inverse order in which
5738 the problem of modules being loaded in the inverse order in which
5724 they were defined in
5739 they were defined in
5725
5740
5726 * Version 0.1.8 released, 0.1.9 opened for further work.
5741 * Version 0.1.8 released, 0.1.9 opened for further work.
5727
5742
5728 * Added magics pdef, source and file. They respectively show the
5743 * Added magics pdef, source and file. They respectively show the
5729 definition line ('prototype' in C), source code and full python
5744 definition line ('prototype' in C), source code and full python
5730 file for any callable object. The object inspector oinfo uses
5745 file for any callable object. The object inspector oinfo uses
5731 these to show the same information.
5746 these to show the same information.
5732
5747
5733 * Version 0.1.7 released, 0.1.8 opened for further work.
5748 * Version 0.1.7 released, 0.1.8 opened for further work.
5734
5749
5735 * Separated all the magic functions into a class called Magic. The
5750 * Separated all the magic functions into a class called Magic. The
5736 InteractiveShell class was becoming too big for Xemacs to handle
5751 InteractiveShell class was becoming too big for Xemacs to handle
5737 (de-indenting a line would lock it up for 10 seconds while it
5752 (de-indenting a line would lock it up for 10 seconds while it
5738 backtracked on the whole class!)
5753 backtracked on the whole class!)
5739
5754
5740 FIXME: didn't work. It can be done, but right now namespaces are
5755 FIXME: didn't work. It can be done, but right now namespaces are
5741 all messed up. Do it later (reverted it for now, so at least
5756 all messed up. Do it later (reverted it for now, so at least
5742 everything works as before).
5757 everything works as before).
5743
5758
5744 * Got the object introspection system (magic_oinfo) working! I
5759 * Got the object introspection system (magic_oinfo) working! I
5745 think this is pretty much ready for release to Janko, so he can
5760 think this is pretty much ready for release to Janko, so he can
5746 test it for a while and then announce it. Pretty much 100% of what
5761 test it for a while and then announce it. Pretty much 100% of what
5747 I wanted for the 'phase 1' release is ready. Happy, tired.
5762 I wanted for the 'phase 1' release is ready. Happy, tired.
5748
5763
5749 2001-11-12 Fernando Perez <fperez@colorado.edu>
5764 2001-11-12 Fernando Perez <fperez@colorado.edu>
5750
5765
5751 * Version 0.1.6 released, 0.1.7 opened for further work.
5766 * Version 0.1.6 released, 0.1.7 opened for further work.
5752
5767
5753 * Fixed bug in printing: it used to test for truth before
5768 * Fixed bug in printing: it used to test for truth before
5754 printing, so 0 wouldn't print. Now checks for None.
5769 printing, so 0 wouldn't print. Now checks for None.
5755
5770
5756 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5771 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5757 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5772 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5758 reaches by hand into the outputcache. Think of a better way to do
5773 reaches by hand into the outputcache. Think of a better way to do
5759 this later.
5774 this later.
5760
5775
5761 * Various small fixes thanks to Nathan's comments.
5776 * Various small fixes thanks to Nathan's comments.
5762
5777
5763 * Changed magic_pprint to magic_Pprint. This way it doesn't
5778 * Changed magic_pprint to magic_Pprint. This way it doesn't
5764 collide with pprint() and the name is consistent with the command
5779 collide with pprint() and the name is consistent with the command
5765 line option.
5780 line option.
5766
5781
5767 * Changed prompt counter behavior to be fully like
5782 * Changed prompt counter behavior to be fully like
5768 Mathematica's. That is, even input that doesn't return a result
5783 Mathematica's. That is, even input that doesn't return a result
5769 raises the prompt counter. The old behavior was kind of confusing
5784 raises the prompt counter. The old behavior was kind of confusing
5770 (getting the same prompt number several times if the operation
5785 (getting the same prompt number several times if the operation
5771 didn't return a result).
5786 didn't return a result).
5772
5787
5773 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5788 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5774
5789
5775 * Fixed -Classic mode (wasn't working anymore).
5790 * Fixed -Classic mode (wasn't working anymore).
5776
5791
5777 * Added colored prompts using Nathan's new code. Colors are
5792 * Added colored prompts using Nathan's new code. Colors are
5778 currently hardwired, they can be user-configurable. For
5793 currently hardwired, they can be user-configurable. For
5779 developers, they can be chosen in file ipythonlib.py, at the
5794 developers, they can be chosen in file ipythonlib.py, at the
5780 beginning of the CachedOutput class def.
5795 beginning of the CachedOutput class def.
5781
5796
5782 2001-11-11 Fernando Perez <fperez@colorado.edu>
5797 2001-11-11 Fernando Perez <fperez@colorado.edu>
5783
5798
5784 * Version 0.1.5 released, 0.1.6 opened for further work.
5799 * Version 0.1.5 released, 0.1.6 opened for further work.
5785
5800
5786 * Changed magic_env to *return* the environment as a dict (not to
5801 * Changed magic_env to *return* the environment as a dict (not to
5787 print it). This way it prints, but it can also be processed.
5802 print it). This way it prints, but it can also be processed.
5788
5803
5789 * Added Verbose exception reporting to interactive
5804 * Added Verbose exception reporting to interactive
5790 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5805 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5791 traceback. Had to make some changes to the ultraTB file. This is
5806 traceback. Had to make some changes to the ultraTB file. This is
5792 probably the last 'big' thing in my mental todo list. This ties
5807 probably the last 'big' thing in my mental todo list. This ties
5793 in with the next entry:
5808 in with the next entry:
5794
5809
5795 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5810 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5796 has to specify is Plain, Color or Verbose for all exception
5811 has to specify is Plain, Color or Verbose for all exception
5797 handling.
5812 handling.
5798
5813
5799 * Removed ShellServices option. All this can really be done via
5814 * Removed ShellServices option. All this can really be done via
5800 the magic system. It's easier to extend, cleaner and has automatic
5815 the magic system. It's easier to extend, cleaner and has automatic
5801 namespace protection and documentation.
5816 namespace protection and documentation.
5802
5817
5803 2001-11-09 Fernando Perez <fperez@colorado.edu>
5818 2001-11-09 Fernando Perez <fperez@colorado.edu>
5804
5819
5805 * Fixed bug in output cache flushing (missing parameter to
5820 * Fixed bug in output cache flushing (missing parameter to
5806 __init__). Other small bugs fixed (found using pychecker).
5821 __init__). Other small bugs fixed (found using pychecker).
5807
5822
5808 * Version 0.1.4 opened for bugfixing.
5823 * Version 0.1.4 opened for bugfixing.
5809
5824
5810 2001-11-07 Fernando Perez <fperez@colorado.edu>
5825 2001-11-07 Fernando Perez <fperez@colorado.edu>
5811
5826
5812 * Version 0.1.3 released, mainly because of the raw_input bug.
5827 * Version 0.1.3 released, mainly because of the raw_input bug.
5813
5828
5814 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5829 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5815 and when testing for whether things were callable, a call could
5830 and when testing for whether things were callable, a call could
5816 actually be made to certain functions. They would get called again
5831 actually be made to certain functions. They would get called again
5817 once 'really' executed, with a resulting double call. A disaster
5832 once 'really' executed, with a resulting double call. A disaster
5818 in many cases (list.reverse() would never work!).
5833 in many cases (list.reverse() would never work!).
5819
5834
5820 * Removed prefilter() function, moved its code to raw_input (which
5835 * Removed prefilter() function, moved its code to raw_input (which
5821 after all was just a near-empty caller for prefilter). This saves
5836 after all was just a near-empty caller for prefilter). This saves
5822 a function call on every prompt, and simplifies the class a tiny bit.
5837 a function call on every prompt, and simplifies the class a tiny bit.
5823
5838
5824 * Fix _ip to __ip name in magic example file.
5839 * Fix _ip to __ip name in magic example file.
5825
5840
5826 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5841 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5827 work with non-gnu versions of tar.
5842 work with non-gnu versions of tar.
5828
5843
5829 2001-11-06 Fernando Perez <fperez@colorado.edu>
5844 2001-11-06 Fernando Perez <fperez@colorado.edu>
5830
5845
5831 * Version 0.1.2. Just to keep track of the recent changes.
5846 * Version 0.1.2. Just to keep track of the recent changes.
5832
5847
5833 * Fixed nasty bug in output prompt routine. It used to check 'if
5848 * Fixed nasty bug in output prompt routine. It used to check 'if
5834 arg != None...'. Problem is, this fails if arg implements a
5849 arg != None...'. Problem is, this fails if arg implements a
5835 special comparison (__cmp__) which disallows comparing to
5850 special comparison (__cmp__) which disallows comparing to
5836 None. Found it when trying to use the PhysicalQuantity module from
5851 None. Found it when trying to use the PhysicalQuantity module from
5837 ScientificPython.
5852 ScientificPython.
5838
5853
5839 2001-11-05 Fernando Perez <fperez@colorado.edu>
5854 2001-11-05 Fernando Perez <fperez@colorado.edu>
5840
5855
5841 * Also added dirs. Now the pushd/popd/dirs family functions
5856 * Also added dirs. Now the pushd/popd/dirs family functions
5842 basically like the shell, with the added convenience of going home
5857 basically like the shell, with the added convenience of going home
5843 when called with no args.
5858 when called with no args.
5844
5859
5845 * pushd/popd slightly modified to mimic shell behavior more
5860 * pushd/popd slightly modified to mimic shell behavior more
5846 closely.
5861 closely.
5847
5862
5848 * Added env,pushd,popd from ShellServices as magic functions. I
5863 * Added env,pushd,popd from ShellServices as magic functions. I
5849 think the cleanest will be to port all desired functions from
5864 think the cleanest will be to port all desired functions from
5850 ShellServices as magics and remove ShellServices altogether. This
5865 ShellServices as magics and remove ShellServices altogether. This
5851 will provide a single, clean way of adding functionality
5866 will provide a single, clean way of adding functionality
5852 (shell-type or otherwise) to IP.
5867 (shell-type or otherwise) to IP.
5853
5868
5854 2001-11-04 Fernando Perez <fperez@colorado.edu>
5869 2001-11-04 Fernando Perez <fperez@colorado.edu>
5855
5870
5856 * Added .ipython/ directory to sys.path. This way users can keep
5871 * Added .ipython/ directory to sys.path. This way users can keep
5857 customizations there and access them via import.
5872 customizations there and access them via import.
5858
5873
5859 2001-11-03 Fernando Perez <fperez@colorado.edu>
5874 2001-11-03 Fernando Perez <fperez@colorado.edu>
5860
5875
5861 * Opened version 0.1.1 for new changes.
5876 * Opened version 0.1.1 for new changes.
5862
5877
5863 * Changed version number to 0.1.0: first 'public' release, sent to
5878 * Changed version number to 0.1.0: first 'public' release, sent to
5864 Nathan and Janko.
5879 Nathan and Janko.
5865
5880
5866 * Lots of small fixes and tweaks.
5881 * Lots of small fixes and tweaks.
5867
5882
5868 * Minor changes to whos format. Now strings are shown, snipped if
5883 * Minor changes to whos format. Now strings are shown, snipped if
5869 too long.
5884 too long.
5870
5885
5871 * Changed ShellServices to work on __main__ so they show up in @who
5886 * Changed ShellServices to work on __main__ so they show up in @who
5872
5887
5873 * Help also works with ? at the end of a line:
5888 * Help also works with ? at the end of a line:
5874 ?sin and sin?
5889 ?sin and sin?
5875 both produce the same effect. This is nice, as often I use the
5890 both produce the same effect. This is nice, as often I use the
5876 tab-complete to find the name of a method, but I used to then have
5891 tab-complete to find the name of a method, but I used to then have
5877 to go to the beginning of the line to put a ? if I wanted more
5892 to go to the beginning of the line to put a ? if I wanted more
5878 info. Now I can just add the ? and hit return. Convenient.
5893 info. Now I can just add the ? and hit return. Convenient.
5879
5894
5880 2001-11-02 Fernando Perez <fperez@colorado.edu>
5895 2001-11-02 Fernando Perez <fperez@colorado.edu>
5881
5896
5882 * Python version check (>=2.1) added.
5897 * Python version check (>=2.1) added.
5883
5898
5884 * Added LazyPython documentation. At this point the docs are quite
5899 * Added LazyPython documentation. At this point the docs are quite
5885 a mess. A cleanup is in order.
5900 a mess. A cleanup is in order.
5886
5901
5887 * Auto-installer created. For some bizarre reason, the zipfiles
5902 * Auto-installer created. For some bizarre reason, the zipfiles
5888 module isn't working on my system. So I made a tar version
5903 module isn't working on my system. So I made a tar version
5889 (hopefully the command line options in various systems won't kill
5904 (hopefully the command line options in various systems won't kill
5890 me).
5905 me).
5891
5906
5892 * Fixes to Struct in genutils. Now all dictionary-like methods are
5907 * Fixes to Struct in genutils. Now all dictionary-like methods are
5893 protected (reasonably).
5908 protected (reasonably).
5894
5909
5895 * Added pager function to genutils and changed ? to print usage
5910 * Added pager function to genutils and changed ? to print usage
5896 note through it (it was too long).
5911 note through it (it was too long).
5897
5912
5898 * Added the LazyPython functionality. Works great! I changed the
5913 * Added the LazyPython functionality. Works great! I changed the
5899 auto-quote escape to ';', it's on home row and next to '. But
5914 auto-quote escape to ';', it's on home row and next to '. But
5900 both auto-quote and auto-paren (still /) escapes are command-line
5915 both auto-quote and auto-paren (still /) escapes are command-line
5901 parameters.
5916 parameters.
5902
5917
5903
5918
5904 2001-11-01 Fernando Perez <fperez@colorado.edu>
5919 2001-11-01 Fernando Perez <fperez@colorado.edu>
5905
5920
5906 * Version changed to 0.0.7. Fairly large change: configuration now
5921 * Version changed to 0.0.7. Fairly large change: configuration now
5907 is all stored in a directory, by default .ipython. There, all
5922 is all stored in a directory, by default .ipython. There, all
5908 config files have normal looking names (not .names)
5923 config files have normal looking names (not .names)
5909
5924
5910 * Version 0.0.6 Released first to Lucas and Archie as a test
5925 * Version 0.0.6 Released first to Lucas and Archie as a test
5911 run. Since it's the first 'semi-public' release, change version to
5926 run. Since it's the first 'semi-public' release, change version to
5912 > 0.0.6 for any changes now.
5927 > 0.0.6 for any changes now.
5913
5928
5914 * Stuff I had put in the ipplib.py changelog:
5929 * Stuff I had put in the ipplib.py changelog:
5915
5930
5916 Changes to InteractiveShell:
5931 Changes to InteractiveShell:
5917
5932
5918 - Made the usage message a parameter.
5933 - Made the usage message a parameter.
5919
5934
5920 - Require the name of the shell variable to be given. It's a bit
5935 - Require the name of the shell variable to be given. It's a bit
5921 of a hack, but allows the name 'shell' not to be hardwired in the
5936 of a hack, but allows the name 'shell' not to be hardwired in the
5922 magic (@) handler, which is problematic b/c it requires
5937 magic (@) handler, which is problematic b/c it requires
5923 polluting the global namespace with 'shell'. This in turn is
5938 polluting the global namespace with 'shell'. This in turn is
5924 fragile: if a user redefines a variable called shell, things
5939 fragile: if a user redefines a variable called shell, things
5925 break.
5940 break.
5926
5941
5927 - magic @: all functions available through @ need to be defined
5942 - magic @: all functions available through @ need to be defined
5928 as magic_<name>, even though they can be called simply as
5943 as magic_<name>, even though they can be called simply as
5929 @<name>. This allows the special command @magic to gather
5944 @<name>. This allows the special command @magic to gather
5930 information automatically about all existing magic functions,
5945 information automatically about all existing magic functions,
5931 even if they are run-time user extensions, by parsing the shell
5946 even if they are run-time user extensions, by parsing the shell
5932 instance __dict__ looking for special magic_ names.
5947 instance __dict__ looking for special magic_ names.
5933
5948
5934 - mainloop: added *two* local namespace parameters. This allows
5949 - mainloop: added *two* local namespace parameters. This allows
5935 the class to differentiate between parameters which were there
5950 the class to differentiate between parameters which were there
5936 before and after command line initialization was processed. This
5951 before and after command line initialization was processed. This
5937 way, later @who can show things loaded at startup by the
5952 way, later @who can show things loaded at startup by the
5938 user. This trick was necessary to make session saving/reloading
5953 user. This trick was necessary to make session saving/reloading
5939 really work: ideally after saving/exiting/reloading a session,
5954 really work: ideally after saving/exiting/reloading a session,
5940 *everything* should look the same, including the output of @who. I
5955 *everything* should look the same, including the output of @who. I
5941 was only able to make this work with this double namespace
5956 was only able to make this work with this double namespace
5942 trick.
5957 trick.
5943
5958
5944 - added a header to the logfile which allows (almost) full
5959 - added a header to the logfile which allows (almost) full
5945 session restoring.
5960 session restoring.
5946
5961
5947 - prepend lines beginning with @ or !, with a and log
5962 - prepend lines beginning with @ or !, with a and log
5948 them. Why? !lines: may be useful to know what you did @lines:
5963 them. Why? !lines: may be useful to know what you did @lines:
5949 they may affect session state. So when restoring a session, at
5964 they may affect session state. So when restoring a session, at
5950 least inform the user of their presence. I couldn't quite get
5965 least inform the user of their presence. I couldn't quite get
5951 them to properly re-execute, but at least the user is warned.
5966 them to properly re-execute, but at least the user is warned.
5952
5967
5953 * Started ChangeLog.
5968 * Started ChangeLog.
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
General Comments 0
You need to be logged in to leave comments. Login now