##// END OF EJS Templates
fix prompt separators for doctests
fperez -
Show More
@@ -1,48 +1,46 b''
1 """Config file for 'doctest' profile.
1 """Config file for 'doctest' profile.
2
2
3 This profile modifies the prompts to be the standard Python ones, so that you
3 This profile modifies the prompts to be the standard Python ones, so that you
4 can generate easily doctests from an IPython session.
4 can generate easily doctests from an IPython session.
5
5
6 But more importantly, it enables pasting of code with '>>>' prompts and
6 But more importantly, it enables pasting of code with '>>>' prompts and
7 arbitrary initial whitespace, as is typical of doctests in reST files and
7 arbitrary initial whitespace, as is typical of doctests in reST files and
8 docstrings. This allows you to easily re-run existing doctests and iteratively
8 docstrings. This allows you to easily re-run existing doctests and iteratively
9 work on them as part of your development workflow.
9 work on them as part of your development workflow.
10
10
11 The exception mode is also set to 'plain' so the generated exceptions are as
11 The exception mode is also set to 'plain' so the generated exceptions are as
12 similar as possible to the default Python ones, for inclusion in doctests."""
12 similar as possible to the default Python ones, for inclusion in doctests."""
13
13
14 # get various stuff that are there for historical / familiarity reasons
14 # get various stuff that are there for historical / familiarity reasons
15 import ipy_legacy
15 import ipy_legacy
16
16
17 from IPython import ipapi
17 from IPython import ipapi
18
18
19 from IPython.Extensions import InterpreterPasteInput
19 from IPython.Extensions import InterpreterPasteInput
20
20
21 def main():
21 def main():
22 ip = ipapi.get()
22 ip = ipapi.get()
23 o = ip.options
23 o = ip.options
24
24
25 # Set the prompts similar to the defaults
25 # Set the prompts similar to the defaults
26 o.prompt_in1 = '>>> '
26 o.prompt_in1 = '>>> '
27 o.prompt_in2 = '... '
27 o.prompt_in2 = '... '
28 o.prompt_out = ''
28 o.prompt_out = ''
29
29
30 # No separation between successive inputs
30 # Add a blank line before each new set of inputs. This is needed by
31 o.separate_in = ''
31 # doctest to distinguish each test from the next.
32 o.separate_in = '\n'
32 o.separate_out = ''
33 o.separate_out = ''
33 # But add a blank line after any output, to help separate doctests from
34 o.separate_out2 = ''
34 # each other. This is needed by doctest to distinguish each test from the
35 # next.
36 o.separate_out2 = '\n'
37
35
38 # Disable pprint, so that outputs are printed as similarly to standard
36 # Disable pprint, so that outputs are printed as similarly to standard
39 # python as possible
37 # python as possible
40 o.pprint = False
38 o.pprint = False
41
39
42 # Use plain exceptions, to also resemble normal pyhton.
40 # Use plain exceptions, to also resemble normal pyhton.
43 o.xmode = 'plain'
41 o.xmode = 'plain'
44
42
45 # Store the activity flag in the metadata bag from the running shell
43 # Store the activity flag in the metadata bag from the running shell
46 ip.IP.meta.doctest_mode = True
44 ip.IP.meta.doctest_mode = True
47
45
48 main()
46 main()
@@ -1,3001 +1,3002 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 2601 2007-08-10 07:01:29Z fperez $"""
4 $Id: Magic.py 2607 2007-08-13 13:25:24Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
8 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
9 #
9 #
10 # Distributed under the terms of the BSD License. The full license is in
10 # Distributed under the terms of the BSD License. The full license is in
11 # the file COPYING, distributed as part of this software.
11 # the file COPYING, distributed as part of this software.
12 #*****************************************************************************
12 #*****************************************************************************
13
13
14 #****************************************************************************
14 #****************************************************************************
15 # Modules and globals
15 # Modules and globals
16
16
17 from IPython import Release
17 from IPython import Release
18 __author__ = '%s <%s>\n%s <%s>' % \
18 __author__ = '%s <%s>\n%s <%s>' % \
19 ( Release.authors['Janko'] + Release.authors['Fernando'] )
19 ( Release.authors['Janko'] + Release.authors['Fernando'] )
20 __license__ = Release.license
20 __license__ = Release.license
21
21
22 # Python standard modules
22 # Python standard modules
23 import __builtin__
23 import __builtin__
24 import bdb
24 import bdb
25 import inspect
25 import inspect
26 import os
26 import os
27 import pdb
27 import pdb
28 import pydoc
28 import pydoc
29 import sys
29 import sys
30 import re
30 import re
31 import tempfile
31 import tempfile
32 import time
32 import time
33 import cPickle as pickle
33 import cPickle as pickle
34 import textwrap
34 import textwrap
35 from cStringIO import StringIO
35 from cStringIO import StringIO
36 from getopt import getopt,GetoptError
36 from getopt import getopt,GetoptError
37 from pprint import pprint, pformat
37 from pprint import pprint, pformat
38 from sets import Set
38 from sets import Set
39
39
40 # cProfile was added in Python2.5
40 # cProfile was added in Python2.5
41 try:
41 try:
42 import cProfile as profile
42 import cProfile as profile
43 import pstats
43 import pstats
44 except ImportError:
44 except ImportError:
45 # profile isn't bundled by default in Debian for license reasons
45 # profile isn't bundled by default in Debian for license reasons
46 try:
46 try:
47 import profile,pstats
47 import profile,pstats
48 except ImportError:
48 except ImportError:
49 profile = pstats = None
49 profile = pstats = None
50
50
51 # Homebrewed
51 # Homebrewed
52 import IPython
52 import IPython
53 from IPython import Debugger, OInspect, wildcard
53 from IPython import Debugger, OInspect, wildcard
54 from IPython.FakeModule import FakeModule
54 from IPython.FakeModule import FakeModule
55 from IPython.Itpl import Itpl, itpl, printpl,itplns
55 from IPython.Itpl import Itpl, itpl, printpl,itplns
56 from IPython.PyColorize import Parser
56 from IPython.PyColorize import Parser
57 from IPython.ipstruct import Struct
57 from IPython.ipstruct import Struct
58 from IPython.macro import Macro
58 from IPython.macro import Macro
59 from IPython.genutils import *
59 from IPython.genutils import *
60 from IPython import platutils
60 from IPython import platutils
61 import IPython.generics
61 import IPython.generics
62 import IPython.ipapi
62 import IPython.ipapi
63
63
64 #***************************************************************************
64 #***************************************************************************
65 # Utility functions
65 # Utility functions
66 def on_off(tag):
66 def on_off(tag):
67 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
67 """Return an ON/OFF string for a 1/0 input. Simple utility function."""
68 return ['OFF','ON'][tag]
68 return ['OFF','ON'][tag]
69
69
70 class Bunch: pass
70 class Bunch: pass
71
71
72 def compress_dhist(dh):
72 def compress_dhist(dh):
73 head, tail = dh[:-10], dh[-10:]
73 head, tail = dh[:-10], dh[-10:]
74
74
75 newhead = []
75 newhead = []
76 done = Set()
76 done = Set()
77 for h in head:
77 for h in head:
78 if h in done:
78 if h in done:
79 continue
79 continue
80 newhead.append(h)
80 newhead.append(h)
81 done.add(h)
81 done.add(h)
82
82
83 return newhead + tail
83 return newhead + tail
84
84
85
85
86 #***************************************************************************
86 #***************************************************************************
87 # Main class implementing Magic functionality
87 # Main class implementing Magic functionality
88 class Magic:
88 class Magic:
89 """Magic functions for InteractiveShell.
89 """Magic functions for InteractiveShell.
90
90
91 Shell functions which can be reached as %function_name. All magic
91 Shell functions which can be reached as %function_name. All magic
92 functions should accept a string, which they can parse for their own
92 functions should accept a string, which they can parse for their own
93 needs. This can make some functions easier to type, eg `%cd ../`
93 needs. This can make some functions easier to type, eg `%cd ../`
94 vs. `%cd("../")`
94 vs. `%cd("../")`
95
95
96 ALL definitions MUST begin with the prefix magic_. The user won't need it
96 ALL definitions MUST begin with the prefix magic_. The user won't need it
97 at the command line, but it is is needed in the definition. """
97 at the command line, but it is is needed in the definition. """
98
98
99 # class globals
99 # class globals
100 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
100 auto_status = ['Automagic is OFF, % prefix IS needed for magic functions.',
101 'Automagic is ON, % prefix NOT needed for magic functions.']
101 'Automagic is ON, % prefix NOT needed for magic functions.']
102
102
103 #......................................................................
103 #......................................................................
104 # some utility functions
104 # some utility functions
105
105
106 def __init__(self,shell):
106 def __init__(self,shell):
107
107
108 self.options_table = {}
108 self.options_table = {}
109 if profile is None:
109 if profile is None:
110 self.magic_prun = self.profile_missing_notice
110 self.magic_prun = self.profile_missing_notice
111 self.shell = shell
111 self.shell = shell
112
112
113 # namespace for holding state we may need
113 # namespace for holding state we may need
114 self._magic_state = Bunch()
114 self._magic_state = Bunch()
115
115
116 def profile_missing_notice(self, *args, **kwargs):
116 def profile_missing_notice(self, *args, **kwargs):
117 error("""\
117 error("""\
118 The profile module could not be found. If you are a Debian user,
118 The profile module could not be found. If you are a Debian user,
119 it has been removed from the standard Debian package because of its non-free
119 it has been removed from the standard Debian package because of its non-free
120 license. To use profiling, please install"python2.3-profiler" from non-free.""")
120 license. To use profiling, please install"python2.3-profiler" from non-free.""")
121
121
122 def default_option(self,fn,optstr):
122 def default_option(self,fn,optstr):
123 """Make an entry in the options_table for fn, with value optstr"""
123 """Make an entry in the options_table for fn, with value optstr"""
124
124
125 if fn not in self.lsmagic():
125 if fn not in self.lsmagic():
126 error("%s is not a magic function" % fn)
126 error("%s is not a magic function" % fn)
127 self.options_table[fn] = optstr
127 self.options_table[fn] = optstr
128
128
129 def lsmagic(self):
129 def lsmagic(self):
130 """Return a list of currently available magic functions.
130 """Return a list of currently available magic functions.
131
131
132 Gives a list of the bare names after mangling (['ls','cd', ...], not
132 Gives a list of the bare names after mangling (['ls','cd', ...], not
133 ['magic_ls','magic_cd',...]"""
133 ['magic_ls','magic_cd',...]"""
134
134
135 # FIXME. This needs a cleanup, in the way the magics list is built.
135 # FIXME. This needs a cleanup, in the way the magics list is built.
136
136
137 # magics in class definition
137 # magics in class definition
138 class_magic = lambda fn: fn.startswith('magic_') and \
138 class_magic = lambda fn: fn.startswith('magic_') and \
139 callable(Magic.__dict__[fn])
139 callable(Magic.__dict__[fn])
140 # in instance namespace (run-time user additions)
140 # in instance namespace (run-time user additions)
141 inst_magic = lambda fn: fn.startswith('magic_') and \
141 inst_magic = lambda fn: fn.startswith('magic_') and \
142 callable(self.__dict__[fn])
142 callable(self.__dict__[fn])
143 # and bound magics by user (so they can access self):
143 # and bound magics by user (so they can access self):
144 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
144 inst_bound_magic = lambda fn: fn.startswith('magic_') and \
145 callable(self.__class__.__dict__[fn])
145 callable(self.__class__.__dict__[fn])
146 magics = filter(class_magic,Magic.__dict__.keys()) + \
146 magics = filter(class_magic,Magic.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
149 out = []
149 out = []
150 for fn in magics:
150 for fn in magics:
151 out.append(fn.replace('magic_','',1))
151 out.append(fn.replace('magic_','',1))
152 out.sort()
152 out.sort()
153 return out
153 return out
154
154
155 def extract_input_slices(self,slices,raw=False):
155 def extract_input_slices(self,slices,raw=False):
156 """Return as a string a set of input history slices.
156 """Return as a string a set of input history slices.
157
157
158 Inputs:
158 Inputs:
159
159
160 - slices: the set of slices is given as a list of strings (like
160 - slices: the set of slices is given as a list of strings (like
161 ['1','4:8','9'], since this function is for use by magic functions
161 ['1','4:8','9'], since this function is for use by magic functions
162 which get their arguments as strings.
162 which get their arguments as strings.
163
163
164 Optional inputs:
164 Optional inputs:
165
165
166 - raw(False): by default, the processed input is used. If this is
166 - raw(False): by default, the processed input is used. If this is
167 true, the raw input history is used instead.
167 true, the raw input history is used instead.
168
168
169 Note that slices can be called with two notations:
169 Note that slices can be called with two notations:
170
170
171 N:M -> standard python form, means including items N...(M-1).
171 N:M -> standard python form, means including items N...(M-1).
172
172
173 N-M -> include items N..M (closed endpoint)."""
173 N-M -> include items N..M (closed endpoint)."""
174
174
175 if raw:
175 if raw:
176 hist = self.shell.input_hist_raw
176 hist = self.shell.input_hist_raw
177 else:
177 else:
178 hist = self.shell.input_hist
178 hist = self.shell.input_hist
179
179
180 cmds = []
180 cmds = []
181 for chunk in slices:
181 for chunk in slices:
182 if ':' in chunk:
182 if ':' in chunk:
183 ini,fin = map(int,chunk.split(':'))
183 ini,fin = map(int,chunk.split(':'))
184 elif '-' in chunk:
184 elif '-' in chunk:
185 ini,fin = map(int,chunk.split('-'))
185 ini,fin = map(int,chunk.split('-'))
186 fin += 1
186 fin += 1
187 else:
187 else:
188 ini = int(chunk)
188 ini = int(chunk)
189 fin = ini+1
189 fin = ini+1
190 cmds.append(hist[ini:fin])
190 cmds.append(hist[ini:fin])
191 return cmds
191 return cmds
192
192
193 def _ofind(self, oname, namespaces=None):
193 def _ofind(self, oname, namespaces=None):
194 """Find an object in the available namespaces.
194 """Find an object in the available namespaces.
195
195
196 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
196 self._ofind(oname) -> dict with keys: found,obj,ospace,ismagic
197
197
198 Has special code to detect magic functions.
198 Has special code to detect magic functions.
199 """
199 """
200
200
201 oname = oname.strip()
201 oname = oname.strip()
202
202
203 alias_ns = None
203 alias_ns = None
204 if namespaces is None:
204 if namespaces is None:
205 # Namespaces to search in:
205 # Namespaces to search in:
206 # Put them in a list. The order is important so that we
206 # Put them in a list. The order is important so that we
207 # find things in the same order that Python finds them.
207 # find things in the same order that Python finds them.
208 namespaces = [ ('Interactive', self.shell.user_ns),
208 namespaces = [ ('Interactive', self.shell.user_ns),
209 ('IPython internal', self.shell.internal_ns),
209 ('IPython internal', self.shell.internal_ns),
210 ('Python builtin', __builtin__.__dict__),
210 ('Python builtin', __builtin__.__dict__),
211 ('Alias', self.shell.alias_table),
211 ('Alias', self.shell.alias_table),
212 ]
212 ]
213 alias_ns = self.shell.alias_table
213 alias_ns = self.shell.alias_table
214
214
215 # initialize results to 'null'
215 # initialize results to 'null'
216 found = 0; obj = None; ospace = None; ds = None;
216 found = 0; obj = None; ospace = None; ds = None;
217 ismagic = 0; isalias = 0; parent = None
217 ismagic = 0; isalias = 0; parent = None
218
218
219 # Look for the given name by splitting it in parts. If the head is
219 # Look for the given name by splitting it in parts. If the head is
220 # found, then we look for all the remaining parts as members, and only
220 # found, then we look for all the remaining parts as members, and only
221 # declare success if we can find them all.
221 # declare success if we can find them all.
222 oname_parts = oname.split('.')
222 oname_parts = oname.split('.')
223 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
223 oname_head, oname_rest = oname_parts[0],oname_parts[1:]
224 for nsname,ns in namespaces:
224 for nsname,ns in namespaces:
225 try:
225 try:
226 obj = ns[oname_head]
226 obj = ns[oname_head]
227 except KeyError:
227 except KeyError:
228 continue
228 continue
229 else:
229 else:
230 #print 'oname_rest:', oname_rest # dbg
230 #print 'oname_rest:', oname_rest # dbg
231 for part in oname_rest:
231 for part in oname_rest:
232 try:
232 try:
233 parent = obj
233 parent = obj
234 obj = getattr(obj,part)
234 obj = getattr(obj,part)
235 except:
235 except:
236 # Blanket except b/c some badly implemented objects
236 # Blanket except b/c some badly implemented objects
237 # allow __getattr__ to raise exceptions other than
237 # allow __getattr__ to raise exceptions other than
238 # AttributeError, which then crashes IPython.
238 # AttributeError, which then crashes IPython.
239 break
239 break
240 else:
240 else:
241 # If we finish the for loop (no break), we got all members
241 # If we finish the for loop (no break), we got all members
242 found = 1
242 found = 1
243 ospace = nsname
243 ospace = nsname
244 if ns == alias_ns:
244 if ns == alias_ns:
245 isalias = 1
245 isalias = 1
246 break # namespace loop
246 break # namespace loop
247
247
248 # Try to see if it's magic
248 # Try to see if it's magic
249 if not found:
249 if not found:
250 if oname.startswith(self.shell.ESC_MAGIC):
250 if oname.startswith(self.shell.ESC_MAGIC):
251 oname = oname[1:]
251 oname = oname[1:]
252 obj = getattr(self,'magic_'+oname,None)
252 obj = getattr(self,'magic_'+oname,None)
253 if obj is not None:
253 if obj is not None:
254 found = 1
254 found = 1
255 ospace = 'IPython internal'
255 ospace = 'IPython internal'
256 ismagic = 1
256 ismagic = 1
257
257
258 # Last try: special-case some literals like '', [], {}, etc:
258 # Last try: special-case some literals like '', [], {}, etc:
259 if not found and oname_head in ["''",'""','[]','{}','()']:
259 if not found and oname_head in ["''",'""','[]','{}','()']:
260 obj = eval(oname_head)
260 obj = eval(oname_head)
261 found = 1
261 found = 1
262 ospace = 'Interactive'
262 ospace = 'Interactive'
263
263
264 return {'found':found, 'obj':obj, 'namespace':ospace,
264 return {'found':found, 'obj':obj, 'namespace':ospace,
265 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
265 'ismagic':ismagic, 'isalias':isalias, 'parent':parent}
266
266
267 def arg_err(self,func):
267 def arg_err(self,func):
268 """Print docstring if incorrect arguments were passed"""
268 """Print docstring if incorrect arguments were passed"""
269 print 'Error in arguments:'
269 print 'Error in arguments:'
270 print OInspect.getdoc(func)
270 print OInspect.getdoc(func)
271
271
272 def format_latex(self,strng):
272 def format_latex(self,strng):
273 """Format a string for latex inclusion."""
273 """Format a string for latex inclusion."""
274
274
275 # Characters that need to be escaped for latex:
275 # Characters that need to be escaped for latex:
276 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
276 escape_re = re.compile(r'(%|_|\$|#|&)',re.MULTILINE)
277 # Magic command names as headers:
277 # Magic command names as headers:
278 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
278 cmd_name_re = re.compile(r'^(%s.*?):' % self.shell.ESC_MAGIC,
279 re.MULTILINE)
279 re.MULTILINE)
280 # Magic commands
280 # Magic commands
281 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
281 cmd_re = re.compile(r'(?P<cmd>%s.+?\b)(?!\}\}:)' % self.shell.ESC_MAGIC,
282 re.MULTILINE)
282 re.MULTILINE)
283 # Paragraph continue
283 # Paragraph continue
284 par_re = re.compile(r'\\$',re.MULTILINE)
284 par_re = re.compile(r'\\$',re.MULTILINE)
285
285
286 # The "\n" symbol
286 # The "\n" symbol
287 newline_re = re.compile(r'\\n')
287 newline_re = re.compile(r'\\n')
288
288
289 # Now build the string for output:
289 # Now build the string for output:
290 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
290 #strng = cmd_name_re.sub(r'\n\\texttt{\\textsl{\\large \1}}:',strng)
291 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
291 strng = cmd_name_re.sub(r'\n\\bigskip\n\\texttt{\\textbf{ \1}}:',
292 strng)
292 strng)
293 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
293 strng = cmd_re.sub(r'\\texttt{\g<cmd>}',strng)
294 strng = par_re.sub(r'\\\\',strng)
294 strng = par_re.sub(r'\\\\',strng)
295 strng = escape_re.sub(r'\\\1',strng)
295 strng = escape_re.sub(r'\\\1',strng)
296 strng = newline_re.sub(r'\\textbackslash{}n',strng)
296 strng = newline_re.sub(r'\\textbackslash{}n',strng)
297 return strng
297 return strng
298
298
299 def format_screen(self,strng):
299 def format_screen(self,strng):
300 """Format a string for screen printing.
300 """Format a string for screen printing.
301
301
302 This removes some latex-type format codes."""
302 This removes some latex-type format codes."""
303 # Paragraph continue
303 # Paragraph continue
304 par_re = re.compile(r'\\$',re.MULTILINE)
304 par_re = re.compile(r'\\$',re.MULTILINE)
305 strng = par_re.sub('',strng)
305 strng = par_re.sub('',strng)
306 return strng
306 return strng
307
307
308 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
308 def parse_options(self,arg_str,opt_str,*long_opts,**kw):
309 """Parse options passed to an argument string.
309 """Parse options passed to an argument string.
310
310
311 The interface is similar to that of getopt(), but it returns back a
311 The interface is similar to that of getopt(), but it returns back a
312 Struct with the options as keys and the stripped argument string still
312 Struct with the options as keys and the stripped argument string still
313 as a string.
313 as a string.
314
314
315 arg_str is quoted as a true sys.argv vector by using shlex.split.
315 arg_str is quoted as a true sys.argv vector by using shlex.split.
316 This allows us to easily expand variables, glob files, quote
316 This allows us to easily expand variables, glob files, quote
317 arguments, etc.
317 arguments, etc.
318
318
319 Options:
319 Options:
320 -mode: default 'string'. If given as 'list', the argument string is
320 -mode: default 'string'. If given as 'list', the argument string is
321 returned as a list (split on whitespace) instead of a string.
321 returned as a list (split on whitespace) instead of a string.
322
322
323 -list_all: put all option values in lists. Normally only options
323 -list_all: put all option values in lists. Normally only options
324 appearing more than once are put in a list.
324 appearing more than once are put in a list.
325
325
326 -posix (True): whether to split the input line in POSIX mode or not,
326 -posix (True): whether to split the input line in POSIX mode or not,
327 as per the conventions outlined in the shlex module from the
327 as per the conventions outlined in the shlex module from the
328 standard library."""
328 standard library."""
329
329
330 # inject default options at the beginning of the input line
330 # inject default options at the beginning of the input line
331 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
331 caller = sys._getframe(1).f_code.co_name.replace('magic_','')
332 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
332 arg_str = '%s %s' % (self.options_table.get(caller,''),arg_str)
333
333
334 mode = kw.get('mode','string')
334 mode = kw.get('mode','string')
335 if mode not in ['string','list']:
335 if mode not in ['string','list']:
336 raise ValueError,'incorrect mode given: %s' % mode
336 raise ValueError,'incorrect mode given: %s' % mode
337 # Get options
337 # Get options
338 list_all = kw.get('list_all',0)
338 list_all = kw.get('list_all',0)
339 posix = kw.get('posix',True)
339 posix = kw.get('posix',True)
340
340
341 # Check if we have more than one argument to warrant extra processing:
341 # Check if we have more than one argument to warrant extra processing:
342 odict = {} # Dictionary with options
342 odict = {} # Dictionary with options
343 args = arg_str.split()
343 args = arg_str.split()
344 if len(args) >= 1:
344 if len(args) >= 1:
345 # If the list of inputs only has 0 or 1 thing in it, there's no
345 # If the list of inputs only has 0 or 1 thing in it, there's no
346 # need to look for options
346 # need to look for options
347 argv = arg_split(arg_str,posix)
347 argv = arg_split(arg_str,posix)
348 # Do regular option processing
348 # Do regular option processing
349 try:
349 try:
350 opts,args = getopt(argv,opt_str,*long_opts)
350 opts,args = getopt(argv,opt_str,*long_opts)
351 except GetoptError,e:
351 except GetoptError,e:
352 raise GetoptError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
352 raise GetoptError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
353 " ".join(long_opts)))
353 " ".join(long_opts)))
354 for o,a in opts:
354 for o,a in opts:
355 if o.startswith('--'):
355 if o.startswith('--'):
356 o = o[2:]
356 o = o[2:]
357 else:
357 else:
358 o = o[1:]
358 o = o[1:]
359 try:
359 try:
360 odict[o].append(a)
360 odict[o].append(a)
361 except AttributeError:
361 except AttributeError:
362 odict[o] = [odict[o],a]
362 odict[o] = [odict[o],a]
363 except KeyError:
363 except KeyError:
364 if list_all:
364 if list_all:
365 odict[o] = [a]
365 odict[o] = [a]
366 else:
366 else:
367 odict[o] = a
367 odict[o] = a
368
368
369 # Prepare opts,args for return
369 # Prepare opts,args for return
370 opts = Struct(odict)
370 opts = Struct(odict)
371 if mode == 'string':
371 if mode == 'string':
372 args = ' '.join(args)
372 args = ' '.join(args)
373
373
374 return opts,args
374 return opts,args
375
375
376 #......................................................................
376 #......................................................................
377 # And now the actual magic functions
377 # And now the actual magic functions
378
378
379 # Functions for IPython shell work (vars,funcs, config, etc)
379 # Functions for IPython shell work (vars,funcs, config, etc)
380 def magic_lsmagic(self, parameter_s = ''):
380 def magic_lsmagic(self, parameter_s = ''):
381 """List currently available magic functions."""
381 """List currently available magic functions."""
382 mesc = self.shell.ESC_MAGIC
382 mesc = self.shell.ESC_MAGIC
383 print 'Available magic functions:\n'+mesc+\
383 print 'Available magic functions:\n'+mesc+\
384 (' '+mesc).join(self.lsmagic())
384 (' '+mesc).join(self.lsmagic())
385 print '\n' + Magic.auto_status[self.shell.rc.automagic]
385 print '\n' + Magic.auto_status[self.shell.rc.automagic]
386 return None
386 return None
387
387
388 def magic_magic(self, parameter_s = ''):
388 def magic_magic(self, parameter_s = ''):
389 """Print information about the magic function system."""
389 """Print information about the magic function system."""
390
390
391 mode = ''
391 mode = ''
392 try:
392 try:
393 if parameter_s.split()[0] == '-latex':
393 if parameter_s.split()[0] == '-latex':
394 mode = 'latex'
394 mode = 'latex'
395 if parameter_s.split()[0] == '-brief':
395 if parameter_s.split()[0] == '-brief':
396 mode = 'brief'
396 mode = 'brief'
397 except:
397 except:
398 pass
398 pass
399
399
400 magic_docs = []
400 magic_docs = []
401 for fname in self.lsmagic():
401 for fname in self.lsmagic():
402 mname = 'magic_' + fname
402 mname = 'magic_' + fname
403 for space in (Magic,self,self.__class__):
403 for space in (Magic,self,self.__class__):
404 try:
404 try:
405 fn = space.__dict__[mname]
405 fn = space.__dict__[mname]
406 except KeyError:
406 except KeyError:
407 pass
407 pass
408 else:
408 else:
409 break
409 break
410 if mode == 'brief':
410 if mode == 'brief':
411 # only first line
411 # only first line
412 fndoc = fn.__doc__.split('\n',1)[0]
412 fndoc = fn.__doc__.split('\n',1)[0]
413 else:
413 else:
414 fndoc = fn.__doc__
414 fndoc = fn.__doc__
415
415
416 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
416 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
417 fname,fndoc))
417 fname,fndoc))
418 magic_docs = ''.join(magic_docs)
418 magic_docs = ''.join(magic_docs)
419
419
420 if mode == 'latex':
420 if mode == 'latex':
421 print self.format_latex(magic_docs)
421 print self.format_latex(magic_docs)
422 return
422 return
423 else:
423 else:
424 magic_docs = self.format_screen(magic_docs)
424 magic_docs = self.format_screen(magic_docs)
425 if mode == 'brief':
425 if mode == 'brief':
426 return magic_docs
426 return magic_docs
427
427
428 outmsg = """
428 outmsg = """
429 IPython's 'magic' functions
429 IPython's 'magic' functions
430 ===========================
430 ===========================
431
431
432 The magic function system provides a series of functions which allow you to
432 The magic function system provides a series of functions which allow you to
433 control the behavior of IPython itself, plus a lot of system-type
433 control the behavior of IPython itself, plus a lot of system-type
434 features. All these functions are prefixed with a % character, but parameters
434 features. All these functions are prefixed with a % character, but parameters
435 are given without parentheses or quotes.
435 are given without parentheses or quotes.
436
436
437 NOTE: If you have 'automagic' enabled (via the command line option or with the
437 NOTE: If you have 'automagic' enabled (via the command line option or with the
438 %automagic function), you don't need to type in the % explicitly. By default,
438 %automagic function), you don't need to type in the % explicitly. By default,
439 IPython ships with automagic on, so you should only rarely need the % escape.
439 IPython ships with automagic on, so you should only rarely need the % escape.
440
440
441 Example: typing '%cd mydir' (without the quotes) changes you working directory
441 Example: typing '%cd mydir' (without the quotes) changes you working directory
442 to 'mydir', if it exists.
442 to 'mydir', if it exists.
443
443
444 You can define your own magic functions to extend the system. See the supplied
444 You can define your own magic functions to extend the system. See the supplied
445 ipythonrc and example-magic.py files for details (in your ipython
445 ipythonrc and example-magic.py files for details (in your ipython
446 configuration directory, typically $HOME/.ipython/).
446 configuration directory, typically $HOME/.ipython/).
447
447
448 You can also define your own aliased names for magic functions. In your
448 You can also define your own aliased names for magic functions. In your
449 ipythonrc file, placing a line like:
449 ipythonrc file, placing a line like:
450
450
451 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
451 execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
452
452
453 will define %pf as a new name for %profile.
453 will define %pf as a new name for %profile.
454
454
455 You can also call magics in code using the ipmagic() function, which IPython
455 You can also call magics in code using the ipmagic() function, which IPython
456 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
456 automatically adds to the builtin namespace. Type 'ipmagic?' for details.
457
457
458 For a list of the available magic functions, use %lsmagic. For a description
458 For a list of the available magic functions, use %lsmagic. For a description
459 of any of them, type %magic_name?, e.g. '%cd?'.
459 of any of them, type %magic_name?, e.g. '%cd?'.
460
460
461 Currently the magic system has the following functions:\n"""
461 Currently the magic system has the following functions:\n"""
462
462
463 mesc = self.shell.ESC_MAGIC
463 mesc = self.shell.ESC_MAGIC
464 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
464 outmsg = ("%s\n%s\n\nSummary of magic functions (from %slsmagic):"
465 "\n\n%s%s\n\n%s" % (outmsg,
465 "\n\n%s%s\n\n%s" % (outmsg,
466 magic_docs,mesc,mesc,
466 magic_docs,mesc,mesc,
467 (' '+mesc).join(self.lsmagic()),
467 (' '+mesc).join(self.lsmagic()),
468 Magic.auto_status[self.shell.rc.automagic] ) )
468 Magic.auto_status[self.shell.rc.automagic] ) )
469
469
470 page(outmsg,screen_lines=self.shell.rc.screen_length)
470 page(outmsg,screen_lines=self.shell.rc.screen_length)
471
471
472
472
473 def magic_autoindent(self, parameter_s = ''):
473 def magic_autoindent(self, parameter_s = ''):
474 """Toggle autoindent on/off (if available)."""
474 """Toggle autoindent on/off (if available)."""
475
475
476 self.shell.set_autoindent()
476 self.shell.set_autoindent()
477 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
477 print "Automatic indentation is:",['OFF','ON'][self.shell.autoindent]
478
478
479 def magic_system_verbose(self, parameter_s = ''):
479 def magic_system_verbose(self, parameter_s = ''):
480 """Set verbose printing of system calls.
480 """Set verbose printing of system calls.
481
481
482 If called without an argument, act as a toggle"""
482 If called without an argument, act as a toggle"""
483
483
484 if parameter_s:
484 if parameter_s:
485 val = bool(eval(parameter_s))
485 val = bool(eval(parameter_s))
486 else:
486 else:
487 val = None
487 val = None
488
488
489 self.shell.rc_set_toggle('system_verbose',val)
489 self.shell.rc_set_toggle('system_verbose',val)
490 print "System verbose printing is:",\
490 print "System verbose printing is:",\
491 ['OFF','ON'][self.shell.rc.system_verbose]
491 ['OFF','ON'][self.shell.rc.system_verbose]
492
492
493
493
494 def magic_page(self, parameter_s=''):
494 def magic_page(self, parameter_s=''):
495 """Pretty print the object and display it through a pager.
495 """Pretty print the object and display it through a pager.
496
496
497 %page [options] OBJECT
497 %page [options] OBJECT
498
498
499 If no object is given, use _ (last output).
499 If no object is given, use _ (last output).
500
500
501 Options:
501 Options:
502
502
503 -r: page str(object), don't pretty-print it."""
503 -r: page str(object), don't pretty-print it."""
504
504
505 # After a function contributed by Olivier Aubert, slightly modified.
505 # After a function contributed by Olivier Aubert, slightly modified.
506
506
507 # Process options/args
507 # Process options/args
508 opts,args = self.parse_options(parameter_s,'r')
508 opts,args = self.parse_options(parameter_s,'r')
509 raw = 'r' in opts
509 raw = 'r' in opts
510
510
511 oname = args and args or '_'
511 oname = args and args or '_'
512 info = self._ofind(oname)
512 info = self._ofind(oname)
513 if info['found']:
513 if info['found']:
514 txt = (raw and str or pformat)( info['obj'] )
514 txt = (raw and str or pformat)( info['obj'] )
515 page(txt)
515 page(txt)
516 else:
516 else:
517 print 'Object `%s` not found' % oname
517 print 'Object `%s` not found' % oname
518
518
519 def magic_profile(self, parameter_s=''):
519 def magic_profile(self, parameter_s=''):
520 """Print your currently active IPyhton profile."""
520 """Print your currently active IPyhton profile."""
521 if self.shell.rc.profile:
521 if self.shell.rc.profile:
522 printpl('Current IPython profile: $self.shell.rc.profile.')
522 printpl('Current IPython profile: $self.shell.rc.profile.')
523 else:
523 else:
524 print 'No profile active.'
524 print 'No profile active.'
525
525
526 def magic_pinfo(self, parameter_s='', namespaces=None):
526 def magic_pinfo(self, parameter_s='', namespaces=None):
527 """Provide detailed information about an object.
527 """Provide detailed information about an object.
528
528
529 '%pinfo object' is just a synonym for object? or ?object."""
529 '%pinfo object' is just a synonym for object? or ?object."""
530
530
531 #print 'pinfo par: <%s>' % parameter_s # dbg
531 #print 'pinfo par: <%s>' % parameter_s # dbg
532
532
533
533
534 # detail_level: 0 -> obj? , 1 -> obj??
534 # detail_level: 0 -> obj? , 1 -> obj??
535 detail_level = 0
535 detail_level = 0
536 # We need to detect if we got called as 'pinfo pinfo foo', which can
536 # We need to detect if we got called as 'pinfo pinfo foo', which can
537 # happen if the user types 'pinfo foo?' at the cmd line.
537 # happen if the user types 'pinfo foo?' at the cmd line.
538 pinfo,qmark1,oname,qmark2 = \
538 pinfo,qmark1,oname,qmark2 = \
539 re.match('(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
539 re.match('(pinfo )?(\?*)(.*?)(\??$)',parameter_s).groups()
540 if pinfo or qmark1 or qmark2:
540 if pinfo or qmark1 or qmark2:
541 detail_level = 1
541 detail_level = 1
542 if "*" in oname:
542 if "*" in oname:
543 self.magic_psearch(oname)
543 self.magic_psearch(oname)
544 else:
544 else:
545 self._inspect('pinfo', oname, detail_level=detail_level,
545 self._inspect('pinfo', oname, detail_level=detail_level,
546 namespaces=namespaces)
546 namespaces=namespaces)
547
547
548 def _inspect(self,meth,oname,namespaces=None,**kw):
548 def _inspect(self,meth,oname,namespaces=None,**kw):
549 """Generic interface to the inspector system.
549 """Generic interface to the inspector system.
550
550
551 This function is meant to be called by pdef, pdoc & friends."""
551 This function is meant to be called by pdef, pdoc & friends."""
552
552
553 #oname = oname.strip()
553 #oname = oname.strip()
554 #print '1- oname: <%r>' % oname # dbg
554 #print '1- oname: <%r>' % oname # dbg
555 try:
555 try:
556 oname = oname.strip().encode('ascii')
556 oname = oname.strip().encode('ascii')
557 #print '2- oname: <%r>' % oname # dbg
557 #print '2- oname: <%r>' % oname # dbg
558 except UnicodeEncodeError:
558 except UnicodeEncodeError:
559 print 'Python identifiers can only contain ascii characters.'
559 print 'Python identifiers can only contain ascii characters.'
560 return 'not found'
560 return 'not found'
561
561
562 info = Struct(self._ofind(oname, namespaces))
562 info = Struct(self._ofind(oname, namespaces))
563
563
564 if info.found:
564 if info.found:
565 try:
565 try:
566 IPython.generics.inspect_object(info.obj)
566 IPython.generics.inspect_object(info.obj)
567 return
567 return
568 except IPython.ipapi.TryNext:
568 except IPython.ipapi.TryNext:
569 pass
569 pass
570 # Get the docstring of the class property if it exists.
570 # Get the docstring of the class property if it exists.
571 path = oname.split('.')
571 path = oname.split('.')
572 root = '.'.join(path[:-1])
572 root = '.'.join(path[:-1])
573 if info.parent is not None:
573 if info.parent is not None:
574 try:
574 try:
575 target = getattr(info.parent, '__class__')
575 target = getattr(info.parent, '__class__')
576 # The object belongs to a class instance.
576 # The object belongs to a class instance.
577 try:
577 try:
578 target = getattr(target, path[-1])
578 target = getattr(target, path[-1])
579 # The class defines the object.
579 # The class defines the object.
580 if isinstance(target, property):
580 if isinstance(target, property):
581 oname = root + '.__class__.' + path[-1]
581 oname = root + '.__class__.' + path[-1]
582 info = Struct(self._ofind(oname))
582 info = Struct(self._ofind(oname))
583 except AttributeError: pass
583 except AttributeError: pass
584 except AttributeError: pass
584 except AttributeError: pass
585
585
586 pmethod = getattr(self.shell.inspector,meth)
586 pmethod = getattr(self.shell.inspector,meth)
587 formatter = info.ismagic and self.format_screen or None
587 formatter = info.ismagic and self.format_screen or None
588 if meth == 'pdoc':
588 if meth == 'pdoc':
589 pmethod(info.obj,oname,formatter)
589 pmethod(info.obj,oname,formatter)
590 elif meth == 'pinfo':
590 elif meth == 'pinfo':
591 pmethod(info.obj,oname,formatter,info,**kw)
591 pmethod(info.obj,oname,formatter,info,**kw)
592 else:
592 else:
593 pmethod(info.obj,oname)
593 pmethod(info.obj,oname)
594 else:
594 else:
595 print 'Object `%s` not found.' % oname
595 print 'Object `%s` not found.' % oname
596 return 'not found' # so callers can take other action
596 return 'not found' # so callers can take other action
597
597
598 def magic_psearch(self, parameter_s=''):
598 def magic_psearch(self, parameter_s=''):
599 """Search for object in namespaces by wildcard.
599 """Search for object in namespaces by wildcard.
600
600
601 %psearch [options] PATTERN [OBJECT TYPE]
601 %psearch [options] PATTERN [OBJECT TYPE]
602
602
603 Note: ? can be used as a synonym for %psearch, at the beginning or at
603 Note: ? can be used as a synonym for %psearch, at the beginning or at
604 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
604 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
605 rest of the command line must be unchanged (options come first), so
605 rest of the command line must be unchanged (options come first), so
606 for example the following forms are equivalent
606 for example the following forms are equivalent
607
607
608 %psearch -i a* function
608 %psearch -i a* function
609 -i a* function?
609 -i a* function?
610 ?-i a* function
610 ?-i a* function
611
611
612 Arguments:
612 Arguments:
613
613
614 PATTERN
614 PATTERN
615
615
616 where PATTERN is a string containing * as a wildcard similar to its
616 where PATTERN is a string containing * as a wildcard similar to its
617 use in a shell. The pattern is matched in all namespaces on the
617 use in a shell. The pattern is matched in all namespaces on the
618 search path. By default objects starting with a single _ are not
618 search path. By default objects starting with a single _ are not
619 matched, many IPython generated objects have a single
619 matched, many IPython generated objects have a single
620 underscore. The default is case insensitive matching. Matching is
620 underscore. The default is case insensitive matching. Matching is
621 also done on the attributes of objects and not only on the objects
621 also done on the attributes of objects and not only on the objects
622 in a module.
622 in a module.
623
623
624 [OBJECT TYPE]
624 [OBJECT TYPE]
625
625
626 Is the name of a python type from the types module. The name is
626 Is the name of a python type from the types module. The name is
627 given in lowercase without the ending type, ex. StringType is
627 given in lowercase without the ending type, ex. StringType is
628 written string. By adding a type here only objects matching the
628 written string. By adding a type here only objects matching the
629 given type are matched. Using all here makes the pattern match all
629 given type are matched. Using all here makes the pattern match all
630 types (this is the default).
630 types (this is the default).
631
631
632 Options:
632 Options:
633
633
634 -a: makes the pattern match even objects whose names start with a
634 -a: makes the pattern match even objects whose names start with a
635 single underscore. These names are normally ommitted from the
635 single underscore. These names are normally ommitted from the
636 search.
636 search.
637
637
638 -i/-c: make the pattern case insensitive/sensitive. If neither of
638 -i/-c: make the pattern case insensitive/sensitive. If neither of
639 these options is given, the default is read from your ipythonrc
639 these options is given, the default is read from your ipythonrc
640 file. The option name which sets this value is
640 file. The option name which sets this value is
641 'wildcards_case_sensitive'. If this option is not specified in your
641 'wildcards_case_sensitive'. If this option is not specified in your
642 ipythonrc file, IPython's internal default is to do a case sensitive
642 ipythonrc file, IPython's internal default is to do a case sensitive
643 search.
643 search.
644
644
645 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
645 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
646 specifiy can be searched in any of the following namespaces:
646 specifiy can be searched in any of the following namespaces:
647 'builtin', 'user', 'user_global','internal', 'alias', where
647 'builtin', 'user', 'user_global','internal', 'alias', where
648 'builtin' and 'user' are the search defaults. Note that you should
648 'builtin' and 'user' are the search defaults. Note that you should
649 not use quotes when specifying namespaces.
649 not use quotes when specifying namespaces.
650
650
651 'Builtin' contains the python module builtin, 'user' contains all
651 'Builtin' contains the python module builtin, 'user' contains all
652 user data, 'alias' only contain the shell aliases and no python
652 user data, 'alias' only contain the shell aliases and no python
653 objects, 'internal' contains objects used by IPython. The
653 objects, 'internal' contains objects used by IPython. The
654 'user_global' namespace is only used by embedded IPython instances,
654 'user_global' namespace is only used by embedded IPython instances,
655 and it contains module-level globals. You can add namespaces to the
655 and it contains module-level globals. You can add namespaces to the
656 search with -s or exclude them with -e (these options can be given
656 search with -s or exclude them with -e (these options can be given
657 more than once).
657 more than once).
658
658
659 Examples:
659 Examples:
660
660
661 %psearch a* -> objects beginning with an a
661 %psearch a* -> objects beginning with an a
662 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
662 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
663 %psearch a* function -> all functions beginning with an a
663 %psearch a* function -> all functions beginning with an a
664 %psearch re.e* -> objects beginning with an e in module re
664 %psearch re.e* -> objects beginning with an e in module re
665 %psearch r*.e* -> objects that start with e in modules starting in r
665 %psearch r*.e* -> objects that start with e in modules starting in r
666 %psearch r*.* string -> all strings in modules beginning with r
666 %psearch r*.* string -> all strings in modules beginning with r
667
667
668 Case sensitve search:
668 Case sensitve search:
669
669
670 %psearch -c a* list all object beginning with lower case a
670 %psearch -c a* list all object beginning with lower case a
671
671
672 Show objects beginning with a single _:
672 Show objects beginning with a single _:
673
673
674 %psearch -a _* list objects beginning with a single underscore"""
674 %psearch -a _* list objects beginning with a single underscore"""
675 try:
675 try:
676 parameter_s = parameter_s.encode('ascii')
676 parameter_s = parameter_s.encode('ascii')
677 except UnicodeEncodeError:
677 except UnicodeEncodeError:
678 print 'Python identifiers can only contain ascii characters.'
678 print 'Python identifiers can only contain ascii characters.'
679 return
679 return
680
680
681 # default namespaces to be searched
681 # default namespaces to be searched
682 def_search = ['user','builtin']
682 def_search = ['user','builtin']
683
683
684 # Process options/args
684 # Process options/args
685 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
685 opts,args = self.parse_options(parameter_s,'cias:e:',list_all=True)
686 opt = opts.get
686 opt = opts.get
687 shell = self.shell
687 shell = self.shell
688 psearch = shell.inspector.psearch
688 psearch = shell.inspector.psearch
689
689
690 # select case options
690 # select case options
691 if opts.has_key('i'):
691 if opts.has_key('i'):
692 ignore_case = True
692 ignore_case = True
693 elif opts.has_key('c'):
693 elif opts.has_key('c'):
694 ignore_case = False
694 ignore_case = False
695 else:
695 else:
696 ignore_case = not shell.rc.wildcards_case_sensitive
696 ignore_case = not shell.rc.wildcards_case_sensitive
697
697
698 # Build list of namespaces to search from user options
698 # Build list of namespaces to search from user options
699 def_search.extend(opt('s',[]))
699 def_search.extend(opt('s',[]))
700 ns_exclude = ns_exclude=opt('e',[])
700 ns_exclude = ns_exclude=opt('e',[])
701 ns_search = [nm for nm in def_search if nm not in ns_exclude]
701 ns_search = [nm for nm in def_search if nm not in ns_exclude]
702
702
703 # Call the actual search
703 # Call the actual search
704 try:
704 try:
705 psearch(args,shell.ns_table,ns_search,
705 psearch(args,shell.ns_table,ns_search,
706 show_all=opt('a'),ignore_case=ignore_case)
706 show_all=opt('a'),ignore_case=ignore_case)
707 except:
707 except:
708 shell.showtraceback()
708 shell.showtraceback()
709
709
710 def magic_who_ls(self, parameter_s=''):
710 def magic_who_ls(self, parameter_s=''):
711 """Return a sorted list of all interactive variables.
711 """Return a sorted list of all interactive variables.
712
712
713 If arguments are given, only variables of types matching these
713 If arguments are given, only variables of types matching these
714 arguments are returned."""
714 arguments are returned."""
715
715
716 user_ns = self.shell.user_ns
716 user_ns = self.shell.user_ns
717 internal_ns = self.shell.internal_ns
717 internal_ns = self.shell.internal_ns
718 user_config_ns = self.shell.user_config_ns
718 user_config_ns = self.shell.user_config_ns
719 out = []
719 out = []
720 typelist = parameter_s.split()
720 typelist = parameter_s.split()
721
721
722 for i in user_ns:
722 for i in user_ns:
723 if not (i.startswith('_') or i.startswith('_i')) \
723 if not (i.startswith('_') or i.startswith('_i')) \
724 and not (i in internal_ns or i in user_config_ns):
724 and not (i in internal_ns or i in user_config_ns):
725 if typelist:
725 if typelist:
726 if type(user_ns[i]).__name__ in typelist:
726 if type(user_ns[i]).__name__ in typelist:
727 out.append(i)
727 out.append(i)
728 else:
728 else:
729 out.append(i)
729 out.append(i)
730 out.sort()
730 out.sort()
731 return out
731 return out
732
732
733 def magic_who(self, parameter_s=''):
733 def magic_who(self, parameter_s=''):
734 """Print all interactive variables, with some minimal formatting.
734 """Print all interactive variables, with some minimal formatting.
735
735
736 If any arguments are given, only variables whose type matches one of
736 If any arguments are given, only variables whose type matches one of
737 these are printed. For example:
737 these are printed. For example:
738
738
739 %who function str
739 %who function str
740
740
741 will only list functions and strings, excluding all other types of
741 will only list functions and strings, excluding all other types of
742 variables. To find the proper type names, simply use type(var) at a
742 variables. To find the proper type names, simply use type(var) at a
743 command line to see how python prints type names. For example:
743 command line to see how python prints type names. For example:
744
744
745 In [1]: type('hello')\\
745 In [1]: type('hello')\\
746 Out[1]: <type 'str'>
746 Out[1]: <type 'str'>
747
747
748 indicates that the type name for strings is 'str'.
748 indicates that the type name for strings is 'str'.
749
749
750 %who always excludes executed names loaded through your configuration
750 %who always excludes executed names loaded through your configuration
751 file and things which are internal to IPython.
751 file and things which are internal to IPython.
752
752
753 This is deliberate, as typically you may load many modules and the
753 This is deliberate, as typically you may load many modules and the
754 purpose of %who is to show you only what you've manually defined."""
754 purpose of %who is to show you only what you've manually defined."""
755
755
756 varlist = self.magic_who_ls(parameter_s)
756 varlist = self.magic_who_ls(parameter_s)
757 if not varlist:
757 if not varlist:
758 if parameter_s:
758 if parameter_s:
759 print 'No variables match your requested type.'
759 print 'No variables match your requested type.'
760 else:
760 else:
761 print 'Interactive namespace is empty.'
761 print 'Interactive namespace is empty.'
762 return
762 return
763
763
764 # if we have variables, move on...
764 # if we have variables, move on...
765 count = 0
765 count = 0
766 for i in varlist:
766 for i in varlist:
767 print i+'\t',
767 print i+'\t',
768 count += 1
768 count += 1
769 if count > 8:
769 if count > 8:
770 count = 0
770 count = 0
771 print
771 print
772 print
772 print
773
773
774 def magic_whos(self, parameter_s=''):
774 def magic_whos(self, parameter_s=''):
775 """Like %who, but gives some extra information about each variable.
775 """Like %who, but gives some extra information about each variable.
776
776
777 The same type filtering of %who can be applied here.
777 The same type filtering of %who can be applied here.
778
778
779 For all variables, the type is printed. Additionally it prints:
779 For all variables, the type is printed. Additionally it prints:
780
780
781 - For {},[],(): their length.
781 - For {},[],(): their length.
782
782
783 - For numpy and Numeric arrays, a summary with shape, number of
783 - For numpy and Numeric arrays, a summary with shape, number of
784 elements, typecode and size in memory.
784 elements, typecode and size in memory.
785
785
786 - Everything else: a string representation, snipping their middle if
786 - Everything else: a string representation, snipping their middle if
787 too long."""
787 too long."""
788
788
789 varnames = self.magic_who_ls(parameter_s)
789 varnames = self.magic_who_ls(parameter_s)
790 if not varnames:
790 if not varnames:
791 if parameter_s:
791 if parameter_s:
792 print 'No variables match your requested type.'
792 print 'No variables match your requested type.'
793 else:
793 else:
794 print 'Interactive namespace is empty.'
794 print 'Interactive namespace is empty.'
795 return
795 return
796
796
797 # if we have variables, move on...
797 # if we have variables, move on...
798
798
799 # for these types, show len() instead of data:
799 # for these types, show len() instead of data:
800 seq_types = [types.DictType,types.ListType,types.TupleType]
800 seq_types = [types.DictType,types.ListType,types.TupleType]
801
801
802 # for numpy/Numeric arrays, display summary info
802 # for numpy/Numeric arrays, display summary info
803 try:
803 try:
804 import numpy
804 import numpy
805 except ImportError:
805 except ImportError:
806 ndarray_type = None
806 ndarray_type = None
807 else:
807 else:
808 ndarray_type = numpy.ndarray.__name__
808 ndarray_type = numpy.ndarray.__name__
809 try:
809 try:
810 import Numeric
810 import Numeric
811 except ImportError:
811 except ImportError:
812 array_type = None
812 array_type = None
813 else:
813 else:
814 array_type = Numeric.ArrayType.__name__
814 array_type = Numeric.ArrayType.__name__
815
815
816 # Find all variable names and types so we can figure out column sizes
816 # Find all variable names and types so we can figure out column sizes
817 def get_vars(i):
817 def get_vars(i):
818 return self.shell.user_ns[i]
818 return self.shell.user_ns[i]
819
819
820 # some types are well known and can be shorter
820 # some types are well known and can be shorter
821 abbrevs = {'IPython.macro.Macro' : 'Macro'}
821 abbrevs = {'IPython.macro.Macro' : 'Macro'}
822 def type_name(v):
822 def type_name(v):
823 tn = type(v).__name__
823 tn = type(v).__name__
824 return abbrevs.get(tn,tn)
824 return abbrevs.get(tn,tn)
825
825
826 varlist = map(get_vars,varnames)
826 varlist = map(get_vars,varnames)
827
827
828 typelist = []
828 typelist = []
829 for vv in varlist:
829 for vv in varlist:
830 tt = type_name(vv)
830 tt = type_name(vv)
831
831
832 if tt=='instance':
832 if tt=='instance':
833 typelist.append( abbrevs.get(str(vv.__class__),
833 typelist.append( abbrevs.get(str(vv.__class__),
834 str(vv.__class__)))
834 str(vv.__class__)))
835 else:
835 else:
836 typelist.append(tt)
836 typelist.append(tt)
837
837
838 # column labels and # of spaces as separator
838 # column labels and # of spaces as separator
839 varlabel = 'Variable'
839 varlabel = 'Variable'
840 typelabel = 'Type'
840 typelabel = 'Type'
841 datalabel = 'Data/Info'
841 datalabel = 'Data/Info'
842 colsep = 3
842 colsep = 3
843 # variable format strings
843 # variable format strings
844 vformat = "$vname.ljust(varwidth)$vtype.ljust(typewidth)"
844 vformat = "$vname.ljust(varwidth)$vtype.ljust(typewidth)"
845 vfmt_short = '$vstr[:25]<...>$vstr[-25:]'
845 vfmt_short = '$vstr[:25]<...>$vstr[-25:]'
846 aformat = "%s: %s elems, type `%s`, %s bytes"
846 aformat = "%s: %s elems, type `%s`, %s bytes"
847 # find the size of the columns to format the output nicely
847 # find the size of the columns to format the output nicely
848 varwidth = max(max(map(len,varnames)), len(varlabel)) + colsep
848 varwidth = max(max(map(len,varnames)), len(varlabel)) + colsep
849 typewidth = max(max(map(len,typelist)), len(typelabel)) + colsep
849 typewidth = max(max(map(len,typelist)), len(typelabel)) + colsep
850 # table header
850 # table header
851 print varlabel.ljust(varwidth) + typelabel.ljust(typewidth) + \
851 print varlabel.ljust(varwidth) + typelabel.ljust(typewidth) + \
852 ' '+datalabel+'\n' + '-'*(varwidth+typewidth+len(datalabel)+1)
852 ' '+datalabel+'\n' + '-'*(varwidth+typewidth+len(datalabel)+1)
853 # and the table itself
853 # and the table itself
854 kb = 1024
854 kb = 1024
855 Mb = 1048576 # kb**2
855 Mb = 1048576 # kb**2
856 for vname,var,vtype in zip(varnames,varlist,typelist):
856 for vname,var,vtype in zip(varnames,varlist,typelist):
857 print itpl(vformat),
857 print itpl(vformat),
858 if vtype in seq_types:
858 if vtype in seq_types:
859 print len(var)
859 print len(var)
860 elif vtype in [array_type,ndarray_type]:
860 elif vtype in [array_type,ndarray_type]:
861 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
861 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
862 if vtype==ndarray_type:
862 if vtype==ndarray_type:
863 # numpy
863 # numpy
864 vsize = var.size
864 vsize = var.size
865 vbytes = vsize*var.itemsize
865 vbytes = vsize*var.itemsize
866 vdtype = var.dtype
866 vdtype = var.dtype
867 else:
867 else:
868 # Numeric
868 # Numeric
869 vsize = Numeric.size(var)
869 vsize = Numeric.size(var)
870 vbytes = vsize*var.itemsize()
870 vbytes = vsize*var.itemsize()
871 vdtype = var.typecode()
871 vdtype = var.typecode()
872
872
873 if vbytes < 100000:
873 if vbytes < 100000:
874 print aformat % (vshape,vsize,vdtype,vbytes)
874 print aformat % (vshape,vsize,vdtype,vbytes)
875 else:
875 else:
876 print aformat % (vshape,vsize,vdtype,vbytes),
876 print aformat % (vshape,vsize,vdtype,vbytes),
877 if vbytes < Mb:
877 if vbytes < Mb:
878 print '(%s kb)' % (vbytes/kb,)
878 print '(%s kb)' % (vbytes/kb,)
879 else:
879 else:
880 print '(%s Mb)' % (vbytes/Mb,)
880 print '(%s Mb)' % (vbytes/Mb,)
881 else:
881 else:
882 try:
882 try:
883 vstr = str(var)
883 vstr = str(var)
884 except UnicodeEncodeError:
884 except UnicodeEncodeError:
885 vstr = unicode(var).encode(sys.getdefaultencoding(),
885 vstr = unicode(var).encode(sys.getdefaultencoding(),
886 'backslashreplace')
886 'backslashreplace')
887 vstr = vstr.replace('\n','\\n')
887 vstr = vstr.replace('\n','\\n')
888 if len(vstr) < 50:
888 if len(vstr) < 50:
889 print vstr
889 print vstr
890 else:
890 else:
891 printpl(vfmt_short)
891 printpl(vfmt_short)
892
892
893 def magic_reset(self, parameter_s=''):
893 def magic_reset(self, parameter_s=''):
894 """Resets the namespace by removing all names defined by the user.
894 """Resets the namespace by removing all names defined by the user.
895
895
896 Input/Output history are left around in case you need them."""
896 Input/Output history are left around in case you need them."""
897
897
898 ans = self.shell.ask_yes_no(
898 ans = self.shell.ask_yes_no(
899 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
899 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
900 if not ans:
900 if not ans:
901 print 'Nothing done.'
901 print 'Nothing done.'
902 return
902 return
903 user_ns = self.shell.user_ns
903 user_ns = self.shell.user_ns
904 for i in self.magic_who_ls():
904 for i in self.magic_who_ls():
905 del(user_ns[i])
905 del(user_ns[i])
906
906
907 def magic_logstart(self,parameter_s=''):
907 def magic_logstart(self,parameter_s=''):
908 """Start logging anywhere in a session.
908 """Start logging anywhere in a session.
909
909
910 %logstart [-o|-r|-t] [log_name [log_mode]]
910 %logstart [-o|-r|-t] [log_name [log_mode]]
911
911
912 If no name is given, it defaults to a file named 'ipython_log.py' in your
912 If no name is given, it defaults to a file named 'ipython_log.py' in your
913 current directory, in 'rotate' mode (see below).
913 current directory, in 'rotate' mode (see below).
914
914
915 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
915 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
916 history up to that point and then continues logging.
916 history up to that point and then continues logging.
917
917
918 %logstart takes a second optional parameter: logging mode. This can be one
918 %logstart takes a second optional parameter: logging mode. This can be one
919 of (note that the modes are given unquoted):\\
919 of (note that the modes are given unquoted):\\
920 append: well, that says it.\\
920 append: well, that says it.\\
921 backup: rename (if exists) to name~ and start name.\\
921 backup: rename (if exists) to name~ and start name.\\
922 global: single logfile in your home dir, appended to.\\
922 global: single logfile in your home dir, appended to.\\
923 over : overwrite existing log.\\
923 over : overwrite existing log.\\
924 rotate: create rotating logs name.1~, name.2~, etc.
924 rotate: create rotating logs name.1~, name.2~, etc.
925
925
926 Options:
926 Options:
927
927
928 -o: log also IPython's output. In this mode, all commands which
928 -o: log also IPython's output. In this mode, all commands which
929 generate an Out[NN] prompt are recorded to the logfile, right after
929 generate an Out[NN] prompt are recorded to the logfile, right after
930 their corresponding input line. The output lines are always
930 their corresponding input line. The output lines are always
931 prepended with a '#[Out]# ' marker, so that the log remains valid
931 prepended with a '#[Out]# ' marker, so that the log remains valid
932 Python code.
932 Python code.
933
933
934 Since this marker is always the same, filtering only the output from
934 Since this marker is always the same, filtering only the output from
935 a log is very easy, using for example a simple awk call:
935 a log is very easy, using for example a simple awk call:
936
936
937 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
937 awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py
938
938
939 -r: log 'raw' input. Normally, IPython's logs contain the processed
939 -r: log 'raw' input. Normally, IPython's logs contain the processed
940 input, so that user lines are logged in their final form, converted
940 input, so that user lines are logged in their final form, converted
941 into valid Python. For example, %Exit is logged as
941 into valid Python. For example, %Exit is logged as
942 '_ip.magic("Exit"). If the -r flag is given, all input is logged
942 '_ip.magic("Exit"). If the -r flag is given, all input is logged
943 exactly as typed, with no transformations applied.
943 exactly as typed, with no transformations applied.
944
944
945 -t: put timestamps before each input line logged (these are put in
945 -t: put timestamps before each input line logged (these are put in
946 comments)."""
946 comments)."""
947
947
948 opts,par = self.parse_options(parameter_s,'ort')
948 opts,par = self.parse_options(parameter_s,'ort')
949 log_output = 'o' in opts
949 log_output = 'o' in opts
950 log_raw_input = 'r' in opts
950 log_raw_input = 'r' in opts
951 timestamp = 't' in opts
951 timestamp = 't' in opts
952
952
953 rc = self.shell.rc
953 rc = self.shell.rc
954 logger = self.shell.logger
954 logger = self.shell.logger
955
955
956 # if no args are given, the defaults set in the logger constructor by
956 # if no args are given, the defaults set in the logger constructor by
957 # ipytohn remain valid
957 # ipytohn remain valid
958 if par:
958 if par:
959 try:
959 try:
960 logfname,logmode = par.split()
960 logfname,logmode = par.split()
961 except:
961 except:
962 logfname = par
962 logfname = par
963 logmode = 'backup'
963 logmode = 'backup'
964 else:
964 else:
965 logfname = logger.logfname
965 logfname = logger.logfname
966 logmode = logger.logmode
966 logmode = logger.logmode
967 # put logfname into rc struct as if it had been called on the command
967 # put logfname into rc struct as if it had been called on the command
968 # line, so it ends up saved in the log header Save it in case we need
968 # line, so it ends up saved in the log header Save it in case we need
969 # to restore it...
969 # to restore it...
970 old_logfile = rc.opts.get('logfile','')
970 old_logfile = rc.opts.get('logfile','')
971 if logfname:
971 if logfname:
972 logfname = os.path.expanduser(logfname)
972 logfname = os.path.expanduser(logfname)
973 rc.opts.logfile = logfname
973 rc.opts.logfile = logfname
974 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
974 loghead = self.shell.loghead_tpl % (rc.opts,rc.args)
975 try:
975 try:
976 started = logger.logstart(logfname,loghead,logmode,
976 started = logger.logstart(logfname,loghead,logmode,
977 log_output,timestamp,log_raw_input)
977 log_output,timestamp,log_raw_input)
978 except:
978 except:
979 rc.opts.logfile = old_logfile
979 rc.opts.logfile = old_logfile
980 warn("Couldn't start log: %s" % sys.exc_info()[1])
980 warn("Couldn't start log: %s" % sys.exc_info()[1])
981 else:
981 else:
982 # log input history up to this point, optionally interleaving
982 # log input history up to this point, optionally interleaving
983 # output if requested
983 # output if requested
984
984
985 if timestamp:
985 if timestamp:
986 # disable timestamping for the previous history, since we've
986 # disable timestamping for the previous history, since we've
987 # lost those already (no time machine here).
987 # lost those already (no time machine here).
988 logger.timestamp = False
988 logger.timestamp = False
989
989
990 if log_raw_input:
990 if log_raw_input:
991 input_hist = self.shell.input_hist_raw
991 input_hist = self.shell.input_hist_raw
992 else:
992 else:
993 input_hist = self.shell.input_hist
993 input_hist = self.shell.input_hist
994
994
995 if log_output:
995 if log_output:
996 log_write = logger.log_write
996 log_write = logger.log_write
997 output_hist = self.shell.output_hist
997 output_hist = self.shell.output_hist
998 for n in range(1,len(input_hist)-1):
998 for n in range(1,len(input_hist)-1):
999 log_write(input_hist[n].rstrip())
999 log_write(input_hist[n].rstrip())
1000 if n in output_hist:
1000 if n in output_hist:
1001 log_write(repr(output_hist[n]),'output')
1001 log_write(repr(output_hist[n]),'output')
1002 else:
1002 else:
1003 logger.log_write(input_hist[1:])
1003 logger.log_write(input_hist[1:])
1004 if timestamp:
1004 if timestamp:
1005 # re-enable timestamping
1005 # re-enable timestamping
1006 logger.timestamp = True
1006 logger.timestamp = True
1007
1007
1008 print ('Activating auto-logging. '
1008 print ('Activating auto-logging. '
1009 'Current session state plus future input saved.')
1009 'Current session state plus future input saved.')
1010 logger.logstate()
1010 logger.logstate()
1011
1011
1012 def magic_logoff(self,parameter_s=''):
1012 def magic_logoff(self,parameter_s=''):
1013 """Temporarily stop logging.
1013 """Temporarily stop logging.
1014
1014
1015 You must have previously started logging."""
1015 You must have previously started logging."""
1016 self.shell.logger.switch_log(0)
1016 self.shell.logger.switch_log(0)
1017
1017
1018 def magic_logon(self,parameter_s=''):
1018 def magic_logon(self,parameter_s=''):
1019 """Restart logging.
1019 """Restart logging.
1020
1020
1021 This function is for restarting logging which you've temporarily
1021 This function is for restarting logging which you've temporarily
1022 stopped with %logoff. For starting logging for the first time, you
1022 stopped with %logoff. For starting logging for the first time, you
1023 must use the %logstart function, which allows you to specify an
1023 must use the %logstart function, which allows you to specify an
1024 optional log filename."""
1024 optional log filename."""
1025
1025
1026 self.shell.logger.switch_log(1)
1026 self.shell.logger.switch_log(1)
1027
1027
1028 def magic_logstate(self,parameter_s=''):
1028 def magic_logstate(self,parameter_s=''):
1029 """Print the status of the logging system."""
1029 """Print the status of the logging system."""
1030
1030
1031 self.shell.logger.logstate()
1031 self.shell.logger.logstate()
1032
1032
1033 def magic_pdb(self, parameter_s=''):
1033 def magic_pdb(self, parameter_s=''):
1034 """Control the automatic calling of the pdb interactive debugger.
1034 """Control the automatic calling of the pdb interactive debugger.
1035
1035
1036 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1036 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
1037 argument it works as a toggle.
1037 argument it works as a toggle.
1038
1038
1039 When an exception is triggered, IPython can optionally call the
1039 When an exception is triggered, IPython can optionally call the
1040 interactive pdb debugger after the traceback printout. %pdb toggles
1040 interactive pdb debugger after the traceback printout. %pdb toggles
1041 this feature on and off.
1041 this feature on and off.
1042
1042
1043 The initial state of this feature is set in your ipythonrc
1043 The initial state of this feature is set in your ipythonrc
1044 configuration file (the variable is called 'pdb').
1044 configuration file (the variable is called 'pdb').
1045
1045
1046 If you want to just activate the debugger AFTER an exception has fired,
1046 If you want to just activate the debugger AFTER an exception has fired,
1047 without having to type '%pdb on' and rerunning your code, you can use
1047 without having to type '%pdb on' and rerunning your code, you can use
1048 the %debug magic."""
1048 the %debug magic."""
1049
1049
1050 par = parameter_s.strip().lower()
1050 par = parameter_s.strip().lower()
1051
1051
1052 if par:
1052 if par:
1053 try:
1053 try:
1054 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1054 new_pdb = {'off':0,'0':0,'on':1,'1':1}[par]
1055 except KeyError:
1055 except KeyError:
1056 print ('Incorrect argument. Use on/1, off/0, '
1056 print ('Incorrect argument. Use on/1, off/0, '
1057 'or nothing for a toggle.')
1057 'or nothing for a toggle.')
1058 return
1058 return
1059 else:
1059 else:
1060 # toggle
1060 # toggle
1061 new_pdb = not self.shell.call_pdb
1061 new_pdb = not self.shell.call_pdb
1062
1062
1063 # set on the shell
1063 # set on the shell
1064 self.shell.call_pdb = new_pdb
1064 self.shell.call_pdb = new_pdb
1065 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1065 print 'Automatic pdb calling has been turned',on_off(new_pdb)
1066
1066
1067 def magic_debug(self, parameter_s=''):
1067 def magic_debug(self, parameter_s=''):
1068 """Activate the interactive debugger in post-mortem mode.
1068 """Activate the interactive debugger in post-mortem mode.
1069
1069
1070 If an exception has just occurred, this lets you inspect its stack
1070 If an exception has just occurred, this lets you inspect its stack
1071 frames interactively. Note that this will always work only on the last
1071 frames interactively. Note that this will always work only on the last
1072 traceback that occurred, so you must call this quickly after an
1072 traceback that occurred, so you must call this quickly after an
1073 exception that you wish to inspect has fired, because if another one
1073 exception that you wish to inspect has fired, because if another one
1074 occurs, it clobbers the previous one.
1074 occurs, it clobbers the previous one.
1075
1075
1076 If you want IPython to automatically do this on every exception, see
1076 If you want IPython to automatically do this on every exception, see
1077 the %pdb magic for more details.
1077 the %pdb magic for more details.
1078 """
1078 """
1079
1079
1080 self.shell.debugger(force=True)
1080 self.shell.debugger(force=True)
1081
1081
1082 def magic_prun(self, parameter_s ='',user_mode=1,
1082 def magic_prun(self, parameter_s ='',user_mode=1,
1083 opts=None,arg_lst=None,prog_ns=None):
1083 opts=None,arg_lst=None,prog_ns=None):
1084
1084
1085 """Run a statement through the python code profiler.
1085 """Run a statement through the python code profiler.
1086
1086
1087 Usage:\\
1087 Usage:\\
1088 %prun [options] statement
1088 %prun [options] statement
1089
1089
1090 The given statement (which doesn't require quote marks) is run via the
1090 The given statement (which doesn't require quote marks) is run via the
1091 python profiler in a manner similar to the profile.run() function.
1091 python profiler in a manner similar to the profile.run() function.
1092 Namespaces are internally managed to work correctly; profile.run
1092 Namespaces are internally managed to work correctly; profile.run
1093 cannot be used in IPython because it makes certain assumptions about
1093 cannot be used in IPython because it makes certain assumptions about
1094 namespaces which do not hold under IPython.
1094 namespaces which do not hold under IPython.
1095
1095
1096 Options:
1096 Options:
1097
1097
1098 -l <limit>: you can place restrictions on what or how much of the
1098 -l <limit>: you can place restrictions on what or how much of the
1099 profile gets printed. The limit value can be:
1099 profile gets printed. The limit value can be:
1100
1100
1101 * A string: only information for function names containing this string
1101 * A string: only information for function names containing this string
1102 is printed.
1102 is printed.
1103
1103
1104 * An integer: only these many lines are printed.
1104 * An integer: only these many lines are printed.
1105
1105
1106 * A float (between 0 and 1): this fraction of the report is printed
1106 * A float (between 0 and 1): this fraction of the report is printed
1107 (for example, use a limit of 0.4 to see the topmost 40% only).
1107 (for example, use a limit of 0.4 to see the topmost 40% only).
1108
1108
1109 You can combine several limits with repeated use of the option. For
1109 You can combine several limits with repeated use of the option. For
1110 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1110 example, '-l __init__ -l 5' will print only the topmost 5 lines of
1111 information about class constructors.
1111 information about class constructors.
1112
1112
1113 -r: return the pstats.Stats object generated by the profiling. This
1113 -r: return the pstats.Stats object generated by the profiling. This
1114 object has all the information about the profile in it, and you can
1114 object has all the information about the profile in it, and you can
1115 later use it for further analysis or in other functions.
1115 later use it for further analysis or in other functions.
1116
1116
1117 -s <key>: sort profile by given key. You can provide more than one key
1117 -s <key>: sort profile by given key. You can provide more than one key
1118 by using the option several times: '-s key1 -s key2 -s key3...'. The
1118 by using the option several times: '-s key1 -s key2 -s key3...'. The
1119 default sorting key is 'time'.
1119 default sorting key is 'time'.
1120
1120
1121 The following is copied verbatim from the profile documentation
1121 The following is copied verbatim from the profile documentation
1122 referenced below:
1122 referenced below:
1123
1123
1124 When more than one key is provided, additional keys are used as
1124 When more than one key is provided, additional keys are used as
1125 secondary criteria when the there is equality in all keys selected
1125 secondary criteria when the there is equality in all keys selected
1126 before them.
1126 before them.
1127
1127
1128 Abbreviations can be used for any key names, as long as the
1128 Abbreviations can be used for any key names, as long as the
1129 abbreviation is unambiguous. The following are the keys currently
1129 abbreviation is unambiguous. The following are the keys currently
1130 defined:
1130 defined:
1131
1131
1132 Valid Arg Meaning\\
1132 Valid Arg Meaning\\
1133 "calls" call count\\
1133 "calls" call count\\
1134 "cumulative" cumulative time\\
1134 "cumulative" cumulative time\\
1135 "file" file name\\
1135 "file" file name\\
1136 "module" file name\\
1136 "module" file name\\
1137 "pcalls" primitive call count\\
1137 "pcalls" primitive call count\\
1138 "line" line number\\
1138 "line" line number\\
1139 "name" function name\\
1139 "name" function name\\
1140 "nfl" name/file/line\\
1140 "nfl" name/file/line\\
1141 "stdname" standard name\\
1141 "stdname" standard name\\
1142 "time" internal time
1142 "time" internal time
1143
1143
1144 Note that all sorts on statistics are in descending order (placing
1144 Note that all sorts on statistics are in descending order (placing
1145 most time consuming items first), where as name, file, and line number
1145 most time consuming items first), where as name, file, and line number
1146 searches are in ascending order (i.e., alphabetical). The subtle
1146 searches are in ascending order (i.e., alphabetical). The subtle
1147 distinction between "nfl" and "stdname" is that the standard name is a
1147 distinction between "nfl" and "stdname" is that the standard name is a
1148 sort of the name as printed, which means that the embedded line
1148 sort of the name as printed, which means that the embedded line
1149 numbers get compared in an odd way. For example, lines 3, 20, and 40
1149 numbers get compared in an odd way. For example, lines 3, 20, and 40
1150 would (if the file names were the same) appear in the string order
1150 would (if the file names were the same) appear in the string order
1151 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1151 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
1152 line numbers. In fact, sort_stats("nfl") is the same as
1152 line numbers. In fact, sort_stats("nfl") is the same as
1153 sort_stats("name", "file", "line").
1153 sort_stats("name", "file", "line").
1154
1154
1155 -T <filename>: save profile results as shown on screen to a text
1155 -T <filename>: save profile results as shown on screen to a text
1156 file. The profile is still shown on screen.
1156 file. The profile is still shown on screen.
1157
1157
1158 -D <filename>: save (via dump_stats) profile statistics to given
1158 -D <filename>: save (via dump_stats) profile statistics to given
1159 filename. This data is in a format understod by the pstats module, and
1159 filename. This data is in a format understod by the pstats module, and
1160 is generated by a call to the dump_stats() method of profile
1160 is generated by a call to the dump_stats() method of profile
1161 objects. The profile is still shown on screen.
1161 objects. The profile is still shown on screen.
1162
1162
1163 If you want to run complete programs under the profiler's control, use
1163 If you want to run complete programs under the profiler's control, use
1164 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1164 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
1165 contains profiler specific options as described here.
1165 contains profiler specific options as described here.
1166
1166
1167 You can read the complete documentation for the profile module with:\\
1167 You can read the complete documentation for the profile module with:\\
1168 In [1]: import profile; profile.help() """
1168 In [1]: import profile; profile.help() """
1169
1169
1170 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1170 opts_def = Struct(D=[''],l=[],s=['time'],T=[''])
1171 # protect user quote marks
1171 # protect user quote marks
1172 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1172 parameter_s = parameter_s.replace('"',r'\"').replace("'",r"\'")
1173
1173
1174 if user_mode: # regular user call
1174 if user_mode: # regular user call
1175 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1175 opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:',
1176 list_all=1)
1176 list_all=1)
1177 namespace = self.shell.user_ns
1177 namespace = self.shell.user_ns
1178 else: # called to run a program by %run -p
1178 else: # called to run a program by %run -p
1179 try:
1179 try:
1180 filename = get_py_filename(arg_lst[0])
1180 filename = get_py_filename(arg_lst[0])
1181 except IOError,msg:
1181 except IOError,msg:
1182 error(msg)
1182 error(msg)
1183 return
1183 return
1184
1184
1185 arg_str = 'execfile(filename,prog_ns)'
1185 arg_str = 'execfile(filename,prog_ns)'
1186 namespace = locals()
1186 namespace = locals()
1187
1187
1188 opts.merge(opts_def)
1188 opts.merge(opts_def)
1189
1189
1190 prof = profile.Profile()
1190 prof = profile.Profile()
1191 try:
1191 try:
1192 prof = prof.runctx(arg_str,namespace,namespace)
1192 prof = prof.runctx(arg_str,namespace,namespace)
1193 sys_exit = ''
1193 sys_exit = ''
1194 except SystemExit:
1194 except SystemExit:
1195 sys_exit = """*** SystemExit exception caught in code being profiled."""
1195 sys_exit = """*** SystemExit exception caught in code being profiled."""
1196
1196
1197 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1197 stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s)
1198
1198
1199 lims = opts.l
1199 lims = opts.l
1200 if lims:
1200 if lims:
1201 lims = [] # rebuild lims with ints/floats/strings
1201 lims = [] # rebuild lims with ints/floats/strings
1202 for lim in opts.l:
1202 for lim in opts.l:
1203 try:
1203 try:
1204 lims.append(int(lim))
1204 lims.append(int(lim))
1205 except ValueError:
1205 except ValueError:
1206 try:
1206 try:
1207 lims.append(float(lim))
1207 lims.append(float(lim))
1208 except ValueError:
1208 except ValueError:
1209 lims.append(lim)
1209 lims.append(lim)
1210
1210
1211 # Trap output.
1211 # Trap output.
1212 stdout_trap = StringIO()
1212 stdout_trap = StringIO()
1213
1213
1214 if hasattr(stats,'stream'):
1214 if hasattr(stats,'stream'):
1215 # In newer versions of python, the stats object has a 'stream'
1215 # In newer versions of python, the stats object has a 'stream'
1216 # attribute to write into.
1216 # attribute to write into.
1217 stats.stream = stdout_trap
1217 stats.stream = stdout_trap
1218 stats.print_stats(*lims)
1218 stats.print_stats(*lims)
1219 else:
1219 else:
1220 # For older versions, we manually redirect stdout during printing
1220 # For older versions, we manually redirect stdout during printing
1221 sys_stdout = sys.stdout
1221 sys_stdout = sys.stdout
1222 try:
1222 try:
1223 sys.stdout = stdout_trap
1223 sys.stdout = stdout_trap
1224 stats.print_stats(*lims)
1224 stats.print_stats(*lims)
1225 finally:
1225 finally:
1226 sys.stdout = sys_stdout
1226 sys.stdout = sys_stdout
1227
1227
1228 output = stdout_trap.getvalue()
1228 output = stdout_trap.getvalue()
1229 output = output.rstrip()
1229 output = output.rstrip()
1230
1230
1231 page(output,screen_lines=self.shell.rc.screen_length)
1231 page(output,screen_lines=self.shell.rc.screen_length)
1232 print sys_exit,
1232 print sys_exit,
1233
1233
1234 dump_file = opts.D[0]
1234 dump_file = opts.D[0]
1235 text_file = opts.T[0]
1235 text_file = opts.T[0]
1236 if dump_file:
1236 if dump_file:
1237 prof.dump_stats(dump_file)
1237 prof.dump_stats(dump_file)
1238 print '\n*** Profile stats marshalled to file',\
1238 print '\n*** Profile stats marshalled to file',\
1239 `dump_file`+'.',sys_exit
1239 `dump_file`+'.',sys_exit
1240 if text_file:
1240 if text_file:
1241 pfile = file(text_file,'w')
1241 pfile = file(text_file,'w')
1242 pfile.write(output)
1242 pfile.write(output)
1243 pfile.close()
1243 pfile.close()
1244 print '\n*** Profile printout saved to text file',\
1244 print '\n*** Profile printout saved to text file',\
1245 `text_file`+'.',sys_exit
1245 `text_file`+'.',sys_exit
1246
1246
1247 if opts.has_key('r'):
1247 if opts.has_key('r'):
1248 return stats
1248 return stats
1249 else:
1249 else:
1250 return None
1250 return None
1251
1251
1252 def magic_run(self, parameter_s ='',runner=None):
1252 def magic_run(self, parameter_s ='',runner=None):
1253 """Run the named file inside IPython as a program.
1253 """Run the named file inside IPython as a program.
1254
1254
1255 Usage:\\
1255 Usage:\\
1256 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1256 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
1257
1257
1258 Parameters after the filename are passed as command-line arguments to
1258 Parameters after the filename are passed as command-line arguments to
1259 the program (put in sys.argv). Then, control returns to IPython's
1259 the program (put in sys.argv). Then, control returns to IPython's
1260 prompt.
1260 prompt.
1261
1261
1262 This is similar to running at a system prompt:\\
1262 This is similar to running at a system prompt:\\
1263 $ python file args\\
1263 $ python file args\\
1264 but with the advantage of giving you IPython's tracebacks, and of
1264 but with the advantage of giving you IPython's tracebacks, and of
1265 loading all variables into your interactive namespace for further use
1265 loading all variables into your interactive namespace for further use
1266 (unless -p is used, see below).
1266 (unless -p is used, see below).
1267
1267
1268 The file is executed in a namespace initially consisting only of
1268 The file is executed in a namespace initially consisting only of
1269 __name__=='__main__' and sys.argv constructed as indicated. It thus
1269 __name__=='__main__' and sys.argv constructed as indicated. It thus
1270 sees its environment as if it were being run as a stand-alone
1270 sees its environment as if it were being run as a stand-alone
1271 program. But after execution, the IPython interactive namespace gets
1271 program. But after execution, the IPython interactive namespace gets
1272 updated with all variables defined in the program (except for __name__
1272 updated with all variables defined in the program (except for __name__
1273 and sys.argv). This allows for very convenient loading of code for
1273 and sys.argv). This allows for very convenient loading of code for
1274 interactive work, while giving each program a 'clean sheet' to run in.
1274 interactive work, while giving each program a 'clean sheet' to run in.
1275
1275
1276 Options:
1276 Options:
1277
1277
1278 -n: __name__ is NOT set to '__main__', but to the running file's name
1278 -n: __name__ is NOT set to '__main__', but to the running file's name
1279 without extension (as python does under import). This allows running
1279 without extension (as python does under import). This allows running
1280 scripts and reloading the definitions in them without calling code
1280 scripts and reloading the definitions in them without calling code
1281 protected by an ' if __name__ == "__main__" ' clause.
1281 protected by an ' if __name__ == "__main__" ' clause.
1282
1282
1283 -i: run the file in IPython's namespace instead of an empty one. This
1283 -i: run the file in IPython's namespace instead of an empty one. This
1284 is useful if you are experimenting with code written in a text editor
1284 is useful if you are experimenting with code written in a text editor
1285 which depends on variables defined interactively.
1285 which depends on variables defined interactively.
1286
1286
1287 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1287 -e: ignore sys.exit() calls or SystemExit exceptions in the script
1288 being run. This is particularly useful if IPython is being used to
1288 being run. This is particularly useful if IPython is being used to
1289 run unittests, which always exit with a sys.exit() call. In such
1289 run unittests, which always exit with a sys.exit() call. In such
1290 cases you are interested in the output of the test results, not in
1290 cases you are interested in the output of the test results, not in
1291 seeing a traceback of the unittest module.
1291 seeing a traceback of the unittest module.
1292
1292
1293 -t: print timing information at the end of the run. IPython will give
1293 -t: print timing information at the end of the run. IPython will give
1294 you an estimated CPU time consumption for your script, which under
1294 you an estimated CPU time consumption for your script, which under
1295 Unix uses the resource module to avoid the wraparound problems of
1295 Unix uses the resource module to avoid the wraparound problems of
1296 time.clock(). Under Unix, an estimate of time spent on system tasks
1296 time.clock(). Under Unix, an estimate of time spent on system tasks
1297 is also given (for Windows platforms this is reported as 0.0).
1297 is also given (for Windows platforms this is reported as 0.0).
1298
1298
1299 If -t is given, an additional -N<N> option can be given, where <N>
1299 If -t is given, an additional -N<N> option can be given, where <N>
1300 must be an integer indicating how many times you want the script to
1300 must be an integer indicating how many times you want the script to
1301 run. The final timing report will include total and per run results.
1301 run. The final timing report will include total and per run results.
1302
1302
1303 For example (testing the script uniq_stable.py):
1303 For example (testing the script uniq_stable.py):
1304
1304
1305 In [1]: run -t uniq_stable
1305 In [1]: run -t uniq_stable
1306
1306
1307 IPython CPU timings (estimated):\\
1307 IPython CPU timings (estimated):\\
1308 User : 0.19597 s.\\
1308 User : 0.19597 s.\\
1309 System: 0.0 s.\\
1309 System: 0.0 s.\\
1310
1310
1311 In [2]: run -t -N5 uniq_stable
1311 In [2]: run -t -N5 uniq_stable
1312
1312
1313 IPython CPU timings (estimated):\\
1313 IPython CPU timings (estimated):\\
1314 Total runs performed: 5\\
1314 Total runs performed: 5\\
1315 Times : Total Per run\\
1315 Times : Total Per run\\
1316 User : 0.910862 s, 0.1821724 s.\\
1316 User : 0.910862 s, 0.1821724 s.\\
1317 System: 0.0 s, 0.0 s.
1317 System: 0.0 s, 0.0 s.
1318
1318
1319 -d: run your program under the control of pdb, the Python debugger.
1319 -d: run your program under the control of pdb, the Python debugger.
1320 This allows you to execute your program step by step, watch variables,
1320 This allows you to execute your program step by step, watch variables,
1321 etc. Internally, what IPython does is similar to calling:
1321 etc. Internally, what IPython does is similar to calling:
1322
1322
1323 pdb.run('execfile("YOURFILENAME")')
1323 pdb.run('execfile("YOURFILENAME")')
1324
1324
1325 with a breakpoint set on line 1 of your file. You can change the line
1325 with a breakpoint set on line 1 of your file. You can change the line
1326 number for this automatic breakpoint to be <N> by using the -bN option
1326 number for this automatic breakpoint to be <N> by using the -bN option
1327 (where N must be an integer). For example:
1327 (where N must be an integer). For example:
1328
1328
1329 %run -d -b40 myscript
1329 %run -d -b40 myscript
1330
1330
1331 will set the first breakpoint at line 40 in myscript.py. Note that
1331 will set the first breakpoint at line 40 in myscript.py. Note that
1332 the first breakpoint must be set on a line which actually does
1332 the first breakpoint must be set on a line which actually does
1333 something (not a comment or docstring) for it to stop execution.
1333 something (not a comment or docstring) for it to stop execution.
1334
1334
1335 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1335 When the pdb debugger starts, you will see a (Pdb) prompt. You must
1336 first enter 'c' (without qoutes) to start execution up to the first
1336 first enter 'c' (without qoutes) to start execution up to the first
1337 breakpoint.
1337 breakpoint.
1338
1338
1339 Entering 'help' gives information about the use of the debugger. You
1339 Entering 'help' gives information about the use of the debugger. You
1340 can easily see pdb's full documentation with "import pdb;pdb.help()"
1340 can easily see pdb's full documentation with "import pdb;pdb.help()"
1341 at a prompt.
1341 at a prompt.
1342
1342
1343 -p: run program under the control of the Python profiler module (which
1343 -p: run program under the control of the Python profiler module (which
1344 prints a detailed report of execution times, function calls, etc).
1344 prints a detailed report of execution times, function calls, etc).
1345
1345
1346 You can pass other options after -p which affect the behavior of the
1346 You can pass other options after -p which affect the behavior of the
1347 profiler itself. See the docs for %prun for details.
1347 profiler itself. See the docs for %prun for details.
1348
1348
1349 In this mode, the program's variables do NOT propagate back to the
1349 In this mode, the program's variables do NOT propagate back to the
1350 IPython interactive namespace (because they remain in the namespace
1350 IPython interactive namespace (because they remain in the namespace
1351 where the profiler executes them).
1351 where the profiler executes them).
1352
1352
1353 Internally this triggers a call to %prun, see its documentation for
1353 Internally this triggers a call to %prun, see its documentation for
1354 details on the options available specifically for profiling.
1354 details on the options available specifically for profiling.
1355
1355
1356 There is one special usage for which the text above doesn't apply:
1356 There is one special usage for which the text above doesn't apply:
1357 if the filename ends with .ipy, the file is run as ipython script,
1357 if the filename ends with .ipy, the file is run as ipython script,
1358 just as if the commands were written on IPython prompt.
1358 just as if the commands were written on IPython prompt.
1359 """
1359 """
1360
1360
1361 # get arguments and set sys.argv for program to be run.
1361 # get arguments and set sys.argv for program to be run.
1362 opts,arg_lst = self.parse_options(parameter_s,'nidtN:b:pD:l:rs:T:e',
1362 opts,arg_lst = self.parse_options(parameter_s,'nidtN:b:pD:l:rs:T:e',
1363 mode='list',list_all=1)
1363 mode='list',list_all=1)
1364
1364
1365 try:
1365 try:
1366 filename = get_py_filename(arg_lst[0])
1366 filename = get_py_filename(arg_lst[0])
1367 except IndexError:
1367 except IndexError:
1368 warn('you must provide at least a filename.')
1368 warn('you must provide at least a filename.')
1369 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1369 print '\n%run:\n',OInspect.getdoc(self.magic_run)
1370 return
1370 return
1371 except IOError,msg:
1371 except IOError,msg:
1372 error(msg)
1372 error(msg)
1373 return
1373 return
1374
1374
1375 if filename.lower().endswith('.ipy'):
1375 if filename.lower().endswith('.ipy'):
1376 self.api.runlines(open(filename).read())
1376 self.api.runlines(open(filename).read())
1377 return
1377 return
1378
1378
1379 # Control the response to exit() calls made by the script being run
1379 # Control the response to exit() calls made by the script being run
1380 exit_ignore = opts.has_key('e')
1380 exit_ignore = opts.has_key('e')
1381
1381
1382 # Make sure that the running script gets a proper sys.argv as if it
1382 # Make sure that the running script gets a proper sys.argv as if it
1383 # were run from a system shell.
1383 # were run from a system shell.
1384 save_argv = sys.argv # save it for later restoring
1384 save_argv = sys.argv # save it for later restoring
1385 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1385 sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
1386
1386
1387 if opts.has_key('i'):
1387 if opts.has_key('i'):
1388 prog_ns = self.shell.user_ns
1388 prog_ns = self.shell.user_ns
1389 __name__save = self.shell.user_ns['__name__']
1389 __name__save = self.shell.user_ns['__name__']
1390 prog_ns['__name__'] = '__main__'
1390 prog_ns['__name__'] = '__main__'
1391 else:
1391 else:
1392 if opts.has_key('n'):
1392 if opts.has_key('n'):
1393 name = os.path.splitext(os.path.basename(filename))[0]
1393 name = os.path.splitext(os.path.basename(filename))[0]
1394 else:
1394 else:
1395 name = '__main__'
1395 name = '__main__'
1396 prog_ns = {'__name__':name}
1396 prog_ns = {'__name__':name}
1397
1397
1398 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1398 # Since '%run foo' emulates 'python foo.py' at the cmd line, we must
1399 # set the __file__ global in the script's namespace
1399 # set the __file__ global in the script's namespace
1400 prog_ns['__file__'] = filename
1400 prog_ns['__file__'] = filename
1401
1401
1402 # pickle fix. See iplib for an explanation. But we need to make sure
1402 # pickle fix. See iplib for an explanation. But we need to make sure
1403 # that, if we overwrite __main__, we replace it at the end
1403 # that, if we overwrite __main__, we replace it at the end
1404 if prog_ns['__name__'] == '__main__':
1404 if prog_ns['__name__'] == '__main__':
1405 restore_main = sys.modules['__main__']
1405 restore_main = sys.modules['__main__']
1406 else:
1406 else:
1407 restore_main = False
1407 restore_main = False
1408
1408
1409 sys.modules[prog_ns['__name__']] = FakeModule(prog_ns)
1409 sys.modules[prog_ns['__name__']] = FakeModule(prog_ns)
1410
1410
1411 stats = None
1411 stats = None
1412 try:
1412 try:
1413 if self.shell.has_readline:
1413 if self.shell.has_readline:
1414 self.shell.savehist()
1414 self.shell.savehist()
1415
1415
1416 if opts.has_key('p'):
1416 if opts.has_key('p'):
1417 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1417 stats = self.magic_prun('',0,opts,arg_lst,prog_ns)
1418 else:
1418 else:
1419 if opts.has_key('d'):
1419 if opts.has_key('d'):
1420 deb = Debugger.Pdb(self.shell.rc.colors)
1420 deb = Debugger.Pdb(self.shell.rc.colors)
1421 # reset Breakpoint state, which is moronically kept
1421 # reset Breakpoint state, which is moronically kept
1422 # in a class
1422 # in a class
1423 bdb.Breakpoint.next = 1
1423 bdb.Breakpoint.next = 1
1424 bdb.Breakpoint.bplist = {}
1424 bdb.Breakpoint.bplist = {}
1425 bdb.Breakpoint.bpbynumber = [None]
1425 bdb.Breakpoint.bpbynumber = [None]
1426 # Set an initial breakpoint to stop execution
1426 # Set an initial breakpoint to stop execution
1427 maxtries = 10
1427 maxtries = 10
1428 bp = int(opts.get('b',[1])[0])
1428 bp = int(opts.get('b',[1])[0])
1429 checkline = deb.checkline(filename,bp)
1429 checkline = deb.checkline(filename,bp)
1430 if not checkline:
1430 if not checkline:
1431 for bp in range(bp+1,bp+maxtries+1):
1431 for bp in range(bp+1,bp+maxtries+1):
1432 if deb.checkline(filename,bp):
1432 if deb.checkline(filename,bp):
1433 break
1433 break
1434 else:
1434 else:
1435 msg = ("\nI failed to find a valid line to set "
1435 msg = ("\nI failed to find a valid line to set "
1436 "a breakpoint\n"
1436 "a breakpoint\n"
1437 "after trying up to line: %s.\n"
1437 "after trying up to line: %s.\n"
1438 "Please set a valid breakpoint manually "
1438 "Please set a valid breakpoint manually "
1439 "with the -b option." % bp)
1439 "with the -b option." % bp)
1440 error(msg)
1440 error(msg)
1441 return
1441 return
1442 # if we find a good linenumber, set the breakpoint
1442 # if we find a good linenumber, set the breakpoint
1443 deb.do_break('%s:%s' % (filename,bp))
1443 deb.do_break('%s:%s' % (filename,bp))
1444 # Start file run
1444 # Start file run
1445 print "NOTE: Enter 'c' at the",
1445 print "NOTE: Enter 'c' at the",
1446 print "%s prompt to start your script." % deb.prompt
1446 print "%s prompt to start your script." % deb.prompt
1447 try:
1447 try:
1448 deb.run('execfile("%s")' % filename,prog_ns)
1448 deb.run('execfile("%s")' % filename,prog_ns)
1449
1449
1450 except:
1450 except:
1451 etype, value, tb = sys.exc_info()
1451 etype, value, tb = sys.exc_info()
1452 # Skip three frames in the traceback: the %run one,
1452 # Skip three frames in the traceback: the %run one,
1453 # one inside bdb.py, and the command-line typed by the
1453 # one inside bdb.py, and the command-line typed by the
1454 # user (run by exec in pdb itself).
1454 # user (run by exec in pdb itself).
1455 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1455 self.shell.InteractiveTB(etype,value,tb,tb_offset=3)
1456 else:
1456 else:
1457 if runner is None:
1457 if runner is None:
1458 runner = self.shell.safe_execfile
1458 runner = self.shell.safe_execfile
1459 if opts.has_key('t'):
1459 if opts.has_key('t'):
1460 try:
1460 try:
1461 nruns = int(opts['N'][0])
1461 nruns = int(opts['N'][0])
1462 if nruns < 1:
1462 if nruns < 1:
1463 error('Number of runs must be >=1')
1463 error('Number of runs must be >=1')
1464 return
1464 return
1465 except (KeyError):
1465 except (KeyError):
1466 nruns = 1
1466 nruns = 1
1467 if nruns == 1:
1467 if nruns == 1:
1468 t0 = clock2()
1468 t0 = clock2()
1469 runner(filename,prog_ns,prog_ns,
1469 runner(filename,prog_ns,prog_ns,
1470 exit_ignore=exit_ignore)
1470 exit_ignore=exit_ignore)
1471 t1 = clock2()
1471 t1 = clock2()
1472 t_usr = t1[0]-t0[0]
1472 t_usr = t1[0]-t0[0]
1473 t_sys = t1[1]-t1[1]
1473 t_sys = t1[1]-t1[1]
1474 print "\nIPython CPU timings (estimated):"
1474 print "\nIPython CPU timings (estimated):"
1475 print " User : %10s s." % t_usr
1475 print " User : %10s s." % t_usr
1476 print " System: %10s s." % t_sys
1476 print " System: %10s s." % t_sys
1477 else:
1477 else:
1478 runs = range(nruns)
1478 runs = range(nruns)
1479 t0 = clock2()
1479 t0 = clock2()
1480 for nr in runs:
1480 for nr in runs:
1481 runner(filename,prog_ns,prog_ns,
1481 runner(filename,prog_ns,prog_ns,
1482 exit_ignore=exit_ignore)
1482 exit_ignore=exit_ignore)
1483 t1 = clock2()
1483 t1 = clock2()
1484 t_usr = t1[0]-t0[0]
1484 t_usr = t1[0]-t0[0]
1485 t_sys = t1[1]-t1[1]
1485 t_sys = t1[1]-t1[1]
1486 print "\nIPython CPU timings (estimated):"
1486 print "\nIPython CPU timings (estimated):"
1487 print "Total runs performed:",nruns
1487 print "Total runs performed:",nruns
1488 print " Times : %10s %10s" % ('Total','Per run')
1488 print " Times : %10s %10s" % ('Total','Per run')
1489 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1489 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1490 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1490 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1491
1491
1492 else:
1492 else:
1493 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1493 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
1494 if opts.has_key('i'):
1494 if opts.has_key('i'):
1495 self.shell.user_ns['__name__'] = __name__save
1495 self.shell.user_ns['__name__'] = __name__save
1496 else:
1496 else:
1497 # update IPython interactive namespace
1497 # update IPython interactive namespace
1498 del prog_ns['__name__']
1498 del prog_ns['__name__']
1499 self.shell.user_ns.update(prog_ns)
1499 self.shell.user_ns.update(prog_ns)
1500 finally:
1500 finally:
1501 sys.argv = save_argv
1501 sys.argv = save_argv
1502 if restore_main:
1502 if restore_main:
1503 sys.modules['__main__'] = restore_main
1503 sys.modules['__main__'] = restore_main
1504 self.shell.reloadhist()
1504 self.shell.reloadhist()
1505
1505
1506 return stats
1506 return stats
1507
1507
1508 def magic_runlog(self, parameter_s =''):
1508 def magic_runlog(self, parameter_s =''):
1509 """Run files as logs.
1509 """Run files as logs.
1510
1510
1511 Usage:\\
1511 Usage:\\
1512 %runlog file1 file2 ...
1512 %runlog file1 file2 ...
1513
1513
1514 Run the named files (treating them as log files) in sequence inside
1514 Run the named files (treating them as log files) in sequence inside
1515 the interpreter, and return to the prompt. This is much slower than
1515 the interpreter, and return to the prompt. This is much slower than
1516 %run because each line is executed in a try/except block, but it
1516 %run because each line is executed in a try/except block, but it
1517 allows running files with syntax errors in them.
1517 allows running files with syntax errors in them.
1518
1518
1519 Normally IPython will guess when a file is one of its own logfiles, so
1519 Normally IPython will guess when a file is one of its own logfiles, so
1520 you can typically use %run even for logs. This shorthand allows you to
1520 you can typically use %run even for logs. This shorthand allows you to
1521 force any file to be treated as a log file."""
1521 force any file to be treated as a log file."""
1522
1522
1523 for f in parameter_s.split():
1523 for f in parameter_s.split():
1524 self.shell.safe_execfile(f,self.shell.user_ns,
1524 self.shell.safe_execfile(f,self.shell.user_ns,
1525 self.shell.user_ns,islog=1)
1525 self.shell.user_ns,islog=1)
1526
1526
1527 def magic_timeit(self, parameter_s =''):
1527 def magic_timeit(self, parameter_s =''):
1528 """Time execution of a Python statement or expression
1528 """Time execution of a Python statement or expression
1529
1529
1530 Usage:\\
1530 Usage:\\
1531 %timeit [-n<N> -r<R> [-t|-c]] statement
1531 %timeit [-n<N> -r<R> [-t|-c]] statement
1532
1532
1533 Time execution of a Python statement or expression using the timeit
1533 Time execution of a Python statement or expression using the timeit
1534 module.
1534 module.
1535
1535
1536 Options:
1536 Options:
1537 -n<N>: execute the given statement <N> times in a loop. If this value
1537 -n<N>: execute the given statement <N> times in a loop. If this value
1538 is not given, a fitting value is chosen.
1538 is not given, a fitting value is chosen.
1539
1539
1540 -r<R>: repeat the loop iteration <R> times and take the best result.
1540 -r<R>: repeat the loop iteration <R> times and take the best result.
1541 Default: 3
1541 Default: 3
1542
1542
1543 -t: use time.time to measure the time, which is the default on Unix.
1543 -t: use time.time to measure the time, which is the default on Unix.
1544 This function measures wall time.
1544 This function measures wall time.
1545
1545
1546 -c: use time.clock to measure the time, which is the default on
1546 -c: use time.clock to measure the time, which is the default on
1547 Windows and measures wall time. On Unix, resource.getrusage is used
1547 Windows and measures wall time. On Unix, resource.getrusage is used
1548 instead and returns the CPU user time.
1548 instead and returns the CPU user time.
1549
1549
1550 -p<P>: use a precision of <P> digits to display the timing result.
1550 -p<P>: use a precision of <P> digits to display the timing result.
1551 Default: 3
1551 Default: 3
1552
1552
1553
1553
1554 Examples:\\
1554 Examples:\\
1555 In [1]: %timeit pass
1555 In [1]: %timeit pass
1556 10000000 loops, best of 3: 53.3 ns per loop
1556 10000000 loops, best of 3: 53.3 ns per loop
1557
1557
1558 In [2]: u = None
1558 In [2]: u = None
1559
1559
1560 In [3]: %timeit u is None
1560 In [3]: %timeit u is None
1561 10000000 loops, best of 3: 184 ns per loop
1561 10000000 loops, best of 3: 184 ns per loop
1562
1562
1563 In [4]: %timeit -r 4 u == None
1563 In [4]: %timeit -r 4 u == None
1564 1000000 loops, best of 4: 242 ns per loop
1564 1000000 loops, best of 4: 242 ns per loop
1565
1565
1566 In [5]: import time
1566 In [5]: import time
1567
1567
1568 In [6]: %timeit -n1 time.sleep(2)
1568 In [6]: %timeit -n1 time.sleep(2)
1569 1 loops, best of 3: 2 s per loop
1569 1 loops, best of 3: 2 s per loop
1570
1570
1571
1571
1572 The times reported by %timeit will be slightly higher than those
1572 The times reported by %timeit will be slightly higher than those
1573 reported by the timeit.py script when variables are accessed. This is
1573 reported by the timeit.py script when variables are accessed. This is
1574 due to the fact that %timeit executes the statement in the namespace
1574 due to the fact that %timeit executes the statement in the namespace
1575 of the shell, compared with timeit.py, which uses a single setup
1575 of the shell, compared with timeit.py, which uses a single setup
1576 statement to import function or create variables. Generally, the bias
1576 statement to import function or create variables. Generally, the bias
1577 does not matter as long as results from timeit.py are not mixed with
1577 does not matter as long as results from timeit.py are not mixed with
1578 those from %timeit."""
1578 those from %timeit."""
1579
1579
1580 import timeit
1580 import timeit
1581 import math
1581 import math
1582
1582
1583 units = ["s", "ms", "\xc2\xb5s", "ns"]
1583 units = ["s", "ms", "\xc2\xb5s", "ns"]
1584 scaling = [1, 1e3, 1e6, 1e9]
1584 scaling = [1, 1e3, 1e6, 1e9]
1585
1585
1586 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1586 opts, stmt = self.parse_options(parameter_s,'n:r:tcp:',
1587 posix=False)
1587 posix=False)
1588 if stmt == "":
1588 if stmt == "":
1589 return
1589 return
1590 timefunc = timeit.default_timer
1590 timefunc = timeit.default_timer
1591 number = int(getattr(opts, "n", 0))
1591 number = int(getattr(opts, "n", 0))
1592 repeat = int(getattr(opts, "r", timeit.default_repeat))
1592 repeat = int(getattr(opts, "r", timeit.default_repeat))
1593 precision = int(getattr(opts, "p", 3))
1593 precision = int(getattr(opts, "p", 3))
1594 if hasattr(opts, "t"):
1594 if hasattr(opts, "t"):
1595 timefunc = time.time
1595 timefunc = time.time
1596 if hasattr(opts, "c"):
1596 if hasattr(opts, "c"):
1597 timefunc = clock
1597 timefunc = clock
1598
1598
1599 timer = timeit.Timer(timer=timefunc)
1599 timer = timeit.Timer(timer=timefunc)
1600 # this code has tight coupling to the inner workings of timeit.Timer,
1600 # this code has tight coupling to the inner workings of timeit.Timer,
1601 # but is there a better way to achieve that the code stmt has access
1601 # but is there a better way to achieve that the code stmt has access
1602 # to the shell namespace?
1602 # to the shell namespace?
1603
1603
1604 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1604 src = timeit.template % {'stmt': timeit.reindent(stmt, 8),
1605 'setup': "pass"}
1605 'setup': "pass"}
1606 code = compile(src, "<magic-timeit>", "exec")
1606 code = compile(src, "<magic-timeit>", "exec")
1607 ns = {}
1607 ns = {}
1608 exec code in self.shell.user_ns, ns
1608 exec code in self.shell.user_ns, ns
1609 timer.inner = ns["inner"]
1609 timer.inner = ns["inner"]
1610
1610
1611 if number == 0:
1611 if number == 0:
1612 # determine number so that 0.2 <= total time < 2.0
1612 # determine number so that 0.2 <= total time < 2.0
1613 number = 1
1613 number = 1
1614 for i in range(1, 10):
1614 for i in range(1, 10):
1615 number *= 10
1615 number *= 10
1616 if timer.timeit(number) >= 0.2:
1616 if timer.timeit(number) >= 0.2:
1617 break
1617 break
1618
1618
1619 best = min(timer.repeat(repeat, number)) / number
1619 best = min(timer.repeat(repeat, number)) / number
1620
1620
1621 if best > 0.0:
1621 if best > 0.0:
1622 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1622 order = min(-int(math.floor(math.log10(best)) // 3), 3)
1623 else:
1623 else:
1624 order = 3
1624 order = 3
1625 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1625 print "%d loops, best of %d: %.*g %s per loop" % (number, repeat,
1626 precision,
1626 precision,
1627 best * scaling[order],
1627 best * scaling[order],
1628 units[order])
1628 units[order])
1629
1629
1630 def magic_time(self,parameter_s = ''):
1630 def magic_time(self,parameter_s = ''):
1631 """Time execution of a Python statement or expression.
1631 """Time execution of a Python statement or expression.
1632
1632
1633 The CPU and wall clock times are printed, and the value of the
1633 The CPU and wall clock times are printed, and the value of the
1634 expression (if any) is returned. Note that under Win32, system time
1634 expression (if any) is returned. Note that under Win32, system time
1635 is always reported as 0, since it can not be measured.
1635 is always reported as 0, since it can not be measured.
1636
1636
1637 This function provides very basic timing functionality. In Python
1637 This function provides very basic timing functionality. In Python
1638 2.3, the timeit module offers more control and sophistication, so this
1638 2.3, the timeit module offers more control and sophistication, so this
1639 could be rewritten to use it (patches welcome).
1639 could be rewritten to use it (patches welcome).
1640
1640
1641 Some examples:
1641 Some examples:
1642
1642
1643 In [1]: time 2**128
1643 In [1]: time 2**128
1644 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1644 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1645 Wall time: 0.00
1645 Wall time: 0.00
1646 Out[1]: 340282366920938463463374607431768211456L
1646 Out[1]: 340282366920938463463374607431768211456L
1647
1647
1648 In [2]: n = 1000000
1648 In [2]: n = 1000000
1649
1649
1650 In [3]: time sum(range(n))
1650 In [3]: time sum(range(n))
1651 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1651 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
1652 Wall time: 1.37
1652 Wall time: 1.37
1653 Out[3]: 499999500000L
1653 Out[3]: 499999500000L
1654
1654
1655 In [4]: time print 'hello world'
1655 In [4]: time print 'hello world'
1656 hello world
1656 hello world
1657 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1657 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1658 Wall time: 0.00
1658 Wall time: 0.00
1659 """
1659 """
1660
1660
1661 # fail immediately if the given expression can't be compiled
1661 # fail immediately if the given expression can't be compiled
1662 try:
1662 try:
1663 mode = 'eval'
1663 mode = 'eval'
1664 code = compile(parameter_s,'<timed eval>',mode)
1664 code = compile(parameter_s,'<timed eval>',mode)
1665 except SyntaxError:
1665 except SyntaxError:
1666 mode = 'exec'
1666 mode = 'exec'
1667 code = compile(parameter_s,'<timed exec>',mode)
1667 code = compile(parameter_s,'<timed exec>',mode)
1668 # skew measurement as little as possible
1668 # skew measurement as little as possible
1669 glob = self.shell.user_ns
1669 glob = self.shell.user_ns
1670 clk = clock2
1670 clk = clock2
1671 wtime = time.time
1671 wtime = time.time
1672 # time execution
1672 # time execution
1673 wall_st = wtime()
1673 wall_st = wtime()
1674 if mode=='eval':
1674 if mode=='eval':
1675 st = clk()
1675 st = clk()
1676 out = eval(code,glob)
1676 out = eval(code,glob)
1677 end = clk()
1677 end = clk()
1678 else:
1678 else:
1679 st = clk()
1679 st = clk()
1680 exec code in glob
1680 exec code in glob
1681 end = clk()
1681 end = clk()
1682 out = None
1682 out = None
1683 wall_end = wtime()
1683 wall_end = wtime()
1684 # Compute actual times and report
1684 # Compute actual times and report
1685 wall_time = wall_end-wall_st
1685 wall_time = wall_end-wall_st
1686 cpu_user = end[0]-st[0]
1686 cpu_user = end[0]-st[0]
1687 cpu_sys = end[1]-st[1]
1687 cpu_sys = end[1]-st[1]
1688 cpu_tot = cpu_user+cpu_sys
1688 cpu_tot = cpu_user+cpu_sys
1689 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1689 print "CPU times: user %.2f s, sys: %.2f s, total: %.2f s" % \
1690 (cpu_user,cpu_sys,cpu_tot)
1690 (cpu_user,cpu_sys,cpu_tot)
1691 print "Wall time: %.2f" % wall_time
1691 print "Wall time: %.2f" % wall_time
1692 return out
1692 return out
1693
1693
1694 def magic_macro(self,parameter_s = ''):
1694 def magic_macro(self,parameter_s = ''):
1695 """Define a set of input lines as a macro for future re-execution.
1695 """Define a set of input lines as a macro for future re-execution.
1696
1696
1697 Usage:\\
1697 Usage:\\
1698 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1698 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
1699
1699
1700 Options:
1700 Options:
1701
1701
1702 -r: use 'raw' input. By default, the 'processed' history is used,
1702 -r: use 'raw' input. By default, the 'processed' history is used,
1703 so that magics are loaded in their transformed version to valid
1703 so that magics are loaded in their transformed version to valid
1704 Python. If this option is given, the raw input as typed as the
1704 Python. If this option is given, the raw input as typed as the
1705 command line is used instead.
1705 command line is used instead.
1706
1706
1707 This will define a global variable called `name` which is a string
1707 This will define a global variable called `name` which is a string
1708 made of joining the slices and lines you specify (n1,n2,... numbers
1708 made of joining the slices and lines you specify (n1,n2,... numbers
1709 above) from your input history into a single string. This variable
1709 above) from your input history into a single string. This variable
1710 acts like an automatic function which re-executes those lines as if
1710 acts like an automatic function which re-executes those lines as if
1711 you had typed them. You just type 'name' at the prompt and the code
1711 you had typed them. You just type 'name' at the prompt and the code
1712 executes.
1712 executes.
1713
1713
1714 The notation for indicating number ranges is: n1-n2 means 'use line
1714 The notation for indicating number ranges is: n1-n2 means 'use line
1715 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1715 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
1716 using the lines numbered 5,6 and 7.
1716 using the lines numbered 5,6 and 7.
1717
1717
1718 Note: as a 'hidden' feature, you can also use traditional python slice
1718 Note: as a 'hidden' feature, you can also use traditional python slice
1719 notation, where N:M means numbers N through M-1.
1719 notation, where N:M means numbers N through M-1.
1720
1720
1721 For example, if your history contains (%hist prints it):
1721 For example, if your history contains (%hist prints it):
1722
1722
1723 44: x=1\\
1723 44: x=1\\
1724 45: y=3\\
1724 45: y=3\\
1725 46: z=x+y\\
1725 46: z=x+y\\
1726 47: print x\\
1726 47: print x\\
1727 48: a=5\\
1727 48: a=5\\
1728 49: print 'x',x,'y',y\\
1728 49: print 'x',x,'y',y\\
1729
1729
1730 you can create a macro with lines 44 through 47 (included) and line 49
1730 you can create a macro with lines 44 through 47 (included) and line 49
1731 called my_macro with:
1731 called my_macro with:
1732
1732
1733 In [51]: %macro my_macro 44-47 49
1733 In [51]: %macro my_macro 44-47 49
1734
1734
1735 Now, typing `my_macro` (without quotes) will re-execute all this code
1735 Now, typing `my_macro` (without quotes) will re-execute all this code
1736 in one pass.
1736 in one pass.
1737
1737
1738 You don't need to give the line-numbers in order, and any given line
1738 You don't need to give the line-numbers in order, and any given line
1739 number can appear multiple times. You can assemble macros with any
1739 number can appear multiple times. You can assemble macros with any
1740 lines from your input history in any order.
1740 lines from your input history in any order.
1741
1741
1742 The macro is a simple object which holds its value in an attribute,
1742 The macro is a simple object which holds its value in an attribute,
1743 but IPython's display system checks for macros and executes them as
1743 but IPython's display system checks for macros and executes them as
1744 code instead of printing them when you type their name.
1744 code instead of printing them when you type their name.
1745
1745
1746 You can view a macro's contents by explicitly printing it with:
1746 You can view a macro's contents by explicitly printing it with:
1747
1747
1748 'print macro_name'.
1748 'print macro_name'.
1749
1749
1750 For one-off cases which DON'T contain magic function calls in them you
1750 For one-off cases which DON'T contain magic function calls in them you
1751 can obtain similar results by explicitly executing slices from your
1751 can obtain similar results by explicitly executing slices from your
1752 input history with:
1752 input history with:
1753
1753
1754 In [60]: exec In[44:48]+In[49]"""
1754 In [60]: exec In[44:48]+In[49]"""
1755
1755
1756 opts,args = self.parse_options(parameter_s,'r',mode='list')
1756 opts,args = self.parse_options(parameter_s,'r',mode='list')
1757 if not args:
1757 if not args:
1758 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1758 macs = [k for k,v in self.shell.user_ns.items() if isinstance(v, Macro)]
1759 macs.sort()
1759 macs.sort()
1760 return macs
1760 return macs
1761 name,ranges = args[0], args[1:]
1761 name,ranges = args[0], args[1:]
1762 #print 'rng',ranges # dbg
1762 #print 'rng',ranges # dbg
1763 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1763 lines = self.extract_input_slices(ranges,opts.has_key('r'))
1764 macro = Macro(lines)
1764 macro = Macro(lines)
1765 self.shell.user_ns.update({name:macro})
1765 self.shell.user_ns.update({name:macro})
1766 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1766 print 'Macro `%s` created. To execute, type its name (without quotes).' % name
1767 print 'Macro contents:'
1767 print 'Macro contents:'
1768 print macro,
1768 print macro,
1769
1769
1770 def magic_save(self,parameter_s = ''):
1770 def magic_save(self,parameter_s = ''):
1771 """Save a set of lines to a given filename.
1771 """Save a set of lines to a given filename.
1772
1772
1773 Usage:\\
1773 Usage:\\
1774 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1774 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
1775
1775
1776 Options:
1776 Options:
1777
1777
1778 -r: use 'raw' input. By default, the 'processed' history is used,
1778 -r: use 'raw' input. By default, the 'processed' history is used,
1779 so that magics are loaded in their transformed version to valid
1779 so that magics are loaded in their transformed version to valid
1780 Python. If this option is given, the raw input as typed as the
1780 Python. If this option is given, the raw input as typed as the
1781 command line is used instead.
1781 command line is used instead.
1782
1782
1783 This function uses the same syntax as %macro for line extraction, but
1783 This function uses the same syntax as %macro for line extraction, but
1784 instead of creating a macro it saves the resulting string to the
1784 instead of creating a macro it saves the resulting string to the
1785 filename you specify.
1785 filename you specify.
1786
1786
1787 It adds a '.py' extension to the file if you don't do so yourself, and
1787 It adds a '.py' extension to the file if you don't do so yourself, and
1788 it asks for confirmation before overwriting existing files."""
1788 it asks for confirmation before overwriting existing files."""
1789
1789
1790 opts,args = self.parse_options(parameter_s,'r',mode='list')
1790 opts,args = self.parse_options(parameter_s,'r',mode='list')
1791 fname,ranges = args[0], args[1:]
1791 fname,ranges = args[0], args[1:]
1792 if not fname.endswith('.py'):
1792 if not fname.endswith('.py'):
1793 fname += '.py'
1793 fname += '.py'
1794 if os.path.isfile(fname):
1794 if os.path.isfile(fname):
1795 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1795 ans = raw_input('File `%s` exists. Overwrite (y/[N])? ' % fname)
1796 if ans.lower() not in ['y','yes']:
1796 if ans.lower() not in ['y','yes']:
1797 print 'Operation cancelled.'
1797 print 'Operation cancelled.'
1798 return
1798 return
1799 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1799 cmds = ''.join(self.extract_input_slices(ranges,opts.has_key('r')))
1800 f = file(fname,'w')
1800 f = file(fname,'w')
1801 f.write(cmds)
1801 f.write(cmds)
1802 f.close()
1802 f.close()
1803 print 'The following commands were written to file `%s`:' % fname
1803 print 'The following commands were written to file `%s`:' % fname
1804 print cmds
1804 print cmds
1805
1805
1806 def _edit_macro(self,mname,macro):
1806 def _edit_macro(self,mname,macro):
1807 """open an editor with the macro data in a file"""
1807 """open an editor with the macro data in a file"""
1808 filename = self.shell.mktempfile(macro.value)
1808 filename = self.shell.mktempfile(macro.value)
1809 self.shell.hooks.editor(filename)
1809 self.shell.hooks.editor(filename)
1810
1810
1811 # and make a new macro object, to replace the old one
1811 # and make a new macro object, to replace the old one
1812 mfile = open(filename)
1812 mfile = open(filename)
1813 mvalue = mfile.read()
1813 mvalue = mfile.read()
1814 mfile.close()
1814 mfile.close()
1815 self.shell.user_ns[mname] = Macro(mvalue)
1815 self.shell.user_ns[mname] = Macro(mvalue)
1816
1816
1817 def magic_ed(self,parameter_s=''):
1817 def magic_ed(self,parameter_s=''):
1818 """Alias to %edit."""
1818 """Alias to %edit."""
1819 return self.magic_edit(parameter_s)
1819 return self.magic_edit(parameter_s)
1820
1820
1821 def magic_edit(self,parameter_s='',last_call=['','']):
1821 def magic_edit(self,parameter_s='',last_call=['','']):
1822 """Bring up an editor and execute the resulting code.
1822 """Bring up an editor and execute the resulting code.
1823
1823
1824 Usage:
1824 Usage:
1825 %edit [options] [args]
1825 %edit [options] [args]
1826
1826
1827 %edit runs IPython's editor hook. The default version of this hook is
1827 %edit runs IPython's editor hook. The default version of this hook is
1828 set to call the __IPYTHON__.rc.editor command. This is read from your
1828 set to call the __IPYTHON__.rc.editor command. This is read from your
1829 environment variable $EDITOR. If this isn't found, it will default to
1829 environment variable $EDITOR. If this isn't found, it will default to
1830 vi under Linux/Unix and to notepad under Windows. See the end of this
1830 vi under Linux/Unix and to notepad under Windows. See the end of this
1831 docstring for how to change the editor hook.
1831 docstring for how to change the editor hook.
1832
1832
1833 You can also set the value of this editor via the command line option
1833 You can also set the value of this editor via the command line option
1834 '-editor' or in your ipythonrc file. This is useful if you wish to use
1834 '-editor' or in your ipythonrc file. This is useful if you wish to use
1835 specifically for IPython an editor different from your typical default
1835 specifically for IPython an editor different from your typical default
1836 (and for Windows users who typically don't set environment variables).
1836 (and for Windows users who typically don't set environment variables).
1837
1837
1838 This command allows you to conveniently edit multi-line code right in
1838 This command allows you to conveniently edit multi-line code right in
1839 your IPython session.
1839 your IPython session.
1840
1840
1841 If called without arguments, %edit opens up an empty editor with a
1841 If called without arguments, %edit opens up an empty editor with a
1842 temporary file and will execute the contents of this file when you
1842 temporary file and will execute the contents of this file when you
1843 close it (don't forget to save it!).
1843 close it (don't forget to save it!).
1844
1844
1845
1845
1846 Options:
1846 Options:
1847
1847
1848 -n <number>: open the editor at a specified line number. By default,
1848 -n <number>: open the editor at a specified line number. By default,
1849 the IPython editor hook uses the unix syntax 'editor +N filename', but
1849 the IPython editor hook uses the unix syntax 'editor +N filename', but
1850 you can configure this by providing your own modified hook if your
1850 you can configure this by providing your own modified hook if your
1851 favorite editor supports line-number specifications with a different
1851 favorite editor supports line-number specifications with a different
1852 syntax.
1852 syntax.
1853
1853
1854 -p: this will call the editor with the same data as the previous time
1854 -p: this will call the editor with the same data as the previous time
1855 it was used, regardless of how long ago (in your current session) it
1855 it was used, regardless of how long ago (in your current session) it
1856 was.
1856 was.
1857
1857
1858 -r: use 'raw' input. This option only applies to input taken from the
1858 -r: use 'raw' input. This option only applies to input taken from the
1859 user's history. By default, the 'processed' history is used, so that
1859 user's history. By default, the 'processed' history is used, so that
1860 magics are loaded in their transformed version to valid Python. If
1860 magics are loaded in their transformed version to valid Python. If
1861 this option is given, the raw input as typed as the command line is
1861 this option is given, the raw input as typed as the command line is
1862 used instead. When you exit the editor, it will be executed by
1862 used instead. When you exit the editor, it will be executed by
1863 IPython's own processor.
1863 IPython's own processor.
1864
1864
1865 -x: do not execute the edited code immediately upon exit. This is
1865 -x: do not execute the edited code immediately upon exit. This is
1866 mainly useful if you are editing programs which need to be called with
1866 mainly useful if you are editing programs which need to be called with
1867 command line arguments, which you can then do using %run.
1867 command line arguments, which you can then do using %run.
1868
1868
1869
1869
1870 Arguments:
1870 Arguments:
1871
1871
1872 If arguments are given, the following possibilites exist:
1872 If arguments are given, the following possibilites exist:
1873
1873
1874 - The arguments are numbers or pairs of colon-separated numbers (like
1874 - The arguments are numbers or pairs of colon-separated numbers (like
1875 1 4:8 9). These are interpreted as lines of previous input to be
1875 1 4:8 9). These are interpreted as lines of previous input to be
1876 loaded into the editor. The syntax is the same of the %macro command.
1876 loaded into the editor. The syntax is the same of the %macro command.
1877
1877
1878 - If the argument doesn't start with a number, it is evaluated as a
1878 - If the argument doesn't start with a number, it is evaluated as a
1879 variable and its contents loaded into the editor. You can thus edit
1879 variable and its contents loaded into the editor. You can thus edit
1880 any string which contains python code (including the result of
1880 any string which contains python code (including the result of
1881 previous edits).
1881 previous edits).
1882
1882
1883 - If the argument is the name of an object (other than a string),
1883 - If the argument is the name of an object (other than a string),
1884 IPython will try to locate the file where it was defined and open the
1884 IPython will try to locate the file where it was defined and open the
1885 editor at the point where it is defined. You can use `%edit function`
1885 editor at the point where it is defined. You can use `%edit function`
1886 to load an editor exactly at the point where 'function' is defined,
1886 to load an editor exactly at the point where 'function' is defined,
1887 edit it and have the file be executed automatically.
1887 edit it and have the file be executed automatically.
1888
1888
1889 If the object is a macro (see %macro for details), this opens up your
1889 If the object is a macro (see %macro for details), this opens up your
1890 specified editor with a temporary file containing the macro's data.
1890 specified editor with a temporary file containing the macro's data.
1891 Upon exit, the macro is reloaded with the contents of the file.
1891 Upon exit, the macro is reloaded with the contents of the file.
1892
1892
1893 Note: opening at an exact line is only supported under Unix, and some
1893 Note: opening at an exact line is only supported under Unix, and some
1894 editors (like kedit and gedit up to Gnome 2.8) do not understand the
1894 editors (like kedit and gedit up to Gnome 2.8) do not understand the
1895 '+NUMBER' parameter necessary for this feature. Good editors like
1895 '+NUMBER' parameter necessary for this feature. Good editors like
1896 (X)Emacs, vi, jed, pico and joe all do.
1896 (X)Emacs, vi, jed, pico and joe all do.
1897
1897
1898 - If the argument is not found as a variable, IPython will look for a
1898 - If the argument is not found as a variable, IPython will look for a
1899 file with that name (adding .py if necessary) and load it into the
1899 file with that name (adding .py if necessary) and load it into the
1900 editor. It will execute its contents with execfile() when you exit,
1900 editor. It will execute its contents with execfile() when you exit,
1901 loading any code in the file into your interactive namespace.
1901 loading any code in the file into your interactive namespace.
1902
1902
1903 After executing your code, %edit will return as output the code you
1903 After executing your code, %edit will return as output the code you
1904 typed in the editor (except when it was an existing file). This way
1904 typed in the editor (except when it was an existing file). This way
1905 you can reload the code in further invocations of %edit as a variable,
1905 you can reload the code in further invocations of %edit as a variable,
1906 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
1906 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
1907 the output.
1907 the output.
1908
1908
1909 Note that %edit is also available through the alias %ed.
1909 Note that %edit is also available through the alias %ed.
1910
1910
1911 This is an example of creating a simple function inside the editor and
1911 This is an example of creating a simple function inside the editor and
1912 then modifying it. First, start up the editor:
1912 then modifying it. First, start up the editor:
1913
1913
1914 In [1]: ed\\
1914 In [1]: ed\\
1915 Editing... done. Executing edited code...\\
1915 Editing... done. Executing edited code...\\
1916 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
1916 Out[1]: 'def foo():\\n print "foo() was defined in an editing session"\\n'
1917
1917
1918 We can then call the function foo():
1918 We can then call the function foo():
1919
1919
1920 In [2]: foo()\\
1920 In [2]: foo()\\
1921 foo() was defined in an editing session
1921 foo() was defined in an editing session
1922
1922
1923 Now we edit foo. IPython automatically loads the editor with the
1923 Now we edit foo. IPython automatically loads the editor with the
1924 (temporary) file where foo() was previously defined:
1924 (temporary) file where foo() was previously defined:
1925
1925
1926 In [3]: ed foo\\
1926 In [3]: ed foo\\
1927 Editing... done. Executing edited code...
1927 Editing... done. Executing edited code...
1928
1928
1929 And if we call foo() again we get the modified version:
1929 And if we call foo() again we get the modified version:
1930
1930
1931 In [4]: foo()\\
1931 In [4]: foo()\\
1932 foo() has now been changed!
1932 foo() has now been changed!
1933
1933
1934 Here is an example of how to edit a code snippet successive
1934 Here is an example of how to edit a code snippet successive
1935 times. First we call the editor:
1935 times. First we call the editor:
1936
1936
1937 In [8]: ed\\
1937 In [8]: ed\\
1938 Editing... done. Executing edited code...\\
1938 Editing... done. Executing edited code...\\
1939 hello\\
1939 hello\\
1940 Out[8]: "print 'hello'\\n"
1940 Out[8]: "print 'hello'\\n"
1941
1941
1942 Now we call it again with the previous output (stored in _):
1942 Now we call it again with the previous output (stored in _):
1943
1943
1944 In [9]: ed _\\
1944 In [9]: ed _\\
1945 Editing... done. Executing edited code...\\
1945 Editing... done. Executing edited code...\\
1946 hello world\\
1946 hello world\\
1947 Out[9]: "print 'hello world'\\n"
1947 Out[9]: "print 'hello world'\\n"
1948
1948
1949 Now we call it with the output #8 (stored in _8, also as Out[8]):
1949 Now we call it with the output #8 (stored in _8, also as Out[8]):
1950
1950
1951 In [10]: ed _8\\
1951 In [10]: ed _8\\
1952 Editing... done. Executing edited code...\\
1952 Editing... done. Executing edited code...\\
1953 hello again\\
1953 hello again\\
1954 Out[10]: "print 'hello again'\\n"
1954 Out[10]: "print 'hello again'\\n"
1955
1955
1956
1956
1957 Changing the default editor hook:
1957 Changing the default editor hook:
1958
1958
1959 If you wish to write your own editor hook, you can put it in a
1959 If you wish to write your own editor hook, you can put it in a
1960 configuration file which you load at startup time. The default hook
1960 configuration file which you load at startup time. The default hook
1961 is defined in the IPython.hooks module, and you can use that as a
1961 is defined in the IPython.hooks module, and you can use that as a
1962 starting example for further modifications. That file also has
1962 starting example for further modifications. That file also has
1963 general instructions on how to set a new hook for use once you've
1963 general instructions on how to set a new hook for use once you've
1964 defined it."""
1964 defined it."""
1965
1965
1966 # FIXME: This function has become a convoluted mess. It needs a
1966 # FIXME: This function has become a convoluted mess. It needs a
1967 # ground-up rewrite with clean, simple logic.
1967 # ground-up rewrite with clean, simple logic.
1968
1968
1969 def make_filename(arg):
1969 def make_filename(arg):
1970 "Make a filename from the given args"
1970 "Make a filename from the given args"
1971 try:
1971 try:
1972 filename = get_py_filename(arg)
1972 filename = get_py_filename(arg)
1973 except IOError:
1973 except IOError:
1974 if args.endswith('.py'):
1974 if args.endswith('.py'):
1975 filename = arg
1975 filename = arg
1976 else:
1976 else:
1977 filename = None
1977 filename = None
1978 return filename
1978 return filename
1979
1979
1980 # custom exceptions
1980 # custom exceptions
1981 class DataIsObject(Exception): pass
1981 class DataIsObject(Exception): pass
1982
1982
1983 opts,args = self.parse_options(parameter_s,'prxn:')
1983 opts,args = self.parse_options(parameter_s,'prxn:')
1984 # Set a few locals from the options for convenience:
1984 # Set a few locals from the options for convenience:
1985 opts_p = opts.has_key('p')
1985 opts_p = opts.has_key('p')
1986 opts_r = opts.has_key('r')
1986 opts_r = opts.has_key('r')
1987
1987
1988 # Default line number value
1988 # Default line number value
1989 lineno = opts.get('n',None)
1989 lineno = opts.get('n',None)
1990
1990
1991 if opts_p:
1991 if opts_p:
1992 args = '_%s' % last_call[0]
1992 args = '_%s' % last_call[0]
1993 if not self.shell.user_ns.has_key(args):
1993 if not self.shell.user_ns.has_key(args):
1994 args = last_call[1]
1994 args = last_call[1]
1995
1995
1996 # use last_call to remember the state of the previous call, but don't
1996 # use last_call to remember the state of the previous call, but don't
1997 # let it be clobbered by successive '-p' calls.
1997 # let it be clobbered by successive '-p' calls.
1998 try:
1998 try:
1999 last_call[0] = self.shell.outputcache.prompt_count
1999 last_call[0] = self.shell.outputcache.prompt_count
2000 if not opts_p:
2000 if not opts_p:
2001 last_call[1] = parameter_s
2001 last_call[1] = parameter_s
2002 except:
2002 except:
2003 pass
2003 pass
2004
2004
2005 # by default this is done with temp files, except when the given
2005 # by default this is done with temp files, except when the given
2006 # arg is a filename
2006 # arg is a filename
2007 use_temp = 1
2007 use_temp = 1
2008
2008
2009 if re.match(r'\d',args):
2009 if re.match(r'\d',args):
2010 # Mode where user specifies ranges of lines, like in %macro.
2010 # Mode where user specifies ranges of lines, like in %macro.
2011 # This means that you can't edit files whose names begin with
2011 # This means that you can't edit files whose names begin with
2012 # numbers this way. Tough.
2012 # numbers this way. Tough.
2013 ranges = args.split()
2013 ranges = args.split()
2014 data = ''.join(self.extract_input_slices(ranges,opts_r))
2014 data = ''.join(self.extract_input_slices(ranges,opts_r))
2015 elif args.endswith('.py'):
2015 elif args.endswith('.py'):
2016 filename = make_filename(args)
2016 filename = make_filename(args)
2017 data = ''
2017 data = ''
2018 use_temp = 0
2018 use_temp = 0
2019 elif args:
2019 elif args:
2020 try:
2020 try:
2021 # Load the parameter given as a variable. If not a string,
2021 # Load the parameter given as a variable. If not a string,
2022 # process it as an object instead (below)
2022 # process it as an object instead (below)
2023
2023
2024 #print '*** args',args,'type',type(args) # dbg
2024 #print '*** args',args,'type',type(args) # dbg
2025 data = eval(args,self.shell.user_ns)
2025 data = eval(args,self.shell.user_ns)
2026 if not type(data) in StringTypes:
2026 if not type(data) in StringTypes:
2027 raise DataIsObject
2027 raise DataIsObject
2028
2028
2029 except (NameError,SyntaxError):
2029 except (NameError,SyntaxError):
2030 # given argument is not a variable, try as a filename
2030 # given argument is not a variable, try as a filename
2031 filename = make_filename(args)
2031 filename = make_filename(args)
2032 if filename is None:
2032 if filename is None:
2033 warn("Argument given (%s) can't be found as a variable "
2033 warn("Argument given (%s) can't be found as a variable "
2034 "or as a filename." % args)
2034 "or as a filename." % args)
2035 return
2035 return
2036
2036
2037 data = ''
2037 data = ''
2038 use_temp = 0
2038 use_temp = 0
2039 except DataIsObject:
2039 except DataIsObject:
2040
2040
2041 # macros have a special edit function
2041 # macros have a special edit function
2042 if isinstance(data,Macro):
2042 if isinstance(data,Macro):
2043 self._edit_macro(args,data)
2043 self._edit_macro(args,data)
2044 return
2044 return
2045
2045
2046 # For objects, try to edit the file where they are defined
2046 # For objects, try to edit the file where they are defined
2047 try:
2047 try:
2048 filename = inspect.getabsfile(data)
2048 filename = inspect.getabsfile(data)
2049 datafile = 1
2049 datafile = 1
2050 except TypeError:
2050 except TypeError:
2051 filename = make_filename(args)
2051 filename = make_filename(args)
2052 datafile = 1
2052 datafile = 1
2053 warn('Could not find file where `%s` is defined.\n'
2053 warn('Could not find file where `%s` is defined.\n'
2054 'Opening a file named `%s`' % (args,filename))
2054 'Opening a file named `%s`' % (args,filename))
2055 # Now, make sure we can actually read the source (if it was in
2055 # Now, make sure we can actually read the source (if it was in
2056 # a temp file it's gone by now).
2056 # a temp file it's gone by now).
2057 if datafile:
2057 if datafile:
2058 try:
2058 try:
2059 if lineno is None:
2059 if lineno is None:
2060 lineno = inspect.getsourcelines(data)[1]
2060 lineno = inspect.getsourcelines(data)[1]
2061 except IOError:
2061 except IOError:
2062 filename = make_filename(args)
2062 filename = make_filename(args)
2063 if filename is None:
2063 if filename is None:
2064 warn('The file `%s` where `%s` was defined cannot '
2064 warn('The file `%s` where `%s` was defined cannot '
2065 'be read.' % (filename,data))
2065 'be read.' % (filename,data))
2066 return
2066 return
2067 use_temp = 0
2067 use_temp = 0
2068 else:
2068 else:
2069 data = ''
2069 data = ''
2070
2070
2071 if use_temp:
2071 if use_temp:
2072 filename = self.shell.mktempfile(data)
2072 filename = self.shell.mktempfile(data)
2073 print 'IPython will make a temporary file named:',filename
2073 print 'IPython will make a temporary file named:',filename
2074
2074
2075 # do actual editing here
2075 # do actual editing here
2076 print 'Editing...',
2076 print 'Editing...',
2077 sys.stdout.flush()
2077 sys.stdout.flush()
2078 self.shell.hooks.editor(filename,lineno)
2078 self.shell.hooks.editor(filename,lineno)
2079 if opts.has_key('x'): # -x prevents actual execution
2079 if opts.has_key('x'): # -x prevents actual execution
2080 print
2080 print
2081 else:
2081 else:
2082 print 'done. Executing edited code...'
2082 print 'done. Executing edited code...'
2083 if opts_r:
2083 if opts_r:
2084 self.shell.runlines(file_read(filename))
2084 self.shell.runlines(file_read(filename))
2085 else:
2085 else:
2086 self.shell.safe_execfile(filename,self.shell.user_ns,
2086 self.shell.safe_execfile(filename,self.shell.user_ns,
2087 self.shell.user_ns)
2087 self.shell.user_ns)
2088 if use_temp:
2088 if use_temp:
2089 try:
2089 try:
2090 return open(filename).read()
2090 return open(filename).read()
2091 except IOError,msg:
2091 except IOError,msg:
2092 if msg.filename == filename:
2092 if msg.filename == filename:
2093 warn('File not found. Did you forget to save?')
2093 warn('File not found. Did you forget to save?')
2094 return
2094 return
2095 else:
2095 else:
2096 self.shell.showtraceback()
2096 self.shell.showtraceback()
2097
2097
2098 def magic_xmode(self,parameter_s = ''):
2098 def magic_xmode(self,parameter_s = ''):
2099 """Switch modes for the exception handlers.
2099 """Switch modes for the exception handlers.
2100
2100
2101 Valid modes: Plain, Context and Verbose.
2101 Valid modes: Plain, Context and Verbose.
2102
2102
2103 If called without arguments, acts as a toggle."""
2103 If called without arguments, acts as a toggle."""
2104
2104
2105 def xmode_switch_err(name):
2105 def xmode_switch_err(name):
2106 warn('Error changing %s exception modes.\n%s' %
2106 warn('Error changing %s exception modes.\n%s' %
2107 (name,sys.exc_info()[1]))
2107 (name,sys.exc_info()[1]))
2108
2108
2109 shell = self.shell
2109 shell = self.shell
2110 new_mode = parameter_s.strip().capitalize()
2110 new_mode = parameter_s.strip().capitalize()
2111 try:
2111 try:
2112 shell.InteractiveTB.set_mode(mode=new_mode)
2112 shell.InteractiveTB.set_mode(mode=new_mode)
2113 print 'Exception reporting mode:',shell.InteractiveTB.mode
2113 print 'Exception reporting mode:',shell.InteractiveTB.mode
2114 except:
2114 except:
2115 xmode_switch_err('user')
2115 xmode_switch_err('user')
2116
2116
2117 # threaded shells use a special handler in sys.excepthook
2117 # threaded shells use a special handler in sys.excepthook
2118 if shell.isthreaded:
2118 if shell.isthreaded:
2119 try:
2119 try:
2120 shell.sys_excepthook.set_mode(mode=new_mode)
2120 shell.sys_excepthook.set_mode(mode=new_mode)
2121 except:
2121 except:
2122 xmode_switch_err('threaded')
2122 xmode_switch_err('threaded')
2123
2123
2124 def magic_colors(self,parameter_s = ''):
2124 def magic_colors(self,parameter_s = ''):
2125 """Switch color scheme for prompts, info system and exception handlers.
2125 """Switch color scheme for prompts, info system and exception handlers.
2126
2126
2127 Currently implemented schemes: NoColor, Linux, LightBG.
2127 Currently implemented schemes: NoColor, Linux, LightBG.
2128
2128
2129 Color scheme names are not case-sensitive."""
2129 Color scheme names are not case-sensitive."""
2130
2130
2131 def color_switch_err(name):
2131 def color_switch_err(name):
2132 warn('Error changing %s color schemes.\n%s' %
2132 warn('Error changing %s color schemes.\n%s' %
2133 (name,sys.exc_info()[1]))
2133 (name,sys.exc_info()[1]))
2134
2134
2135
2135
2136 new_scheme = parameter_s.strip()
2136 new_scheme = parameter_s.strip()
2137 if not new_scheme:
2137 if not new_scheme:
2138 print 'You must specify a color scheme.'
2138 print 'You must specify a color scheme.'
2139 return
2139 return
2140 import IPython.rlineimpl as readline
2140 import IPython.rlineimpl as readline
2141 if not readline.have_readline and sys.platform == "win32":
2141 if not readline.have_readline and sys.platform == "win32":
2142 msg = """\
2142 msg = """\
2143 Proper color support under MS Windows requires the pyreadline library.
2143 Proper color support under MS Windows requires the pyreadline library.
2144 You can find it at:
2144 You can find it at:
2145 http://ipython.scipy.org/moin/PyReadline/Intro
2145 http://ipython.scipy.org/moin/PyReadline/Intro
2146 Gary's readline needs the ctypes module, from:
2146 Gary's readline needs the ctypes module, from:
2147 http://starship.python.net/crew/theller/ctypes
2147 http://starship.python.net/crew/theller/ctypes
2148 (Note that ctypes is already part of Python versions 2.5 and newer).
2148 (Note that ctypes is already part of Python versions 2.5 and newer).
2149
2149
2150 Defaulting color scheme to 'NoColor'"""
2150 Defaulting color scheme to 'NoColor'"""
2151 new_scheme = 'NoColor'
2151 new_scheme = 'NoColor'
2152 warn(msg)
2152 warn(msg)
2153 # local shortcut
2153 # local shortcut
2154 shell = self.shell
2154 shell = self.shell
2155
2155
2156 # Set prompt colors
2156 # Set prompt colors
2157 try:
2157 try:
2158 shell.outputcache.set_colors(new_scheme)
2158 shell.outputcache.set_colors(new_scheme)
2159 except:
2159 except:
2160 color_switch_err('prompt')
2160 color_switch_err('prompt')
2161 else:
2161 else:
2162 shell.rc.colors = \
2162 shell.rc.colors = \
2163 shell.outputcache.color_table.active_scheme_name
2163 shell.outputcache.color_table.active_scheme_name
2164 # Set exception colors
2164 # Set exception colors
2165 try:
2165 try:
2166 shell.InteractiveTB.set_colors(scheme = new_scheme)
2166 shell.InteractiveTB.set_colors(scheme = new_scheme)
2167 shell.SyntaxTB.set_colors(scheme = new_scheme)
2167 shell.SyntaxTB.set_colors(scheme = new_scheme)
2168 except:
2168 except:
2169 color_switch_err('exception')
2169 color_switch_err('exception')
2170
2170
2171 # threaded shells use a verbose traceback in sys.excepthook
2171 # threaded shells use a verbose traceback in sys.excepthook
2172 if shell.isthreaded:
2172 if shell.isthreaded:
2173 try:
2173 try:
2174 shell.sys_excepthook.set_colors(scheme=new_scheme)
2174 shell.sys_excepthook.set_colors(scheme=new_scheme)
2175 except:
2175 except:
2176 color_switch_err('system exception handler')
2176 color_switch_err('system exception handler')
2177
2177
2178 # Set info (for 'object?') colors
2178 # Set info (for 'object?') colors
2179 if shell.rc.color_info:
2179 if shell.rc.color_info:
2180 try:
2180 try:
2181 shell.inspector.set_active_scheme(new_scheme)
2181 shell.inspector.set_active_scheme(new_scheme)
2182 except:
2182 except:
2183 color_switch_err('object inspector')
2183 color_switch_err('object inspector')
2184 else:
2184 else:
2185 shell.inspector.set_active_scheme('NoColor')
2185 shell.inspector.set_active_scheme('NoColor')
2186
2186
2187 def magic_color_info(self,parameter_s = ''):
2187 def magic_color_info(self,parameter_s = ''):
2188 """Toggle color_info.
2188 """Toggle color_info.
2189
2189
2190 The color_info configuration parameter controls whether colors are
2190 The color_info configuration parameter controls whether colors are
2191 used for displaying object details (by things like %psource, %pfile or
2191 used for displaying object details (by things like %psource, %pfile or
2192 the '?' system). This function toggles this value with each call.
2192 the '?' system). This function toggles this value with each call.
2193
2193
2194 Note that unless you have a fairly recent pager (less works better
2194 Note that unless you have a fairly recent pager (less works better
2195 than more) in your system, using colored object information displays
2195 than more) in your system, using colored object information displays
2196 will not work properly. Test it and see."""
2196 will not work properly. Test it and see."""
2197
2197
2198 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2198 self.shell.rc.color_info = 1 - self.shell.rc.color_info
2199 self.magic_colors(self.shell.rc.colors)
2199 self.magic_colors(self.shell.rc.colors)
2200 print 'Object introspection functions have now coloring:',
2200 print 'Object introspection functions have now coloring:',
2201 print ['OFF','ON'][self.shell.rc.color_info]
2201 print ['OFF','ON'][self.shell.rc.color_info]
2202
2202
2203 def magic_Pprint(self, parameter_s=''):
2203 def magic_Pprint(self, parameter_s=''):
2204 """Toggle pretty printing on/off."""
2204 """Toggle pretty printing on/off."""
2205
2205
2206 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2206 self.shell.rc.pprint = 1 - self.shell.rc.pprint
2207 print 'Pretty printing has been turned', \
2207 print 'Pretty printing has been turned', \
2208 ['OFF','ON'][self.shell.rc.pprint]
2208 ['OFF','ON'][self.shell.rc.pprint]
2209
2209
2210 def magic_exit(self, parameter_s=''):
2210 def magic_exit(self, parameter_s=''):
2211 """Exit IPython, confirming if configured to do so.
2211 """Exit IPython, confirming if configured to do so.
2212
2212
2213 You can configure whether IPython asks for confirmation upon exit by
2213 You can configure whether IPython asks for confirmation upon exit by
2214 setting the confirm_exit flag in the ipythonrc file."""
2214 setting the confirm_exit flag in the ipythonrc file."""
2215
2215
2216 self.shell.exit()
2216 self.shell.exit()
2217
2217
2218 def magic_quit(self, parameter_s=''):
2218 def magic_quit(self, parameter_s=''):
2219 """Exit IPython, confirming if configured to do so (like %exit)"""
2219 """Exit IPython, confirming if configured to do so (like %exit)"""
2220
2220
2221 self.shell.exit()
2221 self.shell.exit()
2222
2222
2223 def magic_Exit(self, parameter_s=''):
2223 def magic_Exit(self, parameter_s=''):
2224 """Exit IPython without confirmation."""
2224 """Exit IPython without confirmation."""
2225
2225
2226 self.shell.exit_now = True
2226 self.shell.exit_now = True
2227
2227
2228 #......................................................................
2228 #......................................................................
2229 # Functions to implement unix shell-type things
2229 # Functions to implement unix shell-type things
2230
2230
2231 def magic_alias(self, parameter_s = ''):
2231 def magic_alias(self, parameter_s = ''):
2232 """Define an alias for a system command.
2232 """Define an alias for a system command.
2233
2233
2234 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2234 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
2235
2235
2236 Then, typing 'alias_name params' will execute the system command 'cmd
2236 Then, typing 'alias_name params' will execute the system command 'cmd
2237 params' (from your underlying operating system).
2237 params' (from your underlying operating system).
2238
2238
2239 Aliases have lower precedence than magic functions and Python normal
2239 Aliases have lower precedence than magic functions and Python normal
2240 variables, so if 'foo' is both a Python variable and an alias, the
2240 variables, so if 'foo' is both a Python variable and an alias, the
2241 alias can not be executed until 'del foo' removes the Python variable.
2241 alias can not be executed until 'del foo' removes the Python variable.
2242
2242
2243 You can use the %l specifier in an alias definition to represent the
2243 You can use the %l specifier in an alias definition to represent the
2244 whole line when the alias is called. For example:
2244 whole line when the alias is called. For example:
2245
2245
2246 In [2]: alias all echo "Input in brackets: <%l>"\\
2246 In [2]: alias all echo "Input in brackets: <%l>"\\
2247 In [3]: all hello world\\
2247 In [3]: all hello world\\
2248 Input in brackets: <hello world>
2248 Input in brackets: <hello world>
2249
2249
2250 You can also define aliases with parameters using %s specifiers (one
2250 You can also define aliases with parameters using %s specifiers (one
2251 per parameter):
2251 per parameter):
2252
2252
2253 In [1]: alias parts echo first %s second %s\\
2253 In [1]: alias parts echo first %s second %s\\
2254 In [2]: %parts A B\\
2254 In [2]: %parts A B\\
2255 first A second B\\
2255 first A second B\\
2256 In [3]: %parts A\\
2256 In [3]: %parts A\\
2257 Incorrect number of arguments: 2 expected.\\
2257 Incorrect number of arguments: 2 expected.\\
2258 parts is an alias to: 'echo first %s second %s'
2258 parts is an alias to: 'echo first %s second %s'
2259
2259
2260 Note that %l and %s are mutually exclusive. You can only use one or
2260 Note that %l and %s are mutually exclusive. You can only use one or
2261 the other in your aliases.
2261 the other in your aliases.
2262
2262
2263 Aliases expand Python variables just like system calls using ! or !!
2263 Aliases expand Python variables just like system calls using ! or !!
2264 do: all expressions prefixed with '$' get expanded. For details of
2264 do: all expressions prefixed with '$' get expanded. For details of
2265 the semantic rules, see PEP-215:
2265 the semantic rules, see PEP-215:
2266 http://www.python.org/peps/pep-0215.html. This is the library used by
2266 http://www.python.org/peps/pep-0215.html. This is the library used by
2267 IPython for variable expansion. If you want to access a true shell
2267 IPython for variable expansion. If you want to access a true shell
2268 variable, an extra $ is necessary to prevent its expansion by IPython:
2268 variable, an extra $ is necessary to prevent its expansion by IPython:
2269
2269
2270 In [6]: alias show echo\\
2270 In [6]: alias show echo\\
2271 In [7]: PATH='A Python string'\\
2271 In [7]: PATH='A Python string'\\
2272 In [8]: show $PATH\\
2272 In [8]: show $PATH\\
2273 A Python string\\
2273 A Python string\\
2274 In [9]: show $$PATH\\
2274 In [9]: show $$PATH\\
2275 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2275 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2276
2276
2277 You can use the alias facility to acess all of $PATH. See the %rehash
2277 You can use the alias facility to acess all of $PATH. See the %rehash
2278 and %rehashx functions, which automatically create aliases for the
2278 and %rehashx functions, which automatically create aliases for the
2279 contents of your $PATH.
2279 contents of your $PATH.
2280
2280
2281 If called with no parameters, %alias prints the current alias table."""
2281 If called with no parameters, %alias prints the current alias table."""
2282
2282
2283 par = parameter_s.strip()
2283 par = parameter_s.strip()
2284 if not par:
2284 if not par:
2285 stored = self.db.get('stored_aliases', {} )
2285 stored = self.db.get('stored_aliases', {} )
2286 atab = self.shell.alias_table
2286 atab = self.shell.alias_table
2287 aliases = atab.keys()
2287 aliases = atab.keys()
2288 aliases.sort()
2288 aliases.sort()
2289 res = []
2289 res = []
2290 showlast = []
2290 showlast = []
2291 for alias in aliases:
2291 for alias in aliases:
2292 tgt = atab[alias][1]
2292 tgt = atab[alias][1]
2293 # 'interesting' aliases
2293 # 'interesting' aliases
2294 if (alias in stored or
2294 if (alias in stored or
2295 alias.lower() != os.path.splitext(tgt)[0].lower() or
2295 alias.lower() != os.path.splitext(tgt)[0].lower() or
2296 ' ' in tgt):
2296 ' ' in tgt):
2297 showlast.append((alias, tgt))
2297 showlast.append((alias, tgt))
2298 else:
2298 else:
2299 res.append((alias, tgt ))
2299 res.append((alias, tgt ))
2300
2300
2301 # show most interesting aliases last
2301 # show most interesting aliases last
2302 res.extend(showlast)
2302 res.extend(showlast)
2303 print "Total number of aliases:",len(aliases)
2303 print "Total number of aliases:",len(aliases)
2304 return res
2304 return res
2305 try:
2305 try:
2306 alias,cmd = par.split(None,1)
2306 alias,cmd = par.split(None,1)
2307 except:
2307 except:
2308 print OInspect.getdoc(self.magic_alias)
2308 print OInspect.getdoc(self.magic_alias)
2309 else:
2309 else:
2310 nargs = cmd.count('%s')
2310 nargs = cmd.count('%s')
2311 if nargs>0 and cmd.find('%l')>=0:
2311 if nargs>0 and cmd.find('%l')>=0:
2312 error('The %s and %l specifiers are mutually exclusive '
2312 error('The %s and %l specifiers are mutually exclusive '
2313 'in alias definitions.')
2313 'in alias definitions.')
2314 else: # all looks OK
2314 else: # all looks OK
2315 self.shell.alias_table[alias] = (nargs,cmd)
2315 self.shell.alias_table[alias] = (nargs,cmd)
2316 self.shell.alias_table_validate(verbose=0)
2316 self.shell.alias_table_validate(verbose=0)
2317 # end magic_alias
2317 # end magic_alias
2318
2318
2319 def magic_unalias(self, parameter_s = ''):
2319 def magic_unalias(self, parameter_s = ''):
2320 """Remove an alias"""
2320 """Remove an alias"""
2321
2321
2322 aname = parameter_s.strip()
2322 aname = parameter_s.strip()
2323 if aname in self.shell.alias_table:
2323 if aname in self.shell.alias_table:
2324 del self.shell.alias_table[aname]
2324 del self.shell.alias_table[aname]
2325 stored = self.db.get('stored_aliases', {} )
2325 stored = self.db.get('stored_aliases', {} )
2326 if aname in stored:
2326 if aname in stored:
2327 print "Removing %stored alias",aname
2327 print "Removing %stored alias",aname
2328 del stored[aname]
2328 del stored[aname]
2329 self.db['stored_aliases'] = stored
2329 self.db['stored_aliases'] = stored
2330
2330
2331
2331
2332 def magic_rehashx(self, parameter_s = ''):
2332 def magic_rehashx(self, parameter_s = ''):
2333 """Update the alias table with all executable files in $PATH.
2333 """Update the alias table with all executable files in $PATH.
2334
2334
2335 This version explicitly checks that every entry in $PATH is a file
2335 This version explicitly checks that every entry in $PATH is a file
2336 with execute access (os.X_OK), so it is much slower than %rehash.
2336 with execute access (os.X_OK), so it is much slower than %rehash.
2337
2337
2338 Under Windows, it checks executability as a match agains a
2338 Under Windows, it checks executability as a match agains a
2339 '|'-separated string of extensions, stored in the IPython config
2339 '|'-separated string of extensions, stored in the IPython config
2340 variable win_exec_ext. This defaults to 'exe|com|bat'.
2340 variable win_exec_ext. This defaults to 'exe|com|bat'.
2341
2341
2342 This function also resets the root module cache of module completer,
2342 This function also resets the root module cache of module completer,
2343 used on slow filesystems.
2343 used on slow filesystems.
2344 """
2344 """
2345
2345
2346
2346
2347 ip = self.api
2347 ip = self.api
2348
2348
2349 # for the benefit of module completer in ipy_completers.py
2349 # for the benefit of module completer in ipy_completers.py
2350 del ip.db['rootmodules']
2350 del ip.db['rootmodules']
2351
2351
2352 path = [os.path.abspath(os.path.expanduser(p)) for p in
2352 path = [os.path.abspath(os.path.expanduser(p)) for p in
2353 os.environ.get('PATH','').split(os.pathsep)]
2353 os.environ.get('PATH','').split(os.pathsep)]
2354 path = filter(os.path.isdir,path)
2354 path = filter(os.path.isdir,path)
2355
2355
2356 alias_table = self.shell.alias_table
2356 alias_table = self.shell.alias_table
2357 syscmdlist = []
2357 syscmdlist = []
2358 if os.name == 'posix':
2358 if os.name == 'posix':
2359 isexec = lambda fname:os.path.isfile(fname) and \
2359 isexec = lambda fname:os.path.isfile(fname) and \
2360 os.access(fname,os.X_OK)
2360 os.access(fname,os.X_OK)
2361 else:
2361 else:
2362
2362
2363 try:
2363 try:
2364 winext = os.environ['pathext'].replace(';','|').replace('.','')
2364 winext = os.environ['pathext'].replace(';','|').replace('.','')
2365 except KeyError:
2365 except KeyError:
2366 winext = 'exe|com|bat|py'
2366 winext = 'exe|com|bat|py'
2367 if 'py' not in winext:
2367 if 'py' not in winext:
2368 winext += '|py'
2368 winext += '|py'
2369 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2369 execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
2370 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2370 isexec = lambda fname:os.path.isfile(fname) and execre.match(fname)
2371 savedir = os.getcwd()
2371 savedir = os.getcwd()
2372 try:
2372 try:
2373 # write the whole loop for posix/Windows so we don't have an if in
2373 # write the whole loop for posix/Windows so we don't have an if in
2374 # the innermost part
2374 # the innermost part
2375 if os.name == 'posix':
2375 if os.name == 'posix':
2376 for pdir in path:
2376 for pdir in path:
2377 os.chdir(pdir)
2377 os.chdir(pdir)
2378 for ff in os.listdir(pdir):
2378 for ff in os.listdir(pdir):
2379 if isexec(ff) and ff not in self.shell.no_alias:
2379 if isexec(ff) and ff not in self.shell.no_alias:
2380 # each entry in the alias table must be (N,name),
2380 # each entry in the alias table must be (N,name),
2381 # where N is the number of positional arguments of the
2381 # where N is the number of positional arguments of the
2382 # alias.
2382 # alias.
2383 alias_table[ff] = (0,ff)
2383 alias_table[ff] = (0,ff)
2384 syscmdlist.append(ff)
2384 syscmdlist.append(ff)
2385 else:
2385 else:
2386 for pdir in path:
2386 for pdir in path:
2387 os.chdir(pdir)
2387 os.chdir(pdir)
2388 for ff in os.listdir(pdir):
2388 for ff in os.listdir(pdir):
2389 base, ext = os.path.splitext(ff)
2389 base, ext = os.path.splitext(ff)
2390 if isexec(ff) and base not in self.shell.no_alias:
2390 if isexec(ff) and base not in self.shell.no_alias:
2391 if ext.lower() == '.exe':
2391 if ext.lower() == '.exe':
2392 ff = base
2392 ff = base
2393 alias_table[base.lower()] = (0,ff)
2393 alias_table[base.lower()] = (0,ff)
2394 syscmdlist.append(ff)
2394 syscmdlist.append(ff)
2395 # Make sure the alias table doesn't contain keywords or builtins
2395 # Make sure the alias table doesn't contain keywords or builtins
2396 self.shell.alias_table_validate()
2396 self.shell.alias_table_validate()
2397 # Call again init_auto_alias() so we get 'rm -i' and other
2397 # Call again init_auto_alias() so we get 'rm -i' and other
2398 # modified aliases since %rehashx will probably clobber them
2398 # modified aliases since %rehashx will probably clobber them
2399
2399
2400 # no, we don't want them. if %rehashx clobbers them, good,
2400 # no, we don't want them. if %rehashx clobbers them, good,
2401 # we'll probably get better versions
2401 # we'll probably get better versions
2402 # self.shell.init_auto_alias()
2402 # self.shell.init_auto_alias()
2403 db = ip.db
2403 db = ip.db
2404 db['syscmdlist'] = syscmdlist
2404 db['syscmdlist'] = syscmdlist
2405 finally:
2405 finally:
2406 os.chdir(savedir)
2406 os.chdir(savedir)
2407
2407
2408 def magic_pwd(self, parameter_s = ''):
2408 def magic_pwd(self, parameter_s = ''):
2409 """Return the current working directory path."""
2409 """Return the current working directory path."""
2410 return os.getcwd()
2410 return os.getcwd()
2411
2411
2412 def magic_cd(self, parameter_s=''):
2412 def magic_cd(self, parameter_s=''):
2413 """Change the current working directory.
2413 """Change the current working directory.
2414
2414
2415 This command automatically maintains an internal list of directories
2415 This command automatically maintains an internal list of directories
2416 you visit during your IPython session, in the variable _dh. The
2416 you visit during your IPython session, in the variable _dh. The
2417 command %dhist shows this history nicely formatted. You can also
2417 command %dhist shows this history nicely formatted. You can also
2418 do 'cd -<tab>' to see directory history conveniently.
2418 do 'cd -<tab>' to see directory history conveniently.
2419
2419
2420 Usage:
2420 Usage:
2421
2421
2422 cd 'dir': changes to directory 'dir'.
2422 cd 'dir': changes to directory 'dir'.
2423
2423
2424 cd -: changes to the last visited directory.
2424 cd -: changes to the last visited directory.
2425
2425
2426 cd -<n>: changes to the n-th directory in the directory history.
2426 cd -<n>: changes to the n-th directory in the directory history.
2427
2427
2428 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2428 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
2429 (note: cd <bookmark_name> is enough if there is no
2429 (note: cd <bookmark_name> is enough if there is no
2430 directory <bookmark_name>, but a bookmark with the name exists.)
2430 directory <bookmark_name>, but a bookmark with the name exists.)
2431 'cd -b <tab>' allows you to tab-complete bookmark names.
2431 'cd -b <tab>' allows you to tab-complete bookmark names.
2432
2432
2433 Options:
2433 Options:
2434
2434
2435 -q: quiet. Do not print the working directory after the cd command is
2435 -q: quiet. Do not print the working directory after the cd command is
2436 executed. By default IPython's cd command does print this directory,
2436 executed. By default IPython's cd command does print this directory,
2437 since the default prompts do not display path information.
2437 since the default prompts do not display path information.
2438
2438
2439 Note that !cd doesn't work for this purpose because the shell where
2439 Note that !cd doesn't work for this purpose because the shell where
2440 !command runs is immediately discarded after executing 'command'."""
2440 !command runs is immediately discarded after executing 'command'."""
2441
2441
2442 parameter_s = parameter_s.strip()
2442 parameter_s = parameter_s.strip()
2443 #bkms = self.shell.persist.get("bookmarks",{})
2443 #bkms = self.shell.persist.get("bookmarks",{})
2444
2444
2445 numcd = re.match(r'(-)(\d+)$',parameter_s)
2445 numcd = re.match(r'(-)(\d+)$',parameter_s)
2446 # jump in directory history by number
2446 # jump in directory history by number
2447 if numcd:
2447 if numcd:
2448 nn = int(numcd.group(2))
2448 nn = int(numcd.group(2))
2449 try:
2449 try:
2450 ps = self.shell.user_ns['_dh'][nn]
2450 ps = self.shell.user_ns['_dh'][nn]
2451 except IndexError:
2451 except IndexError:
2452 print 'The requested directory does not exist in history.'
2452 print 'The requested directory does not exist in history.'
2453 return
2453 return
2454 else:
2454 else:
2455 opts = {}
2455 opts = {}
2456 else:
2456 else:
2457 #turn all non-space-escaping backslashes to slashes,
2457 #turn all non-space-escaping backslashes to slashes,
2458 # for c:\windows\directory\names\
2458 # for c:\windows\directory\names\
2459 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2459 parameter_s = re.sub(r'\\(?! )','/', parameter_s)
2460 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2460 opts,ps = self.parse_options(parameter_s,'qb',mode='string')
2461 # jump to previous
2461 # jump to previous
2462 if ps == '-':
2462 if ps == '-':
2463 try:
2463 try:
2464 ps = self.shell.user_ns['_dh'][-2]
2464 ps = self.shell.user_ns['_dh'][-2]
2465 except IndexError:
2465 except IndexError:
2466 print 'No previous directory to change to.'
2466 print 'No previous directory to change to.'
2467 return
2467 return
2468 # jump to bookmark if needed
2468 # jump to bookmark if needed
2469 else:
2469 else:
2470 if not os.path.isdir(ps) or opts.has_key('b'):
2470 if not os.path.isdir(ps) or opts.has_key('b'):
2471 bkms = self.db.get('bookmarks', {})
2471 bkms = self.db.get('bookmarks', {})
2472
2472
2473 if bkms.has_key(ps):
2473 if bkms.has_key(ps):
2474 target = bkms[ps]
2474 target = bkms[ps]
2475 print '(bookmark:%s) -> %s' % (ps,target)
2475 print '(bookmark:%s) -> %s' % (ps,target)
2476 ps = target
2476 ps = target
2477 else:
2477 else:
2478 if opts.has_key('b'):
2478 if opts.has_key('b'):
2479 error("Bookmark '%s' not found. "
2479 error("Bookmark '%s' not found. "
2480 "Use '%%bookmark -l' to see your bookmarks." % ps)
2480 "Use '%%bookmark -l' to see your bookmarks." % ps)
2481 return
2481 return
2482
2482
2483 # at this point ps should point to the target dir
2483 # at this point ps should point to the target dir
2484 if ps:
2484 if ps:
2485 try:
2485 try:
2486 os.chdir(os.path.expanduser(ps))
2486 os.chdir(os.path.expanduser(ps))
2487 if self.shell.rc.term_title:
2487 if self.shell.rc.term_title:
2488 #print 'set term title:',self.shell.rc.term_title # dbg
2488 #print 'set term title:',self.shell.rc.term_title # dbg
2489 ttitle = ("IPy:" + (
2489 ttitle = ("IPy:" + (
2490 os.getcwd() == '/' and '/' or \
2490 os.getcwd() == '/' and '/' or \
2491 os.path.basename(os.getcwd())))
2491 os.path.basename(os.getcwd())))
2492 platutils.set_term_title(ttitle)
2492 platutils.set_term_title(ttitle)
2493 except OSError:
2493 except OSError:
2494 print sys.exc_info()[1]
2494 print sys.exc_info()[1]
2495 else:
2495 else:
2496 cwd = os.getcwd()
2496 cwd = os.getcwd()
2497 dhist = self.shell.user_ns['_dh']
2497 dhist = self.shell.user_ns['_dh']
2498 dhist.append(cwd)
2498 dhist.append(cwd)
2499 self.db['dhist'] = compress_dhist(dhist)[-100:]
2499 self.db['dhist'] = compress_dhist(dhist)[-100:]
2500
2500
2501 else:
2501 else:
2502 os.chdir(self.shell.home_dir)
2502 os.chdir(self.shell.home_dir)
2503 if self.shell.rc.term_title:
2503 if self.shell.rc.term_title:
2504 platutils.set_term_title("IPy:~")
2504 platutils.set_term_title("IPy:~")
2505 cwd = os.getcwd()
2505 cwd = os.getcwd()
2506 dhist = self.shell.user_ns['_dh']
2506 dhist = self.shell.user_ns['_dh']
2507 dhist.append(cwd)
2507 dhist.append(cwd)
2508 self.db['dhist'] = compress_dhist(dhist)[-100:]
2508 self.db['dhist'] = compress_dhist(dhist)[-100:]
2509 if not 'q' in opts:
2509 if not 'q' in opts:
2510 print self.shell.user_ns['_dh'][-1]
2510 print self.shell.user_ns['_dh'][-1]
2511
2511
2512
2512
2513 def magic_env(self, parameter_s=''):
2513 def magic_env(self, parameter_s=''):
2514 """List environment variables."""
2514 """List environment variables."""
2515
2515
2516 return os.environ.data
2516 return os.environ.data
2517
2517
2518 def magic_pushd(self, parameter_s=''):
2518 def magic_pushd(self, parameter_s=''):
2519 """Place the current dir on stack and change directory.
2519 """Place the current dir on stack and change directory.
2520
2520
2521 Usage:\\
2521 Usage:\\
2522 %pushd ['dirname']
2522 %pushd ['dirname']
2523
2523
2524 %pushd with no arguments does a %pushd to your home directory.
2524 %pushd with no arguments does a %pushd to your home directory.
2525 """
2525 """
2526 if parameter_s == '': parameter_s = '~'
2526 if parameter_s == '': parameter_s = '~'
2527 dir_s = self.shell.dir_stack
2527 dir_s = self.shell.dir_stack
2528 if len(dir_s)>0 and os.path.expanduser(parameter_s) != \
2528 if len(dir_s)>0 and os.path.expanduser(parameter_s) != \
2529 os.path.expanduser(self.shell.dir_stack[0]):
2529 os.path.expanduser(self.shell.dir_stack[0]):
2530 try:
2530 try:
2531 self.magic_cd(parameter_s)
2531 self.magic_cd(parameter_s)
2532 dir_s.insert(0,os.getcwd().replace(self.home_dir,'~'))
2532 dir_s.insert(0,os.getcwd().replace(self.home_dir,'~'))
2533 self.magic_dirs()
2533 self.magic_dirs()
2534 except:
2534 except:
2535 print 'Invalid directory'
2535 print 'Invalid directory'
2536 else:
2536 else:
2537 print 'You are already there!'
2537 print 'You are already there!'
2538
2538
2539 def magic_popd(self, parameter_s=''):
2539 def magic_popd(self, parameter_s=''):
2540 """Change to directory popped off the top of the stack.
2540 """Change to directory popped off the top of the stack.
2541 """
2541 """
2542 if len (self.shell.dir_stack) > 1:
2542 if len (self.shell.dir_stack) > 1:
2543 self.shell.dir_stack.pop(0)
2543 self.shell.dir_stack.pop(0)
2544 self.magic_cd(self.shell.dir_stack[0])
2544 self.magic_cd(self.shell.dir_stack[0])
2545 print self.shell.dir_stack[0]
2545 print self.shell.dir_stack[0]
2546 else:
2546 else:
2547 print "You can't remove the starting directory from the stack:",\
2547 print "You can't remove the starting directory from the stack:",\
2548 self.shell.dir_stack
2548 self.shell.dir_stack
2549
2549
2550 def magic_dirs(self, parameter_s=''):
2550 def magic_dirs(self, parameter_s=''):
2551 """Return the current directory stack."""
2551 """Return the current directory stack."""
2552
2552
2553 return self.shell.dir_stack[:]
2553 return self.shell.dir_stack[:]
2554
2554
2555 def magic_sc(self, parameter_s=''):
2555 def magic_sc(self, parameter_s=''):
2556 """Shell capture - execute a shell command and capture its output.
2556 """Shell capture - execute a shell command and capture its output.
2557
2557
2558 DEPRECATED. Suboptimal, retained for backwards compatibility.
2558 DEPRECATED. Suboptimal, retained for backwards compatibility.
2559
2559
2560 You should use the form 'var = !command' instead. Example:
2560 You should use the form 'var = !command' instead. Example:
2561
2561
2562 "%sc -l myfiles = ls ~" should now be written as
2562 "%sc -l myfiles = ls ~" should now be written as
2563
2563
2564 "myfiles = !ls ~"
2564 "myfiles = !ls ~"
2565
2565
2566 myfiles.s, myfiles.l and myfiles.n still apply as documented
2566 myfiles.s, myfiles.l and myfiles.n still apply as documented
2567 below.
2567 below.
2568
2568
2569 --
2569 --
2570 %sc [options] varname=command
2570 %sc [options] varname=command
2571
2571
2572 IPython will run the given command using commands.getoutput(), and
2572 IPython will run the given command using commands.getoutput(), and
2573 will then update the user's interactive namespace with a variable
2573 will then update the user's interactive namespace with a variable
2574 called varname, containing the value of the call. Your command can
2574 called varname, containing the value of the call. Your command can
2575 contain shell wildcards, pipes, etc.
2575 contain shell wildcards, pipes, etc.
2576
2576
2577 The '=' sign in the syntax is mandatory, and the variable name you
2577 The '=' sign in the syntax is mandatory, and the variable name you
2578 supply must follow Python's standard conventions for valid names.
2578 supply must follow Python's standard conventions for valid names.
2579
2579
2580 (A special format without variable name exists for internal use)
2580 (A special format without variable name exists for internal use)
2581
2581
2582 Options:
2582 Options:
2583
2583
2584 -l: list output. Split the output on newlines into a list before
2584 -l: list output. Split the output on newlines into a list before
2585 assigning it to the given variable. By default the output is stored
2585 assigning it to the given variable. By default the output is stored
2586 as a single string.
2586 as a single string.
2587
2587
2588 -v: verbose. Print the contents of the variable.
2588 -v: verbose. Print the contents of the variable.
2589
2589
2590 In most cases you should not need to split as a list, because the
2590 In most cases you should not need to split as a list, because the
2591 returned value is a special type of string which can automatically
2591 returned value is a special type of string which can automatically
2592 provide its contents either as a list (split on newlines) or as a
2592 provide its contents either as a list (split on newlines) or as a
2593 space-separated string. These are convenient, respectively, either
2593 space-separated string. These are convenient, respectively, either
2594 for sequential processing or to be passed to a shell command.
2594 for sequential processing or to be passed to a shell command.
2595
2595
2596 For example:
2596 For example:
2597
2597
2598 # Capture into variable a
2598 # Capture into variable a
2599 In [9]: sc a=ls *py
2599 In [9]: sc a=ls *py
2600
2600
2601 # a is a string with embedded newlines
2601 # a is a string with embedded newlines
2602 In [10]: a
2602 In [10]: a
2603 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2603 Out[10]: 'setup.py\nwin32_manual_post_install.py'
2604
2604
2605 # which can be seen as a list:
2605 # which can be seen as a list:
2606 In [11]: a.l
2606 In [11]: a.l
2607 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2607 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2608
2608
2609 # or as a whitespace-separated string:
2609 # or as a whitespace-separated string:
2610 In [12]: a.s
2610 In [12]: a.s
2611 Out[12]: 'setup.py win32_manual_post_install.py'
2611 Out[12]: 'setup.py win32_manual_post_install.py'
2612
2612
2613 # a.s is useful to pass as a single command line:
2613 # a.s is useful to pass as a single command line:
2614 In [13]: !wc -l $a.s
2614 In [13]: !wc -l $a.s
2615 146 setup.py
2615 146 setup.py
2616 130 win32_manual_post_install.py
2616 130 win32_manual_post_install.py
2617 276 total
2617 276 total
2618
2618
2619 # while the list form is useful to loop over:
2619 # while the list form is useful to loop over:
2620 In [14]: for f in a.l:
2620 In [14]: for f in a.l:
2621 ....: !wc -l $f
2621 ....: !wc -l $f
2622 ....:
2622 ....:
2623 146 setup.py
2623 146 setup.py
2624 130 win32_manual_post_install.py
2624 130 win32_manual_post_install.py
2625
2625
2626 Similiarly, the lists returned by the -l option are also special, in
2626 Similiarly, the lists returned by the -l option are also special, in
2627 the sense that you can equally invoke the .s attribute on them to
2627 the sense that you can equally invoke the .s attribute on them to
2628 automatically get a whitespace-separated string from their contents:
2628 automatically get a whitespace-separated string from their contents:
2629
2629
2630 In [1]: sc -l b=ls *py
2630 In [1]: sc -l b=ls *py
2631
2631
2632 In [2]: b
2632 In [2]: b
2633 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2633 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2634
2634
2635 In [3]: b.s
2635 In [3]: b.s
2636 Out[3]: 'setup.py win32_manual_post_install.py'
2636 Out[3]: 'setup.py win32_manual_post_install.py'
2637
2637
2638 In summary, both the lists and strings used for ouptut capture have
2638 In summary, both the lists and strings used for ouptut capture have
2639 the following special attributes:
2639 the following special attributes:
2640
2640
2641 .l (or .list) : value as list.
2641 .l (or .list) : value as list.
2642 .n (or .nlstr): value as newline-separated string.
2642 .n (or .nlstr): value as newline-separated string.
2643 .s (or .spstr): value as space-separated string.
2643 .s (or .spstr): value as space-separated string.
2644 """
2644 """
2645
2645
2646 opts,args = self.parse_options(parameter_s,'lv')
2646 opts,args = self.parse_options(parameter_s,'lv')
2647 # Try to get a variable name and command to run
2647 # Try to get a variable name and command to run
2648 try:
2648 try:
2649 # the variable name must be obtained from the parse_options
2649 # the variable name must be obtained from the parse_options
2650 # output, which uses shlex.split to strip options out.
2650 # output, which uses shlex.split to strip options out.
2651 var,_ = args.split('=',1)
2651 var,_ = args.split('=',1)
2652 var = var.strip()
2652 var = var.strip()
2653 # But the the command has to be extracted from the original input
2653 # But the the command has to be extracted from the original input
2654 # parameter_s, not on what parse_options returns, to avoid the
2654 # parameter_s, not on what parse_options returns, to avoid the
2655 # quote stripping which shlex.split performs on it.
2655 # quote stripping which shlex.split performs on it.
2656 _,cmd = parameter_s.split('=',1)
2656 _,cmd = parameter_s.split('=',1)
2657 except ValueError:
2657 except ValueError:
2658 var,cmd = '',''
2658 var,cmd = '',''
2659 # If all looks ok, proceed
2659 # If all looks ok, proceed
2660 out,err = self.shell.getoutputerror(cmd)
2660 out,err = self.shell.getoutputerror(cmd)
2661 if err:
2661 if err:
2662 print >> Term.cerr,err
2662 print >> Term.cerr,err
2663 if opts.has_key('l'):
2663 if opts.has_key('l'):
2664 out = SList(out.split('\n'))
2664 out = SList(out.split('\n'))
2665 else:
2665 else:
2666 out = LSString(out)
2666 out = LSString(out)
2667 if opts.has_key('v'):
2667 if opts.has_key('v'):
2668 print '%s ==\n%s' % (var,pformat(out))
2668 print '%s ==\n%s' % (var,pformat(out))
2669 if var:
2669 if var:
2670 self.shell.user_ns.update({var:out})
2670 self.shell.user_ns.update({var:out})
2671 else:
2671 else:
2672 return out
2672 return out
2673
2673
2674 def magic_sx(self, parameter_s=''):
2674 def magic_sx(self, parameter_s=''):
2675 """Shell execute - run a shell command and capture its output.
2675 """Shell execute - run a shell command and capture its output.
2676
2676
2677 %sx command
2677 %sx command
2678
2678
2679 IPython will run the given command using commands.getoutput(), and
2679 IPython will run the given command using commands.getoutput(), and
2680 return the result formatted as a list (split on '\\n'). Since the
2680 return the result formatted as a list (split on '\\n'). Since the
2681 output is _returned_, it will be stored in ipython's regular output
2681 output is _returned_, it will be stored in ipython's regular output
2682 cache Out[N] and in the '_N' automatic variables.
2682 cache Out[N] and in the '_N' automatic variables.
2683
2683
2684 Notes:
2684 Notes:
2685
2685
2686 1) If an input line begins with '!!', then %sx is automatically
2686 1) If an input line begins with '!!', then %sx is automatically
2687 invoked. That is, while:
2687 invoked. That is, while:
2688 !ls
2688 !ls
2689 causes ipython to simply issue system('ls'), typing
2689 causes ipython to simply issue system('ls'), typing
2690 !!ls
2690 !!ls
2691 is a shorthand equivalent to:
2691 is a shorthand equivalent to:
2692 %sx ls
2692 %sx ls
2693
2693
2694 2) %sx differs from %sc in that %sx automatically splits into a list,
2694 2) %sx differs from %sc in that %sx automatically splits into a list,
2695 like '%sc -l'. The reason for this is to make it as easy as possible
2695 like '%sc -l'. The reason for this is to make it as easy as possible
2696 to process line-oriented shell output via further python commands.
2696 to process line-oriented shell output via further python commands.
2697 %sc is meant to provide much finer control, but requires more
2697 %sc is meant to provide much finer control, but requires more
2698 typing.
2698 typing.
2699
2699
2700 3) Just like %sc -l, this is a list with special attributes:
2700 3) Just like %sc -l, this is a list with special attributes:
2701
2701
2702 .l (or .list) : value as list.
2702 .l (or .list) : value as list.
2703 .n (or .nlstr): value as newline-separated string.
2703 .n (or .nlstr): value as newline-separated string.
2704 .s (or .spstr): value as whitespace-separated string.
2704 .s (or .spstr): value as whitespace-separated string.
2705
2705
2706 This is very useful when trying to use such lists as arguments to
2706 This is very useful when trying to use such lists as arguments to
2707 system commands."""
2707 system commands."""
2708
2708
2709 if parameter_s:
2709 if parameter_s:
2710 out,err = self.shell.getoutputerror(parameter_s)
2710 out,err = self.shell.getoutputerror(parameter_s)
2711 if err:
2711 if err:
2712 print >> Term.cerr,err
2712 print >> Term.cerr,err
2713 return SList(out.split('\n'))
2713 return SList(out.split('\n'))
2714
2714
2715 def magic_bg(self, parameter_s=''):
2715 def magic_bg(self, parameter_s=''):
2716 """Run a job in the background, in a separate thread.
2716 """Run a job in the background, in a separate thread.
2717
2717
2718 For example,
2718 For example,
2719
2719
2720 %bg myfunc(x,y,z=1)
2720 %bg myfunc(x,y,z=1)
2721
2721
2722 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2722 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
2723 execution starts, a message will be printed indicating the job
2723 execution starts, a message will be printed indicating the job
2724 number. If your job number is 5, you can use
2724 number. If your job number is 5, you can use
2725
2725
2726 myvar = jobs.result(5) or myvar = jobs[5].result
2726 myvar = jobs.result(5) or myvar = jobs[5].result
2727
2727
2728 to assign this result to variable 'myvar'.
2728 to assign this result to variable 'myvar'.
2729
2729
2730 IPython has a job manager, accessible via the 'jobs' object. You can
2730 IPython has a job manager, accessible via the 'jobs' object. You can
2731 type jobs? to get more information about it, and use jobs.<TAB> to see
2731 type jobs? to get more information about it, and use jobs.<TAB> to see
2732 its attributes. All attributes not starting with an underscore are
2732 its attributes. All attributes not starting with an underscore are
2733 meant for public use.
2733 meant for public use.
2734
2734
2735 In particular, look at the jobs.new() method, which is used to create
2735 In particular, look at the jobs.new() method, which is used to create
2736 new jobs. This magic %bg function is just a convenience wrapper
2736 new jobs. This magic %bg function is just a convenience wrapper
2737 around jobs.new(), for expression-based jobs. If you want to create a
2737 around jobs.new(), for expression-based jobs. If you want to create a
2738 new job with an explicit function object and arguments, you must call
2738 new job with an explicit function object and arguments, you must call
2739 jobs.new() directly.
2739 jobs.new() directly.
2740
2740
2741 The jobs.new docstring also describes in detail several important
2741 The jobs.new docstring also describes in detail several important
2742 caveats associated with a thread-based model for background job
2742 caveats associated with a thread-based model for background job
2743 execution. Type jobs.new? for details.
2743 execution. Type jobs.new? for details.
2744
2744
2745 You can check the status of all jobs with jobs.status().
2745 You can check the status of all jobs with jobs.status().
2746
2746
2747 The jobs variable is set by IPython into the Python builtin namespace.
2747 The jobs variable is set by IPython into the Python builtin namespace.
2748 If you ever declare a variable named 'jobs', you will shadow this
2748 If you ever declare a variable named 'jobs', you will shadow this
2749 name. You can either delete your global jobs variable to regain
2749 name. You can either delete your global jobs variable to regain
2750 access to the job manager, or make a new name and assign it manually
2750 access to the job manager, or make a new name and assign it manually
2751 to the manager (stored in IPython's namespace). For example, to
2751 to the manager (stored in IPython's namespace). For example, to
2752 assign the job manager to the Jobs name, use:
2752 assign the job manager to the Jobs name, use:
2753
2753
2754 Jobs = __builtins__.jobs"""
2754 Jobs = __builtins__.jobs"""
2755
2755
2756 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2756 self.shell.jobs.new(parameter_s,self.shell.user_ns)
2757
2757
2758
2758
2759 def magic_bookmark(self, parameter_s=''):
2759 def magic_bookmark(self, parameter_s=''):
2760 """Manage IPython's bookmark system.
2760 """Manage IPython's bookmark system.
2761
2761
2762 %bookmark <name> - set bookmark to current dir
2762 %bookmark <name> - set bookmark to current dir
2763 %bookmark <name> <dir> - set bookmark to <dir>
2763 %bookmark <name> <dir> - set bookmark to <dir>
2764 %bookmark -l - list all bookmarks
2764 %bookmark -l - list all bookmarks
2765 %bookmark -d <name> - remove bookmark
2765 %bookmark -d <name> - remove bookmark
2766 %bookmark -r - remove all bookmarks
2766 %bookmark -r - remove all bookmarks
2767
2767
2768 You can later on access a bookmarked folder with:
2768 You can later on access a bookmarked folder with:
2769 %cd -b <name>
2769 %cd -b <name>
2770 or simply '%cd <name>' if there is no directory called <name> AND
2770 or simply '%cd <name>' if there is no directory called <name> AND
2771 there is such a bookmark defined.
2771 there is such a bookmark defined.
2772
2772
2773 Your bookmarks persist through IPython sessions, but they are
2773 Your bookmarks persist through IPython sessions, but they are
2774 associated with each profile."""
2774 associated with each profile."""
2775
2775
2776 opts,args = self.parse_options(parameter_s,'drl',mode='list')
2776 opts,args = self.parse_options(parameter_s,'drl',mode='list')
2777 if len(args) > 2:
2777 if len(args) > 2:
2778 error('You can only give at most two arguments')
2778 error('You can only give at most two arguments')
2779 return
2779 return
2780
2780
2781 bkms = self.db.get('bookmarks',{})
2781 bkms = self.db.get('bookmarks',{})
2782
2782
2783 if opts.has_key('d'):
2783 if opts.has_key('d'):
2784 try:
2784 try:
2785 todel = args[0]
2785 todel = args[0]
2786 except IndexError:
2786 except IndexError:
2787 error('You must provide a bookmark to delete')
2787 error('You must provide a bookmark to delete')
2788 else:
2788 else:
2789 try:
2789 try:
2790 del bkms[todel]
2790 del bkms[todel]
2791 except:
2791 except:
2792 error("Can't delete bookmark '%s'" % todel)
2792 error("Can't delete bookmark '%s'" % todel)
2793 elif opts.has_key('r'):
2793 elif opts.has_key('r'):
2794 bkms = {}
2794 bkms = {}
2795 elif opts.has_key('l'):
2795 elif opts.has_key('l'):
2796 bks = bkms.keys()
2796 bks = bkms.keys()
2797 bks.sort()
2797 bks.sort()
2798 if bks:
2798 if bks:
2799 size = max(map(len,bks))
2799 size = max(map(len,bks))
2800 else:
2800 else:
2801 size = 0
2801 size = 0
2802 fmt = '%-'+str(size)+'s -> %s'
2802 fmt = '%-'+str(size)+'s -> %s'
2803 print 'Current bookmarks:'
2803 print 'Current bookmarks:'
2804 for bk in bks:
2804 for bk in bks:
2805 print fmt % (bk,bkms[bk])
2805 print fmt % (bk,bkms[bk])
2806 else:
2806 else:
2807 if not args:
2807 if not args:
2808 error("You must specify the bookmark name")
2808 error("You must specify the bookmark name")
2809 elif len(args)==1:
2809 elif len(args)==1:
2810 bkms[args[0]] = os.getcwd()
2810 bkms[args[0]] = os.getcwd()
2811 elif len(args)==2:
2811 elif len(args)==2:
2812 bkms[args[0]] = args[1]
2812 bkms[args[0]] = args[1]
2813 self.db['bookmarks'] = bkms
2813 self.db['bookmarks'] = bkms
2814
2814
2815 def magic_pycat(self, parameter_s=''):
2815 def magic_pycat(self, parameter_s=''):
2816 """Show a syntax-highlighted file through a pager.
2816 """Show a syntax-highlighted file through a pager.
2817
2817
2818 This magic is similar to the cat utility, but it will assume the file
2818 This magic is similar to the cat utility, but it will assume the file
2819 to be Python source and will show it with syntax highlighting. """
2819 to be Python source and will show it with syntax highlighting. """
2820
2820
2821 try:
2821 try:
2822 filename = get_py_filename(parameter_s)
2822 filename = get_py_filename(parameter_s)
2823 cont = file_read(filename)
2823 cont = file_read(filename)
2824 except IOError:
2824 except IOError:
2825 try:
2825 try:
2826 cont = eval(parameter_s,self.user_ns)
2826 cont = eval(parameter_s,self.user_ns)
2827 except NameError:
2827 except NameError:
2828 cont = None
2828 cont = None
2829 if cont is None:
2829 if cont is None:
2830 print "Error: no such file or variable"
2830 print "Error: no such file or variable"
2831 return
2831 return
2832
2832
2833 page(self.shell.pycolorize(cont),
2833 page(self.shell.pycolorize(cont),
2834 screen_lines=self.shell.rc.screen_length)
2834 screen_lines=self.shell.rc.screen_length)
2835
2835
2836 def magic_cpaste(self, parameter_s=''):
2836 def magic_cpaste(self, parameter_s=''):
2837 """Allows you to paste & execute a pre-formatted code block from clipboard
2837 """Allows you to paste & execute a pre-formatted code block from clipboard
2838
2838
2839 You must terminate the block with '--' (two minus-signs) alone on the
2839 You must terminate the block with '--' (two minus-signs) alone on the
2840 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
2840 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
2841 is the new sentinel for this operation)
2841 is the new sentinel for this operation)
2842
2842
2843 The block is dedented prior to execution to enable execution of method
2843 The block is dedented prior to execution to enable execution of method
2844 definitions. '>' and '+' characters at the beginning of a line are
2844 definitions. '>' and '+' characters at the beginning of a line are
2845 ignored, to allow pasting directly from e-mails or diff files. The
2845 ignored, to allow pasting directly from e-mails or diff files. The
2846 executed block is also assigned to variable named 'pasted_block' for
2846 executed block is also assigned to variable named 'pasted_block' for
2847 later editing with '%edit pasted_block'.
2847 later editing with '%edit pasted_block'.
2848
2848
2849 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
2849 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
2850 This assigns the pasted block to variable 'foo' as string, without
2850 This assigns the pasted block to variable 'foo' as string, without
2851 dedenting or executing it.
2851 dedenting or executing it.
2852
2852
2853 Do not be alarmed by garbled output on Windows (it's a readline bug).
2853 Do not be alarmed by garbled output on Windows (it's a readline bug).
2854 Just press enter and type -- (and press enter again) and the block
2854 Just press enter and type -- (and press enter again) and the block
2855 will be what was just pasted.
2855 will be what was just pasted.
2856
2856
2857 IPython statements (magics, shell escapes) are not supported (yet).
2857 IPython statements (magics, shell escapes) are not supported (yet).
2858 """
2858 """
2859 opts,args = self.parse_options(parameter_s,'s:',mode='string')
2859 opts,args = self.parse_options(parameter_s,'s:',mode='string')
2860 par = args.strip()
2860 par = args.strip()
2861 sentinel = opts.get('s','--')
2861 sentinel = opts.get('s','--')
2862
2862
2863 from IPython import iplib
2863 from IPython import iplib
2864 lines = []
2864 lines = []
2865 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
2865 print "Pasting code; enter '%s' alone on the line to stop." % sentinel
2866 while 1:
2866 while 1:
2867 l = iplib.raw_input_original(':')
2867 l = iplib.raw_input_original(':')
2868 if l ==sentinel:
2868 if l ==sentinel:
2869 break
2869 break
2870 lines.append(l.lstrip('>').lstrip('+'))
2870 lines.append(l.lstrip('>').lstrip('+'))
2871 block = "\n".join(lines) + '\n'
2871 block = "\n".join(lines) + '\n'
2872 #print "block:\n",block
2872 #print "block:\n",block
2873 if not par:
2873 if not par:
2874 b = textwrap.dedent(block)
2874 b = textwrap.dedent(block)
2875 exec b in self.user_ns
2875 exec b in self.user_ns
2876 self.user_ns['pasted_block'] = b
2876 self.user_ns['pasted_block'] = b
2877 else:
2877 else:
2878 self.user_ns[par] = block
2878 self.user_ns[par] = block
2879 print "Block assigned to '%s'" % par
2879 print "Block assigned to '%s'" % par
2880
2880
2881 def magic_quickref(self,arg):
2881 def magic_quickref(self,arg):
2882 """ Show a quick reference sheet """
2882 """ Show a quick reference sheet """
2883 import IPython.usage
2883 import IPython.usage
2884 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
2884 qr = IPython.usage.quick_reference + self.magic_magic('-brief')
2885
2885
2886 page(qr)
2886 page(qr)
2887
2887
2888 def magic_upgrade(self,arg):
2888 def magic_upgrade(self,arg):
2889 """ Upgrade your IPython installation
2889 """ Upgrade your IPython installation
2890
2890
2891 This will copy the config files that don't yet exist in your
2891 This will copy the config files that don't yet exist in your
2892 ipython dir from the system config dir. Use this after upgrading
2892 ipython dir from the system config dir. Use this after upgrading
2893 IPython if you don't wish to delete your .ipython dir.
2893 IPython if you don't wish to delete your .ipython dir.
2894
2894
2895 Call with -nolegacy to get rid of ipythonrc* files (recommended for
2895 Call with -nolegacy to get rid of ipythonrc* files (recommended for
2896 new users)
2896 new users)
2897
2897
2898 """
2898 """
2899 ip = self.getapi()
2899 ip = self.getapi()
2900 ipinstallation = path(IPython.__file__).dirname()
2900 ipinstallation = path(IPython.__file__).dirname()
2901 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
2901 upgrade_script = '%s "%s"' % (sys.executable,ipinstallation / 'upgrade_dir.py')
2902 src_config = ipinstallation / 'UserConfig'
2902 src_config = ipinstallation / 'UserConfig'
2903 userdir = path(ip.options.ipythondir)
2903 userdir = path(ip.options.ipythondir)
2904 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
2904 cmd = '%s "%s" "%s"' % (upgrade_script, src_config, userdir)
2905 print ">",cmd
2905 print ">",cmd
2906 shell(cmd)
2906 shell(cmd)
2907 if arg == '-nolegacy':
2907 if arg == '-nolegacy':
2908 legacy = userdir.files('ipythonrc*')
2908 legacy = userdir.files('ipythonrc*')
2909 print "Nuking legacy files:",legacy
2909 print "Nuking legacy files:",legacy
2910
2910
2911 [p.remove() for p in legacy]
2911 [p.remove() for p in legacy]
2912 suffix = (sys.platform == 'win32' and '.ini' or '')
2912 suffix = (sys.platform == 'win32' and '.ini' or '')
2913 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
2913 (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n')
2914
2914
2915
2915
2916 def magic_doctest_mode(self,parameter_s=''):
2916 def magic_doctest_mode(self,parameter_s=''):
2917 """Toggle doctest mode on and off.
2917 """Toggle doctest mode on and off.
2918
2918
2919 This mode allows you to toggle the prompt behavior between normal
2919 This mode allows you to toggle the prompt behavior between normal
2920 IPython prompts and ones that are as similar to the default IPython
2920 IPython prompts and ones that are as similar to the default IPython
2921 interpreter as possible.
2921 interpreter as possible.
2922
2922
2923 It also supports the pasting of code snippets that have leading '>>>'
2923 It also supports the pasting of code snippets that have leading '>>>'
2924 and '...' prompts in them. This means that you can paste doctests from
2924 and '...' prompts in them. This means that you can paste doctests from
2925 files or docstrings (even if they have leading whitespace), and the
2925 files or docstrings (even if they have leading whitespace), and the
2926 code will execute correctly. You can then use '%history -tn' to see
2926 code will execute correctly. You can then use '%history -tn' to see
2927 the translated history without line numbers; this will give you the
2927 the translated history without line numbers; this will give you the
2928 input after removal of all the leading prompts and whitespace, which
2928 input after removal of all the leading prompts and whitespace, which
2929 can be pasted back into an editor.
2929 can be pasted back into an editor.
2930
2930
2931 With these features, you can switch into this mode easily whenever you
2931 With these features, you can switch into this mode easily whenever you
2932 need to do testing and changes to doctests, without having to leave
2932 need to do testing and changes to doctests, without having to leave
2933 your existing IPython session.
2933 your existing IPython session.
2934 """
2934 """
2935
2935
2936 # XXX - Fix this to have cleaner activate/deactivate calls.
2936 # XXX - Fix this to have cleaner activate/deactivate calls.
2937 from IPython.Extensions import InterpreterPasteInput as ipaste
2937 from IPython.Extensions import InterpreterPasteInput as ipaste
2938 from IPython.ipstruct import Struct
2938 from IPython.ipstruct import Struct
2939
2939
2940 # Shorthands
2940 # Shorthands
2941 shell = self.shell
2941 shell = self.shell
2942 oc = shell.outputcache
2942 oc = shell.outputcache
2943 rc = shell.rc
2943 rc = shell.rc
2944 meta = shell.meta
2944 meta = shell.meta
2945 # dstore is a data store kept in the instance metadata bag to track any
2945 # dstore is a data store kept in the instance metadata bag to track any
2946 # changes we make, so we can undo them later.
2946 # changes we make, so we can undo them later.
2947 dstore = meta.setdefault('doctest_mode',Struct())
2947 dstore = meta.setdefault('doctest_mode',Struct())
2948 save_dstore = dstore.setdefault
2948 save_dstore = dstore.setdefault
2949
2949
2950 # save a few values we'll need to recover later
2950 # save a few values we'll need to recover later
2951 mode = save_dstore('mode',False)
2951 mode = save_dstore('mode',False)
2952 save_dstore('rc_pprint',rc.pprint)
2952 save_dstore('rc_pprint',rc.pprint)
2953 save_dstore('xmode',shell.InteractiveTB.mode)
2953 save_dstore('xmode',shell.InteractiveTB.mode)
2954 save_dstore('rc_separate_in',rc.separate_in)
2954 save_dstore('rc_separate_in',rc.separate_in)
2955 save_dstore('rc_separate_out',rc.separate_out)
2955 save_dstore('rc_separate_out',rc.separate_out)
2956 save_dstore('rc_separate_out2',rc.separate_out2)
2956 save_dstore('rc_separate_out2',rc.separate_out2)
2957 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
2957 save_dstore('rc_prompts_pad_left',rc.prompts_pad_left)
2958
2958
2959 if mode == False:
2959 if mode == False:
2960 # turn on
2960 # turn on
2961 ipaste.activate_prefilter()
2961 ipaste.activate_prefilter()
2962
2962
2963 oc.prompt1.p_template = '>>> '
2963 oc.prompt1.p_template = '>>> '
2964 oc.prompt2.p_template = '... '
2964 oc.prompt2.p_template = '... '
2965 oc.prompt_out.p_template = ''
2965 oc.prompt_out.p_template = ''
2966
2966
2967 oc.prompt1.sep = ''
2967 oc.prompt1.sep = '\n'
2968 oc.prompt_out.output_sep = ''
2968 oc.output_sep = ''
2969 oc.prompt_out.output_sep2 = '\n'
2969 oc.output_sep2 = ''
2970
2970
2971 oc.prompt1.pad_left = oc.prompt2.pad_left = \
2971 oc.prompt1.pad_left = oc.prompt2.pad_left = \
2972 oc.prompt_out.pad_left = False
2972 oc.prompt_out.pad_left = False
2973
2973
2974 shell.magic_xmode('Plain')
2975
2976 rc.pprint = False
2974 rc.pprint = False
2977
2975
2976 shell.magic_xmode('Plain')
2977
2978 else:
2978 else:
2979 # turn off
2979 # turn off
2980 ipaste.deactivate_prefilter()
2980 ipaste.deactivate_prefilter()
2981
2981
2982 oc.prompt1.p_template = rc.prompt_in1
2982 oc.prompt1.p_template = rc.prompt_in1
2983 oc.prompt2.p_template = rc.prompt_in2
2983 oc.prompt2.p_template = rc.prompt_in2
2984 oc.prompt_out.p_template = rc.prompt_out
2984 oc.prompt_out.p_template = rc.prompt_out
2985
2985
2986 oc.prompt1.sep = dstore.rc_separate_in
2986 oc.prompt1.sep = dstore.rc_separate_in
2987 oc.prompt_out.output_sep = dstore.rc_separate_out
2987 oc.output_sep = dstore.rc_separate_out
2988 oc.prompt_out.output_sep2 = dstore.rc_separate_out2
2988 oc.output_sep2 = dstore.rc_separate_out2
2989
2989
2990 oc.prompt1.pad_left = oc.prompt2.pad_left = \
2990 oc.prompt1.pad_left = oc.prompt2.pad_left = \
2991 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
2991 oc.prompt_out.pad_left = dstore.rc_prompts_pad_left
2992 shell.magic_xmode(dstore.xmode)
2993
2992
2994 rc.pprint = dstore.rc_pprint
2993 rc.pprint = dstore.rc_pprint
2995
2994
2995 shell.magic_xmode(dstore.xmode)
2996
2996 # Store new mode and inform
2997 # Store new mode and inform
2997 dstore.mode = bool(1-int(mode))
2998 dstore.mode = bool(1-int(mode))
2998 print 'Doctest mode is:',
2999 print 'Doctest mode is:',
2999 print ['OFF','ON'][dstore.mode]
3000 print ['OFF','ON'][dstore.mode]
3000
3001
3001 # end Magic
3002 # end Magic
@@ -1,83 +1,83 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Release data for the IPython project.
2 """Release data for the IPython project.
3
3
4 $Id: Release.py 2602 2007-08-12 22:45:38Z fperez $"""
4 $Id: Release.py 2607 2007-08-13 13:25:24Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
7 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
8 #
8 #
9 # Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and Nathaniel Gray
9 # Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and Nathaniel Gray
10 # <n8gray@caltech.edu>
10 # <n8gray@caltech.edu>
11 #
11 #
12 # Distributed under the terms of the BSD License. The full license is in
12 # Distributed under the terms of the BSD License. The full license is in
13 # the file COPYING, distributed as part of this software.
13 # the file COPYING, distributed as part of this software.
14 #*****************************************************************************
14 #*****************************************************************************
15
15
16 # Name of the package for release purposes. This is the name which labels
16 # Name of the package for release purposes. This is the name which labels
17 # the tarballs and RPMs made by distutils, so it's best to lowercase it.
17 # the tarballs and RPMs made by distutils, so it's best to lowercase it.
18 name = 'ipython'
18 name = 'ipython'
19
19
20 # For versions with substrings (like 0.6.16.svn), use an extra . to separate
20 # For versions with substrings (like 0.6.16.svn), use an extra . to separate
21 # the new substring. We have to avoid using either dashes or underscores,
21 # the new substring. We have to avoid using either dashes or underscores,
22 # because bdist_rpm does not accept dashes (an RPM) convention, and
22 # because bdist_rpm does not accept dashes (an RPM) convention, and
23 # bdist_deb does not accept underscores (a Debian convention).
23 # bdist_deb does not accept underscores (a Debian convention).
24
24
25 revision = '2601'
25 revision = '2606'
26
26
27 version = '0.8.2.svn.r' + revision.rstrip('M')
27 version = '0.8.2.svn.r' + revision.rstrip('M')
28
28
29 description = "An enhanced interactive Python shell."
29 description = "An enhanced interactive Python shell."
30
30
31 long_description = \
31 long_description = \
32 """
32 """
33 IPython provides a replacement for the interactive Python interpreter with
33 IPython provides a replacement for the interactive Python interpreter with
34 extra functionality.
34 extra functionality.
35
35
36 Main features:
36 Main features:
37
37
38 * Comprehensive object introspection.
38 * Comprehensive object introspection.
39
39
40 * Input history, persistent across sessions.
40 * Input history, persistent across sessions.
41
41
42 * Caching of output results during a session with automatically generated
42 * Caching of output results during a session with automatically generated
43 references.
43 references.
44
44
45 * Readline based name completion.
45 * Readline based name completion.
46
46
47 * Extensible system of 'magic' commands for controlling the environment and
47 * Extensible system of 'magic' commands for controlling the environment and
48 performing many tasks related either to IPython or the operating system.
48 performing many tasks related either to IPython or the operating system.
49
49
50 * Configuration system with easy switching between different setups (simpler
50 * Configuration system with easy switching between different setups (simpler
51 than changing $PYTHONSTARTUP environment variables every time).
51 than changing $PYTHONSTARTUP environment variables every time).
52
52
53 * Session logging and reloading.
53 * Session logging and reloading.
54
54
55 * Extensible syntax processing for special purpose situations.
55 * Extensible syntax processing for special purpose situations.
56
56
57 * Access to the system shell with user-extensible alias system.
57 * Access to the system shell with user-extensible alias system.
58
58
59 * Easily embeddable in other Python programs.
59 * Easily embeddable in other Python programs.
60
60
61 * Integrated access to the pdb debugger and the Python profiler.
61 * Integrated access to the pdb debugger and the Python profiler.
62
62
63 The latest development version is always available at the IPython subversion
63 The latest development version is always available at the IPython subversion
64 repository_.
64 repository_.
65
65
66 .. _repository: http://ipython.scipy.org/svn/ipython/ipython/trunk#egg=ipython-dev
66 .. _repository: http://ipython.scipy.org/svn/ipython/ipython/trunk#egg=ipython-dev
67 """
67 """
68
68
69 license = 'BSD'
69 license = 'BSD'
70
70
71 authors = {'Fernando' : ('Fernando Perez','fperez@colorado.edu'),
71 authors = {'Fernando' : ('Fernando Perez','fperez@colorado.edu'),
72 'Janko' : ('Janko Hauser','jhauser@zscout.de'),
72 'Janko' : ('Janko Hauser','jhauser@zscout.de'),
73 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu'),
73 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu'),
74 'Ville' : ('Ville Vainio','vivainio@gmail.com')
74 'Ville' : ('Ville Vainio','vivainio@gmail.com')
75 }
75 }
76
76
77 url = 'http://ipython.scipy.org'
77 url = 'http://ipython.scipy.org'
78
78
79 download_url = 'http://ipython.scipy.org/dist'
79 download_url = 'http://ipython.scipy.org/dist'
80
80
81 platforms = ['Linux','Mac OSX','Windows XP/2000/NT','Windows 95/98/ME']
81 platforms = ['Linux','Mac OSX','Windows XP/2000/NT','Windows 95/98/ME']
82
82
83 keywords = ['Interactive','Interpreter','Shell']
83 keywords = ['Interactive','Interpreter','Shell']
@@ -1,6980 +1,6984 b''
1 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
1 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
2
2
3 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
4 doctest profile and %doctest_mode, so they actually generate the
5 blank lines needed by doctest to separate individual tests.
6
3 * IPython/iplib.py (safe_execfile): modify so that running code
7 * IPython/iplib.py (safe_execfile): modify so that running code
4 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
8 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
5 doesn't get a printed traceback. Any other value in sys.exit(),
9 doesn't get a printed traceback. Any other value in sys.exit(),
6 including the empty call, still generates a traceback. This
10 including the empty call, still generates a traceback. This
7 enables use of %run without having to pass '-e' for codes that
11 enables use of %run without having to pass '-e' for codes that
8 correctly set the exit status flag.
12 correctly set the exit status flag.
9
13
10 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
14 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
11
15
12 * IPython/iplib.py (InteractiveShell.post_config_initialization):
16 * IPython/iplib.py (InteractiveShell.post_config_initialization):
13 fix problems with doctests failing when run inside IPython due to
17 fix problems with doctests failing when run inside IPython due to
14 IPython's modifications of sys.displayhook.
18 IPython's modifications of sys.displayhook.
15
19
16 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
20 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
17
21
18 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
22 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
19 a string with names.
23 a string with names.
20
24
21 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
25 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
22
26
23 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
27 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
24 magic to toggle on/off the doctest pasting support without having
28 magic to toggle on/off the doctest pasting support without having
25 to leave a session to switch to a separate profile.
29 to leave a session to switch to a separate profile.
26
30
27 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
31 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
28
32
29 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
33 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
30 introduce a blank line between inputs, to conform to doctest
34 introduce a blank line between inputs, to conform to doctest
31 requirements.
35 requirements.
32
36
33 * IPython/OInspect.py (Inspector.pinfo): fix another part where
37 * IPython/OInspect.py (Inspector.pinfo): fix another part where
34 auto-generated docstrings for new-style classes were showing up.
38 auto-generated docstrings for new-style classes were showing up.
35
39
36 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
40 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
37
41
38 * api_changes: Add new file to track backward-incompatible
42 * api_changes: Add new file to track backward-incompatible
39 user-visible changes.
43 user-visible changes.
40
44
41 2007-08-06 Ville Vainio <vivainio@gmail.com>
45 2007-08-06 Ville Vainio <vivainio@gmail.com>
42
46
43 * ipmaker.py: fix bug where user_config_ns didn't exist at all
47 * ipmaker.py: fix bug where user_config_ns didn't exist at all
44 before all the config files were handled.
48 before all the config files were handled.
45
49
46 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
50 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
47
51
48 * IPython/irunner.py (RunnerFactory): Add new factory class for
52 * IPython/irunner.py (RunnerFactory): Add new factory class for
49 creating reusable runners based on filenames.
53 creating reusable runners based on filenames.
50
54
51 * IPython/Extensions/ipy_profile_doctest.py: New profile for
55 * IPython/Extensions/ipy_profile_doctest.py: New profile for
52 doctest support. It sets prompts/exceptions as similar to
56 doctest support. It sets prompts/exceptions as similar to
53 standard Python as possible, so that ipython sessions in this
57 standard Python as possible, so that ipython sessions in this
54 profile can be easily pasted as doctests with minimal
58 profile can be easily pasted as doctests with minimal
55 modifications. It also enables pasting of doctests from external
59 modifications. It also enables pasting of doctests from external
56 sources (even if they have leading whitespace), so that you can
60 sources (even if they have leading whitespace), so that you can
57 rerun doctests from existing sources.
61 rerun doctests from existing sources.
58
62
59 * IPython/iplib.py (_prefilter): fix a buglet where after entering
63 * IPython/iplib.py (_prefilter): fix a buglet where after entering
60 some whitespace, the prompt would become a continuation prompt
64 some whitespace, the prompt would become a continuation prompt
61 with no way of exiting it other than Ctrl-C. This fix brings us
65 with no way of exiting it other than Ctrl-C. This fix brings us
62 into conformity with how the default python prompt works.
66 into conformity with how the default python prompt works.
63
67
64 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
68 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
65 Add support for pasting not only lines that start with '>>>', but
69 Add support for pasting not only lines that start with '>>>', but
66 also with ' >>>'. That is, arbitrary whitespace can now precede
70 also with ' >>>'. That is, arbitrary whitespace can now precede
67 the prompts. This makes the system useful for pasting doctests
71 the prompts. This makes the system useful for pasting doctests
68 from docstrings back into a normal session.
72 from docstrings back into a normal session.
69
73
70 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
74 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
71
75
72 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
76 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
73 r1357, which had killed multiple invocations of an embedded
77 r1357, which had killed multiple invocations of an embedded
74 ipython (this means that example-embed has been broken for over 1
78 ipython (this means that example-embed has been broken for over 1
75 year!!!). Rather than possibly breaking the batch stuff for which
79 year!!!). Rather than possibly breaking the batch stuff for which
76 the code in iplib.py/interact was introduced, I worked around the
80 the code in iplib.py/interact was introduced, I worked around the
77 problem in the embedding class in Shell.py. We really need a
81 problem in the embedding class in Shell.py. We really need a
78 bloody test suite for this code, I'm sick of finding stuff that
82 bloody test suite for this code, I'm sick of finding stuff that
79 used to work breaking left and right every time I use an old
83 used to work breaking left and right every time I use an old
80 feature I hadn't touched in a few months.
84 feature I hadn't touched in a few months.
81 (kill_embedded): Add a new magic that only shows up in embedded
85 (kill_embedded): Add a new magic that only shows up in embedded
82 mode, to allow users to permanently deactivate an embedded instance.
86 mode, to allow users to permanently deactivate an embedded instance.
83
87
84 2007-08-01 Ville Vainio <vivainio@gmail.com>
88 2007-08-01 Ville Vainio <vivainio@gmail.com>
85
89
86 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
90 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
87 history gets out of sync on runlines (e.g. when running macros).
91 history gets out of sync on runlines (e.g. when running macros).
88
92
89 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
93 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
90
94
91 * IPython/Magic.py (magic_colors): fix win32-related error message
95 * IPython/Magic.py (magic_colors): fix win32-related error message
92 that could appear under *nix when readline was missing. Patch by
96 that could appear under *nix when readline was missing. Patch by
93 Scott Jackson, closes #175.
97 Scott Jackson, closes #175.
94
98
95 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
99 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
96
100
97 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
101 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
98 completer that it traits-aware, so that traits objects don't show
102 completer that it traits-aware, so that traits objects don't show
99 all of their internal attributes all the time.
103 all of their internal attributes all the time.
100
104
101 * IPython/genutils.py (dir2): moved this code from inside
105 * IPython/genutils.py (dir2): moved this code from inside
102 completer.py to expose it publicly, so I could use it in the
106 completer.py to expose it publicly, so I could use it in the
103 wildcards bugfix.
107 wildcards bugfix.
104
108
105 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
109 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
106 Stefan with Traits.
110 Stefan with Traits.
107
111
108 * IPython/completer.py (Completer.attr_matches): change internal
112 * IPython/completer.py (Completer.attr_matches): change internal
109 var name from 'object' to 'obj', since 'object' is now a builtin
113 var name from 'object' to 'obj', since 'object' is now a builtin
110 and this can lead to weird bugs if reusing this code elsewhere.
114 and this can lead to weird bugs if reusing this code elsewhere.
111
115
112 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
116 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
113
117
114 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
118 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
115 'foo?' and update the code to prevent printing of default
119 'foo?' and update the code to prevent printing of default
116 docstrings that started appearing after I added support for
120 docstrings that started appearing after I added support for
117 new-style classes. The approach I'm using isn't ideal (I just
121 new-style classes. The approach I'm using isn't ideal (I just
118 special-case those strings) but I'm not sure how to more robustly
122 special-case those strings) but I'm not sure how to more robustly
119 differentiate between truly user-written strings and Python's
123 differentiate between truly user-written strings and Python's
120 automatic ones.
124 automatic ones.
121
125
122 2007-07-09 Ville Vainio <vivainio@gmail.com>
126 2007-07-09 Ville Vainio <vivainio@gmail.com>
123
127
124 * completer.py: Applied Matthew Neeley's patch:
128 * completer.py: Applied Matthew Neeley's patch:
125 Dynamic attributes from trait_names and _getAttributeNames are added
129 Dynamic attributes from trait_names and _getAttributeNames are added
126 to the list of tab completions, but when this happens, the attribute
130 to the list of tab completions, but when this happens, the attribute
127 list is turned into a set, so the attributes are unordered when
131 list is turned into a set, so the attributes are unordered when
128 printed, which makes it hard to find the right completion. This patch
132 printed, which makes it hard to find the right completion. This patch
129 turns this set back into a list and sort it.
133 turns this set back into a list and sort it.
130
134
131 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
135 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
132
136
133 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
137 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
134 classes in various inspector functions.
138 classes in various inspector functions.
135
139
136 2007-06-28 Ville Vainio <vivainio@gmail.com>
140 2007-06-28 Ville Vainio <vivainio@gmail.com>
137
141
138 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
142 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
139 Implement "shadow" namespace, and callable aliases that reside there.
143 Implement "shadow" namespace, and callable aliases that reside there.
140 Use them by:
144 Use them by:
141
145
142 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
146 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
143
147
144 foo hello world
148 foo hello world
145 (gets translated to:)
149 (gets translated to:)
146 _sh.foo(r"""hello world""")
150 _sh.foo(r"""hello world""")
147
151
148 In practice, this kind of alias can take the role of a magic function
152 In practice, this kind of alias can take the role of a magic function
149
153
150 * New generic inspect_object, called on obj? and obj??
154 * New generic inspect_object, called on obj? and obj??
151
155
152 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
156 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
153
157
154 * IPython/ultraTB.py (findsource): fix a problem with
158 * IPython/ultraTB.py (findsource): fix a problem with
155 inspect.getfile that can cause crashes during traceback construction.
159 inspect.getfile that can cause crashes during traceback construction.
156
160
157 2007-06-14 Ville Vainio <vivainio@gmail.com>
161 2007-06-14 Ville Vainio <vivainio@gmail.com>
158
162
159 * iplib.py (handle_auto): Try to use ascii for printing "--->"
163 * iplib.py (handle_auto): Try to use ascii for printing "--->"
160 autocall rewrite indication, becausesometimes unicode fails to print
164 autocall rewrite indication, becausesometimes unicode fails to print
161 properly (and you get ' - - - '). Use plain uncoloured ---> for
165 properly (and you get ' - - - '). Use plain uncoloured ---> for
162 unicode.
166 unicode.
163
167
164 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
168 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
165
169
166 . pickleshare 'hash' commands (hget, hset, hcompress,
170 . pickleshare 'hash' commands (hget, hset, hcompress,
167 hdict) for efficient shadow history storage.
171 hdict) for efficient shadow history storage.
168
172
169 2007-06-13 Ville Vainio <vivainio@gmail.com>
173 2007-06-13 Ville Vainio <vivainio@gmail.com>
170
174
171 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
175 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
172 Added kw arg 'interactive', tell whether vars should be visible
176 Added kw arg 'interactive', tell whether vars should be visible
173 with %whos.
177 with %whos.
174
178
175 2007-06-11 Ville Vainio <vivainio@gmail.com>
179 2007-06-11 Ville Vainio <vivainio@gmail.com>
176
180
177 * pspersistence.py, Magic.py, iplib.py: directory history now saved
181 * pspersistence.py, Magic.py, iplib.py: directory history now saved
178 to db
182 to db
179
183
180 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
184 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
181 Also, it exits IPython immediately after evaluating the command (just like
185 Also, it exits IPython immediately after evaluating the command (just like
182 std python)
186 std python)
183
187
184 2007-06-05 Walter Doerwald <walter@livinglogic.de>
188 2007-06-05 Walter Doerwald <walter@livinglogic.de>
185
189
186 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
190 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
187 Python string and captures the output. (Idea and original patch by
191 Python string and captures the output. (Idea and original patch by
188 StοΏ½fan van der Walt)
192 StοΏ½fan van der Walt)
189
193
190 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
194 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
191
195
192 * IPython/ultraTB.py (VerboseTB.text): update printing of
196 * IPython/ultraTB.py (VerboseTB.text): update printing of
193 exception types for Python 2.5 (now all exceptions in the stdlib
197 exception types for Python 2.5 (now all exceptions in the stdlib
194 are new-style classes).
198 are new-style classes).
195
199
196 2007-05-31 Walter Doerwald <walter@livinglogic.de>
200 2007-05-31 Walter Doerwald <walter@livinglogic.de>
197
201
198 * IPython/Extensions/igrid.py: Add new commands refresh and
202 * IPython/Extensions/igrid.py: Add new commands refresh and
199 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
203 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
200 the iterator once (refresh) or after every x seconds (refresh_timer).
204 the iterator once (refresh) or after every x seconds (refresh_timer).
201 Add a working implementation of "searchexpression", where the text
205 Add a working implementation of "searchexpression", where the text
202 entered is not the text to search for, but an expression that must
206 entered is not the text to search for, but an expression that must
203 be true. Added display of shortcuts to the menu. Added commands "pickinput"
207 be true. Added display of shortcuts to the menu. Added commands "pickinput"
204 and "pickinputattr" that put the object or attribute under the cursor
208 and "pickinputattr" that put the object or attribute under the cursor
205 in the input line. Split the statusbar to be able to display the currently
209 in the input line. Split the statusbar to be able to display the currently
206 active refresh interval. (Patch by Nik Tautenhahn)
210 active refresh interval. (Patch by Nik Tautenhahn)
207
211
208 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
212 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
209
213
210 * fixing set_term_title to use ctypes as default
214 * fixing set_term_title to use ctypes as default
211
215
212 * fixing set_term_title fallback to work when curent dir
216 * fixing set_term_title fallback to work when curent dir
213 is on a windows network share
217 is on a windows network share
214
218
215 2007-05-28 Ville Vainio <vivainio@gmail.com>
219 2007-05-28 Ville Vainio <vivainio@gmail.com>
216
220
217 * %cpaste: strip + with > from left (diffs).
221 * %cpaste: strip + with > from left (diffs).
218
222
219 * iplib.py: Fix crash when readline not installed
223 * iplib.py: Fix crash when readline not installed
220
224
221 2007-05-26 Ville Vainio <vivainio@gmail.com>
225 2007-05-26 Ville Vainio <vivainio@gmail.com>
222
226
223 * generics.py: intruduce easy to extend result_display generic
227 * generics.py: intruduce easy to extend result_display generic
224 function (using simplegeneric.py).
228 function (using simplegeneric.py).
225
229
226 * Fixed the append functionality of %set.
230 * Fixed the append functionality of %set.
227
231
228 2007-05-25 Ville Vainio <vivainio@gmail.com>
232 2007-05-25 Ville Vainio <vivainio@gmail.com>
229
233
230 * New magic: %rep (fetch / run old commands from history)
234 * New magic: %rep (fetch / run old commands from history)
231
235
232 * New extension: mglob (%mglob magic), for powerful glob / find /filter
236 * New extension: mglob (%mglob magic), for powerful glob / find /filter
233 like functionality
237 like functionality
234
238
235 % maghistory.py: %hist -g PATTERM greps the history for pattern
239 % maghistory.py: %hist -g PATTERM greps the history for pattern
236
240
237 2007-05-24 Walter Doerwald <walter@livinglogic.de>
241 2007-05-24 Walter Doerwald <walter@livinglogic.de>
238
242
239 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
243 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
240 browse the IPython input history
244 browse the IPython input history
241
245
242 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
246 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
243 (mapped to "i") can be used to put the object under the curser in the input
247 (mapped to "i") can be used to put the object under the curser in the input
244 line. pickinputattr (mapped to "I") does the same for the attribute under
248 line. pickinputattr (mapped to "I") does the same for the attribute under
245 the cursor.
249 the cursor.
246
250
247 2007-05-24 Ville Vainio <vivainio@gmail.com>
251 2007-05-24 Ville Vainio <vivainio@gmail.com>
248
252
249 * Grand magic cleansing (changeset [2380]):
253 * Grand magic cleansing (changeset [2380]):
250
254
251 * Introduce ipy_legacy.py where the following magics were
255 * Introduce ipy_legacy.py where the following magics were
252 moved:
256 moved:
253
257
254 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
258 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
255
259
256 If you need them, either use default profile or "import ipy_legacy"
260 If you need them, either use default profile or "import ipy_legacy"
257 in your ipy_user_conf.py
261 in your ipy_user_conf.py
258
262
259 * Move sh and scipy profile to Extensions from UserConfig. this implies
263 * Move sh and scipy profile to Extensions from UserConfig. this implies
260 you should not edit them, but you don't need to run %upgrade when
264 you should not edit them, but you don't need to run %upgrade when
261 upgrading IPython anymore.
265 upgrading IPython anymore.
262
266
263 * %hist/%history now operates in "raw" mode by default. To get the old
267 * %hist/%history now operates in "raw" mode by default. To get the old
264 behaviour, run '%hist -n' (native mode).
268 behaviour, run '%hist -n' (native mode).
265
269
266 * split ipy_stock_completers.py to ipy_stock_completers.py and
270 * split ipy_stock_completers.py to ipy_stock_completers.py and
267 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
271 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
268 installed as default.
272 installed as default.
269
273
270 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
274 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
271 handling.
275 handling.
272
276
273 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
277 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
274 input if readline is available.
278 input if readline is available.
275
279
276 2007-05-23 Ville Vainio <vivainio@gmail.com>
280 2007-05-23 Ville Vainio <vivainio@gmail.com>
277
281
278 * macro.py: %store uses __getstate__ properly
282 * macro.py: %store uses __getstate__ properly
279
283
280 * exesetup.py: added new setup script for creating
284 * exesetup.py: added new setup script for creating
281 standalone IPython executables with py2exe (i.e.
285 standalone IPython executables with py2exe (i.e.
282 no python installation required).
286 no python installation required).
283
287
284 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
288 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
285 its place.
289 its place.
286
290
287 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
291 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
288
292
289 2007-05-21 Ville Vainio <vivainio@gmail.com>
293 2007-05-21 Ville Vainio <vivainio@gmail.com>
290
294
291 * platutil_win32.py (set_term_title): handle
295 * platutil_win32.py (set_term_title): handle
292 failure of 'title' system call properly.
296 failure of 'title' system call properly.
293
297
294 2007-05-17 Walter Doerwald <walter@livinglogic.de>
298 2007-05-17 Walter Doerwald <walter@livinglogic.de>
295
299
296 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
300 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
297 (Bug detected by Paul Mueller).
301 (Bug detected by Paul Mueller).
298
302
299 2007-05-16 Ville Vainio <vivainio@gmail.com>
303 2007-05-16 Ville Vainio <vivainio@gmail.com>
300
304
301 * ipy_profile_sci.py, ipython_win_post_install.py: Create
305 * ipy_profile_sci.py, ipython_win_post_install.py: Create
302 new "sci" profile, effectively a modern version of the old
306 new "sci" profile, effectively a modern version of the old
303 "scipy" profile (which is now slated for deprecation).
307 "scipy" profile (which is now slated for deprecation).
304
308
305 2007-05-15 Ville Vainio <vivainio@gmail.com>
309 2007-05-15 Ville Vainio <vivainio@gmail.com>
306
310
307 * pycolorize.py, pycolor.1: Paul Mueller's patches that
311 * pycolorize.py, pycolor.1: Paul Mueller's patches that
308 make pycolorize read input from stdin when run without arguments.
312 make pycolorize read input from stdin when run without arguments.
309
313
310 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
314 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
311
315
312 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
316 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
313 it in sh profile (instead of ipy_system_conf.py).
317 it in sh profile (instead of ipy_system_conf.py).
314
318
315 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
319 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
316 aliases are now lower case on windows (MyCommand.exe => mycommand).
320 aliases are now lower case on windows (MyCommand.exe => mycommand).
317
321
318 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
322 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
319 Macros are now callable objects that inherit from ipapi.IPyAutocall,
323 Macros are now callable objects that inherit from ipapi.IPyAutocall,
320 i.e. get autocalled regardless of system autocall setting.
324 i.e. get autocalled regardless of system autocall setting.
321
325
322 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
326 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
323
327
324 * IPython/rlineimpl.py: check for clear_history in readline and
328 * IPython/rlineimpl.py: check for clear_history in readline and
325 make it a dummy no-op if not available. This function isn't
329 make it a dummy no-op if not available. This function isn't
326 guaranteed to be in the API and appeared in Python 2.4, so we need
330 guaranteed to be in the API and appeared in Python 2.4, so we need
327 to check it ourselves. Also, clean up this file quite a bit.
331 to check it ourselves. Also, clean up this file quite a bit.
328
332
329 * ipython.1: update man page and full manual with information
333 * ipython.1: update man page and full manual with information
330 about threads (remove outdated warning). Closes #151.
334 about threads (remove outdated warning). Closes #151.
331
335
332 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
336 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
333
337
334 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
338 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
335 in trunk (note that this made it into the 0.8.1 release already,
339 in trunk (note that this made it into the 0.8.1 release already,
336 but the changelogs didn't get coordinated). Many thanks to Gael
340 but the changelogs didn't get coordinated). Many thanks to Gael
337 Varoquaux <gael.varoquaux-AT-normalesup.org>
341 Varoquaux <gael.varoquaux-AT-normalesup.org>
338
342
339 2007-05-09 *** Released version 0.8.1
343 2007-05-09 *** Released version 0.8.1
340
344
341 2007-05-10 Walter Doerwald <walter@livinglogic.de>
345 2007-05-10 Walter Doerwald <walter@livinglogic.de>
342
346
343 * IPython/Extensions/igrid.py: Incorporate html help into
347 * IPython/Extensions/igrid.py: Incorporate html help into
344 the module, so we don't have to search for the file.
348 the module, so we don't have to search for the file.
345
349
346 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
350 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
347
351
348 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
352 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
349
353
350 2007-04-30 Ville Vainio <vivainio@gmail.com>
354 2007-04-30 Ville Vainio <vivainio@gmail.com>
351
355
352 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
356 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
353 user has illegal (non-ascii) home directory name
357 user has illegal (non-ascii) home directory name
354
358
355 2007-04-27 Ville Vainio <vivainio@gmail.com>
359 2007-04-27 Ville Vainio <vivainio@gmail.com>
356
360
357 * platutils_win32.py: implement set_term_title for windows
361 * platutils_win32.py: implement set_term_title for windows
358
362
359 * Update version number
363 * Update version number
360
364
361 * ipy_profile_sh.py: more informative prompt (2 dir levels)
365 * ipy_profile_sh.py: more informative prompt (2 dir levels)
362
366
363 2007-04-26 Walter Doerwald <walter@livinglogic.de>
367 2007-04-26 Walter Doerwald <walter@livinglogic.de>
364
368
365 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
369 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
366 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
370 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
367 bug discovered by Ville).
371 bug discovered by Ville).
368
372
369 2007-04-26 Ville Vainio <vivainio@gmail.com>
373 2007-04-26 Ville Vainio <vivainio@gmail.com>
370
374
371 * Extensions/ipy_completers.py: Olivier's module completer now
375 * Extensions/ipy_completers.py: Olivier's module completer now
372 saves the list of root modules if it takes > 4 secs on the first run.
376 saves the list of root modules if it takes > 4 secs on the first run.
373
377
374 * Magic.py (%rehashx): %rehashx now clears the completer cache
378 * Magic.py (%rehashx): %rehashx now clears the completer cache
375
379
376
380
377 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
381 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
378
382
379 * ipython.el: fix incorrect color scheme, reported by Stefan.
383 * ipython.el: fix incorrect color scheme, reported by Stefan.
380 Closes #149.
384 Closes #149.
381
385
382 * IPython/PyColorize.py (Parser.format2): fix state-handling
386 * IPython/PyColorize.py (Parser.format2): fix state-handling
383 logic. I still don't like how that code handles state, but at
387 logic. I still don't like how that code handles state, but at
384 least now it should be correct, if inelegant. Closes #146.
388 least now it should be correct, if inelegant. Closes #146.
385
389
386 2007-04-25 Ville Vainio <vivainio@gmail.com>
390 2007-04-25 Ville Vainio <vivainio@gmail.com>
387
391
388 * Extensions/ipy_which.py: added extension for %which magic, works
392 * Extensions/ipy_which.py: added extension for %which magic, works
389 a lot like unix 'which' but also finds and expands aliases, and
393 a lot like unix 'which' but also finds and expands aliases, and
390 allows wildcards.
394 allows wildcards.
391
395
392 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
396 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
393 as opposed to returning nothing.
397 as opposed to returning nothing.
394
398
395 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
399 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
396 ipy_stock_completers on default profile, do import on sh profile.
400 ipy_stock_completers on default profile, do import on sh profile.
397
401
398 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
402 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
399
403
400 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
404 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
401 like ipython.py foo.py which raised a IndexError.
405 like ipython.py foo.py which raised a IndexError.
402
406
403 2007-04-21 Ville Vainio <vivainio@gmail.com>
407 2007-04-21 Ville Vainio <vivainio@gmail.com>
404
408
405 * Extensions/ipy_extutil.py: added extension to manage other ipython
409 * Extensions/ipy_extutil.py: added extension to manage other ipython
406 extensions. Now only supports 'ls' == list extensions.
410 extensions. Now only supports 'ls' == list extensions.
407
411
408 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
412 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
409
413
410 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
414 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
411 would prevent use of the exception system outside of a running
415 would prevent use of the exception system outside of a running
412 IPython instance.
416 IPython instance.
413
417
414 2007-04-20 Ville Vainio <vivainio@gmail.com>
418 2007-04-20 Ville Vainio <vivainio@gmail.com>
415
419
416 * Extensions/ipy_render.py: added extension for easy
420 * Extensions/ipy_render.py: added extension for easy
417 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
421 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
418 'Iptl' template notation,
422 'Iptl' template notation,
419
423
420 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
424 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
421 safer & faster 'import' completer.
425 safer & faster 'import' completer.
422
426
423 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
427 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
424 and _ip.defalias(name, command).
428 and _ip.defalias(name, command).
425
429
426 * Extensions/ipy_exportdb.py: New extension for exporting all the
430 * Extensions/ipy_exportdb.py: New extension for exporting all the
427 %store'd data in a portable format (normal ipapi calls like
431 %store'd data in a portable format (normal ipapi calls like
428 defmacro() etc.)
432 defmacro() etc.)
429
433
430 2007-04-19 Ville Vainio <vivainio@gmail.com>
434 2007-04-19 Ville Vainio <vivainio@gmail.com>
431
435
432 * upgrade_dir.py: skip junk files like *.pyc
436 * upgrade_dir.py: skip junk files like *.pyc
433
437
434 * Release.py: version number to 0.8.1
438 * Release.py: version number to 0.8.1
435
439
436 2007-04-18 Ville Vainio <vivainio@gmail.com>
440 2007-04-18 Ville Vainio <vivainio@gmail.com>
437
441
438 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
442 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
439 and later on win32.
443 and later on win32.
440
444
441 2007-04-16 Ville Vainio <vivainio@gmail.com>
445 2007-04-16 Ville Vainio <vivainio@gmail.com>
442
446
443 * iplib.py (showtraceback): Do not crash when running w/o readline.
447 * iplib.py (showtraceback): Do not crash when running w/o readline.
444
448
445 2007-04-12 Walter Doerwald <walter@livinglogic.de>
449 2007-04-12 Walter Doerwald <walter@livinglogic.de>
446
450
447 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
451 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
448 sorted (case sensitive with files and dirs mixed).
452 sorted (case sensitive with files and dirs mixed).
449
453
450 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
454 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
451
455
452 * IPython/Release.py (version): Open trunk for 0.8.1 development.
456 * IPython/Release.py (version): Open trunk for 0.8.1 development.
453
457
454 2007-04-10 *** Released version 0.8.0
458 2007-04-10 *** Released version 0.8.0
455
459
456 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
460 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
457
461
458 * Tag 0.8.0 for release.
462 * Tag 0.8.0 for release.
459
463
460 * IPython/iplib.py (reloadhist): add API function to cleanly
464 * IPython/iplib.py (reloadhist): add API function to cleanly
461 reload the readline history, which was growing inappropriately on
465 reload the readline history, which was growing inappropriately on
462 every %run call.
466 every %run call.
463
467
464 * win32_manual_post_install.py (run): apply last part of Nicolas
468 * win32_manual_post_install.py (run): apply last part of Nicolas
465 Pernetty's patch (I'd accidentally applied it in a different
469 Pernetty's patch (I'd accidentally applied it in a different
466 directory and this particular file didn't get patched).
470 directory and this particular file didn't get patched).
467
471
468 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
472 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
469
473
470 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
474 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
471 find the main thread id and use the proper API call. Thanks to
475 find the main thread id and use the proper API call. Thanks to
472 Stefan for the fix.
476 Stefan for the fix.
473
477
474 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
478 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
475 unit tests to reflect fixed ticket #52, and add more tests sent by
479 unit tests to reflect fixed ticket #52, and add more tests sent by
476 him.
480 him.
477
481
478 * IPython/iplib.py (raw_input): restore the readline completer
482 * IPython/iplib.py (raw_input): restore the readline completer
479 state on every input, in case third-party code messed it up.
483 state on every input, in case third-party code messed it up.
480 (_prefilter): revert recent addition of early-escape checks which
484 (_prefilter): revert recent addition of early-escape checks which
481 prevent many valid alias calls from working.
485 prevent many valid alias calls from working.
482
486
483 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
487 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
484 flag for sigint handler so we don't run a full signal() call on
488 flag for sigint handler so we don't run a full signal() call on
485 each runcode access.
489 each runcode access.
486
490
487 * IPython/Magic.py (magic_whos): small improvement to diagnostic
491 * IPython/Magic.py (magic_whos): small improvement to diagnostic
488 message.
492 message.
489
493
490 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
494 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
491
495
492 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
496 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
493 asynchronous exceptions working, i.e., Ctrl-C can actually
497 asynchronous exceptions working, i.e., Ctrl-C can actually
494 interrupt long-running code in the multithreaded shells.
498 interrupt long-running code in the multithreaded shells.
495
499
496 This is using Tomer Filiba's great ctypes-based trick:
500 This is using Tomer Filiba's great ctypes-based trick:
497 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
501 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
498 this in the past, but hadn't been able to make it work before. So
502 this in the past, but hadn't been able to make it work before. So
499 far it looks like it's actually running, but this needs more
503 far it looks like it's actually running, but this needs more
500 testing. If it really works, I'll be *very* happy, and we'll owe
504 testing. If it really works, I'll be *very* happy, and we'll owe
501 a huge thank you to Tomer. My current implementation is ugly,
505 a huge thank you to Tomer. My current implementation is ugly,
502 hackish and uses nasty globals, but I don't want to try and clean
506 hackish and uses nasty globals, but I don't want to try and clean
503 anything up until we know if it actually works.
507 anything up until we know if it actually works.
504
508
505 NOTE: this feature needs ctypes to work. ctypes is included in
509 NOTE: this feature needs ctypes to work. ctypes is included in
506 Python2.5, but 2.4 users will need to manually install it. This
510 Python2.5, but 2.4 users will need to manually install it. This
507 feature makes multi-threaded shells so much more usable that it's
511 feature makes multi-threaded shells so much more usable that it's
508 a minor price to pay (ctypes is very easy to install, already a
512 a minor price to pay (ctypes is very easy to install, already a
509 requirement for win32 and available in major linux distros).
513 requirement for win32 and available in major linux distros).
510
514
511 2007-04-04 Ville Vainio <vivainio@gmail.com>
515 2007-04-04 Ville Vainio <vivainio@gmail.com>
512
516
513 * Extensions/ipy_completers.py, ipy_stock_completers.py:
517 * Extensions/ipy_completers.py, ipy_stock_completers.py:
514 Moved implementations of 'bundled' completers to ipy_completers.py,
518 Moved implementations of 'bundled' completers to ipy_completers.py,
515 they are only enabled in ipy_stock_completers.py.
519 they are only enabled in ipy_stock_completers.py.
516
520
517 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
521 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
518
522
519 * IPython/PyColorize.py (Parser.format2): Fix identation of
523 * IPython/PyColorize.py (Parser.format2): Fix identation of
520 colorzied output and return early if color scheme is NoColor, to
524 colorzied output and return early if color scheme is NoColor, to
521 avoid unnecessary and expensive tokenization. Closes #131.
525 avoid unnecessary and expensive tokenization. Closes #131.
522
526
523 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
527 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
524
528
525 * IPython/Debugger.py: disable the use of pydb version 1.17. It
529 * IPython/Debugger.py: disable the use of pydb version 1.17. It
526 has a critical bug (a missing import that makes post-mortem not
530 has a critical bug (a missing import that makes post-mortem not
527 work at all). Unfortunately as of this time, this is the version
531 work at all). Unfortunately as of this time, this is the version
528 shipped with Ubuntu Edgy, so quite a few people have this one. I
532 shipped with Ubuntu Edgy, so quite a few people have this one. I
529 hope Edgy will update to a more recent package.
533 hope Edgy will update to a more recent package.
530
534
531 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
535 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
532
536
533 * IPython/iplib.py (_prefilter): close #52, second part of a patch
537 * IPython/iplib.py (_prefilter): close #52, second part of a patch
534 set by Stefan (only the first part had been applied before).
538 set by Stefan (only the first part had been applied before).
535
539
536 * IPython/Extensions/ipy_stock_completers.py (module_completer):
540 * IPython/Extensions/ipy_stock_completers.py (module_completer):
537 remove usage of the dangerous pkgutil.walk_packages(). See
541 remove usage of the dangerous pkgutil.walk_packages(). See
538 details in comments left in the code.
542 details in comments left in the code.
539
543
540 * IPython/Magic.py (magic_whos): add support for numpy arrays
544 * IPython/Magic.py (magic_whos): add support for numpy arrays
541 similar to what we had for Numeric.
545 similar to what we had for Numeric.
542
546
543 * IPython/completer.py (IPCompleter.complete): extend the
547 * IPython/completer.py (IPCompleter.complete): extend the
544 complete() call API to support completions by other mechanisms
548 complete() call API to support completions by other mechanisms
545 than readline. Closes #109.
549 than readline. Closes #109.
546
550
547 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
551 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
548 protect against a bug in Python's execfile(). Closes #123.
552 protect against a bug in Python's execfile(). Closes #123.
549
553
550 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
554 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
551
555
552 * IPython/iplib.py (split_user_input): ensure that when splitting
556 * IPython/iplib.py (split_user_input): ensure that when splitting
553 user input, the part that can be treated as a python name is pure
557 user input, the part that can be treated as a python name is pure
554 ascii (Python identifiers MUST be pure ascii). Part of the
558 ascii (Python identifiers MUST be pure ascii). Part of the
555 ongoing Unicode support work.
559 ongoing Unicode support work.
556
560
557 * IPython/Prompts.py (prompt_specials_color): Add \N for the
561 * IPython/Prompts.py (prompt_specials_color): Add \N for the
558 actual prompt number, without any coloring. This allows users to
562 actual prompt number, without any coloring. This allows users to
559 produce numbered prompts with their own colors. Added after a
563 produce numbered prompts with their own colors. Added after a
560 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
564 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
561
565
562 2007-03-31 Walter Doerwald <walter@livinglogic.de>
566 2007-03-31 Walter Doerwald <walter@livinglogic.de>
563
567
564 * IPython/Extensions/igrid.py: Map the return key
568 * IPython/Extensions/igrid.py: Map the return key
565 to enter() and shift-return to enterattr().
569 to enter() and shift-return to enterattr().
566
570
567 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
571 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
568
572
569 * IPython/Magic.py (magic_psearch): add unicode support by
573 * IPython/Magic.py (magic_psearch): add unicode support by
570 encoding to ascii the input, since this routine also only deals
574 encoding to ascii the input, since this routine also only deals
571 with valid Python names. Fixes a bug reported by Stefan.
575 with valid Python names. Fixes a bug reported by Stefan.
572
576
573 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
577 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
574
578
575 * IPython/Magic.py (_inspect): convert unicode input into ascii
579 * IPython/Magic.py (_inspect): convert unicode input into ascii
576 before trying to evaluate it as a Python identifier. This fixes a
580 before trying to evaluate it as a Python identifier. This fixes a
577 problem that the new unicode support had introduced when analyzing
581 problem that the new unicode support had introduced when analyzing
578 long definition lines for functions.
582 long definition lines for functions.
579
583
580 2007-03-24 Walter Doerwald <walter@livinglogic.de>
584 2007-03-24 Walter Doerwald <walter@livinglogic.de>
581
585
582 * IPython/Extensions/igrid.py: Fix picking. Using
586 * IPython/Extensions/igrid.py: Fix picking. Using
583 igrid with wxPython 2.6 and -wthread should work now.
587 igrid with wxPython 2.6 and -wthread should work now.
584 igrid.display() simply tries to create a frame without
588 igrid.display() simply tries to create a frame without
585 an application. Only if this fails an application is created.
589 an application. Only if this fails an application is created.
586
590
587 2007-03-23 Walter Doerwald <walter@livinglogic.de>
591 2007-03-23 Walter Doerwald <walter@livinglogic.de>
588
592
589 * IPython/Extensions/path.py: Updated to version 2.2.
593 * IPython/Extensions/path.py: Updated to version 2.2.
590
594
591 2007-03-23 Ville Vainio <vivainio@gmail.com>
595 2007-03-23 Ville Vainio <vivainio@gmail.com>
592
596
593 * iplib.py: recursive alias expansion now works better, so that
597 * iplib.py: recursive alias expansion now works better, so that
594 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
598 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
595 doesn't trip up the process, if 'd' has been aliased to 'ls'.
599 doesn't trip up the process, if 'd' has been aliased to 'ls'.
596
600
597 * Extensions/ipy_gnuglobal.py added, provides %global magic
601 * Extensions/ipy_gnuglobal.py added, provides %global magic
598 for users of http://www.gnu.org/software/global
602 for users of http://www.gnu.org/software/global
599
603
600 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
604 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
601 Closes #52. Patch by Stefan van der Walt.
605 Closes #52. Patch by Stefan van der Walt.
602
606
603 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
607 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
604
608
605 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
609 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
606 respect the __file__ attribute when using %run. Thanks to a bug
610 respect the __file__ attribute when using %run. Thanks to a bug
607 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
611 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
608
612
609 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
613 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
610
614
611 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
615 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
612 input. Patch sent by Stefan.
616 input. Patch sent by Stefan.
613
617
614 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
618 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
615 * IPython/Extensions/ipy_stock_completer.py
619 * IPython/Extensions/ipy_stock_completer.py
616 shlex_split, fix bug in shlex_split. len function
620 shlex_split, fix bug in shlex_split. len function
617 call was missing an if statement. Caused shlex_split to
621 call was missing an if statement. Caused shlex_split to
618 sometimes return "" as last element.
622 sometimes return "" as last element.
619
623
620 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
624 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
621
625
622 * IPython/completer.py
626 * IPython/completer.py
623 (IPCompleter.file_matches.single_dir_expand): fix a problem
627 (IPCompleter.file_matches.single_dir_expand): fix a problem
624 reported by Stefan, where directories containign a single subdir
628 reported by Stefan, where directories containign a single subdir
625 would be completed too early.
629 would be completed too early.
626
630
627 * IPython/Shell.py (_load_pylab): Make the execution of 'from
631 * IPython/Shell.py (_load_pylab): Make the execution of 'from
628 pylab import *' when -pylab is given be optional. A new flag,
632 pylab import *' when -pylab is given be optional. A new flag,
629 pylab_import_all controls this behavior, the default is True for
633 pylab_import_all controls this behavior, the default is True for
630 backwards compatibility.
634 backwards compatibility.
631
635
632 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
636 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
633 modified) R. Bernstein's patch for fully syntax highlighted
637 modified) R. Bernstein's patch for fully syntax highlighted
634 tracebacks. The functionality is also available under ultraTB for
638 tracebacks. The functionality is also available under ultraTB for
635 non-ipython users (someone using ultraTB but outside an ipython
639 non-ipython users (someone using ultraTB but outside an ipython
636 session). They can select the color scheme by setting the
640 session). They can select the color scheme by setting the
637 module-level global DEFAULT_SCHEME. The highlight functionality
641 module-level global DEFAULT_SCHEME. The highlight functionality
638 also works when debugging.
642 also works when debugging.
639
643
640 * IPython/genutils.py (IOStream.close): small patch by
644 * IPython/genutils.py (IOStream.close): small patch by
641 R. Bernstein for improved pydb support.
645 R. Bernstein for improved pydb support.
642
646
643 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
647 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
644 DaveS <davls@telus.net> to improve support of debugging under
648 DaveS <davls@telus.net> to improve support of debugging under
645 NTEmacs, including improved pydb behavior.
649 NTEmacs, including improved pydb behavior.
646
650
647 * IPython/Magic.py (magic_prun): Fix saving of profile info for
651 * IPython/Magic.py (magic_prun): Fix saving of profile info for
648 Python 2.5, where the stats object API changed a little. Thanks
652 Python 2.5, where the stats object API changed a little. Thanks
649 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
653 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
650
654
651 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
655 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
652 Pernetty's patch to improve support for (X)Emacs under Win32.
656 Pernetty's patch to improve support for (X)Emacs under Win32.
653
657
654 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
658 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
655
659
656 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
660 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
657 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
661 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
658 a report by Nik Tautenhahn.
662 a report by Nik Tautenhahn.
659
663
660 2007-03-16 Walter Doerwald <walter@livinglogic.de>
664 2007-03-16 Walter Doerwald <walter@livinglogic.de>
661
665
662 * setup.py: Add the igrid help files to the list of data files
666 * setup.py: Add the igrid help files to the list of data files
663 to be installed alongside igrid.
667 to be installed alongside igrid.
664 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
668 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
665 Show the input object of the igrid browser as the window tile.
669 Show the input object of the igrid browser as the window tile.
666 Show the object the cursor is on in the statusbar.
670 Show the object the cursor is on in the statusbar.
667
671
668 2007-03-15 Ville Vainio <vivainio@gmail.com>
672 2007-03-15 Ville Vainio <vivainio@gmail.com>
669
673
670 * Extensions/ipy_stock_completers.py: Fixed exception
674 * Extensions/ipy_stock_completers.py: Fixed exception
671 on mismatching quotes in %run completer. Patch by
675 on mismatching quotes in %run completer. Patch by
672 JοΏ½rgen Stenarson. Closes #127.
676 JοΏ½rgen Stenarson. Closes #127.
673
677
674 2007-03-14 Ville Vainio <vivainio@gmail.com>
678 2007-03-14 Ville Vainio <vivainio@gmail.com>
675
679
676 * Extensions/ext_rehashdir.py: Do not do auto_alias
680 * Extensions/ext_rehashdir.py: Do not do auto_alias
677 in %rehashdir, it clobbers %store'd aliases.
681 in %rehashdir, it clobbers %store'd aliases.
678
682
679 * UserConfig/ipy_profile_sh.py: envpersist.py extension
683 * UserConfig/ipy_profile_sh.py: envpersist.py extension
680 (beefed up %env) imported for sh profile.
684 (beefed up %env) imported for sh profile.
681
685
682 2007-03-10 Walter Doerwald <walter@livinglogic.de>
686 2007-03-10 Walter Doerwald <walter@livinglogic.de>
683
687
684 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
688 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
685 as the default browser.
689 as the default browser.
686 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
690 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
687 As igrid displays all attributes it ever encounters, fetch() (which has
691 As igrid displays all attributes it ever encounters, fetch() (which has
688 been renamed to _fetch()) doesn't have to recalculate the display attributes
692 been renamed to _fetch()) doesn't have to recalculate the display attributes
689 every time a new item is fetched. This should speed up scrolling.
693 every time a new item is fetched. This should speed up scrolling.
690
694
691 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
695 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
692
696
693 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
697 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
694 Schmolck's recently reported tab-completion bug (my previous one
698 Schmolck's recently reported tab-completion bug (my previous one
695 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
699 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
696
700
697 2007-03-09 Walter Doerwald <walter@livinglogic.de>
701 2007-03-09 Walter Doerwald <walter@livinglogic.de>
698
702
699 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
703 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
700 Close help window if exiting igrid.
704 Close help window if exiting igrid.
701
705
702 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
706 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
703
707
704 * IPython/Extensions/ipy_defaults.py: Check if readline is available
708 * IPython/Extensions/ipy_defaults.py: Check if readline is available
705 before calling functions from readline.
709 before calling functions from readline.
706
710
707 2007-03-02 Walter Doerwald <walter@livinglogic.de>
711 2007-03-02 Walter Doerwald <walter@livinglogic.de>
708
712
709 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
713 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
710 igrid is a wxPython-based display object for ipipe. If your system has
714 igrid is a wxPython-based display object for ipipe. If your system has
711 wx installed igrid will be the default display. Without wx ipipe falls
715 wx installed igrid will be the default display. Without wx ipipe falls
712 back to ibrowse (which needs curses). If no curses is installed ipipe
716 back to ibrowse (which needs curses). If no curses is installed ipipe
713 falls back to idump.
717 falls back to idump.
714
718
715 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
719 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
716
720
717 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
721 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
718 my changes from yesterday, they introduced bugs. Will reactivate
722 my changes from yesterday, they introduced bugs. Will reactivate
719 once I get a correct solution, which will be much easier thanks to
723 once I get a correct solution, which will be much easier thanks to
720 Dan Milstein's new prefilter test suite.
724 Dan Milstein's new prefilter test suite.
721
725
722 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
726 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
723
727
724 * IPython/iplib.py (split_user_input): fix input splitting so we
728 * IPython/iplib.py (split_user_input): fix input splitting so we
725 don't attempt attribute accesses on things that can't possibly be
729 don't attempt attribute accesses on things that can't possibly be
726 valid Python attributes. After a bug report by Alex Schmolck.
730 valid Python attributes. After a bug report by Alex Schmolck.
727 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
731 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
728 %magic with explicit % prefix.
732 %magic with explicit % prefix.
729
733
730 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
734 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
731
735
732 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
736 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
733 avoid a DeprecationWarning from GTK.
737 avoid a DeprecationWarning from GTK.
734
738
735 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
739 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
736
740
737 * IPython/genutils.py (clock): I modified clock() to return total
741 * IPython/genutils.py (clock): I modified clock() to return total
738 time, user+system. This is a more commonly needed metric. I also
742 time, user+system. This is a more commonly needed metric. I also
739 introduced the new clocku/clocks to get only user/system time if
743 introduced the new clocku/clocks to get only user/system time if
740 one wants those instead.
744 one wants those instead.
741
745
742 ***WARNING: API CHANGE*** clock() used to return only user time,
746 ***WARNING: API CHANGE*** clock() used to return only user time,
743 so if you want exactly the same results as before, use clocku
747 so if you want exactly the same results as before, use clocku
744 instead.
748 instead.
745
749
746 2007-02-22 Ville Vainio <vivainio@gmail.com>
750 2007-02-22 Ville Vainio <vivainio@gmail.com>
747
751
748 * IPython/Extensions/ipy_p4.py: Extension for improved
752 * IPython/Extensions/ipy_p4.py: Extension for improved
749 p4 (perforce version control system) experience.
753 p4 (perforce version control system) experience.
750 Adds %p4 magic with p4 command completion and
754 Adds %p4 magic with p4 command completion and
751 automatic -G argument (marshall output as python dict)
755 automatic -G argument (marshall output as python dict)
752
756
753 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
757 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
754
758
755 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
759 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
756 stop marks.
760 stop marks.
757 (ClearingMixin): a simple mixin to easily make a Demo class clear
761 (ClearingMixin): a simple mixin to easily make a Demo class clear
758 the screen in between blocks and have empty marquees. The
762 the screen in between blocks and have empty marquees. The
759 ClearDemo and ClearIPDemo classes that use it are included.
763 ClearDemo and ClearIPDemo classes that use it are included.
760
764
761 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
765 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
762
766
763 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
767 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
764 protect against exceptions at Python shutdown time. Patch
768 protect against exceptions at Python shutdown time. Patch
765 sumbmitted to upstream.
769 sumbmitted to upstream.
766
770
767 2007-02-14 Walter Doerwald <walter@livinglogic.de>
771 2007-02-14 Walter Doerwald <walter@livinglogic.de>
768
772
769 * IPython/Extensions/ibrowse.py: If entering the first object level
773 * IPython/Extensions/ibrowse.py: If entering the first object level
770 (i.e. the object for which the browser has been started) fails,
774 (i.e. the object for which the browser has been started) fails,
771 now the error is raised directly (aborting the browser) instead of
775 now the error is raised directly (aborting the browser) instead of
772 running into an empty levels list later.
776 running into an empty levels list later.
773
777
774 2007-02-03 Walter Doerwald <walter@livinglogic.de>
778 2007-02-03 Walter Doerwald <walter@livinglogic.de>
775
779
776 * IPython/Extensions/ipipe.py: Add an xrepr implementation
780 * IPython/Extensions/ipipe.py: Add an xrepr implementation
777 for the noitem object.
781 for the noitem object.
778
782
779 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
783 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
780
784
781 * IPython/completer.py (Completer.attr_matches): Fix small
785 * IPython/completer.py (Completer.attr_matches): Fix small
782 tab-completion bug with Enthought Traits objects with units.
786 tab-completion bug with Enthought Traits objects with units.
783 Thanks to a bug report by Tom Denniston
787 Thanks to a bug report by Tom Denniston
784 <tom.denniston-AT-alum.dartmouth.org>.
788 <tom.denniston-AT-alum.dartmouth.org>.
785
789
786 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
790 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
787
791
788 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
792 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
789 bug where only .ipy or .py would be completed. Once the first
793 bug where only .ipy or .py would be completed. Once the first
790 argument to %run has been given, all completions are valid because
794 argument to %run has been given, all completions are valid because
791 they are the arguments to the script, which may well be non-python
795 they are the arguments to the script, which may well be non-python
792 filenames.
796 filenames.
793
797
794 * IPython/irunner.py (InteractiveRunner.run_source): major updates
798 * IPython/irunner.py (InteractiveRunner.run_source): major updates
795 to irunner to allow it to correctly support real doctesting of
799 to irunner to allow it to correctly support real doctesting of
796 out-of-process ipython code.
800 out-of-process ipython code.
797
801
798 * IPython/Magic.py (magic_cd): Make the setting of the terminal
802 * IPython/Magic.py (magic_cd): Make the setting of the terminal
799 title an option (-noterm_title) because it completely breaks
803 title an option (-noterm_title) because it completely breaks
800 doctesting.
804 doctesting.
801
805
802 * IPython/demo.py: fix IPythonDemo class that was not actually working.
806 * IPython/demo.py: fix IPythonDemo class that was not actually working.
803
807
804 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
808 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
805
809
806 * IPython/irunner.py (main): fix small bug where extensions were
810 * IPython/irunner.py (main): fix small bug where extensions were
807 not being correctly recognized.
811 not being correctly recognized.
808
812
809 2007-01-23 Walter Doerwald <walter@livinglogic.de>
813 2007-01-23 Walter Doerwald <walter@livinglogic.de>
810
814
811 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
815 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
812 a string containing a single line yields the string itself as the
816 a string containing a single line yields the string itself as the
813 only item.
817 only item.
814
818
815 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
819 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
816 object if it's the same as the one on the last level (This avoids
820 object if it's the same as the one on the last level (This avoids
817 infinite recursion for one line strings).
821 infinite recursion for one line strings).
818
822
819 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
823 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
820
824
821 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
825 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
822 all output streams before printing tracebacks. This ensures that
826 all output streams before printing tracebacks. This ensures that
823 user output doesn't end up interleaved with traceback output.
827 user output doesn't end up interleaved with traceback output.
824
828
825 2007-01-10 Ville Vainio <vivainio@gmail.com>
829 2007-01-10 Ville Vainio <vivainio@gmail.com>
826
830
827 * Extensions/envpersist.py: Turbocharged %env that remembers
831 * Extensions/envpersist.py: Turbocharged %env that remembers
828 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
832 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
829 "%env VISUAL=jed".
833 "%env VISUAL=jed".
830
834
831 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
835 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
832
836
833 * IPython/iplib.py (showtraceback): ensure that we correctly call
837 * IPython/iplib.py (showtraceback): ensure that we correctly call
834 custom handlers in all cases (some with pdb were slipping through,
838 custom handlers in all cases (some with pdb were slipping through,
835 but I'm not exactly sure why).
839 but I'm not exactly sure why).
836
840
837 * IPython/Debugger.py (Tracer.__init__): added new class to
841 * IPython/Debugger.py (Tracer.__init__): added new class to
838 support set_trace-like usage of IPython's enhanced debugger.
842 support set_trace-like usage of IPython's enhanced debugger.
839
843
840 2006-12-24 Ville Vainio <vivainio@gmail.com>
844 2006-12-24 Ville Vainio <vivainio@gmail.com>
841
845
842 * ipmaker.py: more informative message when ipy_user_conf
846 * ipmaker.py: more informative message when ipy_user_conf
843 import fails (suggest running %upgrade).
847 import fails (suggest running %upgrade).
844
848
845 * tools/run_ipy_in_profiler.py: Utility to see where
849 * tools/run_ipy_in_profiler.py: Utility to see where
846 the time during IPython startup is spent.
850 the time during IPython startup is spent.
847
851
848 2006-12-20 Ville Vainio <vivainio@gmail.com>
852 2006-12-20 Ville Vainio <vivainio@gmail.com>
849
853
850 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
854 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
851
855
852 * ipapi.py: Add new ipapi method, expand_alias.
856 * ipapi.py: Add new ipapi method, expand_alias.
853
857
854 * Release.py: Bump up version to 0.7.4.svn
858 * Release.py: Bump up version to 0.7.4.svn
855
859
856 2006-12-17 Ville Vainio <vivainio@gmail.com>
860 2006-12-17 Ville Vainio <vivainio@gmail.com>
857
861
858 * Extensions/jobctrl.py: Fixed &cmd arg arg...
862 * Extensions/jobctrl.py: Fixed &cmd arg arg...
859 to work properly on posix too
863 to work properly on posix too
860
864
861 * Release.py: Update revnum (version is still just 0.7.3).
865 * Release.py: Update revnum (version is still just 0.7.3).
862
866
863 2006-12-15 Ville Vainio <vivainio@gmail.com>
867 2006-12-15 Ville Vainio <vivainio@gmail.com>
864
868
865 * scripts/ipython_win_post_install: create ipython.py in
869 * scripts/ipython_win_post_install: create ipython.py in
866 prefix + "/scripts".
870 prefix + "/scripts".
867
871
868 * Release.py: Update version to 0.7.3.
872 * Release.py: Update version to 0.7.3.
869
873
870 2006-12-14 Ville Vainio <vivainio@gmail.com>
874 2006-12-14 Ville Vainio <vivainio@gmail.com>
871
875
872 * scripts/ipython_win_post_install: Overwrite old shortcuts
876 * scripts/ipython_win_post_install: Overwrite old shortcuts
873 if they already exist
877 if they already exist
874
878
875 * Release.py: release 0.7.3rc2
879 * Release.py: release 0.7.3rc2
876
880
877 2006-12-13 Ville Vainio <vivainio@gmail.com>
881 2006-12-13 Ville Vainio <vivainio@gmail.com>
878
882
879 * Branch and update Release.py for 0.7.3rc1
883 * Branch and update Release.py for 0.7.3rc1
880
884
881 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
885 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
882
886
883 * IPython/Shell.py (IPShellWX): update for current WX naming
887 * IPython/Shell.py (IPShellWX): update for current WX naming
884 conventions, to avoid a deprecation warning with current WX
888 conventions, to avoid a deprecation warning with current WX
885 versions. Thanks to a report by Danny Shevitz.
889 versions. Thanks to a report by Danny Shevitz.
886
890
887 2006-12-12 Ville Vainio <vivainio@gmail.com>
891 2006-12-12 Ville Vainio <vivainio@gmail.com>
888
892
889 * ipmaker.py: apply david cournapeau's patch to make
893 * ipmaker.py: apply david cournapeau's patch to make
890 import_some work properly even when ipythonrc does
894 import_some work properly even when ipythonrc does
891 import_some on empty list (it was an old bug!).
895 import_some on empty list (it was an old bug!).
892
896
893 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
897 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
894 Add deprecation note to ipythonrc and a url to wiki
898 Add deprecation note to ipythonrc and a url to wiki
895 in ipy_user_conf.py
899 in ipy_user_conf.py
896
900
897
901
898 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
902 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
899 as if it was typed on IPython command prompt, i.e.
903 as if it was typed on IPython command prompt, i.e.
900 as IPython script.
904 as IPython script.
901
905
902 * example-magic.py, magic_grepl.py: remove outdated examples
906 * example-magic.py, magic_grepl.py: remove outdated examples
903
907
904 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
908 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
905
909
906 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
910 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
907 is called before any exception has occurred.
911 is called before any exception has occurred.
908
912
909 2006-12-08 Ville Vainio <vivainio@gmail.com>
913 2006-12-08 Ville Vainio <vivainio@gmail.com>
910
914
911 * Extensions/ipy_stock_completers.py: fix cd completer
915 * Extensions/ipy_stock_completers.py: fix cd completer
912 to translate /'s to \'s again.
916 to translate /'s to \'s again.
913
917
914 * completer.py: prevent traceback on file completions w/
918 * completer.py: prevent traceback on file completions w/
915 backslash.
919 backslash.
916
920
917 * Release.py: Update release number to 0.7.3b3 for release
921 * Release.py: Update release number to 0.7.3b3 for release
918
922
919 2006-12-07 Ville Vainio <vivainio@gmail.com>
923 2006-12-07 Ville Vainio <vivainio@gmail.com>
920
924
921 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
925 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
922 while executing external code. Provides more shell-like behaviour
926 while executing external code. Provides more shell-like behaviour
923 and overall better response to ctrl + C / ctrl + break.
927 and overall better response to ctrl + C / ctrl + break.
924
928
925 * tools/make_tarball.py: new script to create tarball straight from svn
929 * tools/make_tarball.py: new script to create tarball straight from svn
926 (setup.py sdist doesn't work on win32).
930 (setup.py sdist doesn't work on win32).
927
931
928 * Extensions/ipy_stock_completers.py: fix cd completer to give up
932 * Extensions/ipy_stock_completers.py: fix cd completer to give up
929 on dirnames with spaces and use the default completer instead.
933 on dirnames with spaces and use the default completer instead.
930
934
931 * Revision.py: Change version to 0.7.3b2 for release.
935 * Revision.py: Change version to 0.7.3b2 for release.
932
936
933 2006-12-05 Ville Vainio <vivainio@gmail.com>
937 2006-12-05 Ville Vainio <vivainio@gmail.com>
934
938
935 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
939 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
936 pydb patch 4 (rm debug printing, py 2.5 checking)
940 pydb patch 4 (rm debug printing, py 2.5 checking)
937
941
938 2006-11-30 Walter Doerwald <walter@livinglogic.de>
942 2006-11-30 Walter Doerwald <walter@livinglogic.de>
939 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
943 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
940 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
944 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
941 "refreshfind" (mapped to "R") does the same but tries to go back to the same
945 "refreshfind" (mapped to "R") does the same but tries to go back to the same
942 object the cursor was on before the refresh. The command "markrange" is
946 object the cursor was on before the refresh. The command "markrange" is
943 mapped to "%" now.
947 mapped to "%" now.
944 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
948 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
945
949
946 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
950 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
947
951
948 * IPython/Magic.py (magic_debug): new %debug magic to activate the
952 * IPython/Magic.py (magic_debug): new %debug magic to activate the
949 interactive debugger on the last traceback, without having to call
953 interactive debugger on the last traceback, without having to call
950 %pdb and rerun your code. Made minor changes in various modules,
954 %pdb and rerun your code. Made minor changes in various modules,
951 should automatically recognize pydb if available.
955 should automatically recognize pydb if available.
952
956
953 2006-11-28 Ville Vainio <vivainio@gmail.com>
957 2006-11-28 Ville Vainio <vivainio@gmail.com>
954
958
955 * completer.py: If the text start with !, show file completions
959 * completer.py: If the text start with !, show file completions
956 properly. This helps when trying to complete command name
960 properly. This helps when trying to complete command name
957 for shell escapes.
961 for shell escapes.
958
962
959 2006-11-27 Ville Vainio <vivainio@gmail.com>
963 2006-11-27 Ville Vainio <vivainio@gmail.com>
960
964
961 * ipy_stock_completers.py: bzr completer submitted by Stefan van
965 * ipy_stock_completers.py: bzr completer submitted by Stefan van
962 der Walt. Clean up svn and hg completers by using a common
966 der Walt. Clean up svn and hg completers by using a common
963 vcs_completer.
967 vcs_completer.
964
968
965 2006-11-26 Ville Vainio <vivainio@gmail.com>
969 2006-11-26 Ville Vainio <vivainio@gmail.com>
966
970
967 * Remove ipconfig and %config; you should use _ip.options structure
971 * Remove ipconfig and %config; you should use _ip.options structure
968 directly instead!
972 directly instead!
969
973
970 * genutils.py: add wrap_deprecated function for deprecating callables
974 * genutils.py: add wrap_deprecated function for deprecating callables
971
975
972 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
976 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
973 _ip.system instead. ipalias is redundant.
977 _ip.system instead. ipalias is redundant.
974
978
975 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
979 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
976 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
980 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
977 explicit.
981 explicit.
978
982
979 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
983 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
980 completer. Try it by entering 'hg ' and pressing tab.
984 completer. Try it by entering 'hg ' and pressing tab.
981
985
982 * macro.py: Give Macro a useful __repr__ method
986 * macro.py: Give Macro a useful __repr__ method
983
987
984 * Magic.py: %whos abbreviates the typename of Macro for brevity.
988 * Magic.py: %whos abbreviates the typename of Macro for brevity.
985
989
986 2006-11-24 Walter Doerwald <walter@livinglogic.de>
990 2006-11-24 Walter Doerwald <walter@livinglogic.de>
987 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
991 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
988 we don't get a duplicate ipipe module, where registration of the xrepr
992 we don't get a duplicate ipipe module, where registration of the xrepr
989 implementation for Text is useless.
993 implementation for Text is useless.
990
994
991 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
995 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
992
996
993 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
997 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
994
998
995 2006-11-24 Ville Vainio <vivainio@gmail.com>
999 2006-11-24 Ville Vainio <vivainio@gmail.com>
996
1000
997 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1001 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
998 try to use "cProfile" instead of the slower pure python
1002 try to use "cProfile" instead of the slower pure python
999 "profile"
1003 "profile"
1000
1004
1001 2006-11-23 Ville Vainio <vivainio@gmail.com>
1005 2006-11-23 Ville Vainio <vivainio@gmail.com>
1002
1006
1003 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1007 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1004 Qt+IPython+Designer link in documentation.
1008 Qt+IPython+Designer link in documentation.
1005
1009
1006 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1010 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1007 correct Pdb object to %pydb.
1011 correct Pdb object to %pydb.
1008
1012
1009
1013
1010 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1014 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1011 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1015 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1012 generic xrepr(), otherwise the list implementation would kick in.
1016 generic xrepr(), otherwise the list implementation would kick in.
1013
1017
1014 2006-11-21 Ville Vainio <vivainio@gmail.com>
1018 2006-11-21 Ville Vainio <vivainio@gmail.com>
1015
1019
1016 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1020 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1017 with one from UserConfig.
1021 with one from UserConfig.
1018
1022
1019 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1023 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1020 it was missing which broke the sh profile.
1024 it was missing which broke the sh profile.
1021
1025
1022 * completer.py: file completer now uses explicit '/' instead
1026 * completer.py: file completer now uses explicit '/' instead
1023 of os.path.join, expansion of 'foo' was broken on win32
1027 of os.path.join, expansion of 'foo' was broken on win32
1024 if there was one directory with name 'foobar'.
1028 if there was one directory with name 'foobar'.
1025
1029
1026 * A bunch of patches from Kirill Smelkov:
1030 * A bunch of patches from Kirill Smelkov:
1027
1031
1028 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1032 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1029
1033
1030 * [patch 7/9] Implement %page -r (page in raw mode) -
1034 * [patch 7/9] Implement %page -r (page in raw mode) -
1031
1035
1032 * [patch 5/9] ScientificPython webpage has moved
1036 * [patch 5/9] ScientificPython webpage has moved
1033
1037
1034 * [patch 4/9] The manual mentions %ds, should be %dhist
1038 * [patch 4/9] The manual mentions %ds, should be %dhist
1035
1039
1036 * [patch 3/9] Kill old bits from %prun doc.
1040 * [patch 3/9] Kill old bits from %prun doc.
1037
1041
1038 * [patch 1/9] Fix typos here and there.
1042 * [patch 1/9] Fix typos here and there.
1039
1043
1040 2006-11-08 Ville Vainio <vivainio@gmail.com>
1044 2006-11-08 Ville Vainio <vivainio@gmail.com>
1041
1045
1042 * completer.py (attr_matches): catch all exceptions raised
1046 * completer.py (attr_matches): catch all exceptions raised
1043 by eval of expr with dots.
1047 by eval of expr with dots.
1044
1048
1045 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1049 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1046
1050
1047 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1051 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1048 input if it starts with whitespace. This allows you to paste
1052 input if it starts with whitespace. This allows you to paste
1049 indented input from any editor without manually having to type in
1053 indented input from any editor without manually having to type in
1050 the 'if 1:', which is convenient when working interactively.
1054 the 'if 1:', which is convenient when working interactively.
1051 Slightly modifed version of a patch by Bo Peng
1055 Slightly modifed version of a patch by Bo Peng
1052 <bpeng-AT-rice.edu>.
1056 <bpeng-AT-rice.edu>.
1053
1057
1054 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1058 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1055
1059
1056 * IPython/irunner.py (main): modified irunner so it automatically
1060 * IPython/irunner.py (main): modified irunner so it automatically
1057 recognizes the right runner to use based on the extension (.py for
1061 recognizes the right runner to use based on the extension (.py for
1058 python, .ipy for ipython and .sage for sage).
1062 python, .ipy for ipython and .sage for sage).
1059
1063
1060 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1064 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1061 visible in ipapi as ip.config(), to programatically control the
1065 visible in ipapi as ip.config(), to programatically control the
1062 internal rc object. There's an accompanying %config magic for
1066 internal rc object. There's an accompanying %config magic for
1063 interactive use, which has been enhanced to match the
1067 interactive use, which has been enhanced to match the
1064 funtionality in ipconfig.
1068 funtionality in ipconfig.
1065
1069
1066 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1070 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1067 so it's not just a toggle, it now takes an argument. Add support
1071 so it's not just a toggle, it now takes an argument. Add support
1068 for a customizable header when making system calls, as the new
1072 for a customizable header when making system calls, as the new
1069 system_header variable in the ipythonrc file.
1073 system_header variable in the ipythonrc file.
1070
1074
1071 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1075 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1072
1076
1073 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1077 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1074 generic functions (using Philip J. Eby's simplegeneric package).
1078 generic functions (using Philip J. Eby's simplegeneric package).
1075 This makes it possible to customize the display of third-party classes
1079 This makes it possible to customize the display of third-party classes
1076 without having to monkeypatch them. xiter() no longer supports a mode
1080 without having to monkeypatch them. xiter() no longer supports a mode
1077 argument and the XMode class has been removed. The same functionality can
1081 argument and the XMode class has been removed. The same functionality can
1078 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1082 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1079 One consequence of the switch to generic functions is that xrepr() and
1083 One consequence of the switch to generic functions is that xrepr() and
1080 xattrs() implementation must define the default value for the mode
1084 xattrs() implementation must define the default value for the mode
1081 argument themselves and xattrs() implementations must return real
1085 argument themselves and xattrs() implementations must return real
1082 descriptors.
1086 descriptors.
1083
1087
1084 * IPython/external: This new subpackage will contain all third-party
1088 * IPython/external: This new subpackage will contain all third-party
1085 packages that are bundled with IPython. (The first one is simplegeneric).
1089 packages that are bundled with IPython. (The first one is simplegeneric).
1086
1090
1087 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1091 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1088 directory which as been dropped in r1703.
1092 directory which as been dropped in r1703.
1089
1093
1090 * IPython/Extensions/ipipe.py (iless): Fixed.
1094 * IPython/Extensions/ipipe.py (iless): Fixed.
1091
1095
1092 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1096 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1093
1097
1094 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1098 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1095
1099
1096 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1100 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1097 handling in variable expansion so that shells and magics recognize
1101 handling in variable expansion so that shells and magics recognize
1098 function local scopes correctly. Bug reported by Brian.
1102 function local scopes correctly. Bug reported by Brian.
1099
1103
1100 * scripts/ipython: remove the very first entry in sys.path which
1104 * scripts/ipython: remove the very first entry in sys.path which
1101 Python auto-inserts for scripts, so that sys.path under IPython is
1105 Python auto-inserts for scripts, so that sys.path under IPython is
1102 as similar as possible to that under plain Python.
1106 as similar as possible to that under plain Python.
1103
1107
1104 * IPython/completer.py (IPCompleter.file_matches): Fix
1108 * IPython/completer.py (IPCompleter.file_matches): Fix
1105 tab-completion so that quotes are not closed unless the completion
1109 tab-completion so that quotes are not closed unless the completion
1106 is unambiguous. After a request by Stefan. Minor cleanups in
1110 is unambiguous. After a request by Stefan. Minor cleanups in
1107 ipy_stock_completers.
1111 ipy_stock_completers.
1108
1112
1109 2006-11-02 Ville Vainio <vivainio@gmail.com>
1113 2006-11-02 Ville Vainio <vivainio@gmail.com>
1110
1114
1111 * ipy_stock_completers.py: Add %run and %cd completers.
1115 * ipy_stock_completers.py: Add %run and %cd completers.
1112
1116
1113 * completer.py: Try running custom completer for both
1117 * completer.py: Try running custom completer for both
1114 "foo" and "%foo" if the command is just "foo". Ignore case
1118 "foo" and "%foo" if the command is just "foo". Ignore case
1115 when filtering possible completions.
1119 when filtering possible completions.
1116
1120
1117 * UserConfig/ipy_user_conf.py: install stock completers as default
1121 * UserConfig/ipy_user_conf.py: install stock completers as default
1118
1122
1119 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1123 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1120 simplified readline history save / restore through a wrapper
1124 simplified readline history save / restore through a wrapper
1121 function
1125 function
1122
1126
1123
1127
1124 2006-10-31 Ville Vainio <vivainio@gmail.com>
1128 2006-10-31 Ville Vainio <vivainio@gmail.com>
1125
1129
1126 * strdispatch.py, completer.py, ipy_stock_completers.py:
1130 * strdispatch.py, completer.py, ipy_stock_completers.py:
1127 Allow str_key ("command") in completer hooks. Implement
1131 Allow str_key ("command") in completer hooks. Implement
1128 trivial completer for 'import' (stdlib modules only). Rename
1132 trivial completer for 'import' (stdlib modules only). Rename
1129 ipy_linux_package_managers.py to ipy_stock_completers.py.
1133 ipy_linux_package_managers.py to ipy_stock_completers.py.
1130 SVN completer.
1134 SVN completer.
1131
1135
1132 * Extensions/ledit.py: %magic line editor for easily and
1136 * Extensions/ledit.py: %magic line editor for easily and
1133 incrementally manipulating lists of strings. The magic command
1137 incrementally manipulating lists of strings. The magic command
1134 name is %led.
1138 name is %led.
1135
1139
1136 2006-10-30 Ville Vainio <vivainio@gmail.com>
1140 2006-10-30 Ville Vainio <vivainio@gmail.com>
1137
1141
1138 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1142 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1139 Bernsteins's patches for pydb integration.
1143 Bernsteins's patches for pydb integration.
1140 http://bashdb.sourceforge.net/pydb/
1144 http://bashdb.sourceforge.net/pydb/
1141
1145
1142 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1146 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1143 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1147 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1144 custom completer hook to allow the users to implement their own
1148 custom completer hook to allow the users to implement their own
1145 completers. See ipy_linux_package_managers.py for example. The
1149 completers. See ipy_linux_package_managers.py for example. The
1146 hook name is 'complete_command'.
1150 hook name is 'complete_command'.
1147
1151
1148 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1152 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1149
1153
1150 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1154 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1151 Numeric leftovers.
1155 Numeric leftovers.
1152
1156
1153 * ipython.el (py-execute-region): apply Stefan's patch to fix
1157 * ipython.el (py-execute-region): apply Stefan's patch to fix
1154 garbled results if the python shell hasn't been previously started.
1158 garbled results if the python shell hasn't been previously started.
1155
1159
1156 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1160 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1157 pretty generic function and useful for other things.
1161 pretty generic function and useful for other things.
1158
1162
1159 * IPython/OInspect.py (getsource): Add customizable source
1163 * IPython/OInspect.py (getsource): Add customizable source
1160 extractor. After a request/patch form W. Stein (SAGE).
1164 extractor. After a request/patch form W. Stein (SAGE).
1161
1165
1162 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1166 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1163 window size to a more reasonable value from what pexpect does,
1167 window size to a more reasonable value from what pexpect does,
1164 since their choice causes wrapping bugs with long input lines.
1168 since their choice causes wrapping bugs with long input lines.
1165
1169
1166 2006-10-28 Ville Vainio <vivainio@gmail.com>
1170 2006-10-28 Ville Vainio <vivainio@gmail.com>
1167
1171
1168 * Magic.py (%run): Save and restore the readline history from
1172 * Magic.py (%run): Save and restore the readline history from
1169 file around %run commands to prevent side effects from
1173 file around %run commands to prevent side effects from
1170 %runned programs that might use readline (e.g. pydb).
1174 %runned programs that might use readline (e.g. pydb).
1171
1175
1172 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1176 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1173 invoking the pydb enhanced debugger.
1177 invoking the pydb enhanced debugger.
1174
1178
1175 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1179 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1176
1180
1177 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1181 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1178 call the base class method and propagate the return value to
1182 call the base class method and propagate the return value to
1179 ifile. This is now done by path itself.
1183 ifile. This is now done by path itself.
1180
1184
1181 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1185 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1182
1186
1183 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1187 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1184 api: set_crash_handler(), to expose the ability to change the
1188 api: set_crash_handler(), to expose the ability to change the
1185 internal crash handler.
1189 internal crash handler.
1186
1190
1187 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1191 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1188 the various parameters of the crash handler so that apps using
1192 the various parameters of the crash handler so that apps using
1189 IPython as their engine can customize crash handling. Ipmlemented
1193 IPython as their engine can customize crash handling. Ipmlemented
1190 at the request of SAGE.
1194 at the request of SAGE.
1191
1195
1192 2006-10-14 Ville Vainio <vivainio@gmail.com>
1196 2006-10-14 Ville Vainio <vivainio@gmail.com>
1193
1197
1194 * Magic.py, ipython.el: applied first "safe" part of Rocky
1198 * Magic.py, ipython.el: applied first "safe" part of Rocky
1195 Bernstein's patch set for pydb integration.
1199 Bernstein's patch set for pydb integration.
1196
1200
1197 * Magic.py (%unalias, %alias): %store'd aliases can now be
1201 * Magic.py (%unalias, %alias): %store'd aliases can now be
1198 removed with '%unalias'. %alias w/o args now shows most
1202 removed with '%unalias'. %alias w/o args now shows most
1199 interesting (stored / manually defined) aliases last
1203 interesting (stored / manually defined) aliases last
1200 where they catch the eye w/o scrolling.
1204 where they catch the eye w/o scrolling.
1201
1205
1202 * Magic.py (%rehashx), ext_rehashdir.py: files with
1206 * Magic.py (%rehashx), ext_rehashdir.py: files with
1203 'py' extension are always considered executable, even
1207 'py' extension are always considered executable, even
1204 when not in PATHEXT environment variable.
1208 when not in PATHEXT environment variable.
1205
1209
1206 2006-10-12 Ville Vainio <vivainio@gmail.com>
1210 2006-10-12 Ville Vainio <vivainio@gmail.com>
1207
1211
1208 * jobctrl.py: Add new "jobctrl" extension for spawning background
1212 * jobctrl.py: Add new "jobctrl" extension for spawning background
1209 processes with "&find /". 'import jobctrl' to try it out. Requires
1213 processes with "&find /". 'import jobctrl' to try it out. Requires
1210 'subprocess' module, standard in python 2.4+.
1214 'subprocess' module, standard in python 2.4+.
1211
1215
1212 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1216 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1213 so if foo -> bar and bar -> baz, then foo -> baz.
1217 so if foo -> bar and bar -> baz, then foo -> baz.
1214
1218
1215 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1219 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1216
1220
1217 * IPython/Magic.py (Magic.parse_options): add a new posix option
1221 * IPython/Magic.py (Magic.parse_options): add a new posix option
1218 to allow parsing of input args in magics that doesn't strip quotes
1222 to allow parsing of input args in magics that doesn't strip quotes
1219 (if posix=False). This also closes %timeit bug reported by
1223 (if posix=False). This also closes %timeit bug reported by
1220 Stefan.
1224 Stefan.
1221
1225
1222 2006-10-03 Ville Vainio <vivainio@gmail.com>
1226 2006-10-03 Ville Vainio <vivainio@gmail.com>
1223
1227
1224 * iplib.py (raw_input, interact): Return ValueError catching for
1228 * iplib.py (raw_input, interact): Return ValueError catching for
1225 raw_input. Fixes infinite loop for sys.stdin.close() or
1229 raw_input. Fixes infinite loop for sys.stdin.close() or
1226 sys.stdout.close().
1230 sys.stdout.close().
1227
1231
1228 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1232 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1229
1233
1230 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1234 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1231 to help in handling doctests. irunner is now pretty useful for
1235 to help in handling doctests. irunner is now pretty useful for
1232 running standalone scripts and simulate a full interactive session
1236 running standalone scripts and simulate a full interactive session
1233 in a format that can be then pasted as a doctest.
1237 in a format that can be then pasted as a doctest.
1234
1238
1235 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1239 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1236 on top of the default (useless) ones. This also fixes the nasty
1240 on top of the default (useless) ones. This also fixes the nasty
1237 way in which 2.5's Quitter() exits (reverted [1785]).
1241 way in which 2.5's Quitter() exits (reverted [1785]).
1238
1242
1239 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1243 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1240 2.5.
1244 2.5.
1241
1245
1242 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1246 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1243 color scheme is updated as well when color scheme is changed
1247 color scheme is updated as well when color scheme is changed
1244 interactively.
1248 interactively.
1245
1249
1246 2006-09-27 Ville Vainio <vivainio@gmail.com>
1250 2006-09-27 Ville Vainio <vivainio@gmail.com>
1247
1251
1248 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1252 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1249 infinite loop and just exit. It's a hack, but will do for a while.
1253 infinite loop and just exit. It's a hack, but will do for a while.
1250
1254
1251 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1255 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1252
1256
1253 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1257 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1254 the constructor, this makes it possible to get a list of only directories
1258 the constructor, this makes it possible to get a list of only directories
1255 or only files.
1259 or only files.
1256
1260
1257 2006-08-12 Ville Vainio <vivainio@gmail.com>
1261 2006-08-12 Ville Vainio <vivainio@gmail.com>
1258
1262
1259 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1263 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1260 they broke unittest
1264 they broke unittest
1261
1265
1262 2006-08-11 Ville Vainio <vivainio@gmail.com>
1266 2006-08-11 Ville Vainio <vivainio@gmail.com>
1263
1267
1264 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1268 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1265 by resolving issue properly, i.e. by inheriting FakeModule
1269 by resolving issue properly, i.e. by inheriting FakeModule
1266 from types.ModuleType. Pickling ipython interactive data
1270 from types.ModuleType. Pickling ipython interactive data
1267 should still work as usual (testing appreciated).
1271 should still work as usual (testing appreciated).
1268
1272
1269 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1273 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1270
1274
1271 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1275 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1272 running under python 2.3 with code from 2.4 to fix a bug with
1276 running under python 2.3 with code from 2.4 to fix a bug with
1273 help(). Reported by the Debian maintainers, Norbert Tretkowski
1277 help(). Reported by the Debian maintainers, Norbert Tretkowski
1274 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1278 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1275 <afayolle-AT-debian.org>.
1279 <afayolle-AT-debian.org>.
1276
1280
1277 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1281 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1278
1282
1279 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1283 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1280 (which was displaying "quit" twice).
1284 (which was displaying "quit" twice).
1281
1285
1282 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1286 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1283
1287
1284 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1288 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1285 the mode argument).
1289 the mode argument).
1286
1290
1287 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1291 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1288
1292
1289 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1293 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1290 not running under IPython.
1294 not running under IPython.
1291
1295
1292 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1296 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1293 and make it iterable (iterating over the attribute itself). Add two new
1297 and make it iterable (iterating over the attribute itself). Add two new
1294 magic strings for __xattrs__(): If the string starts with "-", the attribute
1298 magic strings for __xattrs__(): If the string starts with "-", the attribute
1295 will not be displayed in ibrowse's detail view (but it can still be
1299 will not be displayed in ibrowse's detail view (but it can still be
1296 iterated over). This makes it possible to add attributes that are large
1300 iterated over). This makes it possible to add attributes that are large
1297 lists or generator methods to the detail view. Replace magic attribute names
1301 lists or generator methods to the detail view. Replace magic attribute names
1298 and _attrname() and _getattr() with "descriptors": For each type of magic
1302 and _attrname() and _getattr() with "descriptors": For each type of magic
1299 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1303 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1300 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1304 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1301 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1305 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1302 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1306 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1303 are still supported.
1307 are still supported.
1304
1308
1305 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1309 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1306 fails in ibrowse.fetch(), the exception object is added as the last item
1310 fails in ibrowse.fetch(), the exception object is added as the last item
1307 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1311 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1308 a generator throws an exception midway through execution.
1312 a generator throws an exception midway through execution.
1309
1313
1310 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1314 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1311 encoding into methods.
1315 encoding into methods.
1312
1316
1313 2006-07-26 Ville Vainio <vivainio@gmail.com>
1317 2006-07-26 Ville Vainio <vivainio@gmail.com>
1314
1318
1315 * iplib.py: history now stores multiline input as single
1319 * iplib.py: history now stores multiline input as single
1316 history entries. Patch by Jorgen Cederlof.
1320 history entries. Patch by Jorgen Cederlof.
1317
1321
1318 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1322 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1319
1323
1320 * IPython/Extensions/ibrowse.py: Make cursor visible over
1324 * IPython/Extensions/ibrowse.py: Make cursor visible over
1321 non existing attributes.
1325 non existing attributes.
1322
1326
1323 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1327 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1324
1328
1325 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1329 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1326 error output of the running command doesn't mess up the screen.
1330 error output of the running command doesn't mess up the screen.
1327
1331
1328 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1332 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1329
1333
1330 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1334 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1331 argument. This sorts the items themselves.
1335 argument. This sorts the items themselves.
1332
1336
1333 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1337 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1334
1338
1335 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1339 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1336 Compile expression strings into code objects. This should speed
1340 Compile expression strings into code objects. This should speed
1337 up ifilter and friends somewhat.
1341 up ifilter and friends somewhat.
1338
1342
1339 2006-07-08 Ville Vainio <vivainio@gmail.com>
1343 2006-07-08 Ville Vainio <vivainio@gmail.com>
1340
1344
1341 * Magic.py: %cpaste now strips > from the beginning of lines
1345 * Magic.py: %cpaste now strips > from the beginning of lines
1342 to ease pasting quoted code from emails. Contributed by
1346 to ease pasting quoted code from emails. Contributed by
1343 Stefan van der Walt.
1347 Stefan van der Walt.
1344
1348
1345 2006-06-29 Ville Vainio <vivainio@gmail.com>
1349 2006-06-29 Ville Vainio <vivainio@gmail.com>
1346
1350
1347 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1351 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1348 mode, patch contributed by Darren Dale. NEEDS TESTING!
1352 mode, patch contributed by Darren Dale. NEEDS TESTING!
1349
1353
1350 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1354 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1351
1355
1352 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1356 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1353 a blue background. Fix fetching new display rows when the browser
1357 a blue background. Fix fetching new display rows when the browser
1354 scrolls more than a screenful (e.g. by using the goto command).
1358 scrolls more than a screenful (e.g. by using the goto command).
1355
1359
1356 2006-06-27 Ville Vainio <vivainio@gmail.com>
1360 2006-06-27 Ville Vainio <vivainio@gmail.com>
1357
1361
1358 * Magic.py (_inspect, _ofind) Apply David Huard's
1362 * Magic.py (_inspect, _ofind) Apply David Huard's
1359 patch for displaying the correct docstring for 'property'
1363 patch for displaying the correct docstring for 'property'
1360 attributes.
1364 attributes.
1361
1365
1362 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1366 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1363
1367
1364 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1368 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1365 commands into the methods implementing them.
1369 commands into the methods implementing them.
1366
1370
1367 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1371 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1368
1372
1369 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1373 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1370 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1374 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1371 autoindent support was authored by Jin Liu.
1375 autoindent support was authored by Jin Liu.
1372
1376
1373 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1377 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1374
1378
1375 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1379 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1376 for keymaps with a custom class that simplifies handling.
1380 for keymaps with a custom class that simplifies handling.
1377
1381
1378 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1382 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1379
1383
1380 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1384 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1381 resizing. This requires Python 2.5 to work.
1385 resizing. This requires Python 2.5 to work.
1382
1386
1383 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1387 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1384
1388
1385 * IPython/Extensions/ibrowse.py: Add two new commands to
1389 * IPython/Extensions/ibrowse.py: Add two new commands to
1386 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1390 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1387 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1391 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1388 attributes again. Remapped the help command to "?". Display
1392 attributes again. Remapped the help command to "?". Display
1389 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1393 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1390 as keys for the "home" and "end" commands. Add three new commands
1394 as keys for the "home" and "end" commands. Add three new commands
1391 to the input mode for "find" and friends: "delend" (CTRL-K)
1395 to the input mode for "find" and friends: "delend" (CTRL-K)
1392 deletes to the end of line. "incsearchup" searches upwards in the
1396 deletes to the end of line. "incsearchup" searches upwards in the
1393 command history for an input that starts with the text before the cursor.
1397 command history for an input that starts with the text before the cursor.
1394 "incsearchdown" does the same downwards. Removed a bogus mapping of
1398 "incsearchdown" does the same downwards. Removed a bogus mapping of
1395 the x key to "delete".
1399 the x key to "delete".
1396
1400
1397 2006-06-15 Ville Vainio <vivainio@gmail.com>
1401 2006-06-15 Ville Vainio <vivainio@gmail.com>
1398
1402
1399 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1403 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1400 used to create prompts dynamically, instead of the "old" way of
1404 used to create prompts dynamically, instead of the "old" way of
1401 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1405 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1402 way still works (it's invoked by the default hook), of course.
1406 way still works (it's invoked by the default hook), of course.
1403
1407
1404 * Prompts.py: added generate_output_prompt hook for altering output
1408 * Prompts.py: added generate_output_prompt hook for altering output
1405 prompt
1409 prompt
1406
1410
1407 * Release.py: Changed version string to 0.7.3.svn.
1411 * Release.py: Changed version string to 0.7.3.svn.
1408
1412
1409 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1413 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1410
1414
1411 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1415 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1412 the call to fetch() always tries to fetch enough data for at least one
1416 the call to fetch() always tries to fetch enough data for at least one
1413 full screen. This makes it possible to simply call moveto(0,0,True) in
1417 full screen. This makes it possible to simply call moveto(0,0,True) in
1414 the constructor. Fix typos and removed the obsolete goto attribute.
1418 the constructor. Fix typos and removed the obsolete goto attribute.
1415
1419
1416 2006-06-12 Ville Vainio <vivainio@gmail.com>
1420 2006-06-12 Ville Vainio <vivainio@gmail.com>
1417
1421
1418 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1422 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1419 allowing $variable interpolation within multiline statements,
1423 allowing $variable interpolation within multiline statements,
1420 though so far only with "sh" profile for a testing period.
1424 though so far only with "sh" profile for a testing period.
1421 The patch also enables splitting long commands with \ but it
1425 The patch also enables splitting long commands with \ but it
1422 doesn't work properly yet.
1426 doesn't work properly yet.
1423
1427
1424 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1428 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1425
1429
1426 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1430 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1427 input history and the position of the cursor in the input history for
1431 input history and the position of the cursor in the input history for
1428 the find, findbackwards and goto command.
1432 the find, findbackwards and goto command.
1429
1433
1430 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1434 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1431
1435
1432 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1436 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1433 implements the basic functionality of browser commands that require
1437 implements the basic functionality of browser commands that require
1434 input. Reimplement the goto, find and findbackwards commands as
1438 input. Reimplement the goto, find and findbackwards commands as
1435 subclasses of _CommandInput. Add an input history and keymaps to those
1439 subclasses of _CommandInput. Add an input history and keymaps to those
1436 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1440 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1437 execute commands.
1441 execute commands.
1438
1442
1439 2006-06-07 Ville Vainio <vivainio@gmail.com>
1443 2006-06-07 Ville Vainio <vivainio@gmail.com>
1440
1444
1441 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1445 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1442 running the batch files instead of leaving the session open.
1446 running the batch files instead of leaving the session open.
1443
1447
1444 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1448 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1445
1449
1446 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1450 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1447 the original fix was incomplete. Patch submitted by W. Maier.
1451 the original fix was incomplete. Patch submitted by W. Maier.
1448
1452
1449 2006-06-07 Ville Vainio <vivainio@gmail.com>
1453 2006-06-07 Ville Vainio <vivainio@gmail.com>
1450
1454
1451 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1455 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1452 Confirmation prompts can be supressed by 'quiet' option.
1456 Confirmation prompts can be supressed by 'quiet' option.
1453 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1457 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1454
1458
1455 2006-06-06 *** Released version 0.7.2
1459 2006-06-06 *** Released version 0.7.2
1456
1460
1457 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1461 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1458
1462
1459 * IPython/Release.py (version): Made 0.7.2 final for release.
1463 * IPython/Release.py (version): Made 0.7.2 final for release.
1460 Repo tagged and release cut.
1464 Repo tagged and release cut.
1461
1465
1462 2006-06-05 Ville Vainio <vivainio@gmail.com>
1466 2006-06-05 Ville Vainio <vivainio@gmail.com>
1463
1467
1464 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1468 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1465 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1469 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1466
1470
1467 * upgrade_dir.py: try import 'path' module a bit harder
1471 * upgrade_dir.py: try import 'path' module a bit harder
1468 (for %upgrade)
1472 (for %upgrade)
1469
1473
1470 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1474 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1471
1475
1472 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1476 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1473 instead of looping 20 times.
1477 instead of looping 20 times.
1474
1478
1475 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1479 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1476 correctly at initialization time. Bug reported by Krishna Mohan
1480 correctly at initialization time. Bug reported by Krishna Mohan
1477 Gundu <gkmohan-AT-gmail.com> on the user list.
1481 Gundu <gkmohan-AT-gmail.com> on the user list.
1478
1482
1479 * IPython/Release.py (version): Mark 0.7.2 version to start
1483 * IPython/Release.py (version): Mark 0.7.2 version to start
1480 testing for release on 06/06.
1484 testing for release on 06/06.
1481
1485
1482 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1486 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1483
1487
1484 * scripts/irunner: thin script interface so users don't have to
1488 * scripts/irunner: thin script interface so users don't have to
1485 find the module and call it as an executable, since modules rarely
1489 find the module and call it as an executable, since modules rarely
1486 live in people's PATH.
1490 live in people's PATH.
1487
1491
1488 * IPython/irunner.py (InteractiveRunner.__init__): added
1492 * IPython/irunner.py (InteractiveRunner.__init__): added
1489 delaybeforesend attribute to control delays with newer versions of
1493 delaybeforesend attribute to control delays with newer versions of
1490 pexpect. Thanks to detailed help from pexpect's author, Noah
1494 pexpect. Thanks to detailed help from pexpect's author, Noah
1491 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1495 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1492 correctly (it works in NoColor mode).
1496 correctly (it works in NoColor mode).
1493
1497
1494 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1498 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1495 SAGE list, from improper log() calls.
1499 SAGE list, from improper log() calls.
1496
1500
1497 2006-05-31 Ville Vainio <vivainio@gmail.com>
1501 2006-05-31 Ville Vainio <vivainio@gmail.com>
1498
1502
1499 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1503 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1500 with args in parens to work correctly with dirs that have spaces.
1504 with args in parens to work correctly with dirs that have spaces.
1501
1505
1502 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1506 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1503
1507
1504 * IPython/Logger.py (Logger.logstart): add option to log raw input
1508 * IPython/Logger.py (Logger.logstart): add option to log raw input
1505 instead of the processed one. A -r flag was added to the
1509 instead of the processed one. A -r flag was added to the
1506 %logstart magic used for controlling logging.
1510 %logstart magic used for controlling logging.
1507
1511
1508 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1512 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1509
1513
1510 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1514 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1511 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1515 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1512 recognize the option. After a bug report by Will Maier. This
1516 recognize the option. After a bug report by Will Maier. This
1513 closes #64 (will do it after confirmation from W. Maier).
1517 closes #64 (will do it after confirmation from W. Maier).
1514
1518
1515 * IPython/irunner.py: New module to run scripts as if manually
1519 * IPython/irunner.py: New module to run scripts as if manually
1516 typed into an interactive environment, based on pexpect. After a
1520 typed into an interactive environment, based on pexpect. After a
1517 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1521 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1518 ipython-user list. Simple unittests in the tests/ directory.
1522 ipython-user list. Simple unittests in the tests/ directory.
1519
1523
1520 * tools/release: add Will Maier, OpenBSD port maintainer, to
1524 * tools/release: add Will Maier, OpenBSD port maintainer, to
1521 recepients list. We are now officially part of the OpenBSD ports:
1525 recepients list. We are now officially part of the OpenBSD ports:
1522 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1526 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1523 work.
1527 work.
1524
1528
1525 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1529 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1526
1530
1527 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1531 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1528 so that it doesn't break tkinter apps.
1532 so that it doesn't break tkinter apps.
1529
1533
1530 * IPython/iplib.py (_prefilter): fix bug where aliases would
1534 * IPython/iplib.py (_prefilter): fix bug where aliases would
1531 shadow variables when autocall was fully off. Reported by SAGE
1535 shadow variables when autocall was fully off. Reported by SAGE
1532 author William Stein.
1536 author William Stein.
1533
1537
1534 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1538 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1535 at what detail level strings are computed when foo? is requested.
1539 at what detail level strings are computed when foo? is requested.
1536 This allows users to ask for example that the string form of an
1540 This allows users to ask for example that the string form of an
1537 object is only computed when foo?? is called, or even never, by
1541 object is only computed when foo?? is called, or even never, by
1538 setting the object_info_string_level >= 2 in the configuration
1542 setting the object_info_string_level >= 2 in the configuration
1539 file. This new option has been added and documented. After a
1543 file. This new option has been added and documented. After a
1540 request by SAGE to be able to control the printing of very large
1544 request by SAGE to be able to control the printing of very large
1541 objects more easily.
1545 objects more easily.
1542
1546
1543 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1547 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1544
1548
1545 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1549 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1546 from sys.argv, to be 100% consistent with how Python itself works
1550 from sys.argv, to be 100% consistent with how Python itself works
1547 (as seen for example with python -i file.py). After a bug report
1551 (as seen for example with python -i file.py). After a bug report
1548 by Jeffrey Collins.
1552 by Jeffrey Collins.
1549
1553
1550 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1554 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1551 nasty bug which was preventing custom namespaces with -pylab,
1555 nasty bug which was preventing custom namespaces with -pylab,
1552 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1556 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1553 compatibility (long gone from mpl).
1557 compatibility (long gone from mpl).
1554
1558
1555 * IPython/ipapi.py (make_session): name change: create->make. We
1559 * IPython/ipapi.py (make_session): name change: create->make. We
1556 use make in other places (ipmaker,...), it's shorter and easier to
1560 use make in other places (ipmaker,...), it's shorter and easier to
1557 type and say, etc. I'm trying to clean things before 0.7.2 so
1561 type and say, etc. I'm trying to clean things before 0.7.2 so
1558 that I can keep things stable wrt to ipapi in the chainsaw branch.
1562 that I can keep things stable wrt to ipapi in the chainsaw branch.
1559
1563
1560 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1564 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1561 python-mode recognizes our debugger mode. Add support for
1565 python-mode recognizes our debugger mode. Add support for
1562 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1566 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1563 <m.liu.jin-AT-gmail.com> originally written by
1567 <m.liu.jin-AT-gmail.com> originally written by
1564 doxgen-AT-newsmth.net (with minor modifications for xemacs
1568 doxgen-AT-newsmth.net (with minor modifications for xemacs
1565 compatibility)
1569 compatibility)
1566
1570
1567 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1571 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1568 tracebacks when walking the stack so that the stack tracking system
1572 tracebacks when walking the stack so that the stack tracking system
1569 in emacs' python-mode can identify the frames correctly.
1573 in emacs' python-mode can identify the frames correctly.
1570
1574
1571 * IPython/ipmaker.py (make_IPython): make the internal (and
1575 * IPython/ipmaker.py (make_IPython): make the internal (and
1572 default config) autoedit_syntax value false by default. Too many
1576 default config) autoedit_syntax value false by default. Too many
1573 users have complained to me (both on and off-list) about problems
1577 users have complained to me (both on and off-list) about problems
1574 with this option being on by default, so I'm making it default to
1578 with this option being on by default, so I'm making it default to
1575 off. It can still be enabled by anyone via the usual mechanisms.
1579 off. It can still be enabled by anyone via the usual mechanisms.
1576
1580
1577 * IPython/completer.py (Completer.attr_matches): add support for
1581 * IPython/completer.py (Completer.attr_matches): add support for
1578 PyCrust-style _getAttributeNames magic method. Patch contributed
1582 PyCrust-style _getAttributeNames magic method. Patch contributed
1579 by <mscott-AT-goldenspud.com>. Closes #50.
1583 by <mscott-AT-goldenspud.com>. Closes #50.
1580
1584
1581 * IPython/iplib.py (InteractiveShell.__init__): remove the
1585 * IPython/iplib.py (InteractiveShell.__init__): remove the
1582 deletion of exit/quit from __builtin__, which can break
1586 deletion of exit/quit from __builtin__, which can break
1583 third-party tools like the Zope debugging console. The
1587 third-party tools like the Zope debugging console. The
1584 %exit/%quit magics remain. In general, it's probably a good idea
1588 %exit/%quit magics remain. In general, it's probably a good idea
1585 not to delete anything from __builtin__, since we never know what
1589 not to delete anything from __builtin__, since we never know what
1586 that will break. In any case, python now (for 2.5) will support
1590 that will break. In any case, python now (for 2.5) will support
1587 'real' exit/quit, so this issue is moot. Closes #55.
1591 'real' exit/quit, so this issue is moot. Closes #55.
1588
1592
1589 * IPython/genutils.py (with_obj): rename the 'with' function to
1593 * IPython/genutils.py (with_obj): rename the 'with' function to
1590 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1594 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1591 becomes a language keyword. Closes #53.
1595 becomes a language keyword. Closes #53.
1592
1596
1593 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1597 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1594 __file__ attribute to this so it fools more things into thinking
1598 __file__ attribute to this so it fools more things into thinking
1595 it is a real module. Closes #59.
1599 it is a real module. Closes #59.
1596
1600
1597 * IPython/Magic.py (magic_edit): add -n option to open the editor
1601 * IPython/Magic.py (magic_edit): add -n option to open the editor
1598 at a specific line number. After a patch by Stefan van der Walt.
1602 at a specific line number. After a patch by Stefan van der Walt.
1599
1603
1600 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1604 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1601
1605
1602 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1606 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1603 reason the file could not be opened. After automatic crash
1607 reason the file could not be opened. After automatic crash
1604 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1608 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1605 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1609 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1606 (_should_recompile): Don't fire editor if using %bg, since there
1610 (_should_recompile): Don't fire editor if using %bg, since there
1607 is no file in the first place. From the same report as above.
1611 is no file in the first place. From the same report as above.
1608 (raw_input): protect against faulty third-party prefilters. After
1612 (raw_input): protect against faulty third-party prefilters. After
1609 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1613 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1610 while running under SAGE.
1614 while running under SAGE.
1611
1615
1612 2006-05-23 Ville Vainio <vivainio@gmail.com>
1616 2006-05-23 Ville Vainio <vivainio@gmail.com>
1613
1617
1614 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1618 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1615 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1619 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1616 now returns None (again), unless dummy is specifically allowed by
1620 now returns None (again), unless dummy is specifically allowed by
1617 ipapi.get(allow_dummy=True).
1621 ipapi.get(allow_dummy=True).
1618
1622
1619 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1623 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1620
1624
1621 * IPython: remove all 2.2-compatibility objects and hacks from
1625 * IPython: remove all 2.2-compatibility objects and hacks from
1622 everywhere, since we only support 2.3 at this point. Docs
1626 everywhere, since we only support 2.3 at this point. Docs
1623 updated.
1627 updated.
1624
1628
1625 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1629 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1626 Anything requiring extra validation can be turned into a Python
1630 Anything requiring extra validation can be turned into a Python
1627 property in the future. I used a property for the db one b/c
1631 property in the future. I used a property for the db one b/c
1628 there was a nasty circularity problem with the initialization
1632 there was a nasty circularity problem with the initialization
1629 order, which right now I don't have time to clean up.
1633 order, which right now I don't have time to clean up.
1630
1634
1631 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1635 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1632 another locking bug reported by Jorgen. I'm not 100% sure though,
1636 another locking bug reported by Jorgen. I'm not 100% sure though,
1633 so more testing is needed...
1637 so more testing is needed...
1634
1638
1635 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1639 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1636
1640
1637 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1641 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1638 local variables from any routine in user code (typically executed
1642 local variables from any routine in user code (typically executed
1639 with %run) directly into the interactive namespace. Very useful
1643 with %run) directly into the interactive namespace. Very useful
1640 when doing complex debugging.
1644 when doing complex debugging.
1641 (IPythonNotRunning): Changed the default None object to a dummy
1645 (IPythonNotRunning): Changed the default None object to a dummy
1642 whose attributes can be queried as well as called without
1646 whose attributes can be queried as well as called without
1643 exploding, to ease writing code which works transparently both in
1647 exploding, to ease writing code which works transparently both in
1644 and out of ipython and uses some of this API.
1648 and out of ipython and uses some of this API.
1645
1649
1646 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1650 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1647
1651
1648 * IPython/hooks.py (result_display): Fix the fact that our display
1652 * IPython/hooks.py (result_display): Fix the fact that our display
1649 hook was using str() instead of repr(), as the default python
1653 hook was using str() instead of repr(), as the default python
1650 console does. This had gone unnoticed b/c it only happened if
1654 console does. This had gone unnoticed b/c it only happened if
1651 %Pprint was off, but the inconsistency was there.
1655 %Pprint was off, but the inconsistency was there.
1652
1656
1653 2006-05-15 Ville Vainio <vivainio@gmail.com>
1657 2006-05-15 Ville Vainio <vivainio@gmail.com>
1654
1658
1655 * Oinspect.py: Only show docstring for nonexisting/binary files
1659 * Oinspect.py: Only show docstring for nonexisting/binary files
1656 when doing object??, closing ticket #62
1660 when doing object??, closing ticket #62
1657
1661
1658 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1662 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1659
1663
1660 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1664 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1661 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1665 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1662 was being released in a routine which hadn't checked if it had
1666 was being released in a routine which hadn't checked if it had
1663 been the one to acquire it.
1667 been the one to acquire it.
1664
1668
1665 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1669 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1666
1670
1667 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1671 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1668
1672
1669 2006-04-11 Ville Vainio <vivainio@gmail.com>
1673 2006-04-11 Ville Vainio <vivainio@gmail.com>
1670
1674
1671 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1675 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1672 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1676 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1673 prefilters, allowing stuff like magics and aliases in the file.
1677 prefilters, allowing stuff like magics and aliases in the file.
1674
1678
1675 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1679 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1676 added. Supported now are "%clear in" and "%clear out" (clear input and
1680 added. Supported now are "%clear in" and "%clear out" (clear input and
1677 output history, respectively). Also fixed CachedOutput.flush to
1681 output history, respectively). Also fixed CachedOutput.flush to
1678 properly flush the output cache.
1682 properly flush the output cache.
1679
1683
1680 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1684 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1681 half-success (and fail explicitly).
1685 half-success (and fail explicitly).
1682
1686
1683 2006-03-28 Ville Vainio <vivainio@gmail.com>
1687 2006-03-28 Ville Vainio <vivainio@gmail.com>
1684
1688
1685 * iplib.py: Fix quoting of aliases so that only argless ones
1689 * iplib.py: Fix quoting of aliases so that only argless ones
1686 are quoted
1690 are quoted
1687
1691
1688 2006-03-28 Ville Vainio <vivainio@gmail.com>
1692 2006-03-28 Ville Vainio <vivainio@gmail.com>
1689
1693
1690 * iplib.py: Quote aliases with spaces in the name.
1694 * iplib.py: Quote aliases with spaces in the name.
1691 "c:\program files\blah\bin" is now legal alias target.
1695 "c:\program files\blah\bin" is now legal alias target.
1692
1696
1693 * ext_rehashdir.py: Space no longer allowed as arg
1697 * ext_rehashdir.py: Space no longer allowed as arg
1694 separator, since space is legal in path names.
1698 separator, since space is legal in path names.
1695
1699
1696 2006-03-16 Ville Vainio <vivainio@gmail.com>
1700 2006-03-16 Ville Vainio <vivainio@gmail.com>
1697
1701
1698 * upgrade_dir.py: Take path.py from Extensions, correcting
1702 * upgrade_dir.py: Take path.py from Extensions, correcting
1699 %upgrade magic
1703 %upgrade magic
1700
1704
1701 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1705 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1702
1706
1703 * hooks.py: Only enclose editor binary in quotes if legal and
1707 * hooks.py: Only enclose editor binary in quotes if legal and
1704 necessary (space in the name, and is an existing file). Fixes a bug
1708 necessary (space in the name, and is an existing file). Fixes a bug
1705 reported by Zachary Pincus.
1709 reported by Zachary Pincus.
1706
1710
1707 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1711 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1708
1712
1709 * Manual: thanks to a tip on proper color handling for Emacs, by
1713 * Manual: thanks to a tip on proper color handling for Emacs, by
1710 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1714 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1711
1715
1712 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1716 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1713 by applying the provided patch. Thanks to Liu Jin
1717 by applying the provided patch. Thanks to Liu Jin
1714 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1718 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1715 XEmacs/Linux, I'm trusting the submitter that it actually helps
1719 XEmacs/Linux, I'm trusting the submitter that it actually helps
1716 under win32/GNU Emacs. Will revisit if any problems are reported.
1720 under win32/GNU Emacs. Will revisit if any problems are reported.
1717
1721
1718 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1722 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1719
1723
1720 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1724 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1721 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1725 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1722
1726
1723 2006-03-12 Ville Vainio <vivainio@gmail.com>
1727 2006-03-12 Ville Vainio <vivainio@gmail.com>
1724
1728
1725 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1729 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1726 Torsten Marek.
1730 Torsten Marek.
1727
1731
1728 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1732 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1729
1733
1730 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1734 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1731 line ranges works again.
1735 line ranges works again.
1732
1736
1733 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1737 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1734
1738
1735 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1739 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1736 and friends, after a discussion with Zach Pincus on ipython-user.
1740 and friends, after a discussion with Zach Pincus on ipython-user.
1737 I'm not 100% sure, but after thinking about it quite a bit, it may
1741 I'm not 100% sure, but after thinking about it quite a bit, it may
1738 be OK. Testing with the multithreaded shells didn't reveal any
1742 be OK. Testing with the multithreaded shells didn't reveal any
1739 problems, but let's keep an eye out.
1743 problems, but let's keep an eye out.
1740
1744
1741 In the process, I fixed a few things which were calling
1745 In the process, I fixed a few things which were calling
1742 self.InteractiveTB() directly (like safe_execfile), which is a
1746 self.InteractiveTB() directly (like safe_execfile), which is a
1743 mistake: ALL exception reporting should be done by calling
1747 mistake: ALL exception reporting should be done by calling
1744 self.showtraceback(), which handles state and tab-completion and
1748 self.showtraceback(), which handles state and tab-completion and
1745 more.
1749 more.
1746
1750
1747 2006-03-01 Ville Vainio <vivainio@gmail.com>
1751 2006-03-01 Ville Vainio <vivainio@gmail.com>
1748
1752
1749 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1753 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1750 To use, do "from ipipe import *".
1754 To use, do "from ipipe import *".
1751
1755
1752 2006-02-24 Ville Vainio <vivainio@gmail.com>
1756 2006-02-24 Ville Vainio <vivainio@gmail.com>
1753
1757
1754 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1758 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1755 "cleanly" and safely than the older upgrade mechanism.
1759 "cleanly" and safely than the older upgrade mechanism.
1756
1760
1757 2006-02-21 Ville Vainio <vivainio@gmail.com>
1761 2006-02-21 Ville Vainio <vivainio@gmail.com>
1758
1762
1759 * Magic.py: %save works again.
1763 * Magic.py: %save works again.
1760
1764
1761 2006-02-15 Ville Vainio <vivainio@gmail.com>
1765 2006-02-15 Ville Vainio <vivainio@gmail.com>
1762
1766
1763 * Magic.py: %Pprint works again
1767 * Magic.py: %Pprint works again
1764
1768
1765 * Extensions/ipy_sane_defaults.py: Provide everything provided
1769 * Extensions/ipy_sane_defaults.py: Provide everything provided
1766 in default ipythonrc, to make it possible to have a completely empty
1770 in default ipythonrc, to make it possible to have a completely empty
1767 ipythonrc (and thus completely rc-file free configuration)
1771 ipythonrc (and thus completely rc-file free configuration)
1768
1772
1769 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1773 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1770
1774
1771 * IPython/hooks.py (editor): quote the call to the editor command,
1775 * IPython/hooks.py (editor): quote the call to the editor command,
1772 to allow commands with spaces in them. Problem noted by watching
1776 to allow commands with spaces in them. Problem noted by watching
1773 Ian Oswald's video about textpad under win32 at
1777 Ian Oswald's video about textpad under win32 at
1774 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1778 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1775
1779
1776 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1780 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1777 describing magics (we haven't used @ for a loong time).
1781 describing magics (we haven't used @ for a loong time).
1778
1782
1779 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1783 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1780 contributed by marienz to close
1784 contributed by marienz to close
1781 http://www.scipy.net/roundup/ipython/issue53.
1785 http://www.scipy.net/roundup/ipython/issue53.
1782
1786
1783 2006-02-10 Ville Vainio <vivainio@gmail.com>
1787 2006-02-10 Ville Vainio <vivainio@gmail.com>
1784
1788
1785 * genutils.py: getoutput now works in win32 too
1789 * genutils.py: getoutput now works in win32 too
1786
1790
1787 * completer.py: alias and magic completion only invoked
1791 * completer.py: alias and magic completion only invoked
1788 at the first "item" in the line, to avoid "cd %store"
1792 at the first "item" in the line, to avoid "cd %store"
1789 nonsense.
1793 nonsense.
1790
1794
1791 2006-02-09 Ville Vainio <vivainio@gmail.com>
1795 2006-02-09 Ville Vainio <vivainio@gmail.com>
1792
1796
1793 * test/*: Added a unit testing framework (finally).
1797 * test/*: Added a unit testing framework (finally).
1794 '%run runtests.py' to run test_*.
1798 '%run runtests.py' to run test_*.
1795
1799
1796 * ipapi.py: Exposed runlines and set_custom_exc
1800 * ipapi.py: Exposed runlines and set_custom_exc
1797
1801
1798 2006-02-07 Ville Vainio <vivainio@gmail.com>
1802 2006-02-07 Ville Vainio <vivainio@gmail.com>
1799
1803
1800 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1804 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1801 instead use "f(1 2)" as before.
1805 instead use "f(1 2)" as before.
1802
1806
1803 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1807 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1804
1808
1805 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1809 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1806 facilities, for demos processed by the IPython input filter
1810 facilities, for demos processed by the IPython input filter
1807 (IPythonDemo), and for running a script one-line-at-a-time as a
1811 (IPythonDemo), and for running a script one-line-at-a-time as a
1808 demo, both for pure Python (LineDemo) and for IPython-processed
1812 demo, both for pure Python (LineDemo) and for IPython-processed
1809 input (IPythonLineDemo). After a request by Dave Kohel, from the
1813 input (IPythonLineDemo). After a request by Dave Kohel, from the
1810 SAGE team.
1814 SAGE team.
1811 (Demo.edit): added an edit() method to the demo objects, to edit
1815 (Demo.edit): added an edit() method to the demo objects, to edit
1812 the in-memory copy of the last executed block.
1816 the in-memory copy of the last executed block.
1813
1817
1814 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1818 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1815 processing to %edit, %macro and %save. These commands can now be
1819 processing to %edit, %macro and %save. These commands can now be
1816 invoked on the unprocessed input as it was typed by the user
1820 invoked on the unprocessed input as it was typed by the user
1817 (without any prefilters applied). After requests by the SAGE team
1821 (without any prefilters applied). After requests by the SAGE team
1818 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1822 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1819
1823
1820 2006-02-01 Ville Vainio <vivainio@gmail.com>
1824 2006-02-01 Ville Vainio <vivainio@gmail.com>
1821
1825
1822 * setup.py, eggsetup.py: easy_install ipython==dev works
1826 * setup.py, eggsetup.py: easy_install ipython==dev works
1823 correctly now (on Linux)
1827 correctly now (on Linux)
1824
1828
1825 * ipy_user_conf,ipmaker: user config changes, removed spurious
1829 * ipy_user_conf,ipmaker: user config changes, removed spurious
1826 warnings
1830 warnings
1827
1831
1828 * iplib: if rc.banner is string, use it as is.
1832 * iplib: if rc.banner is string, use it as is.
1829
1833
1830 * Magic: %pycat accepts a string argument and pages it's contents.
1834 * Magic: %pycat accepts a string argument and pages it's contents.
1831
1835
1832
1836
1833 2006-01-30 Ville Vainio <vivainio@gmail.com>
1837 2006-01-30 Ville Vainio <vivainio@gmail.com>
1834
1838
1835 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1839 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1836 Now %store and bookmarks work through PickleShare, meaning that
1840 Now %store and bookmarks work through PickleShare, meaning that
1837 concurrent access is possible and all ipython sessions see the
1841 concurrent access is possible and all ipython sessions see the
1838 same database situation all the time, instead of snapshot of
1842 same database situation all the time, instead of snapshot of
1839 the situation when the session was started. Hence, %bookmark
1843 the situation when the session was started. Hence, %bookmark
1840 results are immediately accessible from othes sessions. The database
1844 results are immediately accessible from othes sessions. The database
1841 is also available for use by user extensions. See:
1845 is also available for use by user extensions. See:
1842 http://www.python.org/pypi/pickleshare
1846 http://www.python.org/pypi/pickleshare
1843
1847
1844 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1848 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1845
1849
1846 * aliases can now be %store'd
1850 * aliases can now be %store'd
1847
1851
1848 * path.py moved to Extensions so that pickleshare does not need
1852 * path.py moved to Extensions so that pickleshare does not need
1849 IPython-specific import. Extensions added to pythonpath right
1853 IPython-specific import. Extensions added to pythonpath right
1850 at __init__.
1854 at __init__.
1851
1855
1852 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1856 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1853 called with _ip.system and the pre-transformed command string.
1857 called with _ip.system and the pre-transformed command string.
1854
1858
1855 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1859 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1856
1860
1857 * IPython/iplib.py (interact): Fix that we were not catching
1861 * IPython/iplib.py (interact): Fix that we were not catching
1858 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1862 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1859 logic here had to change, but it's fixed now.
1863 logic here had to change, but it's fixed now.
1860
1864
1861 2006-01-29 Ville Vainio <vivainio@gmail.com>
1865 2006-01-29 Ville Vainio <vivainio@gmail.com>
1862
1866
1863 * iplib.py: Try to import pyreadline on Windows.
1867 * iplib.py: Try to import pyreadline on Windows.
1864
1868
1865 2006-01-27 Ville Vainio <vivainio@gmail.com>
1869 2006-01-27 Ville Vainio <vivainio@gmail.com>
1866
1870
1867 * iplib.py: Expose ipapi as _ip in builtin namespace.
1871 * iplib.py: Expose ipapi as _ip in builtin namespace.
1868 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1872 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1869 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1873 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1870 syntax now produce _ip.* variant of the commands.
1874 syntax now produce _ip.* variant of the commands.
1871
1875
1872 * "_ip.options().autoedit_syntax = 2" automatically throws
1876 * "_ip.options().autoedit_syntax = 2" automatically throws
1873 user to editor for syntax error correction without prompting.
1877 user to editor for syntax error correction without prompting.
1874
1878
1875 2006-01-27 Ville Vainio <vivainio@gmail.com>
1879 2006-01-27 Ville Vainio <vivainio@gmail.com>
1876
1880
1877 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1881 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1878 'ipython' at argv[0]) executed through command line.
1882 'ipython' at argv[0]) executed through command line.
1879 NOTE: this DEPRECATES calling ipython with multiple scripts
1883 NOTE: this DEPRECATES calling ipython with multiple scripts
1880 ("ipython a.py b.py c.py")
1884 ("ipython a.py b.py c.py")
1881
1885
1882 * iplib.py, hooks.py: Added configurable input prefilter,
1886 * iplib.py, hooks.py: Added configurable input prefilter,
1883 named 'input_prefilter'. See ext_rescapture.py for example
1887 named 'input_prefilter'. See ext_rescapture.py for example
1884 usage.
1888 usage.
1885
1889
1886 * ext_rescapture.py, Magic.py: Better system command output capture
1890 * ext_rescapture.py, Magic.py: Better system command output capture
1887 through 'var = !ls' (deprecates user-visible %sc). Same notation
1891 through 'var = !ls' (deprecates user-visible %sc). Same notation
1888 applies for magics, 'var = %alias' assigns alias list to var.
1892 applies for magics, 'var = %alias' assigns alias list to var.
1889
1893
1890 * ipapi.py: added meta() for accessing extension-usable data store.
1894 * ipapi.py: added meta() for accessing extension-usable data store.
1891
1895
1892 * iplib.py: added InteractiveShell.getapi(). New magics should be
1896 * iplib.py: added InteractiveShell.getapi(). New magics should be
1893 written doing self.getapi() instead of using the shell directly.
1897 written doing self.getapi() instead of using the shell directly.
1894
1898
1895 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1899 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1896 %store foo >> ~/myfoo.txt to store variables to files (in clean
1900 %store foo >> ~/myfoo.txt to store variables to files (in clean
1897 textual form, not a restorable pickle).
1901 textual form, not a restorable pickle).
1898
1902
1899 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1903 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1900
1904
1901 * usage.py, Magic.py: added %quickref
1905 * usage.py, Magic.py: added %quickref
1902
1906
1903 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1907 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1904
1908
1905 * GetoptErrors when invoking magics etc. with wrong args
1909 * GetoptErrors when invoking magics etc. with wrong args
1906 are now more helpful:
1910 are now more helpful:
1907 GetoptError: option -l not recognized (allowed: "qb" )
1911 GetoptError: option -l not recognized (allowed: "qb" )
1908
1912
1909 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1913 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1910
1914
1911 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1915 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1912 computationally intensive blocks don't appear to stall the demo.
1916 computationally intensive blocks don't appear to stall the demo.
1913
1917
1914 2006-01-24 Ville Vainio <vivainio@gmail.com>
1918 2006-01-24 Ville Vainio <vivainio@gmail.com>
1915
1919
1916 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1920 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1917 value to manipulate resulting history entry.
1921 value to manipulate resulting history entry.
1918
1922
1919 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1923 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1920 to instance methods of IPApi class, to make extending an embedded
1924 to instance methods of IPApi class, to make extending an embedded
1921 IPython feasible. See ext_rehashdir.py for example usage.
1925 IPython feasible. See ext_rehashdir.py for example usage.
1922
1926
1923 * Merged 1071-1076 from branches/0.7.1
1927 * Merged 1071-1076 from branches/0.7.1
1924
1928
1925
1929
1926 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1930 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1927
1931
1928 * tools/release (daystamp): Fix build tools to use the new
1932 * tools/release (daystamp): Fix build tools to use the new
1929 eggsetup.py script to build lightweight eggs.
1933 eggsetup.py script to build lightweight eggs.
1930
1934
1931 * Applied changesets 1062 and 1064 before 0.7.1 release.
1935 * Applied changesets 1062 and 1064 before 0.7.1 release.
1932
1936
1933 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1937 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1934 see the raw input history (without conversions like %ls ->
1938 see the raw input history (without conversions like %ls ->
1935 ipmagic("ls")). After a request from W. Stein, SAGE
1939 ipmagic("ls")). After a request from W. Stein, SAGE
1936 (http://modular.ucsd.edu/sage) developer. This information is
1940 (http://modular.ucsd.edu/sage) developer. This information is
1937 stored in the input_hist_raw attribute of the IPython instance, so
1941 stored in the input_hist_raw attribute of the IPython instance, so
1938 developers can access it if needed (it's an InputList instance).
1942 developers can access it if needed (it's an InputList instance).
1939
1943
1940 * Versionstring = 0.7.2.svn
1944 * Versionstring = 0.7.2.svn
1941
1945
1942 * eggsetup.py: A separate script for constructing eggs, creates
1946 * eggsetup.py: A separate script for constructing eggs, creates
1943 proper launch scripts even on Windows (an .exe file in
1947 proper launch scripts even on Windows (an .exe file in
1944 \python24\scripts).
1948 \python24\scripts).
1945
1949
1946 * ipapi.py: launch_new_instance, launch entry point needed for the
1950 * ipapi.py: launch_new_instance, launch entry point needed for the
1947 egg.
1951 egg.
1948
1952
1949 2006-01-23 Ville Vainio <vivainio@gmail.com>
1953 2006-01-23 Ville Vainio <vivainio@gmail.com>
1950
1954
1951 * Added %cpaste magic for pasting python code
1955 * Added %cpaste magic for pasting python code
1952
1956
1953 2006-01-22 Ville Vainio <vivainio@gmail.com>
1957 2006-01-22 Ville Vainio <vivainio@gmail.com>
1954
1958
1955 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1959 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1956
1960
1957 * Versionstring = 0.7.2.svn
1961 * Versionstring = 0.7.2.svn
1958
1962
1959 * eggsetup.py: A separate script for constructing eggs, creates
1963 * eggsetup.py: A separate script for constructing eggs, creates
1960 proper launch scripts even on Windows (an .exe file in
1964 proper launch scripts even on Windows (an .exe file in
1961 \python24\scripts).
1965 \python24\scripts).
1962
1966
1963 * ipapi.py: launch_new_instance, launch entry point needed for the
1967 * ipapi.py: launch_new_instance, launch entry point needed for the
1964 egg.
1968 egg.
1965
1969
1966 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1970 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1967
1971
1968 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1972 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1969 %pfile foo would print the file for foo even if it was a binary.
1973 %pfile foo would print the file for foo even if it was a binary.
1970 Now, extensions '.so' and '.dll' are skipped.
1974 Now, extensions '.so' and '.dll' are skipped.
1971
1975
1972 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1976 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1973 bug, where macros would fail in all threaded modes. I'm not 100%
1977 bug, where macros would fail in all threaded modes. I'm not 100%
1974 sure, so I'm going to put out an rc instead of making a release
1978 sure, so I'm going to put out an rc instead of making a release
1975 today, and wait for feedback for at least a few days.
1979 today, and wait for feedback for at least a few days.
1976
1980
1977 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1981 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1978 it...) the handling of pasting external code with autoindent on.
1982 it...) the handling of pasting external code with autoindent on.
1979 To get out of a multiline input, the rule will appear for most
1983 To get out of a multiline input, the rule will appear for most
1980 users unchanged: two blank lines or change the indent level
1984 users unchanged: two blank lines or change the indent level
1981 proposed by IPython. But there is a twist now: you can
1985 proposed by IPython. But there is a twist now: you can
1982 add/subtract only *one or two spaces*. If you add/subtract three
1986 add/subtract only *one or two spaces*. If you add/subtract three
1983 or more (unless you completely delete the line), IPython will
1987 or more (unless you completely delete the line), IPython will
1984 accept that line, and you'll need to enter a second one of pure
1988 accept that line, and you'll need to enter a second one of pure
1985 whitespace. I know it sounds complicated, but I can't find a
1989 whitespace. I know it sounds complicated, but I can't find a
1986 different solution that covers all the cases, with the right
1990 different solution that covers all the cases, with the right
1987 heuristics. Hopefully in actual use, nobody will really notice
1991 heuristics. Hopefully in actual use, nobody will really notice
1988 all these strange rules and things will 'just work'.
1992 all these strange rules and things will 'just work'.
1989
1993
1990 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1994 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1991
1995
1992 * IPython/iplib.py (interact): catch exceptions which can be
1996 * IPython/iplib.py (interact): catch exceptions which can be
1993 triggered asynchronously by signal handlers. Thanks to an
1997 triggered asynchronously by signal handlers. Thanks to an
1994 automatic crash report, submitted by Colin Kingsley
1998 automatic crash report, submitted by Colin Kingsley
1995 <tercel-AT-gentoo.org>.
1999 <tercel-AT-gentoo.org>.
1996
2000
1997 2006-01-20 Ville Vainio <vivainio@gmail.com>
2001 2006-01-20 Ville Vainio <vivainio@gmail.com>
1998
2002
1999 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2003 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2000 (%rehashdir, very useful, try it out) of how to extend ipython
2004 (%rehashdir, very useful, try it out) of how to extend ipython
2001 with new magics. Also added Extensions dir to pythonpath to make
2005 with new magics. Also added Extensions dir to pythonpath to make
2002 importing extensions easy.
2006 importing extensions easy.
2003
2007
2004 * %store now complains when trying to store interactively declared
2008 * %store now complains when trying to store interactively declared
2005 classes / instances of those classes.
2009 classes / instances of those classes.
2006
2010
2007 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2011 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2008 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2012 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2009 if they exist, and ipy_user_conf.py with some defaults is created for
2013 if they exist, and ipy_user_conf.py with some defaults is created for
2010 the user.
2014 the user.
2011
2015
2012 * Startup rehashing done by the config file, not InterpreterExec.
2016 * Startup rehashing done by the config file, not InterpreterExec.
2013 This means system commands are available even without selecting the
2017 This means system commands are available even without selecting the
2014 pysh profile. It's the sensible default after all.
2018 pysh profile. It's the sensible default after all.
2015
2019
2016 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2020 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2017
2021
2018 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2022 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2019 multiline code with autoindent on working. But I am really not
2023 multiline code with autoindent on working. But I am really not
2020 sure, so this needs more testing. Will commit a debug-enabled
2024 sure, so this needs more testing. Will commit a debug-enabled
2021 version for now, while I test it some more, so that Ville and
2025 version for now, while I test it some more, so that Ville and
2022 others may also catch any problems. Also made
2026 others may also catch any problems. Also made
2023 self.indent_current_str() a method, to ensure that there's no
2027 self.indent_current_str() a method, to ensure that there's no
2024 chance of the indent space count and the corresponding string
2028 chance of the indent space count and the corresponding string
2025 falling out of sync. All code needing the string should just call
2029 falling out of sync. All code needing the string should just call
2026 the method.
2030 the method.
2027
2031
2028 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2032 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2029
2033
2030 * IPython/Magic.py (magic_edit): fix check for when users don't
2034 * IPython/Magic.py (magic_edit): fix check for when users don't
2031 save their output files, the try/except was in the wrong section.
2035 save their output files, the try/except was in the wrong section.
2032
2036
2033 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2037 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2034
2038
2035 * IPython/Magic.py (magic_run): fix __file__ global missing from
2039 * IPython/Magic.py (magic_run): fix __file__ global missing from
2036 script's namespace when executed via %run. After a report by
2040 script's namespace when executed via %run. After a report by
2037 Vivian.
2041 Vivian.
2038
2042
2039 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2043 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2040 when using python 2.4. The parent constructor changed in 2.4, and
2044 when using python 2.4. The parent constructor changed in 2.4, and
2041 we need to track it directly (we can't call it, as it messes up
2045 we need to track it directly (we can't call it, as it messes up
2042 readline and tab-completion inside our pdb would stop working).
2046 readline and tab-completion inside our pdb would stop working).
2043 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2047 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2044
2048
2045 2006-01-16 Ville Vainio <vivainio@gmail.com>
2049 2006-01-16 Ville Vainio <vivainio@gmail.com>
2046
2050
2047 * Ipython/magic.py: Reverted back to old %edit functionality
2051 * Ipython/magic.py: Reverted back to old %edit functionality
2048 that returns file contents on exit.
2052 that returns file contents on exit.
2049
2053
2050 * IPython/path.py: Added Jason Orendorff's "path" module to
2054 * IPython/path.py: Added Jason Orendorff's "path" module to
2051 IPython tree, http://www.jorendorff.com/articles/python/path/.
2055 IPython tree, http://www.jorendorff.com/articles/python/path/.
2052 You can get path objects conveniently through %sc, and !!, e.g.:
2056 You can get path objects conveniently through %sc, and !!, e.g.:
2053 sc files=ls
2057 sc files=ls
2054 for p in files.paths: # or files.p
2058 for p in files.paths: # or files.p
2055 print p,p.mtime
2059 print p,p.mtime
2056
2060
2057 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2061 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2058 now work again without considering the exclusion regexp -
2062 now work again without considering the exclusion regexp -
2059 hence, things like ',foo my/path' turn to 'foo("my/path")'
2063 hence, things like ',foo my/path' turn to 'foo("my/path")'
2060 instead of syntax error.
2064 instead of syntax error.
2061
2065
2062
2066
2063 2006-01-14 Ville Vainio <vivainio@gmail.com>
2067 2006-01-14 Ville Vainio <vivainio@gmail.com>
2064
2068
2065 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2069 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2066 ipapi decorators for python 2.4 users, options() provides access to rc
2070 ipapi decorators for python 2.4 users, options() provides access to rc
2067 data.
2071 data.
2068
2072
2069 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2073 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2070 as path separators (even on Linux ;-). Space character after
2074 as path separators (even on Linux ;-). Space character after
2071 backslash (as yielded by tab completer) is still space;
2075 backslash (as yielded by tab completer) is still space;
2072 "%cd long\ name" works as expected.
2076 "%cd long\ name" works as expected.
2073
2077
2074 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2078 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2075 as "chain of command", with priority. API stays the same,
2079 as "chain of command", with priority. API stays the same,
2076 TryNext exception raised by a hook function signals that
2080 TryNext exception raised by a hook function signals that
2077 current hook failed and next hook should try handling it, as
2081 current hook failed and next hook should try handling it, as
2078 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2082 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2079 requested configurable display hook, which is now implemented.
2083 requested configurable display hook, which is now implemented.
2080
2084
2081 2006-01-13 Ville Vainio <vivainio@gmail.com>
2085 2006-01-13 Ville Vainio <vivainio@gmail.com>
2082
2086
2083 * IPython/platutils*.py: platform specific utility functions,
2087 * IPython/platutils*.py: platform specific utility functions,
2084 so far only set_term_title is implemented (change terminal
2088 so far only set_term_title is implemented (change terminal
2085 label in windowing systems). %cd now changes the title to
2089 label in windowing systems). %cd now changes the title to
2086 current dir.
2090 current dir.
2087
2091
2088 * IPython/Release.py: Added myself to "authors" list,
2092 * IPython/Release.py: Added myself to "authors" list,
2089 had to create new files.
2093 had to create new files.
2090
2094
2091 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2095 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2092 shell escape; not a known bug but had potential to be one in the
2096 shell escape; not a known bug but had potential to be one in the
2093 future.
2097 future.
2094
2098
2095 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2099 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2096 extension API for IPython! See the module for usage example. Fix
2100 extension API for IPython! See the module for usage example. Fix
2097 OInspect for docstring-less magic functions.
2101 OInspect for docstring-less magic functions.
2098
2102
2099
2103
2100 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2104 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2101
2105
2102 * IPython/iplib.py (raw_input): temporarily deactivate all
2106 * IPython/iplib.py (raw_input): temporarily deactivate all
2103 attempts at allowing pasting of code with autoindent on. It
2107 attempts at allowing pasting of code with autoindent on. It
2104 introduced bugs (reported by Prabhu) and I can't seem to find a
2108 introduced bugs (reported by Prabhu) and I can't seem to find a
2105 robust combination which works in all cases. Will have to revisit
2109 robust combination which works in all cases. Will have to revisit
2106 later.
2110 later.
2107
2111
2108 * IPython/genutils.py: remove isspace() function. We've dropped
2112 * IPython/genutils.py: remove isspace() function. We've dropped
2109 2.2 compatibility, so it's OK to use the string method.
2113 2.2 compatibility, so it's OK to use the string method.
2110
2114
2111 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2115 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2112
2116
2113 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2117 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2114 matching what NOT to autocall on, to include all python binary
2118 matching what NOT to autocall on, to include all python binary
2115 operators (including things like 'and', 'or', 'is' and 'in').
2119 operators (including things like 'and', 'or', 'is' and 'in').
2116 Prompted by a bug report on 'foo & bar', but I realized we had
2120 Prompted by a bug report on 'foo & bar', but I realized we had
2117 many more potential bug cases with other operators. The regexp is
2121 many more potential bug cases with other operators. The regexp is
2118 self.re_exclude_auto, it's fairly commented.
2122 self.re_exclude_auto, it's fairly commented.
2119
2123
2120 2006-01-12 Ville Vainio <vivainio@gmail.com>
2124 2006-01-12 Ville Vainio <vivainio@gmail.com>
2121
2125
2122 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2126 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2123 Prettified and hardened string/backslash quoting with ipsystem(),
2127 Prettified and hardened string/backslash quoting with ipsystem(),
2124 ipalias() and ipmagic(). Now even \ characters are passed to
2128 ipalias() and ipmagic(). Now even \ characters are passed to
2125 %magics, !shell escapes and aliases exactly as they are in the
2129 %magics, !shell escapes and aliases exactly as they are in the
2126 ipython command line. Should improve backslash experience,
2130 ipython command line. Should improve backslash experience,
2127 particularly in Windows (path delimiter for some commands that
2131 particularly in Windows (path delimiter for some commands that
2128 won't understand '/'), but Unix benefits as well (regexps). %cd
2132 won't understand '/'), but Unix benefits as well (regexps). %cd
2129 magic still doesn't support backslash path delimiters, though. Also
2133 magic still doesn't support backslash path delimiters, though. Also
2130 deleted all pretense of supporting multiline command strings in
2134 deleted all pretense of supporting multiline command strings in
2131 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2135 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2132
2136
2133 * doc/build_doc_instructions.txt added. Documentation on how to
2137 * doc/build_doc_instructions.txt added. Documentation on how to
2134 use doc/update_manual.py, added yesterday. Both files contributed
2138 use doc/update_manual.py, added yesterday. Both files contributed
2135 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2139 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2136 doc/*.sh for deprecation at a later date.
2140 doc/*.sh for deprecation at a later date.
2137
2141
2138 * /ipython.py Added ipython.py to root directory for
2142 * /ipython.py Added ipython.py to root directory for
2139 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2143 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2140 ipython.py) and development convenience (no need to keep doing
2144 ipython.py) and development convenience (no need to keep doing
2141 "setup.py install" between changes).
2145 "setup.py install" between changes).
2142
2146
2143 * Made ! and !! shell escapes work (again) in multiline expressions:
2147 * Made ! and !! shell escapes work (again) in multiline expressions:
2144 if 1:
2148 if 1:
2145 !ls
2149 !ls
2146 !!ls
2150 !!ls
2147
2151
2148 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2152 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2149
2153
2150 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2154 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2151 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2155 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2152 module in case-insensitive installation. Was causing crashes
2156 module in case-insensitive installation. Was causing crashes
2153 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2157 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2154
2158
2155 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2159 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2156 <marienz-AT-gentoo.org>, closes
2160 <marienz-AT-gentoo.org>, closes
2157 http://www.scipy.net/roundup/ipython/issue51.
2161 http://www.scipy.net/roundup/ipython/issue51.
2158
2162
2159 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2163 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2160
2164
2161 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2165 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2162 problem of excessive CPU usage under *nix and keyboard lag under
2166 problem of excessive CPU usage under *nix and keyboard lag under
2163 win32.
2167 win32.
2164
2168
2165 2006-01-10 *** Released version 0.7.0
2169 2006-01-10 *** Released version 0.7.0
2166
2170
2167 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2171 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2168
2172
2169 * IPython/Release.py (revision): tag version number to 0.7.0,
2173 * IPython/Release.py (revision): tag version number to 0.7.0,
2170 ready for release.
2174 ready for release.
2171
2175
2172 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2176 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2173 it informs the user of the name of the temp. file used. This can
2177 it informs the user of the name of the temp. file used. This can
2174 help if you decide later to reuse that same file, so you know
2178 help if you decide later to reuse that same file, so you know
2175 where to copy the info from.
2179 where to copy the info from.
2176
2180
2177 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2181 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2178
2182
2179 * setup_bdist_egg.py: little script to build an egg. Added
2183 * setup_bdist_egg.py: little script to build an egg. Added
2180 support in the release tools as well.
2184 support in the release tools as well.
2181
2185
2182 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2186 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2183
2187
2184 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2188 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2185 version selection (new -wxversion command line and ipythonrc
2189 version selection (new -wxversion command line and ipythonrc
2186 parameter). Patch contributed by Arnd Baecker
2190 parameter). Patch contributed by Arnd Baecker
2187 <arnd.baecker-AT-web.de>.
2191 <arnd.baecker-AT-web.de>.
2188
2192
2189 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2193 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2190 embedded instances, for variables defined at the interactive
2194 embedded instances, for variables defined at the interactive
2191 prompt of the embedded ipython. Reported by Arnd.
2195 prompt of the embedded ipython. Reported by Arnd.
2192
2196
2193 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2197 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2194 it can be used as a (stateful) toggle, or with a direct parameter.
2198 it can be used as a (stateful) toggle, or with a direct parameter.
2195
2199
2196 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2200 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2197 could be triggered in certain cases and cause the traceback
2201 could be triggered in certain cases and cause the traceback
2198 printer not to work.
2202 printer not to work.
2199
2203
2200 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2204 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2201
2205
2202 * IPython/iplib.py (_should_recompile): Small fix, closes
2206 * IPython/iplib.py (_should_recompile): Small fix, closes
2203 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2207 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2204
2208
2205 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2209 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2206
2210
2207 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2211 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2208 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2212 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2209 Moad for help with tracking it down.
2213 Moad for help with tracking it down.
2210
2214
2211 * IPython/iplib.py (handle_auto): fix autocall handling for
2215 * IPython/iplib.py (handle_auto): fix autocall handling for
2212 objects which support BOTH __getitem__ and __call__ (so that f [x]
2216 objects which support BOTH __getitem__ and __call__ (so that f [x]
2213 is left alone, instead of becoming f([x]) automatically).
2217 is left alone, instead of becoming f([x]) automatically).
2214
2218
2215 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2219 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2216 Ville's patch.
2220 Ville's patch.
2217
2221
2218 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2222 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2219
2223
2220 * IPython/iplib.py (handle_auto): changed autocall semantics to
2224 * IPython/iplib.py (handle_auto): changed autocall semantics to
2221 include 'smart' mode, where the autocall transformation is NOT
2225 include 'smart' mode, where the autocall transformation is NOT
2222 applied if there are no arguments on the line. This allows you to
2226 applied if there are no arguments on the line. This allows you to
2223 just type 'foo' if foo is a callable to see its internal form,
2227 just type 'foo' if foo is a callable to see its internal form,
2224 instead of having it called with no arguments (typically a
2228 instead of having it called with no arguments (typically a
2225 mistake). The old 'full' autocall still exists: for that, you
2229 mistake). The old 'full' autocall still exists: for that, you
2226 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2230 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2227
2231
2228 * IPython/completer.py (Completer.attr_matches): add
2232 * IPython/completer.py (Completer.attr_matches): add
2229 tab-completion support for Enthoughts' traits. After a report by
2233 tab-completion support for Enthoughts' traits. After a report by
2230 Arnd and a patch by Prabhu.
2234 Arnd and a patch by Prabhu.
2231
2235
2232 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2236 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2233
2237
2234 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2238 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2235 Schmolck's patch to fix inspect.getinnerframes().
2239 Schmolck's patch to fix inspect.getinnerframes().
2236
2240
2237 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2241 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2238 for embedded instances, regarding handling of namespaces and items
2242 for embedded instances, regarding handling of namespaces and items
2239 added to the __builtin__ one. Multiple embedded instances and
2243 added to the __builtin__ one. Multiple embedded instances and
2240 recursive embeddings should work better now (though I'm not sure
2244 recursive embeddings should work better now (though I'm not sure
2241 I've got all the corner cases fixed, that code is a bit of a brain
2245 I've got all the corner cases fixed, that code is a bit of a brain
2242 twister).
2246 twister).
2243
2247
2244 * IPython/Magic.py (magic_edit): added support to edit in-memory
2248 * IPython/Magic.py (magic_edit): added support to edit in-memory
2245 macros (automatically creates the necessary temp files). %edit
2249 macros (automatically creates the necessary temp files). %edit
2246 also doesn't return the file contents anymore, it's just noise.
2250 also doesn't return the file contents anymore, it's just noise.
2247
2251
2248 * IPython/completer.py (Completer.attr_matches): revert change to
2252 * IPython/completer.py (Completer.attr_matches): revert change to
2249 complete only on attributes listed in __all__. I realized it
2253 complete only on attributes listed in __all__. I realized it
2250 cripples the tab-completion system as a tool for exploring the
2254 cripples the tab-completion system as a tool for exploring the
2251 internals of unknown libraries (it renders any non-__all__
2255 internals of unknown libraries (it renders any non-__all__
2252 attribute off-limits). I got bit by this when trying to see
2256 attribute off-limits). I got bit by this when trying to see
2253 something inside the dis module.
2257 something inside the dis module.
2254
2258
2255 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2259 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2256
2260
2257 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2261 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2258 namespace for users and extension writers to hold data in. This
2262 namespace for users and extension writers to hold data in. This
2259 follows the discussion in
2263 follows the discussion in
2260 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2264 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2261
2265
2262 * IPython/completer.py (IPCompleter.complete): small patch to help
2266 * IPython/completer.py (IPCompleter.complete): small patch to help
2263 tab-completion under Emacs, after a suggestion by John Barnard
2267 tab-completion under Emacs, after a suggestion by John Barnard
2264 <barnarj-AT-ccf.org>.
2268 <barnarj-AT-ccf.org>.
2265
2269
2266 * IPython/Magic.py (Magic.extract_input_slices): added support for
2270 * IPython/Magic.py (Magic.extract_input_slices): added support for
2267 the slice notation in magics to use N-M to represent numbers N...M
2271 the slice notation in magics to use N-M to represent numbers N...M
2268 (closed endpoints). This is used by %macro and %save.
2272 (closed endpoints). This is used by %macro and %save.
2269
2273
2270 * IPython/completer.py (Completer.attr_matches): for modules which
2274 * IPython/completer.py (Completer.attr_matches): for modules which
2271 define __all__, complete only on those. After a patch by Jeffrey
2275 define __all__, complete only on those. After a patch by Jeffrey
2272 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2276 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2273 speed up this routine.
2277 speed up this routine.
2274
2278
2275 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2279 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2276 don't know if this is the end of it, but the behavior now is
2280 don't know if this is the end of it, but the behavior now is
2277 certainly much more correct. Note that coupled with macros,
2281 certainly much more correct. Note that coupled with macros,
2278 slightly surprising (at first) behavior may occur: a macro will in
2282 slightly surprising (at first) behavior may occur: a macro will in
2279 general expand to multiple lines of input, so upon exiting, the
2283 general expand to multiple lines of input, so upon exiting, the
2280 in/out counters will both be bumped by the corresponding amount
2284 in/out counters will both be bumped by the corresponding amount
2281 (as if the macro's contents had been typed interactively). Typing
2285 (as if the macro's contents had been typed interactively). Typing
2282 %hist will reveal the intermediate (silently processed) lines.
2286 %hist will reveal the intermediate (silently processed) lines.
2283
2287
2284 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2288 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2285 pickle to fail (%run was overwriting __main__ and not restoring
2289 pickle to fail (%run was overwriting __main__ and not restoring
2286 it, but pickle relies on __main__ to operate).
2290 it, but pickle relies on __main__ to operate).
2287
2291
2288 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2292 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2289 using properties, but forgot to make the main InteractiveShell
2293 using properties, but forgot to make the main InteractiveShell
2290 class a new-style class. Properties fail silently, and
2294 class a new-style class. Properties fail silently, and
2291 mysteriously, with old-style class (getters work, but
2295 mysteriously, with old-style class (getters work, but
2292 setters don't do anything).
2296 setters don't do anything).
2293
2297
2294 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2298 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2295
2299
2296 * IPython/Magic.py (magic_history): fix history reporting bug (I
2300 * IPython/Magic.py (magic_history): fix history reporting bug (I
2297 know some nasties are still there, I just can't seem to find a
2301 know some nasties are still there, I just can't seem to find a
2298 reproducible test case to track them down; the input history is
2302 reproducible test case to track them down; the input history is
2299 falling out of sync...)
2303 falling out of sync...)
2300
2304
2301 * IPython/iplib.py (handle_shell_escape): fix bug where both
2305 * IPython/iplib.py (handle_shell_escape): fix bug where both
2302 aliases and system accesses where broken for indented code (such
2306 aliases and system accesses where broken for indented code (such
2303 as loops).
2307 as loops).
2304
2308
2305 * IPython/genutils.py (shell): fix small but critical bug for
2309 * IPython/genutils.py (shell): fix small but critical bug for
2306 win32 system access.
2310 win32 system access.
2307
2311
2308 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2312 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2309
2313
2310 * IPython/iplib.py (showtraceback): remove use of the
2314 * IPython/iplib.py (showtraceback): remove use of the
2311 sys.last_{type/value/traceback} structures, which are non
2315 sys.last_{type/value/traceback} structures, which are non
2312 thread-safe.
2316 thread-safe.
2313 (_prefilter): change control flow to ensure that we NEVER
2317 (_prefilter): change control flow to ensure that we NEVER
2314 introspect objects when autocall is off. This will guarantee that
2318 introspect objects when autocall is off. This will guarantee that
2315 having an input line of the form 'x.y', where access to attribute
2319 having an input line of the form 'x.y', where access to attribute
2316 'y' has side effects, doesn't trigger the side effect TWICE. It
2320 'y' has side effects, doesn't trigger the side effect TWICE. It
2317 is important to note that, with autocall on, these side effects
2321 is important to note that, with autocall on, these side effects
2318 can still happen.
2322 can still happen.
2319 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2323 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2320 trio. IPython offers these three kinds of special calls which are
2324 trio. IPython offers these three kinds of special calls which are
2321 not python code, and it's a good thing to have their call method
2325 not python code, and it's a good thing to have their call method
2322 be accessible as pure python functions (not just special syntax at
2326 be accessible as pure python functions (not just special syntax at
2323 the command line). It gives us a better internal implementation
2327 the command line). It gives us a better internal implementation
2324 structure, as well as exposing these for user scripting more
2328 structure, as well as exposing these for user scripting more
2325 cleanly.
2329 cleanly.
2326
2330
2327 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2331 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2328 file. Now that they'll be more likely to be used with the
2332 file. Now that they'll be more likely to be used with the
2329 persistance system (%store), I want to make sure their module path
2333 persistance system (%store), I want to make sure their module path
2330 doesn't change in the future, so that we don't break things for
2334 doesn't change in the future, so that we don't break things for
2331 users' persisted data.
2335 users' persisted data.
2332
2336
2333 * IPython/iplib.py (autoindent_update): move indentation
2337 * IPython/iplib.py (autoindent_update): move indentation
2334 management into the _text_ processing loop, not the keyboard
2338 management into the _text_ processing loop, not the keyboard
2335 interactive one. This is necessary to correctly process non-typed
2339 interactive one. This is necessary to correctly process non-typed
2336 multiline input (such as macros).
2340 multiline input (such as macros).
2337
2341
2338 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2342 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2339 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2343 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2340 which was producing problems in the resulting manual.
2344 which was producing problems in the resulting manual.
2341 (magic_whos): improve reporting of instances (show their class,
2345 (magic_whos): improve reporting of instances (show their class,
2342 instead of simply printing 'instance' which isn't terribly
2346 instead of simply printing 'instance' which isn't terribly
2343 informative).
2347 informative).
2344
2348
2345 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2349 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2346 (minor mods) to support network shares under win32.
2350 (minor mods) to support network shares under win32.
2347
2351
2348 * IPython/winconsole.py (get_console_size): add new winconsole
2352 * IPython/winconsole.py (get_console_size): add new winconsole
2349 module and fixes to page_dumb() to improve its behavior under
2353 module and fixes to page_dumb() to improve its behavior under
2350 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2354 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2351
2355
2352 * IPython/Magic.py (Macro): simplified Macro class to just
2356 * IPython/Magic.py (Macro): simplified Macro class to just
2353 subclass list. We've had only 2.2 compatibility for a very long
2357 subclass list. We've had only 2.2 compatibility for a very long
2354 time, yet I was still avoiding subclassing the builtin types. No
2358 time, yet I was still avoiding subclassing the builtin types. No
2355 more (I'm also starting to use properties, though I won't shift to
2359 more (I'm also starting to use properties, though I won't shift to
2356 2.3-specific features quite yet).
2360 2.3-specific features quite yet).
2357 (magic_store): added Ville's patch for lightweight variable
2361 (magic_store): added Ville's patch for lightweight variable
2358 persistence, after a request on the user list by Matt Wilkie
2362 persistence, after a request on the user list by Matt Wilkie
2359 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2363 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2360 details.
2364 details.
2361
2365
2362 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2366 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2363 changed the default logfile name from 'ipython.log' to
2367 changed the default logfile name from 'ipython.log' to
2364 'ipython_log.py'. These logs are real python files, and now that
2368 'ipython_log.py'. These logs are real python files, and now that
2365 we have much better multiline support, people are more likely to
2369 we have much better multiline support, people are more likely to
2366 want to use them as such. Might as well name them correctly.
2370 want to use them as such. Might as well name them correctly.
2367
2371
2368 * IPython/Magic.py: substantial cleanup. While we can't stop
2372 * IPython/Magic.py: substantial cleanup. While we can't stop
2369 using magics as mixins, due to the existing customizations 'out
2373 using magics as mixins, due to the existing customizations 'out
2370 there' which rely on the mixin naming conventions, at least I
2374 there' which rely on the mixin naming conventions, at least I
2371 cleaned out all cross-class name usage. So once we are OK with
2375 cleaned out all cross-class name usage. So once we are OK with
2372 breaking compatibility, the two systems can be separated.
2376 breaking compatibility, the two systems can be separated.
2373
2377
2374 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2378 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2375 anymore, and the class is a fair bit less hideous as well. New
2379 anymore, and the class is a fair bit less hideous as well. New
2376 features were also introduced: timestamping of input, and logging
2380 features were also introduced: timestamping of input, and logging
2377 of output results. These are user-visible with the -t and -o
2381 of output results. These are user-visible with the -t and -o
2378 options to %logstart. Closes
2382 options to %logstart. Closes
2379 http://www.scipy.net/roundup/ipython/issue11 and a request by
2383 http://www.scipy.net/roundup/ipython/issue11 and a request by
2380 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2384 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2381
2385
2382 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2386 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2383
2387
2384 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2388 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2385 better handle backslashes in paths. See the thread 'More Windows
2389 better handle backslashes in paths. See the thread 'More Windows
2386 questions part 2 - \/ characters revisited' on the iypthon user
2390 questions part 2 - \/ characters revisited' on the iypthon user
2387 list:
2391 list:
2388 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2392 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2389
2393
2390 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2394 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2391
2395
2392 (InteractiveShell.__init__): change threaded shells to not use the
2396 (InteractiveShell.__init__): change threaded shells to not use the
2393 ipython crash handler. This was causing more problems than not,
2397 ipython crash handler. This was causing more problems than not,
2394 as exceptions in the main thread (GUI code, typically) would
2398 as exceptions in the main thread (GUI code, typically) would
2395 always show up as a 'crash', when they really weren't.
2399 always show up as a 'crash', when they really weren't.
2396
2400
2397 The colors and exception mode commands (%colors/%xmode) have been
2401 The colors and exception mode commands (%colors/%xmode) have been
2398 synchronized to also take this into account, so users can get
2402 synchronized to also take this into account, so users can get
2399 verbose exceptions for their threaded code as well. I also added
2403 verbose exceptions for their threaded code as well. I also added
2400 support for activating pdb inside this exception handler as well,
2404 support for activating pdb inside this exception handler as well,
2401 so now GUI authors can use IPython's enhanced pdb at runtime.
2405 so now GUI authors can use IPython's enhanced pdb at runtime.
2402
2406
2403 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2407 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2404 true by default, and add it to the shipped ipythonrc file. Since
2408 true by default, and add it to the shipped ipythonrc file. Since
2405 this asks the user before proceeding, I think it's OK to make it
2409 this asks the user before proceeding, I think it's OK to make it
2406 true by default.
2410 true by default.
2407
2411
2408 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2412 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2409 of the previous special-casing of input in the eval loop. I think
2413 of the previous special-casing of input in the eval loop. I think
2410 this is cleaner, as they really are commands and shouldn't have
2414 this is cleaner, as they really are commands and shouldn't have
2411 a special role in the middle of the core code.
2415 a special role in the middle of the core code.
2412
2416
2413 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2417 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2414
2418
2415 * IPython/iplib.py (edit_syntax_error): added support for
2419 * IPython/iplib.py (edit_syntax_error): added support for
2416 automatically reopening the editor if the file had a syntax error
2420 automatically reopening the editor if the file had a syntax error
2417 in it. Thanks to scottt who provided the patch at:
2421 in it. Thanks to scottt who provided the patch at:
2418 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2422 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2419 version committed).
2423 version committed).
2420
2424
2421 * IPython/iplib.py (handle_normal): add suport for multi-line
2425 * IPython/iplib.py (handle_normal): add suport for multi-line
2422 input with emtpy lines. This fixes
2426 input with emtpy lines. This fixes
2423 http://www.scipy.net/roundup/ipython/issue43 and a similar
2427 http://www.scipy.net/roundup/ipython/issue43 and a similar
2424 discussion on the user list.
2428 discussion on the user list.
2425
2429
2426 WARNING: a behavior change is necessarily introduced to support
2430 WARNING: a behavior change is necessarily introduced to support
2427 blank lines: now a single blank line with whitespace does NOT
2431 blank lines: now a single blank line with whitespace does NOT
2428 break the input loop, which means that when autoindent is on, by
2432 break the input loop, which means that when autoindent is on, by
2429 default hitting return on the next (indented) line does NOT exit.
2433 default hitting return on the next (indented) line does NOT exit.
2430
2434
2431 Instead, to exit a multiline input you can either have:
2435 Instead, to exit a multiline input you can either have:
2432
2436
2433 - TWO whitespace lines (just hit return again), or
2437 - TWO whitespace lines (just hit return again), or
2434 - a single whitespace line of a different length than provided
2438 - a single whitespace line of a different length than provided
2435 by the autoindent (add or remove a space).
2439 by the autoindent (add or remove a space).
2436
2440
2437 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2441 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2438 module to better organize all readline-related functionality.
2442 module to better organize all readline-related functionality.
2439 I've deleted FlexCompleter and put all completion clases here.
2443 I've deleted FlexCompleter and put all completion clases here.
2440
2444
2441 * IPython/iplib.py (raw_input): improve indentation management.
2445 * IPython/iplib.py (raw_input): improve indentation management.
2442 It is now possible to paste indented code with autoindent on, and
2446 It is now possible to paste indented code with autoindent on, and
2443 the code is interpreted correctly (though it still looks bad on
2447 the code is interpreted correctly (though it still looks bad on
2444 screen, due to the line-oriented nature of ipython).
2448 screen, due to the line-oriented nature of ipython).
2445 (MagicCompleter.complete): change behavior so that a TAB key on an
2449 (MagicCompleter.complete): change behavior so that a TAB key on an
2446 otherwise empty line actually inserts a tab, instead of completing
2450 otherwise empty line actually inserts a tab, instead of completing
2447 on the entire global namespace. This makes it easier to use the
2451 on the entire global namespace. This makes it easier to use the
2448 TAB key for indentation. After a request by Hans Meine
2452 TAB key for indentation. After a request by Hans Meine
2449 <hans_meine-AT-gmx.net>
2453 <hans_meine-AT-gmx.net>
2450 (_prefilter): add support so that typing plain 'exit' or 'quit'
2454 (_prefilter): add support so that typing plain 'exit' or 'quit'
2451 does a sensible thing. Originally I tried to deviate as little as
2455 does a sensible thing. Originally I tried to deviate as little as
2452 possible from the default python behavior, but even that one may
2456 possible from the default python behavior, but even that one may
2453 change in this direction (thread on python-dev to that effect).
2457 change in this direction (thread on python-dev to that effect).
2454 Regardless, ipython should do the right thing even if CPython's
2458 Regardless, ipython should do the right thing even if CPython's
2455 '>>>' prompt doesn't.
2459 '>>>' prompt doesn't.
2456 (InteractiveShell): removed subclassing code.InteractiveConsole
2460 (InteractiveShell): removed subclassing code.InteractiveConsole
2457 class. By now we'd overridden just about all of its methods: I've
2461 class. By now we'd overridden just about all of its methods: I've
2458 copied the remaining two over, and now ipython is a standalone
2462 copied the remaining two over, and now ipython is a standalone
2459 class. This will provide a clearer picture for the chainsaw
2463 class. This will provide a clearer picture for the chainsaw
2460 branch refactoring.
2464 branch refactoring.
2461
2465
2462 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2466 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2463
2467
2464 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2468 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2465 failures for objects which break when dir() is called on them.
2469 failures for objects which break when dir() is called on them.
2466
2470
2467 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2471 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2468 distinct local and global namespaces in the completer API. This
2472 distinct local and global namespaces in the completer API. This
2469 change allows us to properly handle completion with distinct
2473 change allows us to properly handle completion with distinct
2470 scopes, including in embedded instances (this had never really
2474 scopes, including in embedded instances (this had never really
2471 worked correctly).
2475 worked correctly).
2472
2476
2473 Note: this introduces a change in the constructor for
2477 Note: this introduces a change in the constructor for
2474 MagicCompleter, as a new global_namespace parameter is now the
2478 MagicCompleter, as a new global_namespace parameter is now the
2475 second argument (the others were bumped one position).
2479 second argument (the others were bumped one position).
2476
2480
2477 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2481 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2478
2482
2479 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2483 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2480 embedded instances (which can be done now thanks to Vivian's
2484 embedded instances (which can be done now thanks to Vivian's
2481 frame-handling fixes for pdb).
2485 frame-handling fixes for pdb).
2482 (InteractiveShell.__init__): Fix namespace handling problem in
2486 (InteractiveShell.__init__): Fix namespace handling problem in
2483 embedded instances. We were overwriting __main__ unconditionally,
2487 embedded instances. We were overwriting __main__ unconditionally,
2484 and this should only be done for 'full' (non-embedded) IPython;
2488 and this should only be done for 'full' (non-embedded) IPython;
2485 embedded instances must respect the caller's __main__. Thanks to
2489 embedded instances must respect the caller's __main__. Thanks to
2486 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2490 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2487
2491
2488 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2492 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2489
2493
2490 * setup.py: added download_url to setup(). This registers the
2494 * setup.py: added download_url to setup(). This registers the
2491 download address at PyPI, which is not only useful to humans
2495 download address at PyPI, which is not only useful to humans
2492 browsing the site, but is also picked up by setuptools (the Eggs
2496 browsing the site, but is also picked up by setuptools (the Eggs
2493 machinery). Thanks to Ville and R. Kern for the info/discussion
2497 machinery). Thanks to Ville and R. Kern for the info/discussion
2494 on this.
2498 on this.
2495
2499
2496 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2500 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2497
2501
2498 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2502 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2499 This brings a lot of nice functionality to the pdb mode, which now
2503 This brings a lot of nice functionality to the pdb mode, which now
2500 has tab-completion, syntax highlighting, and better stack handling
2504 has tab-completion, syntax highlighting, and better stack handling
2501 than before. Many thanks to Vivian De Smedt
2505 than before. Many thanks to Vivian De Smedt
2502 <vivian-AT-vdesmedt.com> for the original patches.
2506 <vivian-AT-vdesmedt.com> for the original patches.
2503
2507
2504 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2508 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2505
2509
2506 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2510 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2507 sequence to consistently accept the banner argument. The
2511 sequence to consistently accept the banner argument. The
2508 inconsistency was tripping SAGE, thanks to Gary Zablackis
2512 inconsistency was tripping SAGE, thanks to Gary Zablackis
2509 <gzabl-AT-yahoo.com> for the report.
2513 <gzabl-AT-yahoo.com> for the report.
2510
2514
2511 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2515 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2512
2516
2513 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2517 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2514 Fix bug where a naked 'alias' call in the ipythonrc file would
2518 Fix bug where a naked 'alias' call in the ipythonrc file would
2515 cause a crash. Bug reported by Jorgen Stenarson.
2519 cause a crash. Bug reported by Jorgen Stenarson.
2516
2520
2517 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2521 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2518
2522
2519 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2523 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2520 startup time.
2524 startup time.
2521
2525
2522 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2526 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2523 instances had introduced a bug with globals in normal code. Now
2527 instances had introduced a bug with globals in normal code. Now
2524 it's working in all cases.
2528 it's working in all cases.
2525
2529
2526 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2530 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2527 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2531 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2528 has been introduced to set the default case sensitivity of the
2532 has been introduced to set the default case sensitivity of the
2529 searches. Users can still select either mode at runtime on a
2533 searches. Users can still select either mode at runtime on a
2530 per-search basis.
2534 per-search basis.
2531
2535
2532 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2536 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2533
2537
2534 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2538 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2535 attributes in wildcard searches for subclasses. Modified version
2539 attributes in wildcard searches for subclasses. Modified version
2536 of a patch by Jorgen.
2540 of a patch by Jorgen.
2537
2541
2538 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2542 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2539
2543
2540 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2544 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2541 embedded instances. I added a user_global_ns attribute to the
2545 embedded instances. I added a user_global_ns attribute to the
2542 InteractiveShell class to handle this.
2546 InteractiveShell class to handle this.
2543
2547
2544 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2548 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2545
2549
2546 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2550 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2547 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2551 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2548 (reported under win32, but may happen also in other platforms).
2552 (reported under win32, but may happen also in other platforms).
2549 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2553 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2550
2554
2551 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2555 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2552
2556
2553 * IPython/Magic.py (magic_psearch): new support for wildcard
2557 * IPython/Magic.py (magic_psearch): new support for wildcard
2554 patterns. Now, typing ?a*b will list all names which begin with a
2558 patterns. Now, typing ?a*b will list all names which begin with a
2555 and end in b, for example. The %psearch magic has full
2559 and end in b, for example. The %psearch magic has full
2556 docstrings. Many thanks to JΓΆrgen Stenarson
2560 docstrings. Many thanks to JΓΆrgen Stenarson
2557 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2561 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2558 implementing this functionality.
2562 implementing this functionality.
2559
2563
2560 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2564 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2561
2565
2562 * Manual: fixed long-standing annoyance of double-dashes (as in
2566 * Manual: fixed long-standing annoyance of double-dashes (as in
2563 --prefix=~, for example) being stripped in the HTML version. This
2567 --prefix=~, for example) being stripped in the HTML version. This
2564 is a latex2html bug, but a workaround was provided. Many thanks
2568 is a latex2html bug, but a workaround was provided. Many thanks
2565 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2569 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2566 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2570 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2567 rolling. This seemingly small issue had tripped a number of users
2571 rolling. This seemingly small issue had tripped a number of users
2568 when first installing, so I'm glad to see it gone.
2572 when first installing, so I'm glad to see it gone.
2569
2573
2570 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2574 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2571
2575
2572 * IPython/Extensions/numeric_formats.py: fix missing import,
2576 * IPython/Extensions/numeric_formats.py: fix missing import,
2573 reported by Stephen Walton.
2577 reported by Stephen Walton.
2574
2578
2575 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2579 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2576
2580
2577 * IPython/demo.py: finish demo module, fully documented now.
2581 * IPython/demo.py: finish demo module, fully documented now.
2578
2582
2579 * IPython/genutils.py (file_read): simple little utility to read a
2583 * IPython/genutils.py (file_read): simple little utility to read a
2580 file and ensure it's closed afterwards.
2584 file and ensure it's closed afterwards.
2581
2585
2582 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2586 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2583
2587
2584 * IPython/demo.py (Demo.__init__): added support for individually
2588 * IPython/demo.py (Demo.__init__): added support for individually
2585 tagging blocks for automatic execution.
2589 tagging blocks for automatic execution.
2586
2590
2587 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2591 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2588 syntax-highlighted python sources, requested by John.
2592 syntax-highlighted python sources, requested by John.
2589
2593
2590 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2594 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2591
2595
2592 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2596 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2593 finishing.
2597 finishing.
2594
2598
2595 * IPython/genutils.py (shlex_split): moved from Magic to here,
2599 * IPython/genutils.py (shlex_split): moved from Magic to here,
2596 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2600 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2597
2601
2598 * IPython/demo.py (Demo.__init__): added support for silent
2602 * IPython/demo.py (Demo.__init__): added support for silent
2599 blocks, improved marks as regexps, docstrings written.
2603 blocks, improved marks as regexps, docstrings written.
2600 (Demo.__init__): better docstring, added support for sys.argv.
2604 (Demo.__init__): better docstring, added support for sys.argv.
2601
2605
2602 * IPython/genutils.py (marquee): little utility used by the demo
2606 * IPython/genutils.py (marquee): little utility used by the demo
2603 code, handy in general.
2607 code, handy in general.
2604
2608
2605 * IPython/demo.py (Demo.__init__): new class for interactive
2609 * IPython/demo.py (Demo.__init__): new class for interactive
2606 demos. Not documented yet, I just wrote it in a hurry for
2610 demos. Not documented yet, I just wrote it in a hurry for
2607 scipy'05. Will docstring later.
2611 scipy'05. Will docstring later.
2608
2612
2609 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2613 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2610
2614
2611 * IPython/Shell.py (sigint_handler): Drastic simplification which
2615 * IPython/Shell.py (sigint_handler): Drastic simplification which
2612 also seems to make Ctrl-C work correctly across threads! This is
2616 also seems to make Ctrl-C work correctly across threads! This is
2613 so simple, that I can't beleive I'd missed it before. Needs more
2617 so simple, that I can't beleive I'd missed it before. Needs more
2614 testing, though.
2618 testing, though.
2615 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2619 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2616 like this before...
2620 like this before...
2617
2621
2618 * IPython/genutils.py (get_home_dir): add protection against
2622 * IPython/genutils.py (get_home_dir): add protection against
2619 non-dirs in win32 registry.
2623 non-dirs in win32 registry.
2620
2624
2621 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2625 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2622 bug where dict was mutated while iterating (pysh crash).
2626 bug where dict was mutated while iterating (pysh crash).
2623
2627
2624 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2628 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2625
2629
2626 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2630 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2627 spurious newlines added by this routine. After a report by
2631 spurious newlines added by this routine. After a report by
2628 F. Mantegazza.
2632 F. Mantegazza.
2629
2633
2630 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2634 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2631
2635
2632 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2636 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2633 calls. These were a leftover from the GTK 1.x days, and can cause
2637 calls. These were a leftover from the GTK 1.x days, and can cause
2634 problems in certain cases (after a report by John Hunter).
2638 problems in certain cases (after a report by John Hunter).
2635
2639
2636 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2640 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2637 os.getcwd() fails at init time. Thanks to patch from David Remahl
2641 os.getcwd() fails at init time. Thanks to patch from David Remahl
2638 <chmod007-AT-mac.com>.
2642 <chmod007-AT-mac.com>.
2639 (InteractiveShell.__init__): prevent certain special magics from
2643 (InteractiveShell.__init__): prevent certain special magics from
2640 being shadowed by aliases. Closes
2644 being shadowed by aliases. Closes
2641 http://www.scipy.net/roundup/ipython/issue41.
2645 http://www.scipy.net/roundup/ipython/issue41.
2642
2646
2643 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2647 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2644
2648
2645 * IPython/iplib.py (InteractiveShell.complete): Added new
2649 * IPython/iplib.py (InteractiveShell.complete): Added new
2646 top-level completion method to expose the completion mechanism
2650 top-level completion method to expose the completion mechanism
2647 beyond readline-based environments.
2651 beyond readline-based environments.
2648
2652
2649 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2653 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2650
2654
2651 * tools/ipsvnc (svnversion): fix svnversion capture.
2655 * tools/ipsvnc (svnversion): fix svnversion capture.
2652
2656
2653 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2657 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2654 attribute to self, which was missing. Before, it was set by a
2658 attribute to self, which was missing. Before, it was set by a
2655 routine which in certain cases wasn't being called, so the
2659 routine which in certain cases wasn't being called, so the
2656 instance could end up missing the attribute. This caused a crash.
2660 instance could end up missing the attribute. This caused a crash.
2657 Closes http://www.scipy.net/roundup/ipython/issue40.
2661 Closes http://www.scipy.net/roundup/ipython/issue40.
2658
2662
2659 2005-08-16 Fernando Perez <fperez@colorado.edu>
2663 2005-08-16 Fernando Perez <fperez@colorado.edu>
2660
2664
2661 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2665 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2662 contains non-string attribute. Closes
2666 contains non-string attribute. Closes
2663 http://www.scipy.net/roundup/ipython/issue38.
2667 http://www.scipy.net/roundup/ipython/issue38.
2664
2668
2665 2005-08-14 Fernando Perez <fperez@colorado.edu>
2669 2005-08-14 Fernando Perez <fperez@colorado.edu>
2666
2670
2667 * tools/ipsvnc: Minor improvements, to add changeset info.
2671 * tools/ipsvnc: Minor improvements, to add changeset info.
2668
2672
2669 2005-08-12 Fernando Perez <fperez@colorado.edu>
2673 2005-08-12 Fernando Perez <fperez@colorado.edu>
2670
2674
2671 * IPython/iplib.py (runsource): remove self.code_to_run_src
2675 * IPython/iplib.py (runsource): remove self.code_to_run_src
2672 attribute. I realized this is nothing more than
2676 attribute. I realized this is nothing more than
2673 '\n'.join(self.buffer), and having the same data in two different
2677 '\n'.join(self.buffer), and having the same data in two different
2674 places is just asking for synchronization bugs. This may impact
2678 places is just asking for synchronization bugs. This may impact
2675 people who have custom exception handlers, so I need to warn
2679 people who have custom exception handlers, so I need to warn
2676 ipython-dev about it (F. Mantegazza may use them).
2680 ipython-dev about it (F. Mantegazza may use them).
2677
2681
2678 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2682 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2679
2683
2680 * IPython/genutils.py: fix 2.2 compatibility (generators)
2684 * IPython/genutils.py: fix 2.2 compatibility (generators)
2681
2685
2682 2005-07-18 Fernando Perez <fperez@colorado.edu>
2686 2005-07-18 Fernando Perez <fperez@colorado.edu>
2683
2687
2684 * IPython/genutils.py (get_home_dir): fix to help users with
2688 * IPython/genutils.py (get_home_dir): fix to help users with
2685 invalid $HOME under win32.
2689 invalid $HOME under win32.
2686
2690
2687 2005-07-17 Fernando Perez <fperez@colorado.edu>
2691 2005-07-17 Fernando Perez <fperez@colorado.edu>
2688
2692
2689 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2693 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2690 some old hacks and clean up a bit other routines; code should be
2694 some old hacks and clean up a bit other routines; code should be
2691 simpler and a bit faster.
2695 simpler and a bit faster.
2692
2696
2693 * IPython/iplib.py (interact): removed some last-resort attempts
2697 * IPython/iplib.py (interact): removed some last-resort attempts
2694 to survive broken stdout/stderr. That code was only making it
2698 to survive broken stdout/stderr. That code was only making it
2695 harder to abstract out the i/o (necessary for gui integration),
2699 harder to abstract out the i/o (necessary for gui integration),
2696 and the crashes it could prevent were extremely rare in practice
2700 and the crashes it could prevent were extremely rare in practice
2697 (besides being fully user-induced in a pretty violent manner).
2701 (besides being fully user-induced in a pretty violent manner).
2698
2702
2699 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2703 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2700 Nothing major yet, but the code is simpler to read; this should
2704 Nothing major yet, but the code is simpler to read; this should
2701 make it easier to do more serious modifications in the future.
2705 make it easier to do more serious modifications in the future.
2702
2706
2703 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2707 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2704 which broke in .15 (thanks to a report by Ville).
2708 which broke in .15 (thanks to a report by Ville).
2705
2709
2706 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2710 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2707 be quite correct, I know next to nothing about unicode). This
2711 be quite correct, I know next to nothing about unicode). This
2708 will allow unicode strings to be used in prompts, amongst other
2712 will allow unicode strings to be used in prompts, amongst other
2709 cases. It also will prevent ipython from crashing when unicode
2713 cases. It also will prevent ipython from crashing when unicode
2710 shows up unexpectedly in many places. If ascii encoding fails, we
2714 shows up unexpectedly in many places. If ascii encoding fails, we
2711 assume utf_8. Currently the encoding is not a user-visible
2715 assume utf_8. Currently the encoding is not a user-visible
2712 setting, though it could be made so if there is demand for it.
2716 setting, though it could be made so if there is demand for it.
2713
2717
2714 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2718 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2715
2719
2716 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2720 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2717
2721
2718 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2722 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2719
2723
2720 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2724 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2721 code can work transparently for 2.2/2.3.
2725 code can work transparently for 2.2/2.3.
2722
2726
2723 2005-07-16 Fernando Perez <fperez@colorado.edu>
2727 2005-07-16 Fernando Perez <fperez@colorado.edu>
2724
2728
2725 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2729 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2726 out of the color scheme table used for coloring exception
2730 out of the color scheme table used for coloring exception
2727 tracebacks. This allows user code to add new schemes at runtime.
2731 tracebacks. This allows user code to add new schemes at runtime.
2728 This is a minimally modified version of the patch at
2732 This is a minimally modified version of the patch at
2729 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2733 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2730 for the contribution.
2734 for the contribution.
2731
2735
2732 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2736 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2733 slightly modified version of the patch in
2737 slightly modified version of the patch in
2734 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2738 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2735 to remove the previous try/except solution (which was costlier).
2739 to remove the previous try/except solution (which was costlier).
2736 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2740 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2737
2741
2738 2005-06-08 Fernando Perez <fperez@colorado.edu>
2742 2005-06-08 Fernando Perez <fperez@colorado.edu>
2739
2743
2740 * IPython/iplib.py (write/write_err): Add methods to abstract all
2744 * IPython/iplib.py (write/write_err): Add methods to abstract all
2741 I/O a bit more.
2745 I/O a bit more.
2742
2746
2743 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2747 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2744 warning, reported by Aric Hagberg, fix by JD Hunter.
2748 warning, reported by Aric Hagberg, fix by JD Hunter.
2745
2749
2746 2005-06-02 *** Released version 0.6.15
2750 2005-06-02 *** Released version 0.6.15
2747
2751
2748 2005-06-01 Fernando Perez <fperez@colorado.edu>
2752 2005-06-01 Fernando Perez <fperez@colorado.edu>
2749
2753
2750 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2754 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2751 tab-completion of filenames within open-quoted strings. Note that
2755 tab-completion of filenames within open-quoted strings. Note that
2752 this requires that in ~/.ipython/ipythonrc, users change the
2756 this requires that in ~/.ipython/ipythonrc, users change the
2753 readline delimiters configuration to read:
2757 readline delimiters configuration to read:
2754
2758
2755 readline_remove_delims -/~
2759 readline_remove_delims -/~
2756
2760
2757
2761
2758 2005-05-31 *** Released version 0.6.14
2762 2005-05-31 *** Released version 0.6.14
2759
2763
2760 2005-05-29 Fernando Perez <fperez@colorado.edu>
2764 2005-05-29 Fernando Perez <fperez@colorado.edu>
2761
2765
2762 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2766 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2763 with files not on the filesystem. Reported by Eliyahu Sandler
2767 with files not on the filesystem. Reported by Eliyahu Sandler
2764 <eli@gondolin.net>
2768 <eli@gondolin.net>
2765
2769
2766 2005-05-22 Fernando Perez <fperez@colorado.edu>
2770 2005-05-22 Fernando Perez <fperez@colorado.edu>
2767
2771
2768 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2772 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2769 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2773 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2770
2774
2771 2005-05-19 Fernando Perez <fperez@colorado.edu>
2775 2005-05-19 Fernando Perez <fperez@colorado.edu>
2772
2776
2773 * IPython/iplib.py (safe_execfile): close a file which could be
2777 * IPython/iplib.py (safe_execfile): close a file which could be
2774 left open (causing problems in win32, which locks open files).
2778 left open (causing problems in win32, which locks open files).
2775 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2779 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2776
2780
2777 2005-05-18 Fernando Perez <fperez@colorado.edu>
2781 2005-05-18 Fernando Perez <fperez@colorado.edu>
2778
2782
2779 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2783 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2780 keyword arguments correctly to safe_execfile().
2784 keyword arguments correctly to safe_execfile().
2781
2785
2782 2005-05-13 Fernando Perez <fperez@colorado.edu>
2786 2005-05-13 Fernando Perez <fperez@colorado.edu>
2783
2787
2784 * ipython.1: Added info about Qt to manpage, and threads warning
2788 * ipython.1: Added info about Qt to manpage, and threads warning
2785 to usage page (invoked with --help).
2789 to usage page (invoked with --help).
2786
2790
2787 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2791 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2788 new matcher (it goes at the end of the priority list) to do
2792 new matcher (it goes at the end of the priority list) to do
2789 tab-completion on named function arguments. Submitted by George
2793 tab-completion on named function arguments. Submitted by George
2790 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2794 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2791 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2795 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2792 for more details.
2796 for more details.
2793
2797
2794 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2798 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2795 SystemExit exceptions in the script being run. Thanks to a report
2799 SystemExit exceptions in the script being run. Thanks to a report
2796 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2800 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2797 producing very annoying behavior when running unit tests.
2801 producing very annoying behavior when running unit tests.
2798
2802
2799 2005-05-12 Fernando Perez <fperez@colorado.edu>
2803 2005-05-12 Fernando Perez <fperez@colorado.edu>
2800
2804
2801 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2805 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2802 which I'd broken (again) due to a changed regexp. In the process,
2806 which I'd broken (again) due to a changed regexp. In the process,
2803 added ';' as an escape to auto-quote the whole line without
2807 added ';' as an escape to auto-quote the whole line without
2804 splitting its arguments. Thanks to a report by Jerry McRae
2808 splitting its arguments. Thanks to a report by Jerry McRae
2805 <qrs0xyc02-AT-sneakemail.com>.
2809 <qrs0xyc02-AT-sneakemail.com>.
2806
2810
2807 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2811 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2808 possible crashes caused by a TokenError. Reported by Ed Schofield
2812 possible crashes caused by a TokenError. Reported by Ed Schofield
2809 <schofield-AT-ftw.at>.
2813 <schofield-AT-ftw.at>.
2810
2814
2811 2005-05-06 Fernando Perez <fperez@colorado.edu>
2815 2005-05-06 Fernando Perez <fperez@colorado.edu>
2812
2816
2813 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2817 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2814
2818
2815 2005-04-29 Fernando Perez <fperez@colorado.edu>
2819 2005-04-29 Fernando Perez <fperez@colorado.edu>
2816
2820
2817 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2821 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2818 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2822 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2819 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2823 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2820 which provides support for Qt interactive usage (similar to the
2824 which provides support for Qt interactive usage (similar to the
2821 existing one for WX and GTK). This had been often requested.
2825 existing one for WX and GTK). This had been often requested.
2822
2826
2823 2005-04-14 *** Released version 0.6.13
2827 2005-04-14 *** Released version 0.6.13
2824
2828
2825 2005-04-08 Fernando Perez <fperez@colorado.edu>
2829 2005-04-08 Fernando Perez <fperez@colorado.edu>
2826
2830
2827 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2831 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2828 from _ofind, which gets called on almost every input line. Now,
2832 from _ofind, which gets called on almost every input line. Now,
2829 we only try to get docstrings if they are actually going to be
2833 we only try to get docstrings if they are actually going to be
2830 used (the overhead of fetching unnecessary docstrings can be
2834 used (the overhead of fetching unnecessary docstrings can be
2831 noticeable for certain objects, such as Pyro proxies).
2835 noticeable for certain objects, such as Pyro proxies).
2832
2836
2833 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2837 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2834 for completers. For some reason I had been passing them the state
2838 for completers. For some reason I had been passing them the state
2835 variable, which completers never actually need, and was in
2839 variable, which completers never actually need, and was in
2836 conflict with the rlcompleter API. Custom completers ONLY need to
2840 conflict with the rlcompleter API. Custom completers ONLY need to
2837 take the text parameter.
2841 take the text parameter.
2838
2842
2839 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2843 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2840 work correctly in pysh. I've also moved all the logic which used
2844 work correctly in pysh. I've also moved all the logic which used
2841 to be in pysh.py here, which will prevent problems with future
2845 to be in pysh.py here, which will prevent problems with future
2842 upgrades. However, this time I must warn users to update their
2846 upgrades. However, this time I must warn users to update their
2843 pysh profile to include the line
2847 pysh profile to include the line
2844
2848
2845 import_all IPython.Extensions.InterpreterExec
2849 import_all IPython.Extensions.InterpreterExec
2846
2850
2847 because otherwise things won't work for them. They MUST also
2851 because otherwise things won't work for them. They MUST also
2848 delete pysh.py and the line
2852 delete pysh.py and the line
2849
2853
2850 execfile pysh.py
2854 execfile pysh.py
2851
2855
2852 from their ipythonrc-pysh.
2856 from their ipythonrc-pysh.
2853
2857
2854 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2858 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2855 robust in the face of objects whose dir() returns non-strings
2859 robust in the face of objects whose dir() returns non-strings
2856 (which it shouldn't, but some broken libs like ITK do). Thanks to
2860 (which it shouldn't, but some broken libs like ITK do). Thanks to
2857 a patch by John Hunter (implemented differently, though). Also
2861 a patch by John Hunter (implemented differently, though). Also
2858 minor improvements by using .extend instead of + on lists.
2862 minor improvements by using .extend instead of + on lists.
2859
2863
2860 * pysh.py:
2864 * pysh.py:
2861
2865
2862 2005-04-06 Fernando Perez <fperez@colorado.edu>
2866 2005-04-06 Fernando Perez <fperez@colorado.edu>
2863
2867
2864 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2868 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2865 by default, so that all users benefit from it. Those who don't
2869 by default, so that all users benefit from it. Those who don't
2866 want it can still turn it off.
2870 want it can still turn it off.
2867
2871
2868 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2872 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2869 config file, I'd forgotten about this, so users were getting it
2873 config file, I'd forgotten about this, so users were getting it
2870 off by default.
2874 off by default.
2871
2875
2872 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2876 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2873 consistency. Now magics can be called in multiline statements,
2877 consistency. Now magics can be called in multiline statements,
2874 and python variables can be expanded in magic calls via $var.
2878 and python variables can be expanded in magic calls via $var.
2875 This makes the magic system behave just like aliases or !system
2879 This makes the magic system behave just like aliases or !system
2876 calls.
2880 calls.
2877
2881
2878 2005-03-28 Fernando Perez <fperez@colorado.edu>
2882 2005-03-28 Fernando Perez <fperez@colorado.edu>
2879
2883
2880 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2884 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2881 expensive string additions for building command. Add support for
2885 expensive string additions for building command. Add support for
2882 trailing ';' when autocall is used.
2886 trailing ';' when autocall is used.
2883
2887
2884 2005-03-26 Fernando Perez <fperez@colorado.edu>
2888 2005-03-26 Fernando Perez <fperez@colorado.edu>
2885
2889
2886 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2890 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2887 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2891 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2888 ipython.el robust against prompts with any number of spaces
2892 ipython.el robust against prompts with any number of spaces
2889 (including 0) after the ':' character.
2893 (including 0) after the ':' character.
2890
2894
2891 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2895 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2892 continuation prompt, which misled users to think the line was
2896 continuation prompt, which misled users to think the line was
2893 already indented. Closes debian Bug#300847, reported to me by
2897 already indented. Closes debian Bug#300847, reported to me by
2894 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2898 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2895
2899
2896 2005-03-23 Fernando Perez <fperez@colorado.edu>
2900 2005-03-23 Fernando Perez <fperez@colorado.edu>
2897
2901
2898 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2902 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2899 properly aligned if they have embedded newlines.
2903 properly aligned if they have embedded newlines.
2900
2904
2901 * IPython/iplib.py (runlines): Add a public method to expose
2905 * IPython/iplib.py (runlines): Add a public method to expose
2902 IPython's code execution machinery, so that users can run strings
2906 IPython's code execution machinery, so that users can run strings
2903 as if they had been typed at the prompt interactively.
2907 as if they had been typed at the prompt interactively.
2904 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2908 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2905 methods which can call the system shell, but with python variable
2909 methods which can call the system shell, but with python variable
2906 expansion. The three such methods are: __IPYTHON__.system,
2910 expansion. The three such methods are: __IPYTHON__.system,
2907 .getoutput and .getoutputerror. These need to be documented in a
2911 .getoutput and .getoutputerror. These need to be documented in a
2908 'public API' section (to be written) of the manual.
2912 'public API' section (to be written) of the manual.
2909
2913
2910 2005-03-20 Fernando Perez <fperez@colorado.edu>
2914 2005-03-20 Fernando Perez <fperez@colorado.edu>
2911
2915
2912 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2916 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2913 for custom exception handling. This is quite powerful, and it
2917 for custom exception handling. This is quite powerful, and it
2914 allows for user-installable exception handlers which can trap
2918 allows for user-installable exception handlers which can trap
2915 custom exceptions at runtime and treat them separately from
2919 custom exceptions at runtime and treat them separately from
2916 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2920 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2917 Mantegazza <mantegazza-AT-ill.fr>.
2921 Mantegazza <mantegazza-AT-ill.fr>.
2918 (InteractiveShell.set_custom_completer): public API function to
2922 (InteractiveShell.set_custom_completer): public API function to
2919 add new completers at runtime.
2923 add new completers at runtime.
2920
2924
2921 2005-03-19 Fernando Perez <fperez@colorado.edu>
2925 2005-03-19 Fernando Perez <fperez@colorado.edu>
2922
2926
2923 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2927 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2924 allow objects which provide their docstrings via non-standard
2928 allow objects which provide their docstrings via non-standard
2925 mechanisms (like Pyro proxies) to still be inspected by ipython's
2929 mechanisms (like Pyro proxies) to still be inspected by ipython's
2926 ? system.
2930 ? system.
2927
2931
2928 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2932 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2929 automatic capture system. I tried quite hard to make it work
2933 automatic capture system. I tried quite hard to make it work
2930 reliably, and simply failed. I tried many combinations with the
2934 reliably, and simply failed. I tried many combinations with the
2931 subprocess module, but eventually nothing worked in all needed
2935 subprocess module, but eventually nothing worked in all needed
2932 cases (not blocking stdin for the child, duplicating stdout
2936 cases (not blocking stdin for the child, duplicating stdout
2933 without blocking, etc). The new %sc/%sx still do capture to these
2937 without blocking, etc). The new %sc/%sx still do capture to these
2934 magical list/string objects which make shell use much more
2938 magical list/string objects which make shell use much more
2935 conveninent, so not all is lost.
2939 conveninent, so not all is lost.
2936
2940
2937 XXX - FIX MANUAL for the change above!
2941 XXX - FIX MANUAL for the change above!
2938
2942
2939 (runsource): I copied code.py's runsource() into ipython to modify
2943 (runsource): I copied code.py's runsource() into ipython to modify
2940 it a bit. Now the code object and source to be executed are
2944 it a bit. Now the code object and source to be executed are
2941 stored in ipython. This makes this info accessible to third-party
2945 stored in ipython. This makes this info accessible to third-party
2942 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2946 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2943 Mantegazza <mantegazza-AT-ill.fr>.
2947 Mantegazza <mantegazza-AT-ill.fr>.
2944
2948
2945 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2949 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2946 history-search via readline (like C-p/C-n). I'd wanted this for a
2950 history-search via readline (like C-p/C-n). I'd wanted this for a
2947 long time, but only recently found out how to do it. For users
2951 long time, but only recently found out how to do it. For users
2948 who already have their ipythonrc files made and want this, just
2952 who already have their ipythonrc files made and want this, just
2949 add:
2953 add:
2950
2954
2951 readline_parse_and_bind "\e[A": history-search-backward
2955 readline_parse_and_bind "\e[A": history-search-backward
2952 readline_parse_and_bind "\e[B": history-search-forward
2956 readline_parse_and_bind "\e[B": history-search-forward
2953
2957
2954 2005-03-18 Fernando Perez <fperez@colorado.edu>
2958 2005-03-18 Fernando Perez <fperez@colorado.edu>
2955
2959
2956 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2960 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2957 LSString and SList classes which allow transparent conversions
2961 LSString and SList classes which allow transparent conversions
2958 between list mode and whitespace-separated string.
2962 between list mode and whitespace-separated string.
2959 (magic_r): Fix recursion problem in %r.
2963 (magic_r): Fix recursion problem in %r.
2960
2964
2961 * IPython/genutils.py (LSString): New class to be used for
2965 * IPython/genutils.py (LSString): New class to be used for
2962 automatic storage of the results of all alias/system calls in _o
2966 automatic storage of the results of all alias/system calls in _o
2963 and _e (stdout/err). These provide a .l/.list attribute which
2967 and _e (stdout/err). These provide a .l/.list attribute which
2964 does automatic splitting on newlines. This means that for most
2968 does automatic splitting on newlines. This means that for most
2965 uses, you'll never need to do capturing of output with %sc/%sx
2969 uses, you'll never need to do capturing of output with %sc/%sx
2966 anymore, since ipython keeps this always done for you. Note that
2970 anymore, since ipython keeps this always done for you. Note that
2967 only the LAST results are stored, the _o/e variables are
2971 only the LAST results are stored, the _o/e variables are
2968 overwritten on each call. If you need to save their contents
2972 overwritten on each call. If you need to save their contents
2969 further, simply bind them to any other name.
2973 further, simply bind them to any other name.
2970
2974
2971 2005-03-17 Fernando Perez <fperez@colorado.edu>
2975 2005-03-17 Fernando Perez <fperez@colorado.edu>
2972
2976
2973 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2977 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2974 prompt namespace handling.
2978 prompt namespace handling.
2975
2979
2976 2005-03-16 Fernando Perez <fperez@colorado.edu>
2980 2005-03-16 Fernando Perez <fperez@colorado.edu>
2977
2981
2978 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2982 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2979 classic prompts to be '>>> ' (final space was missing, and it
2983 classic prompts to be '>>> ' (final space was missing, and it
2980 trips the emacs python mode).
2984 trips the emacs python mode).
2981 (BasePrompt.__str__): Added safe support for dynamic prompt
2985 (BasePrompt.__str__): Added safe support for dynamic prompt
2982 strings. Now you can set your prompt string to be '$x', and the
2986 strings. Now you can set your prompt string to be '$x', and the
2983 value of x will be printed from your interactive namespace. The
2987 value of x will be printed from your interactive namespace. The
2984 interpolation syntax includes the full Itpl support, so
2988 interpolation syntax includes the full Itpl support, so
2985 ${foo()+x+bar()} is a valid prompt string now, and the function
2989 ${foo()+x+bar()} is a valid prompt string now, and the function
2986 calls will be made at runtime.
2990 calls will be made at runtime.
2987
2991
2988 2005-03-15 Fernando Perez <fperez@colorado.edu>
2992 2005-03-15 Fernando Perez <fperez@colorado.edu>
2989
2993
2990 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2994 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2991 avoid name clashes in pylab. %hist still works, it just forwards
2995 avoid name clashes in pylab. %hist still works, it just forwards
2992 the call to %history.
2996 the call to %history.
2993
2997
2994 2005-03-02 *** Released version 0.6.12
2998 2005-03-02 *** Released version 0.6.12
2995
2999
2996 2005-03-02 Fernando Perez <fperez@colorado.edu>
3000 2005-03-02 Fernando Perez <fperez@colorado.edu>
2997
3001
2998 * IPython/iplib.py (handle_magic): log magic calls properly as
3002 * IPython/iplib.py (handle_magic): log magic calls properly as
2999 ipmagic() function calls.
3003 ipmagic() function calls.
3000
3004
3001 * IPython/Magic.py (magic_time): Improved %time to support
3005 * IPython/Magic.py (magic_time): Improved %time to support
3002 statements and provide wall-clock as well as CPU time.
3006 statements and provide wall-clock as well as CPU time.
3003
3007
3004 2005-02-27 Fernando Perez <fperez@colorado.edu>
3008 2005-02-27 Fernando Perez <fperez@colorado.edu>
3005
3009
3006 * IPython/hooks.py: New hooks module, to expose user-modifiable
3010 * IPython/hooks.py: New hooks module, to expose user-modifiable
3007 IPython functionality in a clean manner. For now only the editor
3011 IPython functionality in a clean manner. For now only the editor
3008 hook is actually written, and other thigns which I intend to turn
3012 hook is actually written, and other thigns which I intend to turn
3009 into proper hooks aren't yet there. The display and prefilter
3013 into proper hooks aren't yet there. The display and prefilter
3010 stuff, for example, should be hooks. But at least now the
3014 stuff, for example, should be hooks. But at least now the
3011 framework is in place, and the rest can be moved here with more
3015 framework is in place, and the rest can be moved here with more
3012 time later. IPython had had a .hooks variable for a long time for
3016 time later. IPython had had a .hooks variable for a long time for
3013 this purpose, but I'd never actually used it for anything.
3017 this purpose, but I'd never actually used it for anything.
3014
3018
3015 2005-02-26 Fernando Perez <fperez@colorado.edu>
3019 2005-02-26 Fernando Perez <fperez@colorado.edu>
3016
3020
3017 * IPython/ipmaker.py (make_IPython): make the default ipython
3021 * IPython/ipmaker.py (make_IPython): make the default ipython
3018 directory be called _ipython under win32, to follow more the
3022 directory be called _ipython under win32, to follow more the
3019 naming peculiarities of that platform (where buggy software like
3023 naming peculiarities of that platform (where buggy software like
3020 Visual Sourcesafe breaks with .named directories). Reported by
3024 Visual Sourcesafe breaks with .named directories). Reported by
3021 Ville Vainio.
3025 Ville Vainio.
3022
3026
3023 2005-02-23 Fernando Perez <fperez@colorado.edu>
3027 2005-02-23 Fernando Perez <fperez@colorado.edu>
3024
3028
3025 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3029 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3026 auto_aliases for win32 which were causing problems. Users can
3030 auto_aliases for win32 which were causing problems. Users can
3027 define the ones they personally like.
3031 define the ones they personally like.
3028
3032
3029 2005-02-21 Fernando Perez <fperez@colorado.edu>
3033 2005-02-21 Fernando Perez <fperez@colorado.edu>
3030
3034
3031 * IPython/Magic.py (magic_time): new magic to time execution of
3035 * IPython/Magic.py (magic_time): new magic to time execution of
3032 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3036 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3033
3037
3034 2005-02-19 Fernando Perez <fperez@colorado.edu>
3038 2005-02-19 Fernando Perez <fperez@colorado.edu>
3035
3039
3036 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3040 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3037 into keys (for prompts, for example).
3041 into keys (for prompts, for example).
3038
3042
3039 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3043 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3040 prompts in case users want them. This introduces a small behavior
3044 prompts in case users want them. This introduces a small behavior
3041 change: ipython does not automatically add a space to all prompts
3045 change: ipython does not automatically add a space to all prompts
3042 anymore. To get the old prompts with a space, users should add it
3046 anymore. To get the old prompts with a space, users should add it
3043 manually to their ipythonrc file, so for example prompt_in1 should
3047 manually to their ipythonrc file, so for example prompt_in1 should
3044 now read 'In [\#]: ' instead of 'In [\#]:'.
3048 now read 'In [\#]: ' instead of 'In [\#]:'.
3045 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3049 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3046 file) to control left-padding of secondary prompts.
3050 file) to control left-padding of secondary prompts.
3047
3051
3048 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3052 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3049 the profiler can't be imported. Fix for Debian, which removed
3053 the profiler can't be imported. Fix for Debian, which removed
3050 profile.py because of License issues. I applied a slightly
3054 profile.py because of License issues. I applied a slightly
3051 modified version of the original Debian patch at
3055 modified version of the original Debian patch at
3052 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3056 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3053
3057
3054 2005-02-17 Fernando Perez <fperez@colorado.edu>
3058 2005-02-17 Fernando Perez <fperez@colorado.edu>
3055
3059
3056 * IPython/genutils.py (native_line_ends): Fix bug which would
3060 * IPython/genutils.py (native_line_ends): Fix bug which would
3057 cause improper line-ends under win32 b/c I was not opening files
3061 cause improper line-ends under win32 b/c I was not opening files
3058 in binary mode. Bug report and fix thanks to Ville.
3062 in binary mode. Bug report and fix thanks to Ville.
3059
3063
3060 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3064 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3061 trying to catch spurious foo[1] autocalls. My fix actually broke
3065 trying to catch spurious foo[1] autocalls. My fix actually broke
3062 ',/' autoquote/call with explicit escape (bad regexp).
3066 ',/' autoquote/call with explicit escape (bad regexp).
3063
3067
3064 2005-02-15 *** Released version 0.6.11
3068 2005-02-15 *** Released version 0.6.11
3065
3069
3066 2005-02-14 Fernando Perez <fperez@colorado.edu>
3070 2005-02-14 Fernando Perez <fperez@colorado.edu>
3067
3071
3068 * IPython/background_jobs.py: New background job management
3072 * IPython/background_jobs.py: New background job management
3069 subsystem. This is implemented via a new set of classes, and
3073 subsystem. This is implemented via a new set of classes, and
3070 IPython now provides a builtin 'jobs' object for background job
3074 IPython now provides a builtin 'jobs' object for background job
3071 execution. A convenience %bg magic serves as a lightweight
3075 execution. A convenience %bg magic serves as a lightweight
3072 frontend for starting the more common type of calls. This was
3076 frontend for starting the more common type of calls. This was
3073 inspired by discussions with B. Granger and the BackgroundCommand
3077 inspired by discussions with B. Granger and the BackgroundCommand
3074 class described in the book Python Scripting for Computational
3078 class described in the book Python Scripting for Computational
3075 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3079 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3076 (although ultimately no code from this text was used, as IPython's
3080 (although ultimately no code from this text was used, as IPython's
3077 system is a separate implementation).
3081 system is a separate implementation).
3078
3082
3079 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3083 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3080 to control the completion of single/double underscore names
3084 to control the completion of single/double underscore names
3081 separately. As documented in the example ipytonrc file, the
3085 separately. As documented in the example ipytonrc file, the
3082 readline_omit__names variable can now be set to 2, to omit even
3086 readline_omit__names variable can now be set to 2, to omit even
3083 single underscore names. Thanks to a patch by Brian Wong
3087 single underscore names. Thanks to a patch by Brian Wong
3084 <BrianWong-AT-AirgoNetworks.Com>.
3088 <BrianWong-AT-AirgoNetworks.Com>.
3085 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3089 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3086 be autocalled as foo([1]) if foo were callable. A problem for
3090 be autocalled as foo([1]) if foo were callable. A problem for
3087 things which are both callable and implement __getitem__.
3091 things which are both callable and implement __getitem__.
3088 (init_readline): Fix autoindentation for win32. Thanks to a patch
3092 (init_readline): Fix autoindentation for win32. Thanks to a patch
3089 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3093 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3090
3094
3091 2005-02-12 Fernando Perez <fperez@colorado.edu>
3095 2005-02-12 Fernando Perez <fperez@colorado.edu>
3092
3096
3093 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3097 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3094 which I had written long ago to sort out user error messages which
3098 which I had written long ago to sort out user error messages which
3095 may occur during startup. This seemed like a good idea initially,
3099 may occur during startup. This seemed like a good idea initially,
3096 but it has proven a disaster in retrospect. I don't want to
3100 but it has proven a disaster in retrospect. I don't want to
3097 change much code for now, so my fix is to set the internal 'debug'
3101 change much code for now, so my fix is to set the internal 'debug'
3098 flag to true everywhere, whose only job was precisely to control
3102 flag to true everywhere, whose only job was precisely to control
3099 this subsystem. This closes issue 28 (as well as avoiding all
3103 this subsystem. This closes issue 28 (as well as avoiding all
3100 sorts of strange hangups which occur from time to time).
3104 sorts of strange hangups which occur from time to time).
3101
3105
3102 2005-02-07 Fernando Perez <fperez@colorado.edu>
3106 2005-02-07 Fernando Perez <fperez@colorado.edu>
3103
3107
3104 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3108 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3105 previous call produced a syntax error.
3109 previous call produced a syntax error.
3106
3110
3107 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3111 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3108 classes without constructor.
3112 classes without constructor.
3109
3113
3110 2005-02-06 Fernando Perez <fperez@colorado.edu>
3114 2005-02-06 Fernando Perez <fperez@colorado.edu>
3111
3115
3112 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3116 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3113 completions with the results of each matcher, so we return results
3117 completions with the results of each matcher, so we return results
3114 to the user from all namespaces. This breaks with ipython
3118 to the user from all namespaces. This breaks with ipython
3115 tradition, but I think it's a nicer behavior. Now you get all
3119 tradition, but I think it's a nicer behavior. Now you get all
3116 possible completions listed, from all possible namespaces (python,
3120 possible completions listed, from all possible namespaces (python,
3117 filesystem, magics...) After a request by John Hunter
3121 filesystem, magics...) After a request by John Hunter
3118 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3122 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3119
3123
3120 2005-02-05 Fernando Perez <fperez@colorado.edu>
3124 2005-02-05 Fernando Perez <fperez@colorado.edu>
3121
3125
3122 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3126 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3123 the call had quote characters in it (the quotes were stripped).
3127 the call had quote characters in it (the quotes were stripped).
3124
3128
3125 2005-01-31 Fernando Perez <fperez@colorado.edu>
3129 2005-01-31 Fernando Perez <fperez@colorado.edu>
3126
3130
3127 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3131 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3128 Itpl.itpl() to make the code more robust against psyco
3132 Itpl.itpl() to make the code more robust against psyco
3129 optimizations.
3133 optimizations.
3130
3134
3131 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3135 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3132 of causing an exception. Quicker, cleaner.
3136 of causing an exception. Quicker, cleaner.
3133
3137
3134 2005-01-28 Fernando Perez <fperez@colorado.edu>
3138 2005-01-28 Fernando Perez <fperez@colorado.edu>
3135
3139
3136 * scripts/ipython_win_post_install.py (install): hardcode
3140 * scripts/ipython_win_post_install.py (install): hardcode
3137 sys.prefix+'python.exe' as the executable path. It turns out that
3141 sys.prefix+'python.exe' as the executable path. It turns out that
3138 during the post-installation run, sys.executable resolves to the
3142 during the post-installation run, sys.executable resolves to the
3139 name of the binary installer! I should report this as a distutils
3143 name of the binary installer! I should report this as a distutils
3140 bug, I think. I updated the .10 release with this tiny fix, to
3144 bug, I think. I updated the .10 release with this tiny fix, to
3141 avoid annoying the lists further.
3145 avoid annoying the lists further.
3142
3146
3143 2005-01-27 *** Released version 0.6.10
3147 2005-01-27 *** Released version 0.6.10
3144
3148
3145 2005-01-27 Fernando Perez <fperez@colorado.edu>
3149 2005-01-27 Fernando Perez <fperez@colorado.edu>
3146
3150
3147 * IPython/numutils.py (norm): Added 'inf' as optional name for
3151 * IPython/numutils.py (norm): Added 'inf' as optional name for
3148 L-infinity norm, included references to mathworld.com for vector
3152 L-infinity norm, included references to mathworld.com for vector
3149 norm definitions.
3153 norm definitions.
3150 (amin/amax): added amin/amax for array min/max. Similar to what
3154 (amin/amax): added amin/amax for array min/max. Similar to what
3151 pylab ships with after the recent reorganization of names.
3155 pylab ships with after the recent reorganization of names.
3152 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3156 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3153
3157
3154 * ipython.el: committed Alex's recent fixes and improvements.
3158 * ipython.el: committed Alex's recent fixes and improvements.
3155 Tested with python-mode from CVS, and it looks excellent. Since
3159 Tested with python-mode from CVS, and it looks excellent. Since
3156 python-mode hasn't released anything in a while, I'm temporarily
3160 python-mode hasn't released anything in a while, I'm temporarily
3157 putting a copy of today's CVS (v 4.70) of python-mode in:
3161 putting a copy of today's CVS (v 4.70) of python-mode in:
3158 http://ipython.scipy.org/tmp/python-mode.el
3162 http://ipython.scipy.org/tmp/python-mode.el
3159
3163
3160 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3164 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3161 sys.executable for the executable name, instead of assuming it's
3165 sys.executable for the executable name, instead of assuming it's
3162 called 'python.exe' (the post-installer would have produced broken
3166 called 'python.exe' (the post-installer would have produced broken
3163 setups on systems with a differently named python binary).
3167 setups on systems with a differently named python binary).
3164
3168
3165 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3169 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3166 references to os.linesep, to make the code more
3170 references to os.linesep, to make the code more
3167 platform-independent. This is also part of the win32 coloring
3171 platform-independent. This is also part of the win32 coloring
3168 fixes.
3172 fixes.
3169
3173
3170 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3174 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3171 lines, which actually cause coloring bugs because the length of
3175 lines, which actually cause coloring bugs because the length of
3172 the line is very difficult to correctly compute with embedded
3176 the line is very difficult to correctly compute with embedded
3173 escapes. This was the source of all the coloring problems under
3177 escapes. This was the source of all the coloring problems under
3174 Win32. I think that _finally_, Win32 users have a properly
3178 Win32. I think that _finally_, Win32 users have a properly
3175 working ipython in all respects. This would never have happened
3179 working ipython in all respects. This would never have happened
3176 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3180 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3177
3181
3178 2005-01-26 *** Released version 0.6.9
3182 2005-01-26 *** Released version 0.6.9
3179
3183
3180 2005-01-25 Fernando Perez <fperez@colorado.edu>
3184 2005-01-25 Fernando Perez <fperez@colorado.edu>
3181
3185
3182 * setup.py: finally, we have a true Windows installer, thanks to
3186 * setup.py: finally, we have a true Windows installer, thanks to
3183 the excellent work of Viktor Ransmayr
3187 the excellent work of Viktor Ransmayr
3184 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3188 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3185 Windows users. The setup routine is quite a bit cleaner thanks to
3189 Windows users. The setup routine is quite a bit cleaner thanks to
3186 this, and the post-install script uses the proper functions to
3190 this, and the post-install script uses the proper functions to
3187 allow a clean de-installation using the standard Windows Control
3191 allow a clean de-installation using the standard Windows Control
3188 Panel.
3192 Panel.
3189
3193
3190 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3194 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3191 environment variable under all OSes (including win32) if
3195 environment variable under all OSes (including win32) if
3192 available. This will give consistency to win32 users who have set
3196 available. This will give consistency to win32 users who have set
3193 this variable for any reason. If os.environ['HOME'] fails, the
3197 this variable for any reason. If os.environ['HOME'] fails, the
3194 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3198 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3195
3199
3196 2005-01-24 Fernando Perez <fperez@colorado.edu>
3200 2005-01-24 Fernando Perez <fperez@colorado.edu>
3197
3201
3198 * IPython/numutils.py (empty_like): add empty_like(), similar to
3202 * IPython/numutils.py (empty_like): add empty_like(), similar to
3199 zeros_like() but taking advantage of the new empty() Numeric routine.
3203 zeros_like() but taking advantage of the new empty() Numeric routine.
3200
3204
3201 2005-01-23 *** Released version 0.6.8
3205 2005-01-23 *** Released version 0.6.8
3202
3206
3203 2005-01-22 Fernando Perez <fperez@colorado.edu>
3207 2005-01-22 Fernando Perez <fperez@colorado.edu>
3204
3208
3205 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3209 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3206 automatic show() calls. After discussing things with JDH, it
3210 automatic show() calls. After discussing things with JDH, it
3207 turns out there are too many corner cases where this can go wrong.
3211 turns out there are too many corner cases where this can go wrong.
3208 It's best not to try to be 'too smart', and simply have ipython
3212 It's best not to try to be 'too smart', and simply have ipython
3209 reproduce as much as possible the default behavior of a normal
3213 reproduce as much as possible the default behavior of a normal
3210 python shell.
3214 python shell.
3211
3215
3212 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3216 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3213 line-splitting regexp and _prefilter() to avoid calling getattr()
3217 line-splitting regexp and _prefilter() to avoid calling getattr()
3214 on assignments. This closes
3218 on assignments. This closes
3215 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3219 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3216 readline uses getattr(), so a simple <TAB> keypress is still
3220 readline uses getattr(), so a simple <TAB> keypress is still
3217 enough to trigger getattr() calls on an object.
3221 enough to trigger getattr() calls on an object.
3218
3222
3219 2005-01-21 Fernando Perez <fperez@colorado.edu>
3223 2005-01-21 Fernando Perez <fperez@colorado.edu>
3220
3224
3221 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3225 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3222 docstring under pylab so it doesn't mask the original.
3226 docstring under pylab so it doesn't mask the original.
3223
3227
3224 2005-01-21 *** Released version 0.6.7
3228 2005-01-21 *** Released version 0.6.7
3225
3229
3226 2005-01-21 Fernando Perez <fperez@colorado.edu>
3230 2005-01-21 Fernando Perez <fperez@colorado.edu>
3227
3231
3228 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3232 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3229 signal handling for win32 users in multithreaded mode.
3233 signal handling for win32 users in multithreaded mode.
3230
3234
3231 2005-01-17 Fernando Perez <fperez@colorado.edu>
3235 2005-01-17 Fernando Perez <fperez@colorado.edu>
3232
3236
3233 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3237 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3234 instances with no __init__. After a crash report by Norbert Nemec
3238 instances with no __init__. After a crash report by Norbert Nemec
3235 <Norbert-AT-nemec-online.de>.
3239 <Norbert-AT-nemec-online.de>.
3236
3240
3237 2005-01-14 Fernando Perez <fperez@colorado.edu>
3241 2005-01-14 Fernando Perez <fperez@colorado.edu>
3238
3242
3239 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3243 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3240 names for verbose exceptions, when multiple dotted names and the
3244 names for verbose exceptions, when multiple dotted names and the
3241 'parent' object were present on the same line.
3245 'parent' object were present on the same line.
3242
3246
3243 2005-01-11 Fernando Perez <fperez@colorado.edu>
3247 2005-01-11 Fernando Perez <fperez@colorado.edu>
3244
3248
3245 * IPython/genutils.py (flag_calls): new utility to trap and flag
3249 * IPython/genutils.py (flag_calls): new utility to trap and flag
3246 calls in functions. I need it to clean up matplotlib support.
3250 calls in functions. I need it to clean up matplotlib support.
3247 Also removed some deprecated code in genutils.
3251 Also removed some deprecated code in genutils.
3248
3252
3249 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3253 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3250 that matplotlib scripts called with %run, which don't call show()
3254 that matplotlib scripts called with %run, which don't call show()
3251 themselves, still have their plotting windows open.
3255 themselves, still have their plotting windows open.
3252
3256
3253 2005-01-05 Fernando Perez <fperez@colorado.edu>
3257 2005-01-05 Fernando Perez <fperez@colorado.edu>
3254
3258
3255 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3259 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3256 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3260 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3257
3261
3258 2004-12-19 Fernando Perez <fperez@colorado.edu>
3262 2004-12-19 Fernando Perez <fperez@colorado.edu>
3259
3263
3260 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3264 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3261 parent_runcode, which was an eyesore. The same result can be
3265 parent_runcode, which was an eyesore. The same result can be
3262 obtained with Python's regular superclass mechanisms.
3266 obtained with Python's regular superclass mechanisms.
3263
3267
3264 2004-12-17 Fernando Perez <fperez@colorado.edu>
3268 2004-12-17 Fernando Perez <fperez@colorado.edu>
3265
3269
3266 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3270 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3267 reported by Prabhu.
3271 reported by Prabhu.
3268 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3272 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3269 sys.stderr) instead of explicitly calling sys.stderr. This helps
3273 sys.stderr) instead of explicitly calling sys.stderr. This helps
3270 maintain our I/O abstractions clean, for future GUI embeddings.
3274 maintain our I/O abstractions clean, for future GUI embeddings.
3271
3275
3272 * IPython/genutils.py (info): added new utility for sys.stderr
3276 * IPython/genutils.py (info): added new utility for sys.stderr
3273 unified info message handling (thin wrapper around warn()).
3277 unified info message handling (thin wrapper around warn()).
3274
3278
3275 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3279 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3276 composite (dotted) names on verbose exceptions.
3280 composite (dotted) names on verbose exceptions.
3277 (VerboseTB.nullrepr): harden against another kind of errors which
3281 (VerboseTB.nullrepr): harden against another kind of errors which
3278 Python's inspect module can trigger, and which were crashing
3282 Python's inspect module can trigger, and which were crashing
3279 IPython. Thanks to a report by Marco Lombardi
3283 IPython. Thanks to a report by Marco Lombardi
3280 <mlombard-AT-ma010192.hq.eso.org>.
3284 <mlombard-AT-ma010192.hq.eso.org>.
3281
3285
3282 2004-12-13 *** Released version 0.6.6
3286 2004-12-13 *** Released version 0.6.6
3283
3287
3284 2004-12-12 Fernando Perez <fperez@colorado.edu>
3288 2004-12-12 Fernando Perez <fperez@colorado.edu>
3285
3289
3286 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3290 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3287 generated by pygtk upon initialization if it was built without
3291 generated by pygtk upon initialization if it was built without
3288 threads (for matplotlib users). After a crash reported by
3292 threads (for matplotlib users). After a crash reported by
3289 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3293 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3290
3294
3291 * IPython/ipmaker.py (make_IPython): fix small bug in the
3295 * IPython/ipmaker.py (make_IPython): fix small bug in the
3292 import_some parameter for multiple imports.
3296 import_some parameter for multiple imports.
3293
3297
3294 * IPython/iplib.py (ipmagic): simplified the interface of
3298 * IPython/iplib.py (ipmagic): simplified the interface of
3295 ipmagic() to take a single string argument, just as it would be
3299 ipmagic() to take a single string argument, just as it would be
3296 typed at the IPython cmd line.
3300 typed at the IPython cmd line.
3297 (ipalias): Added new ipalias() with an interface identical to
3301 (ipalias): Added new ipalias() with an interface identical to
3298 ipmagic(). This completes exposing a pure python interface to the
3302 ipmagic(). This completes exposing a pure python interface to the
3299 alias and magic system, which can be used in loops or more complex
3303 alias and magic system, which can be used in loops or more complex
3300 code where IPython's automatic line mangling is not active.
3304 code where IPython's automatic line mangling is not active.
3301
3305
3302 * IPython/genutils.py (timing): changed interface of timing to
3306 * IPython/genutils.py (timing): changed interface of timing to
3303 simply run code once, which is the most common case. timings()
3307 simply run code once, which is the most common case. timings()
3304 remains unchanged, for the cases where you want multiple runs.
3308 remains unchanged, for the cases where you want multiple runs.
3305
3309
3306 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3310 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3307 bug where Python2.2 crashes with exec'ing code which does not end
3311 bug where Python2.2 crashes with exec'ing code which does not end
3308 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3312 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3309 before.
3313 before.
3310
3314
3311 2004-12-10 Fernando Perez <fperez@colorado.edu>
3315 2004-12-10 Fernando Perez <fperez@colorado.edu>
3312
3316
3313 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3317 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3314 -t to -T, to accomodate the new -t flag in %run (the %run and
3318 -t to -T, to accomodate the new -t flag in %run (the %run and
3315 %prun options are kind of intermixed, and it's not easy to change
3319 %prun options are kind of intermixed, and it's not easy to change
3316 this with the limitations of python's getopt).
3320 this with the limitations of python's getopt).
3317
3321
3318 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3322 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3319 the execution of scripts. It's not as fine-tuned as timeit.py,
3323 the execution of scripts. It's not as fine-tuned as timeit.py,
3320 but it works from inside ipython (and under 2.2, which lacks
3324 but it works from inside ipython (and under 2.2, which lacks
3321 timeit.py). Optionally a number of runs > 1 can be given for
3325 timeit.py). Optionally a number of runs > 1 can be given for
3322 timing very short-running code.
3326 timing very short-running code.
3323
3327
3324 * IPython/genutils.py (uniq_stable): new routine which returns a
3328 * IPython/genutils.py (uniq_stable): new routine which returns a
3325 list of unique elements in any iterable, but in stable order of
3329 list of unique elements in any iterable, but in stable order of
3326 appearance. I needed this for the ultraTB fixes, and it's a handy
3330 appearance. I needed this for the ultraTB fixes, and it's a handy
3327 utility.
3331 utility.
3328
3332
3329 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3333 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3330 dotted names in Verbose exceptions. This had been broken since
3334 dotted names in Verbose exceptions. This had been broken since
3331 the very start, now x.y will properly be printed in a Verbose
3335 the very start, now x.y will properly be printed in a Verbose
3332 traceback, instead of x being shown and y appearing always as an
3336 traceback, instead of x being shown and y appearing always as an
3333 'undefined global'. Getting this to work was a bit tricky,
3337 'undefined global'. Getting this to work was a bit tricky,
3334 because by default python tokenizers are stateless. Saved by
3338 because by default python tokenizers are stateless. Saved by
3335 python's ability to easily add a bit of state to an arbitrary
3339 python's ability to easily add a bit of state to an arbitrary
3336 function (without needing to build a full-blown callable object).
3340 function (without needing to build a full-blown callable object).
3337
3341
3338 Also big cleanup of this code, which had horrendous runtime
3342 Also big cleanup of this code, which had horrendous runtime
3339 lookups of zillions of attributes for colorization. Moved all
3343 lookups of zillions of attributes for colorization. Moved all
3340 this code into a few templates, which make it cleaner and quicker.
3344 this code into a few templates, which make it cleaner and quicker.
3341
3345
3342 Printout quality was also improved for Verbose exceptions: one
3346 Printout quality was also improved for Verbose exceptions: one
3343 variable per line, and memory addresses are printed (this can be
3347 variable per line, and memory addresses are printed (this can be
3344 quite handy in nasty debugging situations, which is what Verbose
3348 quite handy in nasty debugging situations, which is what Verbose
3345 is for).
3349 is for).
3346
3350
3347 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3351 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3348 the command line as scripts to be loaded by embedded instances.
3352 the command line as scripts to be loaded by embedded instances.
3349 Doing so has the potential for an infinite recursion if there are
3353 Doing so has the potential for an infinite recursion if there are
3350 exceptions thrown in the process. This fixes a strange crash
3354 exceptions thrown in the process. This fixes a strange crash
3351 reported by Philippe MULLER <muller-AT-irit.fr>.
3355 reported by Philippe MULLER <muller-AT-irit.fr>.
3352
3356
3353 2004-12-09 Fernando Perez <fperez@colorado.edu>
3357 2004-12-09 Fernando Perez <fperez@colorado.edu>
3354
3358
3355 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3359 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3356 to reflect new names in matplotlib, which now expose the
3360 to reflect new names in matplotlib, which now expose the
3357 matlab-compatible interface via a pylab module instead of the
3361 matlab-compatible interface via a pylab module instead of the
3358 'matlab' name. The new code is backwards compatible, so users of
3362 'matlab' name. The new code is backwards compatible, so users of
3359 all matplotlib versions are OK. Patch by J. Hunter.
3363 all matplotlib versions are OK. Patch by J. Hunter.
3360
3364
3361 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3365 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3362 of __init__ docstrings for instances (class docstrings are already
3366 of __init__ docstrings for instances (class docstrings are already
3363 automatically printed). Instances with customized docstrings
3367 automatically printed). Instances with customized docstrings
3364 (indep. of the class) are also recognized and all 3 separate
3368 (indep. of the class) are also recognized and all 3 separate
3365 docstrings are printed (instance, class, constructor). After some
3369 docstrings are printed (instance, class, constructor). After some
3366 comments/suggestions by J. Hunter.
3370 comments/suggestions by J. Hunter.
3367
3371
3368 2004-12-05 Fernando Perez <fperez@colorado.edu>
3372 2004-12-05 Fernando Perez <fperez@colorado.edu>
3369
3373
3370 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3374 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3371 warnings when tab-completion fails and triggers an exception.
3375 warnings when tab-completion fails and triggers an exception.
3372
3376
3373 2004-12-03 Fernando Perez <fperez@colorado.edu>
3377 2004-12-03 Fernando Perez <fperez@colorado.edu>
3374
3378
3375 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3379 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3376 be triggered when using 'run -p'. An incorrect option flag was
3380 be triggered when using 'run -p'. An incorrect option flag was
3377 being set ('d' instead of 'D').
3381 being set ('d' instead of 'D').
3378 (manpage): fix missing escaped \- sign.
3382 (manpage): fix missing escaped \- sign.
3379
3383
3380 2004-11-30 *** Released version 0.6.5
3384 2004-11-30 *** Released version 0.6.5
3381
3385
3382 2004-11-30 Fernando Perez <fperez@colorado.edu>
3386 2004-11-30 Fernando Perez <fperez@colorado.edu>
3383
3387
3384 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3388 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3385 setting with -d option.
3389 setting with -d option.
3386
3390
3387 * setup.py (docfiles): Fix problem where the doc glob I was using
3391 * setup.py (docfiles): Fix problem where the doc glob I was using
3388 was COMPLETELY BROKEN. It was giving the right files by pure
3392 was COMPLETELY BROKEN. It was giving the right files by pure
3389 accident, but failed once I tried to include ipython.el. Note:
3393 accident, but failed once I tried to include ipython.el. Note:
3390 glob() does NOT allow you to do exclusion on multiple endings!
3394 glob() does NOT allow you to do exclusion on multiple endings!
3391
3395
3392 2004-11-29 Fernando Perez <fperez@colorado.edu>
3396 2004-11-29 Fernando Perez <fperez@colorado.edu>
3393
3397
3394 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3398 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3395 the manpage as the source. Better formatting & consistency.
3399 the manpage as the source. Better formatting & consistency.
3396
3400
3397 * IPython/Magic.py (magic_run): Added new -d option, to run
3401 * IPython/Magic.py (magic_run): Added new -d option, to run
3398 scripts under the control of the python pdb debugger. Note that
3402 scripts under the control of the python pdb debugger. Note that
3399 this required changing the %prun option -d to -D, to avoid a clash
3403 this required changing the %prun option -d to -D, to avoid a clash
3400 (since %run must pass options to %prun, and getopt is too dumb to
3404 (since %run must pass options to %prun, and getopt is too dumb to
3401 handle options with string values with embedded spaces). Thanks
3405 handle options with string values with embedded spaces). Thanks
3402 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3406 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3403 (magic_who_ls): added type matching to %who and %whos, so that one
3407 (magic_who_ls): added type matching to %who and %whos, so that one
3404 can filter their output to only include variables of certain
3408 can filter their output to only include variables of certain
3405 types. Another suggestion by Matthew.
3409 types. Another suggestion by Matthew.
3406 (magic_whos): Added memory summaries in kb and Mb for arrays.
3410 (magic_whos): Added memory summaries in kb and Mb for arrays.
3407 (magic_who): Improve formatting (break lines every 9 vars).
3411 (magic_who): Improve formatting (break lines every 9 vars).
3408
3412
3409 2004-11-28 Fernando Perez <fperez@colorado.edu>
3413 2004-11-28 Fernando Perez <fperez@colorado.edu>
3410
3414
3411 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3415 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3412 cache when empty lines were present.
3416 cache when empty lines were present.
3413
3417
3414 2004-11-24 Fernando Perez <fperez@colorado.edu>
3418 2004-11-24 Fernando Perez <fperez@colorado.edu>
3415
3419
3416 * IPython/usage.py (__doc__): document the re-activated threading
3420 * IPython/usage.py (__doc__): document the re-activated threading
3417 options for WX and GTK.
3421 options for WX and GTK.
3418
3422
3419 2004-11-23 Fernando Perez <fperez@colorado.edu>
3423 2004-11-23 Fernando Perez <fperez@colorado.edu>
3420
3424
3421 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3425 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3422 the -wthread and -gthread options, along with a new -tk one to try
3426 the -wthread and -gthread options, along with a new -tk one to try
3423 and coordinate Tk threading with wx/gtk. The tk support is very
3427 and coordinate Tk threading with wx/gtk. The tk support is very
3424 platform dependent, since it seems to require Tcl and Tk to be
3428 platform dependent, since it seems to require Tcl and Tk to be
3425 built with threads (Fedora1/2 appears NOT to have it, but in
3429 built with threads (Fedora1/2 appears NOT to have it, but in
3426 Prabhu's Debian boxes it works OK). But even with some Tk
3430 Prabhu's Debian boxes it works OK). But even with some Tk
3427 limitations, this is a great improvement.
3431 limitations, this is a great improvement.
3428
3432
3429 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3433 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3430 info in user prompts. Patch by Prabhu.
3434 info in user prompts. Patch by Prabhu.
3431
3435
3432 2004-11-18 Fernando Perez <fperez@colorado.edu>
3436 2004-11-18 Fernando Perez <fperez@colorado.edu>
3433
3437
3434 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3438 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3435 EOFErrors and bail, to avoid infinite loops if a non-terminating
3439 EOFErrors and bail, to avoid infinite loops if a non-terminating
3436 file is fed into ipython. Patch submitted in issue 19 by user,
3440 file is fed into ipython. Patch submitted in issue 19 by user,
3437 many thanks.
3441 many thanks.
3438
3442
3439 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3443 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3440 autoquote/parens in continuation prompts, which can cause lots of
3444 autoquote/parens in continuation prompts, which can cause lots of
3441 problems. Closes roundup issue 20.
3445 problems. Closes roundup issue 20.
3442
3446
3443 2004-11-17 Fernando Perez <fperez@colorado.edu>
3447 2004-11-17 Fernando Perez <fperez@colorado.edu>
3444
3448
3445 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3449 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3446 reported as debian bug #280505. I'm not sure my local changelog
3450 reported as debian bug #280505. I'm not sure my local changelog
3447 entry has the proper debian format (Jack?).
3451 entry has the proper debian format (Jack?).
3448
3452
3449 2004-11-08 *** Released version 0.6.4
3453 2004-11-08 *** Released version 0.6.4
3450
3454
3451 2004-11-08 Fernando Perez <fperez@colorado.edu>
3455 2004-11-08 Fernando Perez <fperez@colorado.edu>
3452
3456
3453 * IPython/iplib.py (init_readline): Fix exit message for Windows
3457 * IPython/iplib.py (init_readline): Fix exit message for Windows
3454 when readline is active. Thanks to a report by Eric Jones
3458 when readline is active. Thanks to a report by Eric Jones
3455 <eric-AT-enthought.com>.
3459 <eric-AT-enthought.com>.
3456
3460
3457 2004-11-07 Fernando Perez <fperez@colorado.edu>
3461 2004-11-07 Fernando Perez <fperez@colorado.edu>
3458
3462
3459 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3463 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3460 sometimes seen by win2k/cygwin users.
3464 sometimes seen by win2k/cygwin users.
3461
3465
3462 2004-11-06 Fernando Perez <fperez@colorado.edu>
3466 2004-11-06 Fernando Perez <fperez@colorado.edu>
3463
3467
3464 * IPython/iplib.py (interact): Change the handling of %Exit from
3468 * IPython/iplib.py (interact): Change the handling of %Exit from
3465 trying to propagate a SystemExit to an internal ipython flag.
3469 trying to propagate a SystemExit to an internal ipython flag.
3466 This is less elegant than using Python's exception mechanism, but
3470 This is less elegant than using Python's exception mechanism, but
3467 I can't get that to work reliably with threads, so under -pylab
3471 I can't get that to work reliably with threads, so under -pylab
3468 %Exit was hanging IPython. Cross-thread exception handling is
3472 %Exit was hanging IPython. Cross-thread exception handling is
3469 really a bitch. Thaks to a bug report by Stephen Walton
3473 really a bitch. Thaks to a bug report by Stephen Walton
3470 <stephen.walton-AT-csun.edu>.
3474 <stephen.walton-AT-csun.edu>.
3471
3475
3472 2004-11-04 Fernando Perez <fperez@colorado.edu>
3476 2004-11-04 Fernando Perez <fperez@colorado.edu>
3473
3477
3474 * IPython/iplib.py (raw_input_original): store a pointer to the
3478 * IPython/iplib.py (raw_input_original): store a pointer to the
3475 true raw_input to harden against code which can modify it
3479 true raw_input to harden against code which can modify it
3476 (wx.py.PyShell does this and would otherwise crash ipython).
3480 (wx.py.PyShell does this and would otherwise crash ipython).
3477 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3481 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3478
3482
3479 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3483 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3480 Ctrl-C problem, which does not mess up the input line.
3484 Ctrl-C problem, which does not mess up the input line.
3481
3485
3482 2004-11-03 Fernando Perez <fperez@colorado.edu>
3486 2004-11-03 Fernando Perez <fperez@colorado.edu>
3483
3487
3484 * IPython/Release.py: Changed licensing to BSD, in all files.
3488 * IPython/Release.py: Changed licensing to BSD, in all files.
3485 (name): lowercase name for tarball/RPM release.
3489 (name): lowercase name for tarball/RPM release.
3486
3490
3487 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3491 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3488 use throughout ipython.
3492 use throughout ipython.
3489
3493
3490 * IPython/Magic.py (Magic._ofind): Switch to using the new
3494 * IPython/Magic.py (Magic._ofind): Switch to using the new
3491 OInspect.getdoc() function.
3495 OInspect.getdoc() function.
3492
3496
3493 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3497 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3494 of the line currently being canceled via Ctrl-C. It's extremely
3498 of the line currently being canceled via Ctrl-C. It's extremely
3495 ugly, but I don't know how to do it better (the problem is one of
3499 ugly, but I don't know how to do it better (the problem is one of
3496 handling cross-thread exceptions).
3500 handling cross-thread exceptions).
3497
3501
3498 2004-10-28 Fernando Perez <fperez@colorado.edu>
3502 2004-10-28 Fernando Perez <fperez@colorado.edu>
3499
3503
3500 * IPython/Shell.py (signal_handler): add signal handlers to trap
3504 * IPython/Shell.py (signal_handler): add signal handlers to trap
3501 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3505 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3502 report by Francesc Alted.
3506 report by Francesc Alted.
3503
3507
3504 2004-10-21 Fernando Perez <fperez@colorado.edu>
3508 2004-10-21 Fernando Perez <fperez@colorado.edu>
3505
3509
3506 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3510 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3507 to % for pysh syntax extensions.
3511 to % for pysh syntax extensions.
3508
3512
3509 2004-10-09 Fernando Perez <fperez@colorado.edu>
3513 2004-10-09 Fernando Perez <fperez@colorado.edu>
3510
3514
3511 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3515 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3512 arrays to print a more useful summary, without calling str(arr).
3516 arrays to print a more useful summary, without calling str(arr).
3513 This avoids the problem of extremely lengthy computations which
3517 This avoids the problem of extremely lengthy computations which
3514 occur if arr is large, and appear to the user as a system lockup
3518 occur if arr is large, and appear to the user as a system lockup
3515 with 100% cpu activity. After a suggestion by Kristian Sandberg
3519 with 100% cpu activity. After a suggestion by Kristian Sandberg
3516 <Kristian.Sandberg@colorado.edu>.
3520 <Kristian.Sandberg@colorado.edu>.
3517 (Magic.__init__): fix bug in global magic escapes not being
3521 (Magic.__init__): fix bug in global magic escapes not being
3518 correctly set.
3522 correctly set.
3519
3523
3520 2004-10-08 Fernando Perez <fperez@colorado.edu>
3524 2004-10-08 Fernando Perez <fperez@colorado.edu>
3521
3525
3522 * IPython/Magic.py (__license__): change to absolute imports of
3526 * IPython/Magic.py (__license__): change to absolute imports of
3523 ipython's own internal packages, to start adapting to the absolute
3527 ipython's own internal packages, to start adapting to the absolute
3524 import requirement of PEP-328.
3528 import requirement of PEP-328.
3525
3529
3526 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3530 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3527 files, and standardize author/license marks through the Release
3531 files, and standardize author/license marks through the Release
3528 module instead of having per/file stuff (except for files with
3532 module instead of having per/file stuff (except for files with
3529 particular licenses, like the MIT/PSF-licensed codes).
3533 particular licenses, like the MIT/PSF-licensed codes).
3530
3534
3531 * IPython/Debugger.py: remove dead code for python 2.1
3535 * IPython/Debugger.py: remove dead code for python 2.1
3532
3536
3533 2004-10-04 Fernando Perez <fperez@colorado.edu>
3537 2004-10-04 Fernando Perez <fperez@colorado.edu>
3534
3538
3535 * IPython/iplib.py (ipmagic): New function for accessing magics
3539 * IPython/iplib.py (ipmagic): New function for accessing magics
3536 via a normal python function call.
3540 via a normal python function call.
3537
3541
3538 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3542 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3539 from '@' to '%', to accomodate the new @decorator syntax of python
3543 from '@' to '%', to accomodate the new @decorator syntax of python
3540 2.4.
3544 2.4.
3541
3545
3542 2004-09-29 Fernando Perez <fperez@colorado.edu>
3546 2004-09-29 Fernando Perez <fperez@colorado.edu>
3543
3547
3544 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3548 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3545 matplotlib.use to prevent running scripts which try to switch
3549 matplotlib.use to prevent running scripts which try to switch
3546 interactive backends from within ipython. This will just crash
3550 interactive backends from within ipython. This will just crash
3547 the python interpreter, so we can't allow it (but a detailed error
3551 the python interpreter, so we can't allow it (but a detailed error
3548 is given to the user).
3552 is given to the user).
3549
3553
3550 2004-09-28 Fernando Perez <fperez@colorado.edu>
3554 2004-09-28 Fernando Perez <fperez@colorado.edu>
3551
3555
3552 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3556 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3553 matplotlib-related fixes so that using @run with non-matplotlib
3557 matplotlib-related fixes so that using @run with non-matplotlib
3554 scripts doesn't pop up spurious plot windows. This requires
3558 scripts doesn't pop up spurious plot windows. This requires
3555 matplotlib >= 0.63, where I had to make some changes as well.
3559 matplotlib >= 0.63, where I had to make some changes as well.
3556
3560
3557 * IPython/ipmaker.py (make_IPython): update version requirement to
3561 * IPython/ipmaker.py (make_IPython): update version requirement to
3558 python 2.2.
3562 python 2.2.
3559
3563
3560 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3564 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3561 banner arg for embedded customization.
3565 banner arg for embedded customization.
3562
3566
3563 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3567 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3564 explicit uses of __IP as the IPython's instance name. Now things
3568 explicit uses of __IP as the IPython's instance name. Now things
3565 are properly handled via the shell.name value. The actual code
3569 are properly handled via the shell.name value. The actual code
3566 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3570 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3567 is much better than before. I'll clean things completely when the
3571 is much better than before. I'll clean things completely when the
3568 magic stuff gets a real overhaul.
3572 magic stuff gets a real overhaul.
3569
3573
3570 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3574 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3571 minor changes to debian dir.
3575 minor changes to debian dir.
3572
3576
3573 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3577 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3574 pointer to the shell itself in the interactive namespace even when
3578 pointer to the shell itself in the interactive namespace even when
3575 a user-supplied dict is provided. This is needed for embedding
3579 a user-supplied dict is provided. This is needed for embedding
3576 purposes (found by tests with Michel Sanner).
3580 purposes (found by tests with Michel Sanner).
3577
3581
3578 2004-09-27 Fernando Perez <fperez@colorado.edu>
3582 2004-09-27 Fernando Perez <fperez@colorado.edu>
3579
3583
3580 * IPython/UserConfig/ipythonrc: remove []{} from
3584 * IPython/UserConfig/ipythonrc: remove []{} from
3581 readline_remove_delims, so that things like [modname.<TAB> do
3585 readline_remove_delims, so that things like [modname.<TAB> do
3582 proper completion. This disables [].TAB, but that's a less common
3586 proper completion. This disables [].TAB, but that's a less common
3583 case than module names in list comprehensions, for example.
3587 case than module names in list comprehensions, for example.
3584 Thanks to a report by Andrea Riciputi.
3588 Thanks to a report by Andrea Riciputi.
3585
3589
3586 2004-09-09 Fernando Perez <fperez@colorado.edu>
3590 2004-09-09 Fernando Perez <fperez@colorado.edu>
3587
3591
3588 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3592 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3589 blocking problems in win32 and osx. Fix by John.
3593 blocking problems in win32 and osx. Fix by John.
3590
3594
3591 2004-09-08 Fernando Perez <fperez@colorado.edu>
3595 2004-09-08 Fernando Perez <fperez@colorado.edu>
3592
3596
3593 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3597 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3594 for Win32 and OSX. Fix by John Hunter.
3598 for Win32 and OSX. Fix by John Hunter.
3595
3599
3596 2004-08-30 *** Released version 0.6.3
3600 2004-08-30 *** Released version 0.6.3
3597
3601
3598 2004-08-30 Fernando Perez <fperez@colorado.edu>
3602 2004-08-30 Fernando Perez <fperez@colorado.edu>
3599
3603
3600 * setup.py (isfile): Add manpages to list of dependent files to be
3604 * setup.py (isfile): Add manpages to list of dependent files to be
3601 updated.
3605 updated.
3602
3606
3603 2004-08-27 Fernando Perez <fperez@colorado.edu>
3607 2004-08-27 Fernando Perez <fperez@colorado.edu>
3604
3608
3605 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3609 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3606 for now. They don't really work with standalone WX/GTK code
3610 for now. They don't really work with standalone WX/GTK code
3607 (though matplotlib IS working fine with both of those backends).
3611 (though matplotlib IS working fine with both of those backends).
3608 This will neeed much more testing. I disabled most things with
3612 This will neeed much more testing. I disabled most things with
3609 comments, so turning it back on later should be pretty easy.
3613 comments, so turning it back on later should be pretty easy.
3610
3614
3611 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3615 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3612 autocalling of expressions like r'foo', by modifying the line
3616 autocalling of expressions like r'foo', by modifying the line
3613 split regexp. Closes
3617 split regexp. Closes
3614 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3618 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3615 Riley <ipythonbugs-AT-sabi.net>.
3619 Riley <ipythonbugs-AT-sabi.net>.
3616 (InteractiveShell.mainloop): honor --nobanner with banner
3620 (InteractiveShell.mainloop): honor --nobanner with banner
3617 extensions.
3621 extensions.
3618
3622
3619 * IPython/Shell.py: Significant refactoring of all classes, so
3623 * IPython/Shell.py: Significant refactoring of all classes, so
3620 that we can really support ALL matplotlib backends and threading
3624 that we can really support ALL matplotlib backends and threading
3621 models (John spotted a bug with Tk which required this). Now we
3625 models (John spotted a bug with Tk which required this). Now we
3622 should support single-threaded, WX-threads and GTK-threads, both
3626 should support single-threaded, WX-threads and GTK-threads, both
3623 for generic code and for matplotlib.
3627 for generic code and for matplotlib.
3624
3628
3625 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3629 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3626 -pylab, to simplify things for users. Will also remove the pylab
3630 -pylab, to simplify things for users. Will also remove the pylab
3627 profile, since now all of matplotlib configuration is directly
3631 profile, since now all of matplotlib configuration is directly
3628 handled here. This also reduces startup time.
3632 handled here. This also reduces startup time.
3629
3633
3630 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3634 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3631 shell wasn't being correctly called. Also in IPShellWX.
3635 shell wasn't being correctly called. Also in IPShellWX.
3632
3636
3633 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3637 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3634 fine-tune banner.
3638 fine-tune banner.
3635
3639
3636 * IPython/numutils.py (spike): Deprecate these spike functions,
3640 * IPython/numutils.py (spike): Deprecate these spike functions,
3637 delete (long deprecated) gnuplot_exec handler.
3641 delete (long deprecated) gnuplot_exec handler.
3638
3642
3639 2004-08-26 Fernando Perez <fperez@colorado.edu>
3643 2004-08-26 Fernando Perez <fperez@colorado.edu>
3640
3644
3641 * ipython.1: Update for threading options, plus some others which
3645 * ipython.1: Update for threading options, plus some others which
3642 were missing.
3646 were missing.
3643
3647
3644 * IPython/ipmaker.py (__call__): Added -wthread option for
3648 * IPython/ipmaker.py (__call__): Added -wthread option for
3645 wxpython thread handling. Make sure threading options are only
3649 wxpython thread handling. Make sure threading options are only
3646 valid at the command line.
3650 valid at the command line.
3647
3651
3648 * scripts/ipython: moved shell selection into a factory function
3652 * scripts/ipython: moved shell selection into a factory function
3649 in Shell.py, to keep the starter script to a minimum.
3653 in Shell.py, to keep the starter script to a minimum.
3650
3654
3651 2004-08-25 Fernando Perez <fperez@colorado.edu>
3655 2004-08-25 Fernando Perez <fperez@colorado.edu>
3652
3656
3653 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3657 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3654 John. Along with some recent changes he made to matplotlib, the
3658 John. Along with some recent changes he made to matplotlib, the
3655 next versions of both systems should work very well together.
3659 next versions of both systems should work very well together.
3656
3660
3657 2004-08-24 Fernando Perez <fperez@colorado.edu>
3661 2004-08-24 Fernando Perez <fperez@colorado.edu>
3658
3662
3659 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3663 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3660 tried to switch the profiling to using hotshot, but I'm getting
3664 tried to switch the profiling to using hotshot, but I'm getting
3661 strange errors from prof.runctx() there. I may be misreading the
3665 strange errors from prof.runctx() there. I may be misreading the
3662 docs, but it looks weird. For now the profiling code will
3666 docs, but it looks weird. For now the profiling code will
3663 continue to use the standard profiler.
3667 continue to use the standard profiler.
3664
3668
3665 2004-08-23 Fernando Perez <fperez@colorado.edu>
3669 2004-08-23 Fernando Perez <fperez@colorado.edu>
3666
3670
3667 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3671 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3668 threaded shell, by John Hunter. It's not quite ready yet, but
3672 threaded shell, by John Hunter. It's not quite ready yet, but
3669 close.
3673 close.
3670
3674
3671 2004-08-22 Fernando Perez <fperez@colorado.edu>
3675 2004-08-22 Fernando Perez <fperez@colorado.edu>
3672
3676
3673 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3677 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3674 in Magic and ultraTB.
3678 in Magic and ultraTB.
3675
3679
3676 * ipython.1: document threading options in manpage.
3680 * ipython.1: document threading options in manpage.
3677
3681
3678 * scripts/ipython: Changed name of -thread option to -gthread,
3682 * scripts/ipython: Changed name of -thread option to -gthread,
3679 since this is GTK specific. I want to leave the door open for a
3683 since this is GTK specific. I want to leave the door open for a
3680 -wthread option for WX, which will most likely be necessary. This
3684 -wthread option for WX, which will most likely be necessary. This
3681 change affects usage and ipmaker as well.
3685 change affects usage and ipmaker as well.
3682
3686
3683 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3687 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3684 handle the matplotlib shell issues. Code by John Hunter
3688 handle the matplotlib shell issues. Code by John Hunter
3685 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3689 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3686 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3690 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3687 broken (and disabled for end users) for now, but it puts the
3691 broken (and disabled for end users) for now, but it puts the
3688 infrastructure in place.
3692 infrastructure in place.
3689
3693
3690 2004-08-21 Fernando Perez <fperez@colorado.edu>
3694 2004-08-21 Fernando Perez <fperez@colorado.edu>
3691
3695
3692 * ipythonrc-pylab: Add matplotlib support.
3696 * ipythonrc-pylab: Add matplotlib support.
3693
3697
3694 * matplotlib_config.py: new files for matplotlib support, part of
3698 * matplotlib_config.py: new files for matplotlib support, part of
3695 the pylab profile.
3699 the pylab profile.
3696
3700
3697 * IPython/usage.py (__doc__): documented the threading options.
3701 * IPython/usage.py (__doc__): documented the threading options.
3698
3702
3699 2004-08-20 Fernando Perez <fperez@colorado.edu>
3703 2004-08-20 Fernando Perez <fperez@colorado.edu>
3700
3704
3701 * ipython: Modified the main calling routine to handle the -thread
3705 * ipython: Modified the main calling routine to handle the -thread
3702 and -mpthread options. This needs to be done as a top-level hack,
3706 and -mpthread options. This needs to be done as a top-level hack,
3703 because it determines which class to instantiate for IPython
3707 because it determines which class to instantiate for IPython
3704 itself.
3708 itself.
3705
3709
3706 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3710 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3707 classes to support multithreaded GTK operation without blocking,
3711 classes to support multithreaded GTK operation without blocking,
3708 and matplotlib with all backends. This is a lot of still very
3712 and matplotlib with all backends. This is a lot of still very
3709 experimental code, and threads are tricky. So it may still have a
3713 experimental code, and threads are tricky. So it may still have a
3710 few rough edges... This code owes a lot to
3714 few rough edges... This code owes a lot to
3711 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3715 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3712 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3716 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3713 to John Hunter for all the matplotlib work.
3717 to John Hunter for all the matplotlib work.
3714
3718
3715 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3719 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3716 options for gtk thread and matplotlib support.
3720 options for gtk thread and matplotlib support.
3717
3721
3718 2004-08-16 Fernando Perez <fperez@colorado.edu>
3722 2004-08-16 Fernando Perez <fperez@colorado.edu>
3719
3723
3720 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3724 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3721 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3725 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3722 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3726 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3723
3727
3724 2004-08-11 Fernando Perez <fperez@colorado.edu>
3728 2004-08-11 Fernando Perez <fperez@colorado.edu>
3725
3729
3726 * setup.py (isfile): Fix build so documentation gets updated for
3730 * setup.py (isfile): Fix build so documentation gets updated for
3727 rpms (it was only done for .tgz builds).
3731 rpms (it was only done for .tgz builds).
3728
3732
3729 2004-08-10 Fernando Perez <fperez@colorado.edu>
3733 2004-08-10 Fernando Perez <fperez@colorado.edu>
3730
3734
3731 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3735 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3732
3736
3733 * iplib.py : Silence syntax error exceptions in tab-completion.
3737 * iplib.py : Silence syntax error exceptions in tab-completion.
3734
3738
3735 2004-08-05 Fernando Perez <fperez@colorado.edu>
3739 2004-08-05 Fernando Perez <fperez@colorado.edu>
3736
3740
3737 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3741 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3738 'color off' mark for continuation prompts. This was causing long
3742 'color off' mark for continuation prompts. This was causing long
3739 continuation lines to mis-wrap.
3743 continuation lines to mis-wrap.
3740
3744
3741 2004-08-01 Fernando Perez <fperez@colorado.edu>
3745 2004-08-01 Fernando Perez <fperez@colorado.edu>
3742
3746
3743 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3747 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3744 for building ipython to be a parameter. All this is necessary
3748 for building ipython to be a parameter. All this is necessary
3745 right now to have a multithreaded version, but this insane
3749 right now to have a multithreaded version, but this insane
3746 non-design will be cleaned up soon. For now, it's a hack that
3750 non-design will be cleaned up soon. For now, it's a hack that
3747 works.
3751 works.
3748
3752
3749 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3753 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3750 args in various places. No bugs so far, but it's a dangerous
3754 args in various places. No bugs so far, but it's a dangerous
3751 practice.
3755 practice.
3752
3756
3753 2004-07-31 Fernando Perez <fperez@colorado.edu>
3757 2004-07-31 Fernando Perez <fperez@colorado.edu>
3754
3758
3755 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3759 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3756 fix completion of files with dots in their names under most
3760 fix completion of files with dots in their names under most
3757 profiles (pysh was OK because the completion order is different).
3761 profiles (pysh was OK because the completion order is different).
3758
3762
3759 2004-07-27 Fernando Perez <fperez@colorado.edu>
3763 2004-07-27 Fernando Perez <fperez@colorado.edu>
3760
3764
3761 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3765 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3762 keywords manually, b/c the one in keyword.py was removed in python
3766 keywords manually, b/c the one in keyword.py was removed in python
3763 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3767 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3764 This is NOT a bug under python 2.3 and earlier.
3768 This is NOT a bug under python 2.3 and earlier.
3765
3769
3766 2004-07-26 Fernando Perez <fperez@colorado.edu>
3770 2004-07-26 Fernando Perez <fperez@colorado.edu>
3767
3771
3768 * IPython/ultraTB.py (VerboseTB.text): Add another
3772 * IPython/ultraTB.py (VerboseTB.text): Add another
3769 linecache.checkcache() call to try to prevent inspect.py from
3773 linecache.checkcache() call to try to prevent inspect.py from
3770 crashing under python 2.3. I think this fixes
3774 crashing under python 2.3. I think this fixes
3771 http://www.scipy.net/roundup/ipython/issue17.
3775 http://www.scipy.net/roundup/ipython/issue17.
3772
3776
3773 2004-07-26 *** Released version 0.6.2
3777 2004-07-26 *** Released version 0.6.2
3774
3778
3775 2004-07-26 Fernando Perez <fperez@colorado.edu>
3779 2004-07-26 Fernando Perez <fperez@colorado.edu>
3776
3780
3777 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3781 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3778 fail for any number.
3782 fail for any number.
3779 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3783 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3780 empty bookmarks.
3784 empty bookmarks.
3781
3785
3782 2004-07-26 *** Released version 0.6.1
3786 2004-07-26 *** Released version 0.6.1
3783
3787
3784 2004-07-26 Fernando Perez <fperez@colorado.edu>
3788 2004-07-26 Fernando Perez <fperez@colorado.edu>
3785
3789
3786 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3790 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3787
3791
3788 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3792 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3789 escaping '()[]{}' in filenames.
3793 escaping '()[]{}' in filenames.
3790
3794
3791 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3795 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3792 Python 2.2 users who lack a proper shlex.split.
3796 Python 2.2 users who lack a proper shlex.split.
3793
3797
3794 2004-07-19 Fernando Perez <fperez@colorado.edu>
3798 2004-07-19 Fernando Perez <fperez@colorado.edu>
3795
3799
3796 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3800 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3797 for reading readline's init file. I follow the normal chain:
3801 for reading readline's init file. I follow the normal chain:
3798 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3802 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3799 report by Mike Heeter. This closes
3803 report by Mike Heeter. This closes
3800 http://www.scipy.net/roundup/ipython/issue16.
3804 http://www.scipy.net/roundup/ipython/issue16.
3801
3805
3802 2004-07-18 Fernando Perez <fperez@colorado.edu>
3806 2004-07-18 Fernando Perez <fperez@colorado.edu>
3803
3807
3804 * IPython/iplib.py (__init__): Add better handling of '\' under
3808 * IPython/iplib.py (__init__): Add better handling of '\' under
3805 Win32 for filenames. After a patch by Ville.
3809 Win32 for filenames. After a patch by Ville.
3806
3810
3807 2004-07-17 Fernando Perez <fperez@colorado.edu>
3811 2004-07-17 Fernando Perez <fperez@colorado.edu>
3808
3812
3809 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3813 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3810 autocalling would be triggered for 'foo is bar' if foo is
3814 autocalling would be triggered for 'foo is bar' if foo is
3811 callable. I also cleaned up the autocall detection code to use a
3815 callable. I also cleaned up the autocall detection code to use a
3812 regexp, which is faster. Bug reported by Alexander Schmolck.
3816 regexp, which is faster. Bug reported by Alexander Schmolck.
3813
3817
3814 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3818 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3815 '?' in them would confuse the help system. Reported by Alex
3819 '?' in them would confuse the help system. Reported by Alex
3816 Schmolck.
3820 Schmolck.
3817
3821
3818 2004-07-16 Fernando Perez <fperez@colorado.edu>
3822 2004-07-16 Fernando Perez <fperez@colorado.edu>
3819
3823
3820 * IPython/GnuplotInteractive.py (__all__): added plot2.
3824 * IPython/GnuplotInteractive.py (__all__): added plot2.
3821
3825
3822 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3826 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3823 plotting dictionaries, lists or tuples of 1d arrays.
3827 plotting dictionaries, lists or tuples of 1d arrays.
3824
3828
3825 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3829 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3826 optimizations.
3830 optimizations.
3827
3831
3828 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3832 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3829 the information which was there from Janko's original IPP code:
3833 the information which was there from Janko's original IPP code:
3830
3834
3831 03.05.99 20:53 porto.ifm.uni-kiel.de
3835 03.05.99 20:53 porto.ifm.uni-kiel.de
3832 --Started changelog.
3836 --Started changelog.
3833 --make clear do what it say it does
3837 --make clear do what it say it does
3834 --added pretty output of lines from inputcache
3838 --added pretty output of lines from inputcache
3835 --Made Logger a mixin class, simplifies handling of switches
3839 --Made Logger a mixin class, simplifies handling of switches
3836 --Added own completer class. .string<TAB> expands to last history
3840 --Added own completer class. .string<TAB> expands to last history
3837 line which starts with string. The new expansion is also present
3841 line which starts with string. The new expansion is also present
3838 with Ctrl-r from the readline library. But this shows, who this
3842 with Ctrl-r from the readline library. But this shows, who this
3839 can be done for other cases.
3843 can be done for other cases.
3840 --Added convention that all shell functions should accept a
3844 --Added convention that all shell functions should accept a
3841 parameter_string This opens the door for different behaviour for
3845 parameter_string This opens the door for different behaviour for
3842 each function. @cd is a good example of this.
3846 each function. @cd is a good example of this.
3843
3847
3844 04.05.99 12:12 porto.ifm.uni-kiel.de
3848 04.05.99 12:12 porto.ifm.uni-kiel.de
3845 --added logfile rotation
3849 --added logfile rotation
3846 --added new mainloop method which freezes first the namespace
3850 --added new mainloop method which freezes first the namespace
3847
3851
3848 07.05.99 21:24 porto.ifm.uni-kiel.de
3852 07.05.99 21:24 porto.ifm.uni-kiel.de
3849 --added the docreader classes. Now there is a help system.
3853 --added the docreader classes. Now there is a help system.
3850 -This is only a first try. Currently it's not easy to put new
3854 -This is only a first try. Currently it's not easy to put new
3851 stuff in the indices. But this is the way to go. Info would be
3855 stuff in the indices. But this is the way to go. Info would be
3852 better, but HTML is every where and not everybody has an info
3856 better, but HTML is every where and not everybody has an info
3853 system installed and it's not so easy to change html-docs to info.
3857 system installed and it's not so easy to change html-docs to info.
3854 --added global logfile option
3858 --added global logfile option
3855 --there is now a hook for object inspection method pinfo needs to
3859 --there is now a hook for object inspection method pinfo needs to
3856 be provided for this. Can be reached by two '??'.
3860 be provided for this. Can be reached by two '??'.
3857
3861
3858 08.05.99 20:51 porto.ifm.uni-kiel.de
3862 08.05.99 20:51 porto.ifm.uni-kiel.de
3859 --added a README
3863 --added a README
3860 --bug in rc file. Something has changed so functions in the rc
3864 --bug in rc file. Something has changed so functions in the rc
3861 file need to reference the shell and not self. Not clear if it's a
3865 file need to reference the shell and not self. Not clear if it's a
3862 bug or feature.
3866 bug or feature.
3863 --changed rc file for new behavior
3867 --changed rc file for new behavior
3864
3868
3865 2004-07-15 Fernando Perez <fperez@colorado.edu>
3869 2004-07-15 Fernando Perez <fperez@colorado.edu>
3866
3870
3867 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3871 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3868 cache was falling out of sync in bizarre manners when multi-line
3872 cache was falling out of sync in bizarre manners when multi-line
3869 input was present. Minor optimizations and cleanup.
3873 input was present. Minor optimizations and cleanup.
3870
3874
3871 (Logger): Remove old Changelog info for cleanup. This is the
3875 (Logger): Remove old Changelog info for cleanup. This is the
3872 information which was there from Janko's original code:
3876 information which was there from Janko's original code:
3873
3877
3874 Changes to Logger: - made the default log filename a parameter
3878 Changes to Logger: - made the default log filename a parameter
3875
3879
3876 - put a check for lines beginning with !@? in log(). Needed
3880 - put a check for lines beginning with !@? in log(). Needed
3877 (even if the handlers properly log their lines) for mid-session
3881 (even if the handlers properly log their lines) for mid-session
3878 logging activation to work properly. Without this, lines logged
3882 logging activation to work properly. Without this, lines logged
3879 in mid session, which get read from the cache, would end up
3883 in mid session, which get read from the cache, would end up
3880 'bare' (with !@? in the open) in the log. Now they are caught
3884 'bare' (with !@? in the open) in the log. Now they are caught
3881 and prepended with a #.
3885 and prepended with a #.
3882
3886
3883 * IPython/iplib.py (InteractiveShell.init_readline): added check
3887 * IPython/iplib.py (InteractiveShell.init_readline): added check
3884 in case MagicCompleter fails to be defined, so we don't crash.
3888 in case MagicCompleter fails to be defined, so we don't crash.
3885
3889
3886 2004-07-13 Fernando Perez <fperez@colorado.edu>
3890 2004-07-13 Fernando Perez <fperez@colorado.edu>
3887
3891
3888 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3892 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3889 of EPS if the requested filename ends in '.eps'.
3893 of EPS if the requested filename ends in '.eps'.
3890
3894
3891 2004-07-04 Fernando Perez <fperez@colorado.edu>
3895 2004-07-04 Fernando Perez <fperez@colorado.edu>
3892
3896
3893 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3897 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3894 escaping of quotes when calling the shell.
3898 escaping of quotes when calling the shell.
3895
3899
3896 2004-07-02 Fernando Perez <fperez@colorado.edu>
3900 2004-07-02 Fernando Perez <fperez@colorado.edu>
3897
3901
3898 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3902 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3899 gettext not working because we were clobbering '_'. Fixes
3903 gettext not working because we were clobbering '_'. Fixes
3900 http://www.scipy.net/roundup/ipython/issue6.
3904 http://www.scipy.net/roundup/ipython/issue6.
3901
3905
3902 2004-07-01 Fernando Perez <fperez@colorado.edu>
3906 2004-07-01 Fernando Perez <fperez@colorado.edu>
3903
3907
3904 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3908 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3905 into @cd. Patch by Ville.
3909 into @cd. Patch by Ville.
3906
3910
3907 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3911 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3908 new function to store things after ipmaker runs. Patch by Ville.
3912 new function to store things after ipmaker runs. Patch by Ville.
3909 Eventually this will go away once ipmaker is removed and the class
3913 Eventually this will go away once ipmaker is removed and the class
3910 gets cleaned up, but for now it's ok. Key functionality here is
3914 gets cleaned up, but for now it's ok. Key functionality here is
3911 the addition of the persistent storage mechanism, a dict for
3915 the addition of the persistent storage mechanism, a dict for
3912 keeping data across sessions (for now just bookmarks, but more can
3916 keeping data across sessions (for now just bookmarks, but more can
3913 be implemented later).
3917 be implemented later).
3914
3918
3915 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3919 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3916 persistent across sections. Patch by Ville, I modified it
3920 persistent across sections. Patch by Ville, I modified it
3917 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3921 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3918 added a '-l' option to list all bookmarks.
3922 added a '-l' option to list all bookmarks.
3919
3923
3920 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3924 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3921 center for cleanup. Registered with atexit.register(). I moved
3925 center for cleanup. Registered with atexit.register(). I moved
3922 here the old exit_cleanup(). After a patch by Ville.
3926 here the old exit_cleanup(). After a patch by Ville.
3923
3927
3924 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3928 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3925 characters in the hacked shlex_split for python 2.2.
3929 characters in the hacked shlex_split for python 2.2.
3926
3930
3927 * IPython/iplib.py (file_matches): more fixes to filenames with
3931 * IPython/iplib.py (file_matches): more fixes to filenames with
3928 whitespace in them. It's not perfect, but limitations in python's
3932 whitespace in them. It's not perfect, but limitations in python's
3929 readline make it impossible to go further.
3933 readline make it impossible to go further.
3930
3934
3931 2004-06-29 Fernando Perez <fperez@colorado.edu>
3935 2004-06-29 Fernando Perez <fperez@colorado.edu>
3932
3936
3933 * IPython/iplib.py (file_matches): escape whitespace correctly in
3937 * IPython/iplib.py (file_matches): escape whitespace correctly in
3934 filename completions. Bug reported by Ville.
3938 filename completions. Bug reported by Ville.
3935
3939
3936 2004-06-28 Fernando Perez <fperez@colorado.edu>
3940 2004-06-28 Fernando Perez <fperez@colorado.edu>
3937
3941
3938 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3942 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3939 the history file will be called 'history-PROFNAME' (or just
3943 the history file will be called 'history-PROFNAME' (or just
3940 'history' if no profile is loaded). I was getting annoyed at
3944 'history' if no profile is loaded). I was getting annoyed at
3941 getting my Numerical work history clobbered by pysh sessions.
3945 getting my Numerical work history clobbered by pysh sessions.
3942
3946
3943 * IPython/iplib.py (InteractiveShell.__init__): Internal
3947 * IPython/iplib.py (InteractiveShell.__init__): Internal
3944 getoutputerror() function so that we can honor the system_verbose
3948 getoutputerror() function so that we can honor the system_verbose
3945 flag for _all_ system calls. I also added escaping of #
3949 flag for _all_ system calls. I also added escaping of #
3946 characters here to avoid confusing Itpl.
3950 characters here to avoid confusing Itpl.
3947
3951
3948 * IPython/Magic.py (shlex_split): removed call to shell in
3952 * IPython/Magic.py (shlex_split): removed call to shell in
3949 parse_options and replaced it with shlex.split(). The annoying
3953 parse_options and replaced it with shlex.split(). The annoying
3950 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3954 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3951 to backport it from 2.3, with several frail hacks (the shlex
3955 to backport it from 2.3, with several frail hacks (the shlex
3952 module is rather limited in 2.2). Thanks to a suggestion by Ville
3956 module is rather limited in 2.2). Thanks to a suggestion by Ville
3953 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3957 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3954 problem.
3958 problem.
3955
3959
3956 (Magic.magic_system_verbose): new toggle to print the actual
3960 (Magic.magic_system_verbose): new toggle to print the actual
3957 system calls made by ipython. Mainly for debugging purposes.
3961 system calls made by ipython. Mainly for debugging purposes.
3958
3962
3959 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3963 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3960 doesn't support persistence. Reported (and fix suggested) by
3964 doesn't support persistence. Reported (and fix suggested) by
3961 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3965 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3962
3966
3963 2004-06-26 Fernando Perez <fperez@colorado.edu>
3967 2004-06-26 Fernando Perez <fperez@colorado.edu>
3964
3968
3965 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3969 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3966 continue prompts.
3970 continue prompts.
3967
3971
3968 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3972 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3969 function (basically a big docstring) and a few more things here to
3973 function (basically a big docstring) and a few more things here to
3970 speedup startup. pysh.py is now very lightweight. We want because
3974 speedup startup. pysh.py is now very lightweight. We want because
3971 it gets execfile'd, while InterpreterExec gets imported, so
3975 it gets execfile'd, while InterpreterExec gets imported, so
3972 byte-compilation saves time.
3976 byte-compilation saves time.
3973
3977
3974 2004-06-25 Fernando Perez <fperez@colorado.edu>
3978 2004-06-25 Fernando Perez <fperez@colorado.edu>
3975
3979
3976 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3980 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3977 -NUM', which was recently broken.
3981 -NUM', which was recently broken.
3978
3982
3979 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3983 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3980 in multi-line input (but not !!, which doesn't make sense there).
3984 in multi-line input (but not !!, which doesn't make sense there).
3981
3985
3982 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3986 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3983 It's just too useful, and people can turn it off in the less
3987 It's just too useful, and people can turn it off in the less
3984 common cases where it's a problem.
3988 common cases where it's a problem.
3985
3989
3986 2004-06-24 Fernando Perez <fperez@colorado.edu>
3990 2004-06-24 Fernando Perez <fperez@colorado.edu>
3987
3991
3988 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3992 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3989 special syntaxes (like alias calling) is now allied in multi-line
3993 special syntaxes (like alias calling) is now allied in multi-line
3990 input. This is still _very_ experimental, but it's necessary for
3994 input. This is still _very_ experimental, but it's necessary for
3991 efficient shell usage combining python looping syntax with system
3995 efficient shell usage combining python looping syntax with system
3992 calls. For now it's restricted to aliases, I don't think it
3996 calls. For now it's restricted to aliases, I don't think it
3993 really even makes sense to have this for magics.
3997 really even makes sense to have this for magics.
3994
3998
3995 2004-06-23 Fernando Perez <fperez@colorado.edu>
3999 2004-06-23 Fernando Perez <fperez@colorado.edu>
3996
4000
3997 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4001 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3998 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4002 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3999
4003
4000 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4004 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4001 extensions under Windows (after code sent by Gary Bishop). The
4005 extensions under Windows (after code sent by Gary Bishop). The
4002 extensions considered 'executable' are stored in IPython's rc
4006 extensions considered 'executable' are stored in IPython's rc
4003 structure as win_exec_ext.
4007 structure as win_exec_ext.
4004
4008
4005 * IPython/genutils.py (shell): new function, like system() but
4009 * IPython/genutils.py (shell): new function, like system() but
4006 without return value. Very useful for interactive shell work.
4010 without return value. Very useful for interactive shell work.
4007
4011
4008 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4012 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4009 delete aliases.
4013 delete aliases.
4010
4014
4011 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4015 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4012 sure that the alias table doesn't contain python keywords.
4016 sure that the alias table doesn't contain python keywords.
4013
4017
4014 2004-06-21 Fernando Perez <fperez@colorado.edu>
4018 2004-06-21 Fernando Perez <fperez@colorado.edu>
4015
4019
4016 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4020 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4017 non-existent items are found in $PATH. Reported by Thorsten.
4021 non-existent items are found in $PATH. Reported by Thorsten.
4018
4022
4019 2004-06-20 Fernando Perez <fperez@colorado.edu>
4023 2004-06-20 Fernando Perez <fperez@colorado.edu>
4020
4024
4021 * IPython/iplib.py (complete): modified the completer so that the
4025 * IPython/iplib.py (complete): modified the completer so that the
4022 order of priorities can be easily changed at runtime.
4026 order of priorities can be easily changed at runtime.
4023
4027
4024 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4028 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4025 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4029 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4026
4030
4027 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4031 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4028 expand Python variables prepended with $ in all system calls. The
4032 expand Python variables prepended with $ in all system calls. The
4029 same was done to InteractiveShell.handle_shell_escape. Now all
4033 same was done to InteractiveShell.handle_shell_escape. Now all
4030 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4034 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4031 expansion of python variables and expressions according to the
4035 expansion of python variables and expressions according to the
4032 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4036 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4033
4037
4034 Though PEP-215 has been rejected, a similar (but simpler) one
4038 Though PEP-215 has been rejected, a similar (but simpler) one
4035 seems like it will go into Python 2.4, PEP-292 -
4039 seems like it will go into Python 2.4, PEP-292 -
4036 http://www.python.org/peps/pep-0292.html.
4040 http://www.python.org/peps/pep-0292.html.
4037
4041
4038 I'll keep the full syntax of PEP-215, since IPython has since the
4042 I'll keep the full syntax of PEP-215, since IPython has since the
4039 start used Ka-Ping Yee's reference implementation discussed there
4043 start used Ka-Ping Yee's reference implementation discussed there
4040 (Itpl), and I actually like the powerful semantics it offers.
4044 (Itpl), and I actually like the powerful semantics it offers.
4041
4045
4042 In order to access normal shell variables, the $ has to be escaped
4046 In order to access normal shell variables, the $ has to be escaped
4043 via an extra $. For example:
4047 via an extra $. For example:
4044
4048
4045 In [7]: PATH='a python variable'
4049 In [7]: PATH='a python variable'
4046
4050
4047 In [8]: !echo $PATH
4051 In [8]: !echo $PATH
4048 a python variable
4052 a python variable
4049
4053
4050 In [9]: !echo $$PATH
4054 In [9]: !echo $$PATH
4051 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4055 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4052
4056
4053 (Magic.parse_options): escape $ so the shell doesn't evaluate
4057 (Magic.parse_options): escape $ so the shell doesn't evaluate
4054 things prematurely.
4058 things prematurely.
4055
4059
4056 * IPython/iplib.py (InteractiveShell.call_alias): added the
4060 * IPython/iplib.py (InteractiveShell.call_alias): added the
4057 ability for aliases to expand python variables via $.
4061 ability for aliases to expand python variables via $.
4058
4062
4059 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4063 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4060 system, now there's a @rehash/@rehashx pair of magics. These work
4064 system, now there's a @rehash/@rehashx pair of magics. These work
4061 like the csh rehash command, and can be invoked at any time. They
4065 like the csh rehash command, and can be invoked at any time. They
4062 build a table of aliases to everything in the user's $PATH
4066 build a table of aliases to everything in the user's $PATH
4063 (@rehash uses everything, @rehashx is slower but only adds
4067 (@rehash uses everything, @rehashx is slower but only adds
4064 executable files). With this, the pysh.py-based shell profile can
4068 executable files). With this, the pysh.py-based shell profile can
4065 now simply call rehash upon startup, and full access to all
4069 now simply call rehash upon startup, and full access to all
4066 programs in the user's path is obtained.
4070 programs in the user's path is obtained.
4067
4071
4068 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4072 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4069 functionality is now fully in place. I removed the old dynamic
4073 functionality is now fully in place. I removed the old dynamic
4070 code generation based approach, in favor of a much lighter one
4074 code generation based approach, in favor of a much lighter one
4071 based on a simple dict. The advantage is that this allows me to
4075 based on a simple dict. The advantage is that this allows me to
4072 now have thousands of aliases with negligible cost (unthinkable
4076 now have thousands of aliases with negligible cost (unthinkable
4073 with the old system).
4077 with the old system).
4074
4078
4075 2004-06-19 Fernando Perez <fperez@colorado.edu>
4079 2004-06-19 Fernando Perez <fperez@colorado.edu>
4076
4080
4077 * IPython/iplib.py (__init__): extended MagicCompleter class to
4081 * IPython/iplib.py (__init__): extended MagicCompleter class to
4078 also complete (last in priority) on user aliases.
4082 also complete (last in priority) on user aliases.
4079
4083
4080 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4084 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4081 call to eval.
4085 call to eval.
4082 (ItplNS.__init__): Added a new class which functions like Itpl,
4086 (ItplNS.__init__): Added a new class which functions like Itpl,
4083 but allows configuring the namespace for the evaluation to occur
4087 but allows configuring the namespace for the evaluation to occur
4084 in.
4088 in.
4085
4089
4086 2004-06-18 Fernando Perez <fperez@colorado.edu>
4090 2004-06-18 Fernando Perez <fperez@colorado.edu>
4087
4091
4088 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4092 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4089 better message when 'exit' or 'quit' are typed (a common newbie
4093 better message when 'exit' or 'quit' are typed (a common newbie
4090 confusion).
4094 confusion).
4091
4095
4092 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4096 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4093 check for Windows users.
4097 check for Windows users.
4094
4098
4095 * IPython/iplib.py (InteractiveShell.user_setup): removed
4099 * IPython/iplib.py (InteractiveShell.user_setup): removed
4096 disabling of colors for Windows. I'll test at runtime and issue a
4100 disabling of colors for Windows. I'll test at runtime and issue a
4097 warning if Gary's readline isn't found, as to nudge users to
4101 warning if Gary's readline isn't found, as to nudge users to
4098 download it.
4102 download it.
4099
4103
4100 2004-06-16 Fernando Perez <fperez@colorado.edu>
4104 2004-06-16 Fernando Perez <fperez@colorado.edu>
4101
4105
4102 * IPython/genutils.py (Stream.__init__): changed to print errors
4106 * IPython/genutils.py (Stream.__init__): changed to print errors
4103 to sys.stderr. I had a circular dependency here. Now it's
4107 to sys.stderr. I had a circular dependency here. Now it's
4104 possible to run ipython as IDLE's shell (consider this pre-alpha,
4108 possible to run ipython as IDLE's shell (consider this pre-alpha,
4105 since true stdout things end up in the starting terminal instead
4109 since true stdout things end up in the starting terminal instead
4106 of IDLE's out).
4110 of IDLE's out).
4107
4111
4108 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4112 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4109 users who haven't # updated their prompt_in2 definitions. Remove
4113 users who haven't # updated their prompt_in2 definitions. Remove
4110 eventually.
4114 eventually.
4111 (multiple_replace): added credit to original ASPN recipe.
4115 (multiple_replace): added credit to original ASPN recipe.
4112
4116
4113 2004-06-15 Fernando Perez <fperez@colorado.edu>
4117 2004-06-15 Fernando Perez <fperez@colorado.edu>
4114
4118
4115 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4119 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4116 list of auto-defined aliases.
4120 list of auto-defined aliases.
4117
4121
4118 2004-06-13 Fernando Perez <fperez@colorado.edu>
4122 2004-06-13 Fernando Perez <fperez@colorado.edu>
4119
4123
4120 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4124 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4121 install was really requested (so setup.py can be used for other
4125 install was really requested (so setup.py can be used for other
4122 things under Windows).
4126 things under Windows).
4123
4127
4124 2004-06-10 Fernando Perez <fperez@colorado.edu>
4128 2004-06-10 Fernando Perez <fperez@colorado.edu>
4125
4129
4126 * IPython/Logger.py (Logger.create_log): Manually remove any old
4130 * IPython/Logger.py (Logger.create_log): Manually remove any old
4127 backup, since os.remove may fail under Windows. Fixes bug
4131 backup, since os.remove may fail under Windows. Fixes bug
4128 reported by Thorsten.
4132 reported by Thorsten.
4129
4133
4130 2004-06-09 Fernando Perez <fperez@colorado.edu>
4134 2004-06-09 Fernando Perez <fperez@colorado.edu>
4131
4135
4132 * examples/example-embed.py: fixed all references to %n (replaced
4136 * examples/example-embed.py: fixed all references to %n (replaced
4133 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4137 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4134 for all examples and the manual as well.
4138 for all examples and the manual as well.
4135
4139
4136 2004-06-08 Fernando Perez <fperez@colorado.edu>
4140 2004-06-08 Fernando Perez <fperez@colorado.edu>
4137
4141
4138 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4142 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4139 alignment and color management. All 3 prompt subsystems now
4143 alignment and color management. All 3 prompt subsystems now
4140 inherit from BasePrompt.
4144 inherit from BasePrompt.
4141
4145
4142 * tools/release: updates for windows installer build and tag rpms
4146 * tools/release: updates for windows installer build and tag rpms
4143 with python version (since paths are fixed).
4147 with python version (since paths are fixed).
4144
4148
4145 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4149 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4146 which will become eventually obsolete. Also fixed the default
4150 which will become eventually obsolete. Also fixed the default
4147 prompt_in2 to use \D, so at least new users start with the correct
4151 prompt_in2 to use \D, so at least new users start with the correct
4148 defaults.
4152 defaults.
4149 WARNING: Users with existing ipythonrc files will need to apply
4153 WARNING: Users with existing ipythonrc files will need to apply
4150 this fix manually!
4154 this fix manually!
4151
4155
4152 * setup.py: make windows installer (.exe). This is finally the
4156 * setup.py: make windows installer (.exe). This is finally the
4153 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4157 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4154 which I hadn't included because it required Python 2.3 (or recent
4158 which I hadn't included because it required Python 2.3 (or recent
4155 distutils).
4159 distutils).
4156
4160
4157 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4161 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4158 usage of new '\D' escape.
4162 usage of new '\D' escape.
4159
4163
4160 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4164 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4161 lacks os.getuid())
4165 lacks os.getuid())
4162 (CachedOutput.set_colors): Added the ability to turn coloring
4166 (CachedOutput.set_colors): Added the ability to turn coloring
4163 on/off with @colors even for manually defined prompt colors. It
4167 on/off with @colors even for manually defined prompt colors. It
4164 uses a nasty global, but it works safely and via the generic color
4168 uses a nasty global, but it works safely and via the generic color
4165 handling mechanism.
4169 handling mechanism.
4166 (Prompt2.__init__): Introduced new escape '\D' for continuation
4170 (Prompt2.__init__): Introduced new escape '\D' for continuation
4167 prompts. It represents the counter ('\#') as dots.
4171 prompts. It represents the counter ('\#') as dots.
4168 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4172 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4169 need to update their ipythonrc files and replace '%n' with '\D' in
4173 need to update their ipythonrc files and replace '%n' with '\D' in
4170 their prompt_in2 settings everywhere. Sorry, but there's
4174 their prompt_in2 settings everywhere. Sorry, but there's
4171 otherwise no clean way to get all prompts to properly align. The
4175 otherwise no clean way to get all prompts to properly align. The
4172 ipythonrc shipped with IPython has been updated.
4176 ipythonrc shipped with IPython has been updated.
4173
4177
4174 2004-06-07 Fernando Perez <fperez@colorado.edu>
4178 2004-06-07 Fernando Perez <fperez@colorado.edu>
4175
4179
4176 * setup.py (isfile): Pass local_icons option to latex2html, so the
4180 * setup.py (isfile): Pass local_icons option to latex2html, so the
4177 resulting HTML file is self-contained. Thanks to
4181 resulting HTML file is self-contained. Thanks to
4178 dryice-AT-liu.com.cn for the tip.
4182 dryice-AT-liu.com.cn for the tip.
4179
4183
4180 * pysh.py: I created a new profile 'shell', which implements a
4184 * pysh.py: I created a new profile 'shell', which implements a
4181 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4185 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4182 system shell, nor will it become one anytime soon. It's mainly
4186 system shell, nor will it become one anytime soon. It's mainly
4183 meant to illustrate the use of the new flexible bash-like prompts.
4187 meant to illustrate the use of the new flexible bash-like prompts.
4184 I guess it could be used by hardy souls for true shell management,
4188 I guess it could be used by hardy souls for true shell management,
4185 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4189 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4186 profile. This uses the InterpreterExec extension provided by
4190 profile. This uses the InterpreterExec extension provided by
4187 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4191 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4188
4192
4189 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4193 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4190 auto-align itself with the length of the previous input prompt
4194 auto-align itself with the length of the previous input prompt
4191 (taking into account the invisible color escapes).
4195 (taking into account the invisible color escapes).
4192 (CachedOutput.__init__): Large restructuring of this class. Now
4196 (CachedOutput.__init__): Large restructuring of this class. Now
4193 all three prompts (primary1, primary2, output) are proper objects,
4197 all three prompts (primary1, primary2, output) are proper objects,
4194 managed by the 'parent' CachedOutput class. The code is still a
4198 managed by the 'parent' CachedOutput class. The code is still a
4195 bit hackish (all prompts share state via a pointer to the cache),
4199 bit hackish (all prompts share state via a pointer to the cache),
4196 but it's overall far cleaner than before.
4200 but it's overall far cleaner than before.
4197
4201
4198 * IPython/genutils.py (getoutputerror): modified to add verbose,
4202 * IPython/genutils.py (getoutputerror): modified to add verbose,
4199 debug and header options. This makes the interface of all getout*
4203 debug and header options. This makes the interface of all getout*
4200 functions uniform.
4204 functions uniform.
4201 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4205 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4202
4206
4203 * IPython/Magic.py (Magic.default_option): added a function to
4207 * IPython/Magic.py (Magic.default_option): added a function to
4204 allow registering default options for any magic command. This
4208 allow registering default options for any magic command. This
4205 makes it easy to have profiles which customize the magics globally
4209 makes it easy to have profiles which customize the magics globally
4206 for a certain use. The values set through this function are
4210 for a certain use. The values set through this function are
4207 picked up by the parse_options() method, which all magics should
4211 picked up by the parse_options() method, which all magics should
4208 use to parse their options.
4212 use to parse their options.
4209
4213
4210 * IPython/genutils.py (warn): modified the warnings framework to
4214 * IPython/genutils.py (warn): modified the warnings framework to
4211 use the Term I/O class. I'm trying to slowly unify all of
4215 use the Term I/O class. I'm trying to slowly unify all of
4212 IPython's I/O operations to pass through Term.
4216 IPython's I/O operations to pass through Term.
4213
4217
4214 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4218 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4215 the secondary prompt to correctly match the length of the primary
4219 the secondary prompt to correctly match the length of the primary
4216 one for any prompt. Now multi-line code will properly line up
4220 one for any prompt. Now multi-line code will properly line up
4217 even for path dependent prompts, such as the new ones available
4221 even for path dependent prompts, such as the new ones available
4218 via the prompt_specials.
4222 via the prompt_specials.
4219
4223
4220 2004-06-06 Fernando Perez <fperez@colorado.edu>
4224 2004-06-06 Fernando Perez <fperez@colorado.edu>
4221
4225
4222 * IPython/Prompts.py (prompt_specials): Added the ability to have
4226 * IPython/Prompts.py (prompt_specials): Added the ability to have
4223 bash-like special sequences in the prompts, which get
4227 bash-like special sequences in the prompts, which get
4224 automatically expanded. Things like hostname, current working
4228 automatically expanded. Things like hostname, current working
4225 directory and username are implemented already, but it's easy to
4229 directory and username are implemented already, but it's easy to
4226 add more in the future. Thanks to a patch by W.J. van der Laan
4230 add more in the future. Thanks to a patch by W.J. van der Laan
4227 <gnufnork-AT-hetdigitalegat.nl>
4231 <gnufnork-AT-hetdigitalegat.nl>
4228 (prompt_specials): Added color support for prompt strings, so
4232 (prompt_specials): Added color support for prompt strings, so
4229 users can define arbitrary color setups for their prompts.
4233 users can define arbitrary color setups for their prompts.
4230
4234
4231 2004-06-05 Fernando Perez <fperez@colorado.edu>
4235 2004-06-05 Fernando Perez <fperez@colorado.edu>
4232
4236
4233 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4237 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4234 code to load Gary Bishop's readline and configure it
4238 code to load Gary Bishop's readline and configure it
4235 automatically. Thanks to Gary for help on this.
4239 automatically. Thanks to Gary for help on this.
4236
4240
4237 2004-06-01 Fernando Perez <fperez@colorado.edu>
4241 2004-06-01 Fernando Perez <fperez@colorado.edu>
4238
4242
4239 * IPython/Logger.py (Logger.create_log): fix bug for logging
4243 * IPython/Logger.py (Logger.create_log): fix bug for logging
4240 with no filename (previous fix was incomplete).
4244 with no filename (previous fix was incomplete).
4241
4245
4242 2004-05-25 Fernando Perez <fperez@colorado.edu>
4246 2004-05-25 Fernando Perez <fperez@colorado.edu>
4243
4247
4244 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4248 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4245 parens would get passed to the shell.
4249 parens would get passed to the shell.
4246
4250
4247 2004-05-20 Fernando Perez <fperez@colorado.edu>
4251 2004-05-20 Fernando Perez <fperez@colorado.edu>
4248
4252
4249 * IPython/Magic.py (Magic.magic_prun): changed default profile
4253 * IPython/Magic.py (Magic.magic_prun): changed default profile
4250 sort order to 'time' (the more common profiling need).
4254 sort order to 'time' (the more common profiling need).
4251
4255
4252 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4256 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4253 so that source code shown is guaranteed in sync with the file on
4257 so that source code shown is guaranteed in sync with the file on
4254 disk (also changed in psource). Similar fix to the one for
4258 disk (also changed in psource). Similar fix to the one for
4255 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4259 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4256 <yann.ledu-AT-noos.fr>.
4260 <yann.ledu-AT-noos.fr>.
4257
4261
4258 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4262 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4259 with a single option would not be correctly parsed. Closes
4263 with a single option would not be correctly parsed. Closes
4260 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4264 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4261 introduced in 0.6.0 (on 2004-05-06).
4265 introduced in 0.6.0 (on 2004-05-06).
4262
4266
4263 2004-05-13 *** Released version 0.6.0
4267 2004-05-13 *** Released version 0.6.0
4264
4268
4265 2004-05-13 Fernando Perez <fperez@colorado.edu>
4269 2004-05-13 Fernando Perez <fperez@colorado.edu>
4266
4270
4267 * debian/: Added debian/ directory to CVS, so that debian support
4271 * debian/: Added debian/ directory to CVS, so that debian support
4268 is publicly accessible. The debian package is maintained by Jack
4272 is publicly accessible. The debian package is maintained by Jack
4269 Moffit <jack-AT-xiph.org>.
4273 Moffit <jack-AT-xiph.org>.
4270
4274
4271 * Documentation: included the notes about an ipython-based system
4275 * Documentation: included the notes about an ipython-based system
4272 shell (the hypothetical 'pysh') into the new_design.pdf document,
4276 shell (the hypothetical 'pysh') into the new_design.pdf document,
4273 so that these ideas get distributed to users along with the
4277 so that these ideas get distributed to users along with the
4274 official documentation.
4278 official documentation.
4275
4279
4276 2004-05-10 Fernando Perez <fperez@colorado.edu>
4280 2004-05-10 Fernando Perez <fperez@colorado.edu>
4277
4281
4278 * IPython/Logger.py (Logger.create_log): fix recently introduced
4282 * IPython/Logger.py (Logger.create_log): fix recently introduced
4279 bug (misindented line) where logstart would fail when not given an
4283 bug (misindented line) where logstart would fail when not given an
4280 explicit filename.
4284 explicit filename.
4281
4285
4282 2004-05-09 Fernando Perez <fperez@colorado.edu>
4286 2004-05-09 Fernando Perez <fperez@colorado.edu>
4283
4287
4284 * IPython/Magic.py (Magic.parse_options): skip system call when
4288 * IPython/Magic.py (Magic.parse_options): skip system call when
4285 there are no options to look for. Faster, cleaner for the common
4289 there are no options to look for. Faster, cleaner for the common
4286 case.
4290 case.
4287
4291
4288 * Documentation: many updates to the manual: describing Windows
4292 * Documentation: many updates to the manual: describing Windows
4289 support better, Gnuplot updates, credits, misc small stuff. Also
4293 support better, Gnuplot updates, credits, misc small stuff. Also
4290 updated the new_design doc a bit.
4294 updated the new_design doc a bit.
4291
4295
4292 2004-05-06 *** Released version 0.6.0.rc1
4296 2004-05-06 *** Released version 0.6.0.rc1
4293
4297
4294 2004-05-06 Fernando Perez <fperez@colorado.edu>
4298 2004-05-06 Fernando Perez <fperez@colorado.edu>
4295
4299
4296 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4300 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4297 operations to use the vastly more efficient list/''.join() method.
4301 operations to use the vastly more efficient list/''.join() method.
4298 (FormattedTB.text): Fix
4302 (FormattedTB.text): Fix
4299 http://www.scipy.net/roundup/ipython/issue12 - exception source
4303 http://www.scipy.net/roundup/ipython/issue12 - exception source
4300 extract not updated after reload. Thanks to Mike Salib
4304 extract not updated after reload. Thanks to Mike Salib
4301 <msalib-AT-mit.edu> for pinning the source of the problem.
4305 <msalib-AT-mit.edu> for pinning the source of the problem.
4302 Fortunately, the solution works inside ipython and doesn't require
4306 Fortunately, the solution works inside ipython and doesn't require
4303 any changes to python proper.
4307 any changes to python proper.
4304
4308
4305 * IPython/Magic.py (Magic.parse_options): Improved to process the
4309 * IPython/Magic.py (Magic.parse_options): Improved to process the
4306 argument list as a true shell would (by actually using the
4310 argument list as a true shell would (by actually using the
4307 underlying system shell). This way, all @magics automatically get
4311 underlying system shell). This way, all @magics automatically get
4308 shell expansion for variables. Thanks to a comment by Alex
4312 shell expansion for variables. Thanks to a comment by Alex
4309 Schmolck.
4313 Schmolck.
4310
4314
4311 2004-04-04 Fernando Perez <fperez@colorado.edu>
4315 2004-04-04 Fernando Perez <fperez@colorado.edu>
4312
4316
4313 * IPython/iplib.py (InteractiveShell.interact): Added a special
4317 * IPython/iplib.py (InteractiveShell.interact): Added a special
4314 trap for a debugger quit exception, which is basically impossible
4318 trap for a debugger quit exception, which is basically impossible
4315 to handle by normal mechanisms, given what pdb does to the stack.
4319 to handle by normal mechanisms, given what pdb does to the stack.
4316 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4320 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4317
4321
4318 2004-04-03 Fernando Perez <fperez@colorado.edu>
4322 2004-04-03 Fernando Perez <fperez@colorado.edu>
4319
4323
4320 * IPython/genutils.py (Term): Standardized the names of the Term
4324 * IPython/genutils.py (Term): Standardized the names of the Term
4321 class streams to cin/cout/cerr, following C++ naming conventions
4325 class streams to cin/cout/cerr, following C++ naming conventions
4322 (I can't use in/out/err because 'in' is not a valid attribute
4326 (I can't use in/out/err because 'in' is not a valid attribute
4323 name).
4327 name).
4324
4328
4325 * IPython/iplib.py (InteractiveShell.interact): don't increment
4329 * IPython/iplib.py (InteractiveShell.interact): don't increment
4326 the prompt if there's no user input. By Daniel 'Dang' Griffith
4330 the prompt if there's no user input. By Daniel 'Dang' Griffith
4327 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4331 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4328 Francois Pinard.
4332 Francois Pinard.
4329
4333
4330 2004-04-02 Fernando Perez <fperez@colorado.edu>
4334 2004-04-02 Fernando Perez <fperez@colorado.edu>
4331
4335
4332 * IPython/genutils.py (Stream.__init__): Modified to survive at
4336 * IPython/genutils.py (Stream.__init__): Modified to survive at
4333 least importing in contexts where stdin/out/err aren't true file
4337 least importing in contexts where stdin/out/err aren't true file
4334 objects, such as PyCrust (they lack fileno() and mode). However,
4338 objects, such as PyCrust (they lack fileno() and mode). However,
4335 the recovery facilities which rely on these things existing will
4339 the recovery facilities which rely on these things existing will
4336 not work.
4340 not work.
4337
4341
4338 2004-04-01 Fernando Perez <fperez@colorado.edu>
4342 2004-04-01 Fernando Perez <fperez@colorado.edu>
4339
4343
4340 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4344 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4341 use the new getoutputerror() function, so it properly
4345 use the new getoutputerror() function, so it properly
4342 distinguishes stdout/err.
4346 distinguishes stdout/err.
4343
4347
4344 * IPython/genutils.py (getoutputerror): added a function to
4348 * IPython/genutils.py (getoutputerror): added a function to
4345 capture separately the standard output and error of a command.
4349 capture separately the standard output and error of a command.
4346 After a comment from dang on the mailing lists. This code is
4350 After a comment from dang on the mailing lists. This code is
4347 basically a modified version of commands.getstatusoutput(), from
4351 basically a modified version of commands.getstatusoutput(), from
4348 the standard library.
4352 the standard library.
4349
4353
4350 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4354 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4351 '!!' as a special syntax (shorthand) to access @sx.
4355 '!!' as a special syntax (shorthand) to access @sx.
4352
4356
4353 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4357 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4354 command and return its output as a list split on '\n'.
4358 command and return its output as a list split on '\n'.
4355
4359
4356 2004-03-31 Fernando Perez <fperez@colorado.edu>
4360 2004-03-31 Fernando Perez <fperez@colorado.edu>
4357
4361
4358 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4362 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4359 method to dictionaries used as FakeModule instances if they lack
4363 method to dictionaries used as FakeModule instances if they lack
4360 it. At least pydoc in python2.3 breaks for runtime-defined
4364 it. At least pydoc in python2.3 breaks for runtime-defined
4361 functions without this hack. At some point I need to _really_
4365 functions without this hack. At some point I need to _really_
4362 understand what FakeModule is doing, because it's a gross hack.
4366 understand what FakeModule is doing, because it's a gross hack.
4363 But it solves Arnd's problem for now...
4367 But it solves Arnd's problem for now...
4364
4368
4365 2004-02-27 Fernando Perez <fperez@colorado.edu>
4369 2004-02-27 Fernando Perez <fperez@colorado.edu>
4366
4370
4367 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4371 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4368 mode would behave erratically. Also increased the number of
4372 mode would behave erratically. Also increased the number of
4369 possible logs in rotate mod to 999. Thanks to Rod Holland
4373 possible logs in rotate mod to 999. Thanks to Rod Holland
4370 <rhh@StructureLABS.com> for the report and fixes.
4374 <rhh@StructureLABS.com> for the report and fixes.
4371
4375
4372 2004-02-26 Fernando Perez <fperez@colorado.edu>
4376 2004-02-26 Fernando Perez <fperez@colorado.edu>
4373
4377
4374 * IPython/genutils.py (page): Check that the curses module really
4378 * IPython/genutils.py (page): Check that the curses module really
4375 has the initscr attribute before trying to use it. For some
4379 has the initscr attribute before trying to use it. For some
4376 reason, the Solaris curses module is missing this. I think this
4380 reason, the Solaris curses module is missing this. I think this
4377 should be considered a Solaris python bug, but I'm not sure.
4381 should be considered a Solaris python bug, but I'm not sure.
4378
4382
4379 2004-01-17 Fernando Perez <fperez@colorado.edu>
4383 2004-01-17 Fernando Perez <fperez@colorado.edu>
4380
4384
4381 * IPython/genutils.py (Stream.__init__): Changes to try to make
4385 * IPython/genutils.py (Stream.__init__): Changes to try to make
4382 ipython robust against stdin/out/err being closed by the user.
4386 ipython robust against stdin/out/err being closed by the user.
4383 This is 'user error' (and blocks a normal python session, at least
4387 This is 'user error' (and blocks a normal python session, at least
4384 the stdout case). However, Ipython should be able to survive such
4388 the stdout case). However, Ipython should be able to survive such
4385 instances of abuse as gracefully as possible. To simplify the
4389 instances of abuse as gracefully as possible. To simplify the
4386 coding and maintain compatibility with Gary Bishop's Term
4390 coding and maintain compatibility with Gary Bishop's Term
4387 contributions, I've made use of classmethods for this. I think
4391 contributions, I've made use of classmethods for this. I think
4388 this introduces a dependency on python 2.2.
4392 this introduces a dependency on python 2.2.
4389
4393
4390 2004-01-13 Fernando Perez <fperez@colorado.edu>
4394 2004-01-13 Fernando Perez <fperez@colorado.edu>
4391
4395
4392 * IPython/numutils.py (exp_safe): simplified the code a bit and
4396 * IPython/numutils.py (exp_safe): simplified the code a bit and
4393 removed the need for importing the kinds module altogether.
4397 removed the need for importing the kinds module altogether.
4394
4398
4395 2004-01-06 Fernando Perez <fperez@colorado.edu>
4399 2004-01-06 Fernando Perez <fperez@colorado.edu>
4396
4400
4397 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4401 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4398 a magic function instead, after some community feedback. No
4402 a magic function instead, after some community feedback. No
4399 special syntax will exist for it, but its name is deliberately
4403 special syntax will exist for it, but its name is deliberately
4400 very short.
4404 very short.
4401
4405
4402 2003-12-20 Fernando Perez <fperez@colorado.edu>
4406 2003-12-20 Fernando Perez <fperez@colorado.edu>
4403
4407
4404 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4408 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4405 new functionality, to automagically assign the result of a shell
4409 new functionality, to automagically assign the result of a shell
4406 command to a variable. I'll solicit some community feedback on
4410 command to a variable. I'll solicit some community feedback on
4407 this before making it permanent.
4411 this before making it permanent.
4408
4412
4409 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4413 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4410 requested about callables for which inspect couldn't obtain a
4414 requested about callables for which inspect couldn't obtain a
4411 proper argspec. Thanks to a crash report sent by Etienne
4415 proper argspec. Thanks to a crash report sent by Etienne
4412 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4416 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4413
4417
4414 2003-12-09 Fernando Perez <fperez@colorado.edu>
4418 2003-12-09 Fernando Perez <fperez@colorado.edu>
4415
4419
4416 * IPython/genutils.py (page): patch for the pager to work across
4420 * IPython/genutils.py (page): patch for the pager to work across
4417 various versions of Windows. By Gary Bishop.
4421 various versions of Windows. By Gary Bishop.
4418
4422
4419 2003-12-04 Fernando Perez <fperez@colorado.edu>
4423 2003-12-04 Fernando Perez <fperez@colorado.edu>
4420
4424
4421 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4425 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4422 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4426 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4423 While I tested this and it looks ok, there may still be corner
4427 While I tested this and it looks ok, there may still be corner
4424 cases I've missed.
4428 cases I've missed.
4425
4429
4426 2003-12-01 Fernando Perez <fperez@colorado.edu>
4430 2003-12-01 Fernando Perez <fperez@colorado.edu>
4427
4431
4428 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4432 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4429 where a line like 'p,q=1,2' would fail because the automagic
4433 where a line like 'p,q=1,2' would fail because the automagic
4430 system would be triggered for @p.
4434 system would be triggered for @p.
4431
4435
4432 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4436 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4433 cleanups, code unmodified.
4437 cleanups, code unmodified.
4434
4438
4435 * IPython/genutils.py (Term): added a class for IPython to handle
4439 * IPython/genutils.py (Term): added a class for IPython to handle
4436 output. In most cases it will just be a proxy for stdout/err, but
4440 output. In most cases it will just be a proxy for stdout/err, but
4437 having this allows modifications to be made for some platforms,
4441 having this allows modifications to be made for some platforms,
4438 such as handling color escapes under Windows. All of this code
4442 such as handling color escapes under Windows. All of this code
4439 was contributed by Gary Bishop, with minor modifications by me.
4443 was contributed by Gary Bishop, with minor modifications by me.
4440 The actual changes affect many files.
4444 The actual changes affect many files.
4441
4445
4442 2003-11-30 Fernando Perez <fperez@colorado.edu>
4446 2003-11-30 Fernando Perez <fperez@colorado.edu>
4443
4447
4444 * IPython/iplib.py (file_matches): new completion code, courtesy
4448 * IPython/iplib.py (file_matches): new completion code, courtesy
4445 of Jeff Collins. This enables filename completion again under
4449 of Jeff Collins. This enables filename completion again under
4446 python 2.3, which disabled it at the C level.
4450 python 2.3, which disabled it at the C level.
4447
4451
4448 2003-11-11 Fernando Perez <fperez@colorado.edu>
4452 2003-11-11 Fernando Perez <fperez@colorado.edu>
4449
4453
4450 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4454 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4451 for Numeric.array(map(...)), but often convenient.
4455 for Numeric.array(map(...)), but often convenient.
4452
4456
4453 2003-11-05 Fernando Perez <fperez@colorado.edu>
4457 2003-11-05 Fernando Perez <fperez@colorado.edu>
4454
4458
4455 * IPython/numutils.py (frange): Changed a call from int() to
4459 * IPython/numutils.py (frange): Changed a call from int() to
4456 int(round()) to prevent a problem reported with arange() in the
4460 int(round()) to prevent a problem reported with arange() in the
4457 numpy list.
4461 numpy list.
4458
4462
4459 2003-10-06 Fernando Perez <fperez@colorado.edu>
4463 2003-10-06 Fernando Perez <fperez@colorado.edu>
4460
4464
4461 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4465 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4462 prevent crashes if sys lacks an argv attribute (it happens with
4466 prevent crashes if sys lacks an argv attribute (it happens with
4463 embedded interpreters which build a bare-bones sys module).
4467 embedded interpreters which build a bare-bones sys module).
4464 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4468 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4465
4469
4466 2003-09-24 Fernando Perez <fperez@colorado.edu>
4470 2003-09-24 Fernando Perez <fperez@colorado.edu>
4467
4471
4468 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4472 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4469 to protect against poorly written user objects where __getattr__
4473 to protect against poorly written user objects where __getattr__
4470 raises exceptions other than AttributeError. Thanks to a bug
4474 raises exceptions other than AttributeError. Thanks to a bug
4471 report by Oliver Sander <osander-AT-gmx.de>.
4475 report by Oliver Sander <osander-AT-gmx.de>.
4472
4476
4473 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4477 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4474 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4478 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4475
4479
4476 2003-09-09 Fernando Perez <fperez@colorado.edu>
4480 2003-09-09 Fernando Perez <fperez@colorado.edu>
4477
4481
4478 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4482 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4479 unpacking a list whith a callable as first element would
4483 unpacking a list whith a callable as first element would
4480 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4484 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4481 Collins.
4485 Collins.
4482
4486
4483 2003-08-25 *** Released version 0.5.0
4487 2003-08-25 *** Released version 0.5.0
4484
4488
4485 2003-08-22 Fernando Perez <fperez@colorado.edu>
4489 2003-08-22 Fernando Perez <fperez@colorado.edu>
4486
4490
4487 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4491 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4488 improperly defined user exceptions. Thanks to feedback from Mark
4492 improperly defined user exceptions. Thanks to feedback from Mark
4489 Russell <mrussell-AT-verio.net>.
4493 Russell <mrussell-AT-verio.net>.
4490
4494
4491 2003-08-20 Fernando Perez <fperez@colorado.edu>
4495 2003-08-20 Fernando Perez <fperez@colorado.edu>
4492
4496
4493 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4497 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4494 printing so that it would print multi-line string forms starting
4498 printing so that it would print multi-line string forms starting
4495 with a new line. This way the formatting is better respected for
4499 with a new line. This way the formatting is better respected for
4496 objects which work hard to make nice string forms.
4500 objects which work hard to make nice string forms.
4497
4501
4498 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4502 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4499 autocall would overtake data access for objects with both
4503 autocall would overtake data access for objects with both
4500 __getitem__ and __call__.
4504 __getitem__ and __call__.
4501
4505
4502 2003-08-19 *** Released version 0.5.0-rc1
4506 2003-08-19 *** Released version 0.5.0-rc1
4503
4507
4504 2003-08-19 Fernando Perez <fperez@colorado.edu>
4508 2003-08-19 Fernando Perez <fperez@colorado.edu>
4505
4509
4506 * IPython/deep_reload.py (load_tail): single tiny change here
4510 * IPython/deep_reload.py (load_tail): single tiny change here
4507 seems to fix the long-standing bug of dreload() failing to work
4511 seems to fix the long-standing bug of dreload() failing to work
4508 for dotted names. But this module is pretty tricky, so I may have
4512 for dotted names. But this module is pretty tricky, so I may have
4509 missed some subtlety. Needs more testing!.
4513 missed some subtlety. Needs more testing!.
4510
4514
4511 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4515 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4512 exceptions which have badly implemented __str__ methods.
4516 exceptions which have badly implemented __str__ methods.
4513 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4517 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4514 which I've been getting reports about from Python 2.3 users. I
4518 which I've been getting reports about from Python 2.3 users. I
4515 wish I had a simple test case to reproduce the problem, so I could
4519 wish I had a simple test case to reproduce the problem, so I could
4516 either write a cleaner workaround or file a bug report if
4520 either write a cleaner workaround or file a bug report if
4517 necessary.
4521 necessary.
4518
4522
4519 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4523 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4520 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4524 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4521 a bug report by Tjabo Kloppenburg.
4525 a bug report by Tjabo Kloppenburg.
4522
4526
4523 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4527 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4524 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4528 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4525 seems rather unstable. Thanks to a bug report by Tjabo
4529 seems rather unstable. Thanks to a bug report by Tjabo
4526 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4530 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4527
4531
4528 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4532 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4529 this out soon because of the critical fixes in the inner loop for
4533 this out soon because of the critical fixes in the inner loop for
4530 generators.
4534 generators.
4531
4535
4532 * IPython/Magic.py (Magic.getargspec): removed. This (and
4536 * IPython/Magic.py (Magic.getargspec): removed. This (and
4533 _get_def) have been obsoleted by OInspect for a long time, I
4537 _get_def) have been obsoleted by OInspect for a long time, I
4534 hadn't noticed that they were dead code.
4538 hadn't noticed that they were dead code.
4535 (Magic._ofind): restored _ofind functionality for a few literals
4539 (Magic._ofind): restored _ofind functionality for a few literals
4536 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4540 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4537 for things like "hello".capitalize?, since that would require a
4541 for things like "hello".capitalize?, since that would require a
4538 potentially dangerous eval() again.
4542 potentially dangerous eval() again.
4539
4543
4540 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4544 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4541 logic a bit more to clean up the escapes handling and minimize the
4545 logic a bit more to clean up the escapes handling and minimize the
4542 use of _ofind to only necessary cases. The interactive 'feel' of
4546 use of _ofind to only necessary cases. The interactive 'feel' of
4543 IPython should have improved quite a bit with the changes in
4547 IPython should have improved quite a bit with the changes in
4544 _prefilter and _ofind (besides being far safer than before).
4548 _prefilter and _ofind (besides being far safer than before).
4545
4549
4546 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4550 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4547 obscure, never reported). Edit would fail to find the object to
4551 obscure, never reported). Edit would fail to find the object to
4548 edit under some circumstances.
4552 edit under some circumstances.
4549 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4553 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4550 which were causing double-calling of generators. Those eval calls
4554 which were causing double-calling of generators. Those eval calls
4551 were _very_ dangerous, since code with side effects could be
4555 were _very_ dangerous, since code with side effects could be
4552 triggered. As they say, 'eval is evil'... These were the
4556 triggered. As they say, 'eval is evil'... These were the
4553 nastiest evals in IPython. Besides, _ofind is now far simpler,
4557 nastiest evals in IPython. Besides, _ofind is now far simpler,
4554 and it should also be quite a bit faster. Its use of inspect is
4558 and it should also be quite a bit faster. Its use of inspect is
4555 also safer, so perhaps some of the inspect-related crashes I've
4559 also safer, so perhaps some of the inspect-related crashes I've
4556 seen lately with Python 2.3 might be taken care of. That will
4560 seen lately with Python 2.3 might be taken care of. That will
4557 need more testing.
4561 need more testing.
4558
4562
4559 2003-08-17 Fernando Perez <fperez@colorado.edu>
4563 2003-08-17 Fernando Perez <fperez@colorado.edu>
4560
4564
4561 * IPython/iplib.py (InteractiveShell._prefilter): significant
4565 * IPython/iplib.py (InteractiveShell._prefilter): significant
4562 simplifications to the logic for handling user escapes. Faster
4566 simplifications to the logic for handling user escapes. Faster
4563 and simpler code.
4567 and simpler code.
4564
4568
4565 2003-08-14 Fernando Perez <fperez@colorado.edu>
4569 2003-08-14 Fernando Perez <fperez@colorado.edu>
4566
4570
4567 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4571 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4568 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4572 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4569 but it should be quite a bit faster. And the recursive version
4573 but it should be quite a bit faster. And the recursive version
4570 generated O(log N) intermediate storage for all rank>1 arrays,
4574 generated O(log N) intermediate storage for all rank>1 arrays,
4571 even if they were contiguous.
4575 even if they were contiguous.
4572 (l1norm): Added this function.
4576 (l1norm): Added this function.
4573 (norm): Added this function for arbitrary norms (including
4577 (norm): Added this function for arbitrary norms (including
4574 l-infinity). l1 and l2 are still special cases for convenience
4578 l-infinity). l1 and l2 are still special cases for convenience
4575 and speed.
4579 and speed.
4576
4580
4577 2003-08-03 Fernando Perez <fperez@colorado.edu>
4581 2003-08-03 Fernando Perez <fperez@colorado.edu>
4578
4582
4579 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4583 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4580 exceptions, which now raise PendingDeprecationWarnings in Python
4584 exceptions, which now raise PendingDeprecationWarnings in Python
4581 2.3. There were some in Magic and some in Gnuplot2.
4585 2.3. There were some in Magic and some in Gnuplot2.
4582
4586
4583 2003-06-30 Fernando Perez <fperez@colorado.edu>
4587 2003-06-30 Fernando Perez <fperez@colorado.edu>
4584
4588
4585 * IPython/genutils.py (page): modified to call curses only for
4589 * IPython/genutils.py (page): modified to call curses only for
4586 terminals where TERM=='xterm'. After problems under many other
4590 terminals where TERM=='xterm'. After problems under many other
4587 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4591 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4588
4592
4589 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4593 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4590 would be triggered when readline was absent. This was just an old
4594 would be triggered when readline was absent. This was just an old
4591 debugging statement I'd forgotten to take out.
4595 debugging statement I'd forgotten to take out.
4592
4596
4593 2003-06-20 Fernando Perez <fperez@colorado.edu>
4597 2003-06-20 Fernando Perez <fperez@colorado.edu>
4594
4598
4595 * IPython/genutils.py (clock): modified to return only user time
4599 * IPython/genutils.py (clock): modified to return only user time
4596 (not counting system time), after a discussion on scipy. While
4600 (not counting system time), after a discussion on scipy. While
4597 system time may be a useful quantity occasionally, it may much
4601 system time may be a useful quantity occasionally, it may much
4598 more easily be skewed by occasional swapping or other similar
4602 more easily be skewed by occasional swapping or other similar
4599 activity.
4603 activity.
4600
4604
4601 2003-06-05 Fernando Perez <fperez@colorado.edu>
4605 2003-06-05 Fernando Perez <fperez@colorado.edu>
4602
4606
4603 * IPython/numutils.py (identity): new function, for building
4607 * IPython/numutils.py (identity): new function, for building
4604 arbitrary rank Kronecker deltas (mostly backwards compatible with
4608 arbitrary rank Kronecker deltas (mostly backwards compatible with
4605 Numeric.identity)
4609 Numeric.identity)
4606
4610
4607 2003-06-03 Fernando Perez <fperez@colorado.edu>
4611 2003-06-03 Fernando Perez <fperez@colorado.edu>
4608
4612
4609 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4613 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4610 arguments passed to magics with spaces, to allow trailing '\' to
4614 arguments passed to magics with spaces, to allow trailing '\' to
4611 work normally (mainly for Windows users).
4615 work normally (mainly for Windows users).
4612
4616
4613 2003-05-29 Fernando Perez <fperez@colorado.edu>
4617 2003-05-29 Fernando Perez <fperez@colorado.edu>
4614
4618
4615 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4619 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4616 instead of pydoc.help. This fixes a bizarre behavior where
4620 instead of pydoc.help. This fixes a bizarre behavior where
4617 printing '%s' % locals() would trigger the help system. Now
4621 printing '%s' % locals() would trigger the help system. Now
4618 ipython behaves like normal python does.
4622 ipython behaves like normal python does.
4619
4623
4620 Note that if one does 'from pydoc import help', the bizarre
4624 Note that if one does 'from pydoc import help', the bizarre
4621 behavior returns, but this will also happen in normal python, so
4625 behavior returns, but this will also happen in normal python, so
4622 it's not an ipython bug anymore (it has to do with how pydoc.help
4626 it's not an ipython bug anymore (it has to do with how pydoc.help
4623 is implemented).
4627 is implemented).
4624
4628
4625 2003-05-22 Fernando Perez <fperez@colorado.edu>
4629 2003-05-22 Fernando Perez <fperez@colorado.edu>
4626
4630
4627 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4631 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4628 return [] instead of None when nothing matches, also match to end
4632 return [] instead of None when nothing matches, also match to end
4629 of line. Patch by Gary Bishop.
4633 of line. Patch by Gary Bishop.
4630
4634
4631 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4635 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4632 protection as before, for files passed on the command line. This
4636 protection as before, for files passed on the command line. This
4633 prevents the CrashHandler from kicking in if user files call into
4637 prevents the CrashHandler from kicking in if user files call into
4634 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4638 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4635 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4639 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4636
4640
4637 2003-05-20 *** Released version 0.4.0
4641 2003-05-20 *** Released version 0.4.0
4638
4642
4639 2003-05-20 Fernando Perez <fperez@colorado.edu>
4643 2003-05-20 Fernando Perez <fperez@colorado.edu>
4640
4644
4641 * setup.py: added support for manpages. It's a bit hackish b/c of
4645 * setup.py: added support for manpages. It's a bit hackish b/c of
4642 a bug in the way the bdist_rpm distutils target handles gzipped
4646 a bug in the way the bdist_rpm distutils target handles gzipped
4643 manpages, but it works. After a patch by Jack.
4647 manpages, but it works. After a patch by Jack.
4644
4648
4645 2003-05-19 Fernando Perez <fperez@colorado.edu>
4649 2003-05-19 Fernando Perez <fperez@colorado.edu>
4646
4650
4647 * IPython/numutils.py: added a mockup of the kinds module, since
4651 * IPython/numutils.py: added a mockup of the kinds module, since
4648 it was recently removed from Numeric. This way, numutils will
4652 it was recently removed from Numeric. This way, numutils will
4649 work for all users even if they are missing kinds.
4653 work for all users even if they are missing kinds.
4650
4654
4651 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4655 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4652 failure, which can occur with SWIG-wrapped extensions. After a
4656 failure, which can occur with SWIG-wrapped extensions. After a
4653 crash report from Prabhu.
4657 crash report from Prabhu.
4654
4658
4655 2003-05-16 Fernando Perez <fperez@colorado.edu>
4659 2003-05-16 Fernando Perez <fperez@colorado.edu>
4656
4660
4657 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4661 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4658 protect ipython from user code which may call directly
4662 protect ipython from user code which may call directly
4659 sys.excepthook (this looks like an ipython crash to the user, even
4663 sys.excepthook (this looks like an ipython crash to the user, even
4660 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4664 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4661 This is especially important to help users of WxWindows, but may
4665 This is especially important to help users of WxWindows, but may
4662 also be useful in other cases.
4666 also be useful in other cases.
4663
4667
4664 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4668 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4665 an optional tb_offset to be specified, and to preserve exception
4669 an optional tb_offset to be specified, and to preserve exception
4666 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4670 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4667
4671
4668 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4672 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4669
4673
4670 2003-05-15 Fernando Perez <fperez@colorado.edu>
4674 2003-05-15 Fernando Perez <fperez@colorado.edu>
4671
4675
4672 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4676 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4673 installing for a new user under Windows.
4677 installing for a new user under Windows.
4674
4678
4675 2003-05-12 Fernando Perez <fperez@colorado.edu>
4679 2003-05-12 Fernando Perez <fperez@colorado.edu>
4676
4680
4677 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4681 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4678 handler for Emacs comint-based lines. Currently it doesn't do
4682 handler for Emacs comint-based lines. Currently it doesn't do
4679 much (but importantly, it doesn't update the history cache). In
4683 much (but importantly, it doesn't update the history cache). In
4680 the future it may be expanded if Alex needs more functionality
4684 the future it may be expanded if Alex needs more functionality
4681 there.
4685 there.
4682
4686
4683 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4687 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4684 info to crash reports.
4688 info to crash reports.
4685
4689
4686 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4690 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4687 just like Python's -c. Also fixed crash with invalid -color
4691 just like Python's -c. Also fixed crash with invalid -color
4688 option value at startup. Thanks to Will French
4692 option value at startup. Thanks to Will French
4689 <wfrench-AT-bestweb.net> for the bug report.
4693 <wfrench-AT-bestweb.net> for the bug report.
4690
4694
4691 2003-05-09 Fernando Perez <fperez@colorado.edu>
4695 2003-05-09 Fernando Perez <fperez@colorado.edu>
4692
4696
4693 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4697 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4694 to EvalDict (it's a mapping, after all) and simplified its code
4698 to EvalDict (it's a mapping, after all) and simplified its code
4695 quite a bit, after a nice discussion on c.l.py where Gustavo
4699 quite a bit, after a nice discussion on c.l.py where Gustavo
4696 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4700 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4697
4701
4698 2003-04-30 Fernando Perez <fperez@colorado.edu>
4702 2003-04-30 Fernando Perez <fperez@colorado.edu>
4699
4703
4700 * IPython/genutils.py (timings_out): modified it to reduce its
4704 * IPython/genutils.py (timings_out): modified it to reduce its
4701 overhead in the common reps==1 case.
4705 overhead in the common reps==1 case.
4702
4706
4703 2003-04-29 Fernando Perez <fperez@colorado.edu>
4707 2003-04-29 Fernando Perez <fperez@colorado.edu>
4704
4708
4705 * IPython/genutils.py (timings_out): Modified to use the resource
4709 * IPython/genutils.py (timings_out): Modified to use the resource
4706 module, which avoids the wraparound problems of time.clock().
4710 module, which avoids the wraparound problems of time.clock().
4707
4711
4708 2003-04-17 *** Released version 0.2.15pre4
4712 2003-04-17 *** Released version 0.2.15pre4
4709
4713
4710 2003-04-17 Fernando Perez <fperez@colorado.edu>
4714 2003-04-17 Fernando Perez <fperez@colorado.edu>
4711
4715
4712 * setup.py (scriptfiles): Split windows-specific stuff over to a
4716 * setup.py (scriptfiles): Split windows-specific stuff over to a
4713 separate file, in an attempt to have a Windows GUI installer.
4717 separate file, in an attempt to have a Windows GUI installer.
4714 That didn't work, but part of the groundwork is done.
4718 That didn't work, but part of the groundwork is done.
4715
4719
4716 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4720 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4717 indent/unindent with 4 spaces. Particularly useful in combination
4721 indent/unindent with 4 spaces. Particularly useful in combination
4718 with the new auto-indent option.
4722 with the new auto-indent option.
4719
4723
4720 2003-04-16 Fernando Perez <fperez@colorado.edu>
4724 2003-04-16 Fernando Perez <fperez@colorado.edu>
4721
4725
4722 * IPython/Magic.py: various replacements of self.rc for
4726 * IPython/Magic.py: various replacements of self.rc for
4723 self.shell.rc. A lot more remains to be done to fully disentangle
4727 self.shell.rc. A lot more remains to be done to fully disentangle
4724 this class from the main Shell class.
4728 this class from the main Shell class.
4725
4729
4726 * IPython/GnuplotRuntime.py: added checks for mouse support so
4730 * IPython/GnuplotRuntime.py: added checks for mouse support so
4727 that we don't try to enable it if the current gnuplot doesn't
4731 that we don't try to enable it if the current gnuplot doesn't
4728 really support it. Also added checks so that we don't try to
4732 really support it. Also added checks so that we don't try to
4729 enable persist under Windows (where Gnuplot doesn't recognize the
4733 enable persist under Windows (where Gnuplot doesn't recognize the
4730 option).
4734 option).
4731
4735
4732 * IPython/iplib.py (InteractiveShell.interact): Added optional
4736 * IPython/iplib.py (InteractiveShell.interact): Added optional
4733 auto-indenting code, after a patch by King C. Shu
4737 auto-indenting code, after a patch by King C. Shu
4734 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4738 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4735 get along well with pasting indented code. If I ever figure out
4739 get along well with pasting indented code. If I ever figure out
4736 how to make that part go well, it will become on by default.
4740 how to make that part go well, it will become on by default.
4737
4741
4738 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4742 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4739 crash ipython if there was an unmatched '%' in the user's prompt
4743 crash ipython if there was an unmatched '%' in the user's prompt
4740 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4744 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4741
4745
4742 * IPython/iplib.py (InteractiveShell.interact): removed the
4746 * IPython/iplib.py (InteractiveShell.interact): removed the
4743 ability to ask the user whether he wants to crash or not at the
4747 ability to ask the user whether he wants to crash or not at the
4744 'last line' exception handler. Calling functions at that point
4748 'last line' exception handler. Calling functions at that point
4745 changes the stack, and the error reports would have incorrect
4749 changes the stack, and the error reports would have incorrect
4746 tracebacks.
4750 tracebacks.
4747
4751
4748 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4752 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4749 pass through a peger a pretty-printed form of any object. After a
4753 pass through a peger a pretty-printed form of any object. After a
4750 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4754 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4751
4755
4752 2003-04-14 Fernando Perez <fperez@colorado.edu>
4756 2003-04-14 Fernando Perez <fperez@colorado.edu>
4753
4757
4754 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4758 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4755 all files in ~ would be modified at first install (instead of
4759 all files in ~ would be modified at first install (instead of
4756 ~/.ipython). This could be potentially disastrous, as the
4760 ~/.ipython). This could be potentially disastrous, as the
4757 modification (make line-endings native) could damage binary files.
4761 modification (make line-endings native) could damage binary files.
4758
4762
4759 2003-04-10 Fernando Perez <fperez@colorado.edu>
4763 2003-04-10 Fernando Perez <fperez@colorado.edu>
4760
4764
4761 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4765 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4762 handle only lines which are invalid python. This now means that
4766 handle only lines which are invalid python. This now means that
4763 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4767 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4764 for the bug report.
4768 for the bug report.
4765
4769
4766 2003-04-01 Fernando Perez <fperez@colorado.edu>
4770 2003-04-01 Fernando Perez <fperez@colorado.edu>
4767
4771
4768 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4772 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4769 where failing to set sys.last_traceback would crash pdb.pm().
4773 where failing to set sys.last_traceback would crash pdb.pm().
4770 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4774 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4771 report.
4775 report.
4772
4776
4773 2003-03-25 Fernando Perez <fperez@colorado.edu>
4777 2003-03-25 Fernando Perez <fperez@colorado.edu>
4774
4778
4775 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4779 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4776 before printing it (it had a lot of spurious blank lines at the
4780 before printing it (it had a lot of spurious blank lines at the
4777 end).
4781 end).
4778
4782
4779 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4783 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4780 output would be sent 21 times! Obviously people don't use this
4784 output would be sent 21 times! Obviously people don't use this
4781 too often, or I would have heard about it.
4785 too often, or I would have heard about it.
4782
4786
4783 2003-03-24 Fernando Perez <fperez@colorado.edu>
4787 2003-03-24 Fernando Perez <fperez@colorado.edu>
4784
4788
4785 * setup.py (scriptfiles): renamed the data_files parameter from
4789 * setup.py (scriptfiles): renamed the data_files parameter from
4786 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4790 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4787 for the patch.
4791 for the patch.
4788
4792
4789 2003-03-20 Fernando Perez <fperez@colorado.edu>
4793 2003-03-20 Fernando Perez <fperez@colorado.edu>
4790
4794
4791 * IPython/genutils.py (error): added error() and fatal()
4795 * IPython/genutils.py (error): added error() and fatal()
4792 functions.
4796 functions.
4793
4797
4794 2003-03-18 *** Released version 0.2.15pre3
4798 2003-03-18 *** Released version 0.2.15pre3
4795
4799
4796 2003-03-18 Fernando Perez <fperez@colorado.edu>
4800 2003-03-18 Fernando Perez <fperez@colorado.edu>
4797
4801
4798 * setupext/install_data_ext.py
4802 * setupext/install_data_ext.py
4799 (install_data_ext.initialize_options): Class contributed by Jack
4803 (install_data_ext.initialize_options): Class contributed by Jack
4800 Moffit for fixing the old distutils hack. He is sending this to
4804 Moffit for fixing the old distutils hack. He is sending this to
4801 the distutils folks so in the future we may not need it as a
4805 the distutils folks so in the future we may not need it as a
4802 private fix.
4806 private fix.
4803
4807
4804 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4808 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4805 changes for Debian packaging. See his patch for full details.
4809 changes for Debian packaging. See his patch for full details.
4806 The old distutils hack of making the ipythonrc* files carry a
4810 The old distutils hack of making the ipythonrc* files carry a
4807 bogus .py extension is gone, at last. Examples were moved to a
4811 bogus .py extension is gone, at last. Examples were moved to a
4808 separate subdir under doc/, and the separate executable scripts
4812 separate subdir under doc/, and the separate executable scripts
4809 now live in their own directory. Overall a great cleanup. The
4813 now live in their own directory. Overall a great cleanup. The
4810 manual was updated to use the new files, and setup.py has been
4814 manual was updated to use the new files, and setup.py has been
4811 fixed for this setup.
4815 fixed for this setup.
4812
4816
4813 * IPython/PyColorize.py (Parser.usage): made non-executable and
4817 * IPython/PyColorize.py (Parser.usage): made non-executable and
4814 created a pycolor wrapper around it to be included as a script.
4818 created a pycolor wrapper around it to be included as a script.
4815
4819
4816 2003-03-12 *** Released version 0.2.15pre2
4820 2003-03-12 *** Released version 0.2.15pre2
4817
4821
4818 2003-03-12 Fernando Perez <fperez@colorado.edu>
4822 2003-03-12 Fernando Perez <fperez@colorado.edu>
4819
4823
4820 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4824 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4821 long-standing problem with garbage characters in some terminals.
4825 long-standing problem with garbage characters in some terminals.
4822 The issue was really that the \001 and \002 escapes must _only_ be
4826 The issue was really that the \001 and \002 escapes must _only_ be
4823 passed to input prompts (which call readline), but _never_ to
4827 passed to input prompts (which call readline), but _never_ to
4824 normal text to be printed on screen. I changed ColorANSI to have
4828 normal text to be printed on screen. I changed ColorANSI to have
4825 two classes: TermColors and InputTermColors, each with the
4829 two classes: TermColors and InputTermColors, each with the
4826 appropriate escapes for input prompts or normal text. The code in
4830 appropriate escapes for input prompts or normal text. The code in
4827 Prompts.py got slightly more complicated, but this very old and
4831 Prompts.py got slightly more complicated, but this very old and
4828 annoying bug is finally fixed.
4832 annoying bug is finally fixed.
4829
4833
4830 All the credit for nailing down the real origin of this problem
4834 All the credit for nailing down the real origin of this problem
4831 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4835 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4832 *Many* thanks to him for spending quite a bit of effort on this.
4836 *Many* thanks to him for spending quite a bit of effort on this.
4833
4837
4834 2003-03-05 *** Released version 0.2.15pre1
4838 2003-03-05 *** Released version 0.2.15pre1
4835
4839
4836 2003-03-03 Fernando Perez <fperez@colorado.edu>
4840 2003-03-03 Fernando Perez <fperez@colorado.edu>
4837
4841
4838 * IPython/FakeModule.py: Moved the former _FakeModule to a
4842 * IPython/FakeModule.py: Moved the former _FakeModule to a
4839 separate file, because it's also needed by Magic (to fix a similar
4843 separate file, because it's also needed by Magic (to fix a similar
4840 pickle-related issue in @run).
4844 pickle-related issue in @run).
4841
4845
4842 2003-03-02 Fernando Perez <fperez@colorado.edu>
4846 2003-03-02 Fernando Perez <fperez@colorado.edu>
4843
4847
4844 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4848 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4845 the autocall option at runtime.
4849 the autocall option at runtime.
4846 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4850 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4847 across Magic.py to start separating Magic from InteractiveShell.
4851 across Magic.py to start separating Magic from InteractiveShell.
4848 (Magic._ofind): Fixed to return proper namespace for dotted
4852 (Magic._ofind): Fixed to return proper namespace for dotted
4849 names. Before, a dotted name would always return 'not currently
4853 names. Before, a dotted name would always return 'not currently
4850 defined', because it would find the 'parent'. s.x would be found,
4854 defined', because it would find the 'parent'. s.x would be found,
4851 but since 'x' isn't defined by itself, it would get confused.
4855 but since 'x' isn't defined by itself, it would get confused.
4852 (Magic.magic_run): Fixed pickling problems reported by Ralf
4856 (Magic.magic_run): Fixed pickling problems reported by Ralf
4853 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4857 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4854 that I'd used when Mike Heeter reported similar issues at the
4858 that I'd used when Mike Heeter reported similar issues at the
4855 top-level, but now for @run. It boils down to injecting the
4859 top-level, but now for @run. It boils down to injecting the
4856 namespace where code is being executed with something that looks
4860 namespace where code is being executed with something that looks
4857 enough like a module to fool pickle.dump(). Since a pickle stores
4861 enough like a module to fool pickle.dump(). Since a pickle stores
4858 a named reference to the importing module, we need this for
4862 a named reference to the importing module, we need this for
4859 pickles to save something sensible.
4863 pickles to save something sensible.
4860
4864
4861 * IPython/ipmaker.py (make_IPython): added an autocall option.
4865 * IPython/ipmaker.py (make_IPython): added an autocall option.
4862
4866
4863 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4867 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4864 the auto-eval code. Now autocalling is an option, and the code is
4868 the auto-eval code. Now autocalling is an option, and the code is
4865 also vastly safer. There is no more eval() involved at all.
4869 also vastly safer. There is no more eval() involved at all.
4866
4870
4867 2003-03-01 Fernando Perez <fperez@colorado.edu>
4871 2003-03-01 Fernando Perez <fperez@colorado.edu>
4868
4872
4869 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4873 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4870 dict with named keys instead of a tuple.
4874 dict with named keys instead of a tuple.
4871
4875
4872 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4876 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4873
4877
4874 * setup.py (make_shortcut): Fixed message about directories
4878 * setup.py (make_shortcut): Fixed message about directories
4875 created during Windows installation (the directories were ok, just
4879 created during Windows installation (the directories were ok, just
4876 the printed message was misleading). Thanks to Chris Liechti
4880 the printed message was misleading). Thanks to Chris Liechti
4877 <cliechti-AT-gmx.net> for the heads up.
4881 <cliechti-AT-gmx.net> for the heads up.
4878
4882
4879 2003-02-21 Fernando Perez <fperez@colorado.edu>
4883 2003-02-21 Fernando Perez <fperez@colorado.edu>
4880
4884
4881 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4885 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4882 of ValueError exception when checking for auto-execution. This
4886 of ValueError exception when checking for auto-execution. This
4883 one is raised by things like Numeric arrays arr.flat when the
4887 one is raised by things like Numeric arrays arr.flat when the
4884 array is non-contiguous.
4888 array is non-contiguous.
4885
4889
4886 2003-01-31 Fernando Perez <fperez@colorado.edu>
4890 2003-01-31 Fernando Perez <fperez@colorado.edu>
4887
4891
4888 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4892 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4889 not return any value at all (even though the command would get
4893 not return any value at all (even though the command would get
4890 executed).
4894 executed).
4891 (xsys): Flush stdout right after printing the command to ensure
4895 (xsys): Flush stdout right after printing the command to ensure
4892 proper ordering of commands and command output in the total
4896 proper ordering of commands and command output in the total
4893 output.
4897 output.
4894 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4898 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4895 system/getoutput as defaults. The old ones are kept for
4899 system/getoutput as defaults. The old ones are kept for
4896 compatibility reasons, so no code which uses this library needs
4900 compatibility reasons, so no code which uses this library needs
4897 changing.
4901 changing.
4898
4902
4899 2003-01-27 *** Released version 0.2.14
4903 2003-01-27 *** Released version 0.2.14
4900
4904
4901 2003-01-25 Fernando Perez <fperez@colorado.edu>
4905 2003-01-25 Fernando Perez <fperez@colorado.edu>
4902
4906
4903 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4907 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4904 functions defined in previous edit sessions could not be re-edited
4908 functions defined in previous edit sessions could not be re-edited
4905 (because the temp files were immediately removed). Now temp files
4909 (because the temp files were immediately removed). Now temp files
4906 are removed only at IPython's exit.
4910 are removed only at IPython's exit.
4907 (Magic.magic_run): Improved @run to perform shell-like expansions
4911 (Magic.magic_run): Improved @run to perform shell-like expansions
4908 on its arguments (~users and $VARS). With this, @run becomes more
4912 on its arguments (~users and $VARS). With this, @run becomes more
4909 like a normal command-line.
4913 like a normal command-line.
4910
4914
4911 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4915 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4912 bugs related to embedding and cleaned up that code. A fairly
4916 bugs related to embedding and cleaned up that code. A fairly
4913 important one was the impossibility to access the global namespace
4917 important one was the impossibility to access the global namespace
4914 through the embedded IPython (only local variables were visible).
4918 through the embedded IPython (only local variables were visible).
4915
4919
4916 2003-01-14 Fernando Perez <fperez@colorado.edu>
4920 2003-01-14 Fernando Perez <fperez@colorado.edu>
4917
4921
4918 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4922 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4919 auto-calling to be a bit more conservative. Now it doesn't get
4923 auto-calling to be a bit more conservative. Now it doesn't get
4920 triggered if any of '!=()<>' are in the rest of the input line, to
4924 triggered if any of '!=()<>' are in the rest of the input line, to
4921 allow comparing callables. Thanks to Alex for the heads up.
4925 allow comparing callables. Thanks to Alex for the heads up.
4922
4926
4923 2003-01-07 Fernando Perez <fperez@colorado.edu>
4927 2003-01-07 Fernando Perez <fperez@colorado.edu>
4924
4928
4925 * IPython/genutils.py (page): fixed estimation of the number of
4929 * IPython/genutils.py (page): fixed estimation of the number of
4926 lines in a string to be paged to simply count newlines. This
4930 lines in a string to be paged to simply count newlines. This
4927 prevents over-guessing due to embedded escape sequences. A better
4931 prevents over-guessing due to embedded escape sequences. A better
4928 long-term solution would involve stripping out the control chars
4932 long-term solution would involve stripping out the control chars
4929 for the count, but it's potentially so expensive I just don't
4933 for the count, but it's potentially so expensive I just don't
4930 think it's worth doing.
4934 think it's worth doing.
4931
4935
4932 2002-12-19 *** Released version 0.2.14pre50
4936 2002-12-19 *** Released version 0.2.14pre50
4933
4937
4934 2002-12-19 Fernando Perez <fperez@colorado.edu>
4938 2002-12-19 Fernando Perez <fperez@colorado.edu>
4935
4939
4936 * tools/release (version): Changed release scripts to inform
4940 * tools/release (version): Changed release scripts to inform
4937 Andrea and build a NEWS file with a list of recent changes.
4941 Andrea and build a NEWS file with a list of recent changes.
4938
4942
4939 * IPython/ColorANSI.py (__all__): changed terminal detection
4943 * IPython/ColorANSI.py (__all__): changed terminal detection
4940 code. Seems to work better for xterms without breaking
4944 code. Seems to work better for xterms without breaking
4941 konsole. Will need more testing to determine if WinXP and Mac OSX
4945 konsole. Will need more testing to determine if WinXP and Mac OSX
4942 also work ok.
4946 also work ok.
4943
4947
4944 2002-12-18 *** Released version 0.2.14pre49
4948 2002-12-18 *** Released version 0.2.14pre49
4945
4949
4946 2002-12-18 Fernando Perez <fperez@colorado.edu>
4950 2002-12-18 Fernando Perez <fperez@colorado.edu>
4947
4951
4948 * Docs: added new info about Mac OSX, from Andrea.
4952 * Docs: added new info about Mac OSX, from Andrea.
4949
4953
4950 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4954 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4951 allow direct plotting of python strings whose format is the same
4955 allow direct plotting of python strings whose format is the same
4952 of gnuplot data files.
4956 of gnuplot data files.
4953
4957
4954 2002-12-16 Fernando Perez <fperez@colorado.edu>
4958 2002-12-16 Fernando Perez <fperez@colorado.edu>
4955
4959
4956 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4960 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4957 value of exit question to be acknowledged.
4961 value of exit question to be acknowledged.
4958
4962
4959 2002-12-03 Fernando Perez <fperez@colorado.edu>
4963 2002-12-03 Fernando Perez <fperez@colorado.edu>
4960
4964
4961 * IPython/ipmaker.py: removed generators, which had been added
4965 * IPython/ipmaker.py: removed generators, which had been added
4962 by mistake in an earlier debugging run. This was causing trouble
4966 by mistake in an earlier debugging run. This was causing trouble
4963 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4967 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4964 for pointing this out.
4968 for pointing this out.
4965
4969
4966 2002-11-17 Fernando Perez <fperez@colorado.edu>
4970 2002-11-17 Fernando Perez <fperez@colorado.edu>
4967
4971
4968 * Manual: updated the Gnuplot section.
4972 * Manual: updated the Gnuplot section.
4969
4973
4970 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4974 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4971 a much better split of what goes in Runtime and what goes in
4975 a much better split of what goes in Runtime and what goes in
4972 Interactive.
4976 Interactive.
4973
4977
4974 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4978 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4975 being imported from iplib.
4979 being imported from iplib.
4976
4980
4977 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4981 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4978 for command-passing. Now the global Gnuplot instance is called
4982 for command-passing. Now the global Gnuplot instance is called
4979 'gp' instead of 'g', which was really a far too fragile and
4983 'gp' instead of 'g', which was really a far too fragile and
4980 common name.
4984 common name.
4981
4985
4982 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4986 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4983 bounding boxes generated by Gnuplot for square plots.
4987 bounding boxes generated by Gnuplot for square plots.
4984
4988
4985 * IPython/genutils.py (popkey): new function added. I should
4989 * IPython/genutils.py (popkey): new function added. I should
4986 suggest this on c.l.py as a dict method, it seems useful.
4990 suggest this on c.l.py as a dict method, it seems useful.
4987
4991
4988 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4992 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4989 to transparently handle PostScript generation. MUCH better than
4993 to transparently handle PostScript generation. MUCH better than
4990 the previous plot_eps/replot_eps (which I removed now). The code
4994 the previous plot_eps/replot_eps (which I removed now). The code
4991 is also fairly clean and well documented now (including
4995 is also fairly clean and well documented now (including
4992 docstrings).
4996 docstrings).
4993
4997
4994 2002-11-13 Fernando Perez <fperez@colorado.edu>
4998 2002-11-13 Fernando Perez <fperez@colorado.edu>
4995
4999
4996 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5000 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4997 (inconsistent with options).
5001 (inconsistent with options).
4998
5002
4999 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5003 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5000 manually disabled, I don't know why. Fixed it.
5004 manually disabled, I don't know why. Fixed it.
5001 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5005 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5002 eps output.
5006 eps output.
5003
5007
5004 2002-11-12 Fernando Perez <fperez@colorado.edu>
5008 2002-11-12 Fernando Perez <fperez@colorado.edu>
5005
5009
5006 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5010 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5007 don't propagate up to caller. Fixes crash reported by François
5011 don't propagate up to caller. Fixes crash reported by François
5008 Pinard.
5012 Pinard.
5009
5013
5010 2002-11-09 Fernando Perez <fperez@colorado.edu>
5014 2002-11-09 Fernando Perez <fperez@colorado.edu>
5011
5015
5012 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5016 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5013 history file for new users.
5017 history file for new users.
5014 (make_IPython): fixed bug where initial install would leave the
5018 (make_IPython): fixed bug where initial install would leave the
5015 user running in the .ipython dir.
5019 user running in the .ipython dir.
5016 (make_IPython): fixed bug where config dir .ipython would be
5020 (make_IPython): fixed bug where config dir .ipython would be
5017 created regardless of the given -ipythondir option. Thanks to Cory
5021 created regardless of the given -ipythondir option. Thanks to Cory
5018 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5022 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5019
5023
5020 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5024 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5021 type confirmations. Will need to use it in all of IPython's code
5025 type confirmations. Will need to use it in all of IPython's code
5022 consistently.
5026 consistently.
5023
5027
5024 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5028 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5025 context to print 31 lines instead of the default 5. This will make
5029 context to print 31 lines instead of the default 5. This will make
5026 the crash reports extremely detailed in case the problem is in
5030 the crash reports extremely detailed in case the problem is in
5027 libraries I don't have access to.
5031 libraries I don't have access to.
5028
5032
5029 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5033 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5030 line of defense' code to still crash, but giving users fair
5034 line of defense' code to still crash, but giving users fair
5031 warning. I don't want internal errors to go unreported: if there's
5035 warning. I don't want internal errors to go unreported: if there's
5032 an internal problem, IPython should crash and generate a full
5036 an internal problem, IPython should crash and generate a full
5033 report.
5037 report.
5034
5038
5035 2002-11-08 Fernando Perez <fperez@colorado.edu>
5039 2002-11-08 Fernando Perez <fperez@colorado.edu>
5036
5040
5037 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5041 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5038 otherwise uncaught exceptions which can appear if people set
5042 otherwise uncaught exceptions which can appear if people set
5039 sys.stdout to something badly broken. Thanks to a crash report
5043 sys.stdout to something badly broken. Thanks to a crash report
5040 from henni-AT-mail.brainbot.com.
5044 from henni-AT-mail.brainbot.com.
5041
5045
5042 2002-11-04 Fernando Perez <fperez@colorado.edu>
5046 2002-11-04 Fernando Perez <fperez@colorado.edu>
5043
5047
5044 * IPython/iplib.py (InteractiveShell.interact): added
5048 * IPython/iplib.py (InteractiveShell.interact): added
5045 __IPYTHON__active to the builtins. It's a flag which goes on when
5049 __IPYTHON__active to the builtins. It's a flag which goes on when
5046 the interaction starts and goes off again when it stops. This
5050 the interaction starts and goes off again when it stops. This
5047 allows embedding code to detect being inside IPython. Before this
5051 allows embedding code to detect being inside IPython. Before this
5048 was done via __IPYTHON__, but that only shows that an IPython
5052 was done via __IPYTHON__, but that only shows that an IPython
5049 instance has been created.
5053 instance has been created.
5050
5054
5051 * IPython/Magic.py (Magic.magic_env): I realized that in a
5055 * IPython/Magic.py (Magic.magic_env): I realized that in a
5052 UserDict, instance.data holds the data as a normal dict. So I
5056 UserDict, instance.data holds the data as a normal dict. So I
5053 modified @env to return os.environ.data instead of rebuilding a
5057 modified @env to return os.environ.data instead of rebuilding a
5054 dict by hand.
5058 dict by hand.
5055
5059
5056 2002-11-02 Fernando Perez <fperez@colorado.edu>
5060 2002-11-02 Fernando Perez <fperez@colorado.edu>
5057
5061
5058 * IPython/genutils.py (warn): changed so that level 1 prints no
5062 * IPython/genutils.py (warn): changed so that level 1 prints no
5059 header. Level 2 is now the default (with 'WARNING' header, as
5063 header. Level 2 is now the default (with 'WARNING' header, as
5060 before). I think I tracked all places where changes were needed in
5064 before). I think I tracked all places where changes were needed in
5061 IPython, but outside code using the old level numbering may have
5065 IPython, but outside code using the old level numbering may have
5062 broken.
5066 broken.
5063
5067
5064 * IPython/iplib.py (InteractiveShell.runcode): added this to
5068 * IPython/iplib.py (InteractiveShell.runcode): added this to
5065 handle the tracebacks in SystemExit traps correctly. The previous
5069 handle the tracebacks in SystemExit traps correctly. The previous
5066 code (through interact) was printing more of the stack than
5070 code (through interact) was printing more of the stack than
5067 necessary, showing IPython internal code to the user.
5071 necessary, showing IPython internal code to the user.
5068
5072
5069 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5073 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5070 default. Now that the default at the confirmation prompt is yes,
5074 default. Now that the default at the confirmation prompt is yes,
5071 it's not so intrusive. François' argument that ipython sessions
5075 it's not so intrusive. François' argument that ipython sessions
5072 tend to be complex enough not to lose them from an accidental C-d,
5076 tend to be complex enough not to lose them from an accidental C-d,
5073 is a valid one.
5077 is a valid one.
5074
5078
5075 * IPython/iplib.py (InteractiveShell.interact): added a
5079 * IPython/iplib.py (InteractiveShell.interact): added a
5076 showtraceback() call to the SystemExit trap, and modified the exit
5080 showtraceback() call to the SystemExit trap, and modified the exit
5077 confirmation to have yes as the default.
5081 confirmation to have yes as the default.
5078
5082
5079 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5083 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5080 this file. It's been gone from the code for a long time, this was
5084 this file. It's been gone from the code for a long time, this was
5081 simply leftover junk.
5085 simply leftover junk.
5082
5086
5083 2002-11-01 Fernando Perez <fperez@colorado.edu>
5087 2002-11-01 Fernando Perez <fperez@colorado.edu>
5084
5088
5085 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5089 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5086 added. If set, IPython now traps EOF and asks for
5090 added. If set, IPython now traps EOF and asks for
5087 confirmation. After a request by François Pinard.
5091 confirmation. After a request by François Pinard.
5088
5092
5089 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5093 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5090 of @abort, and with a new (better) mechanism for handling the
5094 of @abort, and with a new (better) mechanism for handling the
5091 exceptions.
5095 exceptions.
5092
5096
5093 2002-10-27 Fernando Perez <fperez@colorado.edu>
5097 2002-10-27 Fernando Perez <fperez@colorado.edu>
5094
5098
5095 * IPython/usage.py (__doc__): updated the --help information and
5099 * IPython/usage.py (__doc__): updated the --help information and
5096 the ipythonrc file to indicate that -log generates
5100 the ipythonrc file to indicate that -log generates
5097 ./ipython.log. Also fixed the corresponding info in @logstart.
5101 ./ipython.log. Also fixed the corresponding info in @logstart.
5098 This and several other fixes in the manuals thanks to reports by
5102 This and several other fixes in the manuals thanks to reports by
5099 François Pinard <pinard-AT-iro.umontreal.ca>.
5103 François Pinard <pinard-AT-iro.umontreal.ca>.
5100
5104
5101 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5105 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5102 refer to @logstart (instead of @log, which doesn't exist).
5106 refer to @logstart (instead of @log, which doesn't exist).
5103
5107
5104 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5108 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5105 AttributeError crash. Thanks to Christopher Armstrong
5109 AttributeError crash. Thanks to Christopher Armstrong
5106 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5110 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5107 introduced recently (in 0.2.14pre37) with the fix to the eval
5111 introduced recently (in 0.2.14pre37) with the fix to the eval
5108 problem mentioned below.
5112 problem mentioned below.
5109
5113
5110 2002-10-17 Fernando Perez <fperez@colorado.edu>
5114 2002-10-17 Fernando Perez <fperez@colorado.edu>
5111
5115
5112 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5116 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5113 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5117 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5114
5118
5115 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5119 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5116 this function to fix a problem reported by Alex Schmolck. He saw
5120 this function to fix a problem reported by Alex Schmolck. He saw
5117 it with list comprehensions and generators, which were getting
5121 it with list comprehensions and generators, which were getting
5118 called twice. The real problem was an 'eval' call in testing for
5122 called twice. The real problem was an 'eval' call in testing for
5119 automagic which was evaluating the input line silently.
5123 automagic which was evaluating the input line silently.
5120
5124
5121 This is a potentially very nasty bug, if the input has side
5125 This is a potentially very nasty bug, if the input has side
5122 effects which must not be repeated. The code is much cleaner now,
5126 effects which must not be repeated. The code is much cleaner now,
5123 without any blanket 'except' left and with a regexp test for
5127 without any blanket 'except' left and with a regexp test for
5124 actual function names.
5128 actual function names.
5125
5129
5126 But an eval remains, which I'm not fully comfortable with. I just
5130 But an eval remains, which I'm not fully comfortable with. I just
5127 don't know how to find out if an expression could be a callable in
5131 don't know how to find out if an expression could be a callable in
5128 the user's namespace without doing an eval on the string. However
5132 the user's namespace without doing an eval on the string. However
5129 that string is now much more strictly checked so that no code
5133 that string is now much more strictly checked so that no code
5130 slips by, so the eval should only happen for things that can
5134 slips by, so the eval should only happen for things that can
5131 really be only function/method names.
5135 really be only function/method names.
5132
5136
5133 2002-10-15 Fernando Perez <fperez@colorado.edu>
5137 2002-10-15 Fernando Perez <fperez@colorado.edu>
5134
5138
5135 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5139 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5136 OSX information to main manual, removed README_Mac_OSX file from
5140 OSX information to main manual, removed README_Mac_OSX file from
5137 distribution. Also updated credits for recent additions.
5141 distribution. Also updated credits for recent additions.
5138
5142
5139 2002-10-10 Fernando Perez <fperez@colorado.edu>
5143 2002-10-10 Fernando Perez <fperez@colorado.edu>
5140
5144
5141 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5145 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5142 terminal-related issues. Many thanks to Andrea Riciputi
5146 terminal-related issues. Many thanks to Andrea Riciputi
5143 <andrea.riciputi-AT-libero.it> for writing it.
5147 <andrea.riciputi-AT-libero.it> for writing it.
5144
5148
5145 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5149 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5146 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5150 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5147
5151
5148 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5152 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5149 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5153 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5150 <syver-en-AT-online.no> who both submitted patches for this problem.
5154 <syver-en-AT-online.no> who both submitted patches for this problem.
5151
5155
5152 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5156 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5153 global embedding to make sure that things don't overwrite user
5157 global embedding to make sure that things don't overwrite user
5154 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5158 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5155
5159
5156 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5160 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5157 compatibility. Thanks to Hayden Callow
5161 compatibility. Thanks to Hayden Callow
5158 <h.callow-AT-elec.canterbury.ac.nz>
5162 <h.callow-AT-elec.canterbury.ac.nz>
5159
5163
5160 2002-10-04 Fernando Perez <fperez@colorado.edu>
5164 2002-10-04 Fernando Perez <fperez@colorado.edu>
5161
5165
5162 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5166 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5163 Gnuplot.File objects.
5167 Gnuplot.File objects.
5164
5168
5165 2002-07-23 Fernando Perez <fperez@colorado.edu>
5169 2002-07-23 Fernando Perez <fperez@colorado.edu>
5166
5170
5167 * IPython/genutils.py (timing): Added timings() and timing() for
5171 * IPython/genutils.py (timing): Added timings() and timing() for
5168 quick access to the most commonly needed data, the execution
5172 quick access to the most commonly needed data, the execution
5169 times. Old timing() renamed to timings_out().
5173 times. Old timing() renamed to timings_out().
5170
5174
5171 2002-07-18 Fernando Perez <fperez@colorado.edu>
5175 2002-07-18 Fernando Perez <fperez@colorado.edu>
5172
5176
5173 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5177 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5174 bug with nested instances disrupting the parent's tab completion.
5178 bug with nested instances disrupting the parent's tab completion.
5175
5179
5176 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5180 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5177 all_completions code to begin the emacs integration.
5181 all_completions code to begin the emacs integration.
5178
5182
5179 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5183 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5180 argument to allow titling individual arrays when plotting.
5184 argument to allow titling individual arrays when plotting.
5181
5185
5182 2002-07-15 Fernando Perez <fperez@colorado.edu>
5186 2002-07-15 Fernando Perez <fperez@colorado.edu>
5183
5187
5184 * setup.py (make_shortcut): changed to retrieve the value of
5188 * setup.py (make_shortcut): changed to retrieve the value of
5185 'Program Files' directory from the registry (this value changes in
5189 'Program Files' directory from the registry (this value changes in
5186 non-english versions of Windows). Thanks to Thomas Fanslau
5190 non-english versions of Windows). Thanks to Thomas Fanslau
5187 <tfanslau-AT-gmx.de> for the report.
5191 <tfanslau-AT-gmx.de> for the report.
5188
5192
5189 2002-07-10 Fernando Perez <fperez@colorado.edu>
5193 2002-07-10 Fernando Perez <fperez@colorado.edu>
5190
5194
5191 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5195 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5192 a bug in pdb, which crashes if a line with only whitespace is
5196 a bug in pdb, which crashes if a line with only whitespace is
5193 entered. Bug report submitted to sourceforge.
5197 entered. Bug report submitted to sourceforge.
5194
5198
5195 2002-07-09 Fernando Perez <fperez@colorado.edu>
5199 2002-07-09 Fernando Perez <fperez@colorado.edu>
5196
5200
5197 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5201 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5198 reporting exceptions (it's a bug in inspect.py, I just set a
5202 reporting exceptions (it's a bug in inspect.py, I just set a
5199 workaround).
5203 workaround).
5200
5204
5201 2002-07-08 Fernando Perez <fperez@colorado.edu>
5205 2002-07-08 Fernando Perez <fperez@colorado.edu>
5202
5206
5203 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5207 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5204 __IPYTHON__ in __builtins__ to show up in user_ns.
5208 __IPYTHON__ in __builtins__ to show up in user_ns.
5205
5209
5206 2002-07-03 Fernando Perez <fperez@colorado.edu>
5210 2002-07-03 Fernando Perez <fperez@colorado.edu>
5207
5211
5208 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5212 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5209 name from @gp_set_instance to @gp_set_default.
5213 name from @gp_set_instance to @gp_set_default.
5210
5214
5211 * IPython/ipmaker.py (make_IPython): default editor value set to
5215 * IPython/ipmaker.py (make_IPython): default editor value set to
5212 '0' (a string), to match the rc file. Otherwise will crash when
5216 '0' (a string), to match the rc file. Otherwise will crash when
5213 .strip() is called on it.
5217 .strip() is called on it.
5214
5218
5215
5219
5216 2002-06-28 Fernando Perez <fperez@colorado.edu>
5220 2002-06-28 Fernando Perez <fperez@colorado.edu>
5217
5221
5218 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5222 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5219 of files in current directory when a file is executed via
5223 of files in current directory when a file is executed via
5220 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5224 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5221
5225
5222 * setup.py (manfiles): fix for rpm builds, submitted by RA
5226 * setup.py (manfiles): fix for rpm builds, submitted by RA
5223 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5227 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5224
5228
5225 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5229 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5226 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5230 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5227 string!). A. Schmolck caught this one.
5231 string!). A. Schmolck caught this one.
5228
5232
5229 2002-06-27 Fernando Perez <fperez@colorado.edu>
5233 2002-06-27 Fernando Perez <fperez@colorado.edu>
5230
5234
5231 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5235 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5232 defined files at the cmd line. __name__ wasn't being set to
5236 defined files at the cmd line. __name__ wasn't being set to
5233 __main__.
5237 __main__.
5234
5238
5235 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5239 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5236 regular lists and tuples besides Numeric arrays.
5240 regular lists and tuples besides Numeric arrays.
5237
5241
5238 * IPython/Prompts.py (CachedOutput.__call__): Added output
5242 * IPython/Prompts.py (CachedOutput.__call__): Added output
5239 supression for input ending with ';'. Similar to Mathematica and
5243 supression for input ending with ';'. Similar to Mathematica and
5240 Matlab. The _* vars and Out[] list are still updated, just like
5244 Matlab. The _* vars and Out[] list are still updated, just like
5241 Mathematica behaves.
5245 Mathematica behaves.
5242
5246
5243 2002-06-25 Fernando Perez <fperez@colorado.edu>
5247 2002-06-25 Fernando Perez <fperez@colorado.edu>
5244
5248
5245 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5249 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5246 .ini extensions for profiels under Windows.
5250 .ini extensions for profiels under Windows.
5247
5251
5248 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5252 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5249 string form. Fix contributed by Alexander Schmolck
5253 string form. Fix contributed by Alexander Schmolck
5250 <a.schmolck-AT-gmx.net>
5254 <a.schmolck-AT-gmx.net>
5251
5255
5252 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5256 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5253 pre-configured Gnuplot instance.
5257 pre-configured Gnuplot instance.
5254
5258
5255 2002-06-21 Fernando Perez <fperez@colorado.edu>
5259 2002-06-21 Fernando Perez <fperez@colorado.edu>
5256
5260
5257 * IPython/numutils.py (exp_safe): new function, works around the
5261 * IPython/numutils.py (exp_safe): new function, works around the
5258 underflow problems in Numeric.
5262 underflow problems in Numeric.
5259 (log2): New fn. Safe log in base 2: returns exact integer answer
5263 (log2): New fn. Safe log in base 2: returns exact integer answer
5260 for exact integer powers of 2.
5264 for exact integer powers of 2.
5261
5265
5262 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5266 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5263 properly.
5267 properly.
5264
5268
5265 2002-06-20 Fernando Perez <fperez@colorado.edu>
5269 2002-06-20 Fernando Perez <fperez@colorado.edu>
5266
5270
5267 * IPython/genutils.py (timing): new function like
5271 * IPython/genutils.py (timing): new function like
5268 Mathematica's. Similar to time_test, but returns more info.
5272 Mathematica's. Similar to time_test, but returns more info.
5269
5273
5270 2002-06-18 Fernando Perez <fperez@colorado.edu>
5274 2002-06-18 Fernando Perez <fperez@colorado.edu>
5271
5275
5272 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5276 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5273 according to Mike Heeter's suggestions.
5277 according to Mike Heeter's suggestions.
5274
5278
5275 2002-06-16 Fernando Perez <fperez@colorado.edu>
5279 2002-06-16 Fernando Perez <fperez@colorado.edu>
5276
5280
5277 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5281 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5278 system. GnuplotMagic is gone as a user-directory option. New files
5282 system. GnuplotMagic is gone as a user-directory option. New files
5279 make it easier to use all the gnuplot stuff both from external
5283 make it easier to use all the gnuplot stuff both from external
5280 programs as well as from IPython. Had to rewrite part of
5284 programs as well as from IPython. Had to rewrite part of
5281 hardcopy() b/c of a strange bug: often the ps files simply don't
5285 hardcopy() b/c of a strange bug: often the ps files simply don't
5282 get created, and require a repeat of the command (often several
5286 get created, and require a repeat of the command (often several
5283 times).
5287 times).
5284
5288
5285 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5289 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5286 resolve output channel at call time, so that if sys.stderr has
5290 resolve output channel at call time, so that if sys.stderr has
5287 been redirected by user this gets honored.
5291 been redirected by user this gets honored.
5288
5292
5289 2002-06-13 Fernando Perez <fperez@colorado.edu>
5293 2002-06-13 Fernando Perez <fperez@colorado.edu>
5290
5294
5291 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5295 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5292 IPShell. Kept a copy with the old names to avoid breaking people's
5296 IPShell. Kept a copy with the old names to avoid breaking people's
5293 embedded code.
5297 embedded code.
5294
5298
5295 * IPython/ipython: simplified it to the bare minimum after
5299 * IPython/ipython: simplified it to the bare minimum after
5296 Holger's suggestions. Added info about how to use it in
5300 Holger's suggestions. Added info about how to use it in
5297 PYTHONSTARTUP.
5301 PYTHONSTARTUP.
5298
5302
5299 * IPython/Shell.py (IPythonShell): changed the options passing
5303 * IPython/Shell.py (IPythonShell): changed the options passing
5300 from a string with funky %s replacements to a straight list. Maybe
5304 from a string with funky %s replacements to a straight list. Maybe
5301 a bit more typing, but it follows sys.argv conventions, so there's
5305 a bit more typing, but it follows sys.argv conventions, so there's
5302 less special-casing to remember.
5306 less special-casing to remember.
5303
5307
5304 2002-06-12 Fernando Perez <fperez@colorado.edu>
5308 2002-06-12 Fernando Perez <fperez@colorado.edu>
5305
5309
5306 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5310 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5307 command. Thanks to a suggestion by Mike Heeter.
5311 command. Thanks to a suggestion by Mike Heeter.
5308 (Magic.magic_pfile): added behavior to look at filenames if given
5312 (Magic.magic_pfile): added behavior to look at filenames if given
5309 arg is not a defined object.
5313 arg is not a defined object.
5310 (Magic.magic_save): New @save function to save code snippets. Also
5314 (Magic.magic_save): New @save function to save code snippets. Also
5311 a Mike Heeter idea.
5315 a Mike Heeter idea.
5312
5316
5313 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5317 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5314 plot() and replot(). Much more convenient now, especially for
5318 plot() and replot(). Much more convenient now, especially for
5315 interactive use.
5319 interactive use.
5316
5320
5317 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5321 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5318 filenames.
5322 filenames.
5319
5323
5320 2002-06-02 Fernando Perez <fperez@colorado.edu>
5324 2002-06-02 Fernando Perez <fperez@colorado.edu>
5321
5325
5322 * IPython/Struct.py (Struct.__init__): modified to admit
5326 * IPython/Struct.py (Struct.__init__): modified to admit
5323 initialization via another struct.
5327 initialization via another struct.
5324
5328
5325 * IPython/genutils.py (SystemExec.__init__): New stateful
5329 * IPython/genutils.py (SystemExec.__init__): New stateful
5326 interface to xsys and bq. Useful for writing system scripts.
5330 interface to xsys and bq. Useful for writing system scripts.
5327
5331
5328 2002-05-30 Fernando Perez <fperez@colorado.edu>
5332 2002-05-30 Fernando Perez <fperez@colorado.edu>
5329
5333
5330 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5334 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5331 documents. This will make the user download smaller (it's getting
5335 documents. This will make the user download smaller (it's getting
5332 too big).
5336 too big).
5333
5337
5334 2002-05-29 Fernando Perez <fperez@colorado.edu>
5338 2002-05-29 Fernando Perez <fperez@colorado.edu>
5335
5339
5336 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5340 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5337 fix problems with shelve and pickle. Seems to work, but I don't
5341 fix problems with shelve and pickle. Seems to work, but I don't
5338 know if corner cases break it. Thanks to Mike Heeter
5342 know if corner cases break it. Thanks to Mike Heeter
5339 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5343 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5340
5344
5341 2002-05-24 Fernando Perez <fperez@colorado.edu>
5345 2002-05-24 Fernando Perez <fperez@colorado.edu>
5342
5346
5343 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5347 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5344 macros having broken.
5348 macros having broken.
5345
5349
5346 2002-05-21 Fernando Perez <fperez@colorado.edu>
5350 2002-05-21 Fernando Perez <fperez@colorado.edu>
5347
5351
5348 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5352 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5349 introduced logging bug: all history before logging started was
5353 introduced logging bug: all history before logging started was
5350 being written one character per line! This came from the redesign
5354 being written one character per line! This came from the redesign
5351 of the input history as a special list which slices to strings,
5355 of the input history as a special list which slices to strings,
5352 not to lists.
5356 not to lists.
5353
5357
5354 2002-05-20 Fernando Perez <fperez@colorado.edu>
5358 2002-05-20 Fernando Perez <fperez@colorado.edu>
5355
5359
5356 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5360 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5357 be an attribute of all classes in this module. The design of these
5361 be an attribute of all classes in this module. The design of these
5358 classes needs some serious overhauling.
5362 classes needs some serious overhauling.
5359
5363
5360 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5364 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5361 which was ignoring '_' in option names.
5365 which was ignoring '_' in option names.
5362
5366
5363 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5367 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5364 'Verbose_novars' to 'Context' and made it the new default. It's a
5368 'Verbose_novars' to 'Context' and made it the new default. It's a
5365 bit more readable and also safer than verbose.
5369 bit more readable and also safer than verbose.
5366
5370
5367 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5371 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5368 triple-quoted strings.
5372 triple-quoted strings.
5369
5373
5370 * IPython/OInspect.py (__all__): new module exposing the object
5374 * IPython/OInspect.py (__all__): new module exposing the object
5371 introspection facilities. Now the corresponding magics are dummy
5375 introspection facilities. Now the corresponding magics are dummy
5372 wrappers around this. Having this module will make it much easier
5376 wrappers around this. Having this module will make it much easier
5373 to put these functions into our modified pdb.
5377 to put these functions into our modified pdb.
5374 This new object inspector system uses the new colorizing module,
5378 This new object inspector system uses the new colorizing module,
5375 so source code and other things are nicely syntax highlighted.
5379 so source code and other things are nicely syntax highlighted.
5376
5380
5377 2002-05-18 Fernando Perez <fperez@colorado.edu>
5381 2002-05-18 Fernando Perez <fperez@colorado.edu>
5378
5382
5379 * IPython/ColorANSI.py: Split the coloring tools into a separate
5383 * IPython/ColorANSI.py: Split the coloring tools into a separate
5380 module so I can use them in other code easier (they were part of
5384 module so I can use them in other code easier (they were part of
5381 ultraTB).
5385 ultraTB).
5382
5386
5383 2002-05-17 Fernando Perez <fperez@colorado.edu>
5387 2002-05-17 Fernando Perez <fperez@colorado.edu>
5384
5388
5385 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5389 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5386 fixed it to set the global 'g' also to the called instance, as
5390 fixed it to set the global 'g' also to the called instance, as
5387 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5391 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5388 user's 'g' variables).
5392 user's 'g' variables).
5389
5393
5390 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5394 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5391 global variables (aliases to _ih,_oh) so that users which expect
5395 global variables (aliases to _ih,_oh) so that users which expect
5392 In[5] or Out[7] to work aren't unpleasantly surprised.
5396 In[5] or Out[7] to work aren't unpleasantly surprised.
5393 (InputList.__getslice__): new class to allow executing slices of
5397 (InputList.__getslice__): new class to allow executing slices of
5394 input history directly. Very simple class, complements the use of
5398 input history directly. Very simple class, complements the use of
5395 macros.
5399 macros.
5396
5400
5397 2002-05-16 Fernando Perez <fperez@colorado.edu>
5401 2002-05-16 Fernando Perez <fperez@colorado.edu>
5398
5402
5399 * setup.py (docdirbase): make doc directory be just doc/IPython
5403 * setup.py (docdirbase): make doc directory be just doc/IPython
5400 without version numbers, it will reduce clutter for users.
5404 without version numbers, it will reduce clutter for users.
5401
5405
5402 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5406 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5403 execfile call to prevent possible memory leak. See for details:
5407 execfile call to prevent possible memory leak. See for details:
5404 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5408 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5405
5409
5406 2002-05-15 Fernando Perez <fperez@colorado.edu>
5410 2002-05-15 Fernando Perez <fperez@colorado.edu>
5407
5411
5408 * IPython/Magic.py (Magic.magic_psource): made the object
5412 * IPython/Magic.py (Magic.magic_psource): made the object
5409 introspection names be more standard: pdoc, pdef, pfile and
5413 introspection names be more standard: pdoc, pdef, pfile and
5410 psource. They all print/page their output, and it makes
5414 psource. They all print/page their output, and it makes
5411 remembering them easier. Kept old names for compatibility as
5415 remembering them easier. Kept old names for compatibility as
5412 aliases.
5416 aliases.
5413
5417
5414 2002-05-14 Fernando Perez <fperez@colorado.edu>
5418 2002-05-14 Fernando Perez <fperez@colorado.edu>
5415
5419
5416 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5420 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5417 what the mouse problem was. The trick is to use gnuplot with temp
5421 what the mouse problem was. The trick is to use gnuplot with temp
5418 files and NOT with pipes (for data communication), because having
5422 files and NOT with pipes (for data communication), because having
5419 both pipes and the mouse on is bad news.
5423 both pipes and the mouse on is bad news.
5420
5424
5421 2002-05-13 Fernando Perez <fperez@colorado.edu>
5425 2002-05-13 Fernando Perez <fperez@colorado.edu>
5422
5426
5423 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5427 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5424 bug. Information would be reported about builtins even when
5428 bug. Information would be reported about builtins even when
5425 user-defined functions overrode them.
5429 user-defined functions overrode them.
5426
5430
5427 2002-05-11 Fernando Perez <fperez@colorado.edu>
5431 2002-05-11 Fernando Perez <fperez@colorado.edu>
5428
5432
5429 * IPython/__init__.py (__all__): removed FlexCompleter from
5433 * IPython/__init__.py (__all__): removed FlexCompleter from
5430 __all__ so that things don't fail in platforms without readline.
5434 __all__ so that things don't fail in platforms without readline.
5431
5435
5432 2002-05-10 Fernando Perez <fperez@colorado.edu>
5436 2002-05-10 Fernando Perez <fperez@colorado.edu>
5433
5437
5434 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5438 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5435 it requires Numeric, effectively making Numeric a dependency for
5439 it requires Numeric, effectively making Numeric a dependency for
5436 IPython.
5440 IPython.
5437
5441
5438 * Released 0.2.13
5442 * Released 0.2.13
5439
5443
5440 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5444 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5441 profiler interface. Now all the major options from the profiler
5445 profiler interface. Now all the major options from the profiler
5442 module are directly supported in IPython, both for single
5446 module are directly supported in IPython, both for single
5443 expressions (@prun) and for full programs (@run -p).
5447 expressions (@prun) and for full programs (@run -p).
5444
5448
5445 2002-05-09 Fernando Perez <fperez@colorado.edu>
5449 2002-05-09 Fernando Perez <fperez@colorado.edu>
5446
5450
5447 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5451 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5448 magic properly formatted for screen.
5452 magic properly formatted for screen.
5449
5453
5450 * setup.py (make_shortcut): Changed things to put pdf version in
5454 * setup.py (make_shortcut): Changed things to put pdf version in
5451 doc/ instead of doc/manual (had to change lyxport a bit).
5455 doc/ instead of doc/manual (had to change lyxport a bit).
5452
5456
5453 * IPython/Magic.py (Profile.string_stats): made profile runs go
5457 * IPython/Magic.py (Profile.string_stats): made profile runs go
5454 through pager (they are long and a pager allows searching, saving,
5458 through pager (they are long and a pager allows searching, saving,
5455 etc.)
5459 etc.)
5456
5460
5457 2002-05-08 Fernando Perez <fperez@colorado.edu>
5461 2002-05-08 Fernando Perez <fperez@colorado.edu>
5458
5462
5459 * Released 0.2.12
5463 * Released 0.2.12
5460
5464
5461 2002-05-06 Fernando Perez <fperez@colorado.edu>
5465 2002-05-06 Fernando Perez <fperez@colorado.edu>
5462
5466
5463 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5467 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5464 introduced); 'hist n1 n2' was broken.
5468 introduced); 'hist n1 n2' was broken.
5465 (Magic.magic_pdb): added optional on/off arguments to @pdb
5469 (Magic.magic_pdb): added optional on/off arguments to @pdb
5466 (Magic.magic_run): added option -i to @run, which executes code in
5470 (Magic.magic_run): added option -i to @run, which executes code in
5467 the IPython namespace instead of a clean one. Also added @irun as
5471 the IPython namespace instead of a clean one. Also added @irun as
5468 an alias to @run -i.
5472 an alias to @run -i.
5469
5473
5470 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5474 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5471 fixed (it didn't really do anything, the namespaces were wrong).
5475 fixed (it didn't really do anything, the namespaces were wrong).
5472
5476
5473 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5477 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5474
5478
5475 * IPython/__init__.py (__all__): Fixed package namespace, now
5479 * IPython/__init__.py (__all__): Fixed package namespace, now
5476 'import IPython' does give access to IPython.<all> as
5480 'import IPython' does give access to IPython.<all> as
5477 expected. Also renamed __release__ to Release.
5481 expected. Also renamed __release__ to Release.
5478
5482
5479 * IPython/Debugger.py (__license__): created new Pdb class which
5483 * IPython/Debugger.py (__license__): created new Pdb class which
5480 functions like a drop-in for the normal pdb.Pdb but does NOT
5484 functions like a drop-in for the normal pdb.Pdb but does NOT
5481 import readline by default. This way it doesn't muck up IPython's
5485 import readline by default. This way it doesn't muck up IPython's
5482 readline handling, and now tab-completion finally works in the
5486 readline handling, and now tab-completion finally works in the
5483 debugger -- sort of. It completes things globally visible, but the
5487 debugger -- sort of. It completes things globally visible, but the
5484 completer doesn't track the stack as pdb walks it. That's a bit
5488 completer doesn't track the stack as pdb walks it. That's a bit
5485 tricky, and I'll have to implement it later.
5489 tricky, and I'll have to implement it later.
5486
5490
5487 2002-05-05 Fernando Perez <fperez@colorado.edu>
5491 2002-05-05 Fernando Perez <fperez@colorado.edu>
5488
5492
5489 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5493 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5490 magic docstrings when printed via ? (explicit \'s were being
5494 magic docstrings when printed via ? (explicit \'s were being
5491 printed).
5495 printed).
5492
5496
5493 * IPython/ipmaker.py (make_IPython): fixed namespace
5497 * IPython/ipmaker.py (make_IPython): fixed namespace
5494 identification bug. Now variables loaded via logs or command-line
5498 identification bug. Now variables loaded via logs or command-line
5495 files are recognized in the interactive namespace by @who.
5499 files are recognized in the interactive namespace by @who.
5496
5500
5497 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5501 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5498 log replay system stemming from the string form of Structs.
5502 log replay system stemming from the string form of Structs.
5499
5503
5500 * IPython/Magic.py (Macro.__init__): improved macros to properly
5504 * IPython/Magic.py (Macro.__init__): improved macros to properly
5501 handle magic commands in them.
5505 handle magic commands in them.
5502 (Magic.magic_logstart): usernames are now expanded so 'logstart
5506 (Magic.magic_logstart): usernames are now expanded so 'logstart
5503 ~/mylog' now works.
5507 ~/mylog' now works.
5504
5508
5505 * IPython/iplib.py (complete): fixed bug where paths starting with
5509 * IPython/iplib.py (complete): fixed bug where paths starting with
5506 '/' would be completed as magic names.
5510 '/' would be completed as magic names.
5507
5511
5508 2002-05-04 Fernando Perez <fperez@colorado.edu>
5512 2002-05-04 Fernando Perez <fperez@colorado.edu>
5509
5513
5510 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5514 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5511 allow running full programs under the profiler's control.
5515 allow running full programs under the profiler's control.
5512
5516
5513 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5517 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5514 mode to report exceptions verbosely but without formatting
5518 mode to report exceptions verbosely but without formatting
5515 variables. This addresses the issue of ipython 'freezing' (it's
5519 variables. This addresses the issue of ipython 'freezing' (it's
5516 not frozen, but caught in an expensive formatting loop) when huge
5520 not frozen, but caught in an expensive formatting loop) when huge
5517 variables are in the context of an exception.
5521 variables are in the context of an exception.
5518 (VerboseTB.text): Added '--->' markers at line where exception was
5522 (VerboseTB.text): Added '--->' markers at line where exception was
5519 triggered. Much clearer to read, especially in NoColor modes.
5523 triggered. Much clearer to read, especially in NoColor modes.
5520
5524
5521 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5525 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5522 implemented in reverse when changing to the new parse_options().
5526 implemented in reverse when changing to the new parse_options().
5523
5527
5524 2002-05-03 Fernando Perez <fperez@colorado.edu>
5528 2002-05-03 Fernando Perez <fperez@colorado.edu>
5525
5529
5526 * IPython/Magic.py (Magic.parse_options): new function so that
5530 * IPython/Magic.py (Magic.parse_options): new function so that
5527 magics can parse options easier.
5531 magics can parse options easier.
5528 (Magic.magic_prun): new function similar to profile.run(),
5532 (Magic.magic_prun): new function similar to profile.run(),
5529 suggested by Chris Hart.
5533 suggested by Chris Hart.
5530 (Magic.magic_cd): fixed behavior so that it only changes if
5534 (Magic.magic_cd): fixed behavior so that it only changes if
5531 directory actually is in history.
5535 directory actually is in history.
5532
5536
5533 * IPython/usage.py (__doc__): added information about potential
5537 * IPython/usage.py (__doc__): added information about potential
5534 slowness of Verbose exception mode when there are huge data
5538 slowness of Verbose exception mode when there are huge data
5535 structures to be formatted (thanks to Archie Paulson).
5539 structures to be formatted (thanks to Archie Paulson).
5536
5540
5537 * IPython/ipmaker.py (make_IPython): Changed default logging
5541 * IPython/ipmaker.py (make_IPython): Changed default logging
5538 (when simply called with -log) to use curr_dir/ipython.log in
5542 (when simply called with -log) to use curr_dir/ipython.log in
5539 rotate mode. Fixed crash which was occuring with -log before
5543 rotate mode. Fixed crash which was occuring with -log before
5540 (thanks to Jim Boyle).
5544 (thanks to Jim Boyle).
5541
5545
5542 2002-05-01 Fernando Perez <fperez@colorado.edu>
5546 2002-05-01 Fernando Perez <fperez@colorado.edu>
5543
5547
5544 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5548 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5545 was nasty -- though somewhat of a corner case).
5549 was nasty -- though somewhat of a corner case).
5546
5550
5547 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5551 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5548 text (was a bug).
5552 text (was a bug).
5549
5553
5550 2002-04-30 Fernando Perez <fperez@colorado.edu>
5554 2002-04-30 Fernando Perez <fperez@colorado.edu>
5551
5555
5552 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5556 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5553 a print after ^D or ^C from the user so that the In[] prompt
5557 a print after ^D or ^C from the user so that the In[] prompt
5554 doesn't over-run the gnuplot one.
5558 doesn't over-run the gnuplot one.
5555
5559
5556 2002-04-29 Fernando Perez <fperez@colorado.edu>
5560 2002-04-29 Fernando Perez <fperez@colorado.edu>
5557
5561
5558 * Released 0.2.10
5562 * Released 0.2.10
5559
5563
5560 * IPython/__release__.py (version): get date dynamically.
5564 * IPython/__release__.py (version): get date dynamically.
5561
5565
5562 * Misc. documentation updates thanks to Arnd's comments. Also ran
5566 * Misc. documentation updates thanks to Arnd's comments. Also ran
5563 a full spellcheck on the manual (hadn't been done in a while).
5567 a full spellcheck on the manual (hadn't been done in a while).
5564
5568
5565 2002-04-27 Fernando Perez <fperez@colorado.edu>
5569 2002-04-27 Fernando Perez <fperez@colorado.edu>
5566
5570
5567 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5571 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5568 starting a log in mid-session would reset the input history list.
5572 starting a log in mid-session would reset the input history list.
5569
5573
5570 2002-04-26 Fernando Perez <fperez@colorado.edu>
5574 2002-04-26 Fernando Perez <fperez@colorado.edu>
5571
5575
5572 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5576 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5573 all files were being included in an update. Now anything in
5577 all files were being included in an update. Now anything in
5574 UserConfig that matches [A-Za-z]*.py will go (this excludes
5578 UserConfig that matches [A-Za-z]*.py will go (this excludes
5575 __init__.py)
5579 __init__.py)
5576
5580
5577 2002-04-25 Fernando Perez <fperez@colorado.edu>
5581 2002-04-25 Fernando Perez <fperez@colorado.edu>
5578
5582
5579 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5583 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5580 to __builtins__ so that any form of embedded or imported code can
5584 to __builtins__ so that any form of embedded or imported code can
5581 test for being inside IPython.
5585 test for being inside IPython.
5582
5586
5583 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5587 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5584 changed to GnuplotMagic because it's now an importable module,
5588 changed to GnuplotMagic because it's now an importable module,
5585 this makes the name follow that of the standard Gnuplot module.
5589 this makes the name follow that of the standard Gnuplot module.
5586 GnuplotMagic can now be loaded at any time in mid-session.
5590 GnuplotMagic can now be loaded at any time in mid-session.
5587
5591
5588 2002-04-24 Fernando Perez <fperez@colorado.edu>
5592 2002-04-24 Fernando Perez <fperez@colorado.edu>
5589
5593
5590 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5594 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5591 the globals (IPython has its own namespace) and the
5595 the globals (IPython has its own namespace) and the
5592 PhysicalQuantity stuff is much better anyway.
5596 PhysicalQuantity stuff is much better anyway.
5593
5597
5594 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5598 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5595 embedding example to standard user directory for
5599 embedding example to standard user directory for
5596 distribution. Also put it in the manual.
5600 distribution. Also put it in the manual.
5597
5601
5598 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5602 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5599 instance as first argument (so it doesn't rely on some obscure
5603 instance as first argument (so it doesn't rely on some obscure
5600 hidden global).
5604 hidden global).
5601
5605
5602 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5606 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5603 delimiters. While it prevents ().TAB from working, it allows
5607 delimiters. While it prevents ().TAB from working, it allows
5604 completions in open (... expressions. This is by far a more common
5608 completions in open (... expressions. This is by far a more common
5605 case.
5609 case.
5606
5610
5607 2002-04-23 Fernando Perez <fperez@colorado.edu>
5611 2002-04-23 Fernando Perez <fperez@colorado.edu>
5608
5612
5609 * IPython/Extensions/InterpreterPasteInput.py: new
5613 * IPython/Extensions/InterpreterPasteInput.py: new
5610 syntax-processing module for pasting lines with >>> or ... at the
5614 syntax-processing module for pasting lines with >>> or ... at the
5611 start.
5615 start.
5612
5616
5613 * IPython/Extensions/PhysicalQ_Interactive.py
5617 * IPython/Extensions/PhysicalQ_Interactive.py
5614 (PhysicalQuantityInteractive.__int__): fixed to work with either
5618 (PhysicalQuantityInteractive.__int__): fixed to work with either
5615 Numeric or math.
5619 Numeric or math.
5616
5620
5617 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5621 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5618 provided profiles. Now we have:
5622 provided profiles. Now we have:
5619 -math -> math module as * and cmath with its own namespace.
5623 -math -> math module as * and cmath with its own namespace.
5620 -numeric -> Numeric as *, plus gnuplot & grace
5624 -numeric -> Numeric as *, plus gnuplot & grace
5621 -physics -> same as before
5625 -physics -> same as before
5622
5626
5623 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5627 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5624 user-defined magics wouldn't be found by @magic if they were
5628 user-defined magics wouldn't be found by @magic if they were
5625 defined as class methods. Also cleaned up the namespace search
5629 defined as class methods. Also cleaned up the namespace search
5626 logic and the string building (to use %s instead of many repeated
5630 logic and the string building (to use %s instead of many repeated
5627 string adds).
5631 string adds).
5628
5632
5629 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5633 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5630 of user-defined magics to operate with class methods (cleaner, in
5634 of user-defined magics to operate with class methods (cleaner, in
5631 line with the gnuplot code).
5635 line with the gnuplot code).
5632
5636
5633 2002-04-22 Fernando Perez <fperez@colorado.edu>
5637 2002-04-22 Fernando Perez <fperez@colorado.edu>
5634
5638
5635 * setup.py: updated dependency list so that manual is updated when
5639 * setup.py: updated dependency list so that manual is updated when
5636 all included files change.
5640 all included files change.
5637
5641
5638 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5642 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5639 the delimiter removal option (the fix is ugly right now).
5643 the delimiter removal option (the fix is ugly right now).
5640
5644
5641 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5645 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5642 all of the math profile (quicker loading, no conflict between
5646 all of the math profile (quicker loading, no conflict between
5643 g-9.8 and g-gnuplot).
5647 g-9.8 and g-gnuplot).
5644
5648
5645 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5649 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5646 name of post-mortem files to IPython_crash_report.txt.
5650 name of post-mortem files to IPython_crash_report.txt.
5647
5651
5648 * Cleanup/update of the docs. Added all the new readline info and
5652 * Cleanup/update of the docs. Added all the new readline info and
5649 formatted all lists as 'real lists'.
5653 formatted all lists as 'real lists'.
5650
5654
5651 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5655 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5652 tab-completion options, since the full readline parse_and_bind is
5656 tab-completion options, since the full readline parse_and_bind is
5653 now accessible.
5657 now accessible.
5654
5658
5655 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5659 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5656 handling of readline options. Now users can specify any string to
5660 handling of readline options. Now users can specify any string to
5657 be passed to parse_and_bind(), as well as the delimiters to be
5661 be passed to parse_and_bind(), as well as the delimiters to be
5658 removed.
5662 removed.
5659 (InteractiveShell.__init__): Added __name__ to the global
5663 (InteractiveShell.__init__): Added __name__ to the global
5660 namespace so that things like Itpl which rely on its existence
5664 namespace so that things like Itpl which rely on its existence
5661 don't crash.
5665 don't crash.
5662 (InteractiveShell._prefilter): Defined the default with a _ so
5666 (InteractiveShell._prefilter): Defined the default with a _ so
5663 that prefilter() is easier to override, while the default one
5667 that prefilter() is easier to override, while the default one
5664 remains available.
5668 remains available.
5665
5669
5666 2002-04-18 Fernando Perez <fperez@colorado.edu>
5670 2002-04-18 Fernando Perez <fperez@colorado.edu>
5667
5671
5668 * Added information about pdb in the docs.
5672 * Added information about pdb in the docs.
5669
5673
5670 2002-04-17 Fernando Perez <fperez@colorado.edu>
5674 2002-04-17 Fernando Perez <fperez@colorado.edu>
5671
5675
5672 * IPython/ipmaker.py (make_IPython): added rc_override option to
5676 * IPython/ipmaker.py (make_IPython): added rc_override option to
5673 allow passing config options at creation time which may override
5677 allow passing config options at creation time which may override
5674 anything set in the config files or command line. This is
5678 anything set in the config files or command line. This is
5675 particularly useful for configuring embedded instances.
5679 particularly useful for configuring embedded instances.
5676
5680
5677 2002-04-15 Fernando Perez <fperez@colorado.edu>
5681 2002-04-15 Fernando Perez <fperez@colorado.edu>
5678
5682
5679 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5683 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5680 crash embedded instances because of the input cache falling out of
5684 crash embedded instances because of the input cache falling out of
5681 sync with the output counter.
5685 sync with the output counter.
5682
5686
5683 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5687 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5684 mode which calls pdb after an uncaught exception in IPython itself.
5688 mode which calls pdb after an uncaught exception in IPython itself.
5685
5689
5686 2002-04-14 Fernando Perez <fperez@colorado.edu>
5690 2002-04-14 Fernando Perez <fperez@colorado.edu>
5687
5691
5688 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5692 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5689 readline, fix it back after each call.
5693 readline, fix it back after each call.
5690
5694
5691 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5695 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5692 method to force all access via __call__(), which guarantees that
5696 method to force all access via __call__(), which guarantees that
5693 traceback references are properly deleted.
5697 traceback references are properly deleted.
5694
5698
5695 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5699 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5696 improve printing when pprint is in use.
5700 improve printing when pprint is in use.
5697
5701
5698 2002-04-13 Fernando Perez <fperez@colorado.edu>
5702 2002-04-13 Fernando Perez <fperez@colorado.edu>
5699
5703
5700 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5704 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5701 exceptions aren't caught anymore. If the user triggers one, he
5705 exceptions aren't caught anymore. If the user triggers one, he
5702 should know why he's doing it and it should go all the way up,
5706 should know why he's doing it and it should go all the way up,
5703 just like any other exception. So now @abort will fully kill the
5707 just like any other exception. So now @abort will fully kill the
5704 embedded interpreter and the embedding code (unless that happens
5708 embedded interpreter and the embedding code (unless that happens
5705 to catch SystemExit).
5709 to catch SystemExit).
5706
5710
5707 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5711 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5708 and a debugger() method to invoke the interactive pdb debugger
5712 and a debugger() method to invoke the interactive pdb debugger
5709 after printing exception information. Also added the corresponding
5713 after printing exception information. Also added the corresponding
5710 -pdb option and @pdb magic to control this feature, and updated
5714 -pdb option and @pdb magic to control this feature, and updated
5711 the docs. After a suggestion from Christopher Hart
5715 the docs. After a suggestion from Christopher Hart
5712 (hart-AT-caltech.edu).
5716 (hart-AT-caltech.edu).
5713
5717
5714 2002-04-12 Fernando Perez <fperez@colorado.edu>
5718 2002-04-12 Fernando Perez <fperez@colorado.edu>
5715
5719
5716 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5720 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5717 the exception handlers defined by the user (not the CrashHandler)
5721 the exception handlers defined by the user (not the CrashHandler)
5718 so that user exceptions don't trigger an ipython bug report.
5722 so that user exceptions don't trigger an ipython bug report.
5719
5723
5720 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5724 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5721 configurable (it should have always been so).
5725 configurable (it should have always been so).
5722
5726
5723 2002-03-26 Fernando Perez <fperez@colorado.edu>
5727 2002-03-26 Fernando Perez <fperez@colorado.edu>
5724
5728
5725 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5729 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5726 and there to fix embedding namespace issues. This should all be
5730 and there to fix embedding namespace issues. This should all be
5727 done in a more elegant way.
5731 done in a more elegant way.
5728
5732
5729 2002-03-25 Fernando Perez <fperez@colorado.edu>
5733 2002-03-25 Fernando Perez <fperez@colorado.edu>
5730
5734
5731 * IPython/genutils.py (get_home_dir): Try to make it work under
5735 * IPython/genutils.py (get_home_dir): Try to make it work under
5732 win9x also.
5736 win9x also.
5733
5737
5734 2002-03-20 Fernando Perez <fperez@colorado.edu>
5738 2002-03-20 Fernando Perez <fperez@colorado.edu>
5735
5739
5736 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5740 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5737 sys.displayhook untouched upon __init__.
5741 sys.displayhook untouched upon __init__.
5738
5742
5739 2002-03-19 Fernando Perez <fperez@colorado.edu>
5743 2002-03-19 Fernando Perez <fperez@colorado.edu>
5740
5744
5741 * Released 0.2.9 (for embedding bug, basically).
5745 * Released 0.2.9 (for embedding bug, basically).
5742
5746
5743 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5747 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5744 exceptions so that enclosing shell's state can be restored.
5748 exceptions so that enclosing shell's state can be restored.
5745
5749
5746 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5750 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5747 naming conventions in the .ipython/ dir.
5751 naming conventions in the .ipython/ dir.
5748
5752
5749 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5753 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5750 from delimiters list so filenames with - in them get expanded.
5754 from delimiters list so filenames with - in them get expanded.
5751
5755
5752 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5756 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5753 sys.displayhook not being properly restored after an embedded call.
5757 sys.displayhook not being properly restored after an embedded call.
5754
5758
5755 2002-03-18 Fernando Perez <fperez@colorado.edu>
5759 2002-03-18 Fernando Perez <fperez@colorado.edu>
5756
5760
5757 * Released 0.2.8
5761 * Released 0.2.8
5758
5762
5759 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5763 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5760 some files weren't being included in a -upgrade.
5764 some files weren't being included in a -upgrade.
5761 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5765 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5762 on' so that the first tab completes.
5766 on' so that the first tab completes.
5763 (InteractiveShell.handle_magic): fixed bug with spaces around
5767 (InteractiveShell.handle_magic): fixed bug with spaces around
5764 quotes breaking many magic commands.
5768 quotes breaking many magic commands.
5765
5769
5766 * setup.py: added note about ignoring the syntax error messages at
5770 * setup.py: added note about ignoring the syntax error messages at
5767 installation.
5771 installation.
5768
5772
5769 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5773 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5770 streamlining the gnuplot interface, now there's only one magic @gp.
5774 streamlining the gnuplot interface, now there's only one magic @gp.
5771
5775
5772 2002-03-17 Fernando Perez <fperez@colorado.edu>
5776 2002-03-17 Fernando Perez <fperez@colorado.edu>
5773
5777
5774 * IPython/UserConfig/magic_gnuplot.py: new name for the
5778 * IPython/UserConfig/magic_gnuplot.py: new name for the
5775 example-magic_pm.py file. Much enhanced system, now with a shell
5779 example-magic_pm.py file. Much enhanced system, now with a shell
5776 for communicating directly with gnuplot, one command at a time.
5780 for communicating directly with gnuplot, one command at a time.
5777
5781
5778 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5782 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5779 setting __name__=='__main__'.
5783 setting __name__=='__main__'.
5780
5784
5781 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5785 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5782 mini-shell for accessing gnuplot from inside ipython. Should
5786 mini-shell for accessing gnuplot from inside ipython. Should
5783 extend it later for grace access too. Inspired by Arnd's
5787 extend it later for grace access too. Inspired by Arnd's
5784 suggestion.
5788 suggestion.
5785
5789
5786 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5790 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5787 calling magic functions with () in their arguments. Thanks to Arnd
5791 calling magic functions with () in their arguments. Thanks to Arnd
5788 Baecker for pointing this to me.
5792 Baecker for pointing this to me.
5789
5793
5790 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5794 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5791 infinitely for integer or complex arrays (only worked with floats).
5795 infinitely for integer or complex arrays (only worked with floats).
5792
5796
5793 2002-03-16 Fernando Perez <fperez@colorado.edu>
5797 2002-03-16 Fernando Perez <fperez@colorado.edu>
5794
5798
5795 * setup.py: Merged setup and setup_windows into a single script
5799 * setup.py: Merged setup and setup_windows into a single script
5796 which properly handles things for windows users.
5800 which properly handles things for windows users.
5797
5801
5798 2002-03-15 Fernando Perez <fperez@colorado.edu>
5802 2002-03-15 Fernando Perez <fperez@colorado.edu>
5799
5803
5800 * Big change to the manual: now the magics are all automatically
5804 * Big change to the manual: now the magics are all automatically
5801 documented. This information is generated from their docstrings
5805 documented. This information is generated from their docstrings
5802 and put in a latex file included by the manual lyx file. This way
5806 and put in a latex file included by the manual lyx file. This way
5803 we get always up to date information for the magics. The manual
5807 we get always up to date information for the magics. The manual
5804 now also has proper version information, also auto-synced.
5808 now also has proper version information, also auto-synced.
5805
5809
5806 For this to work, an undocumented --magic_docstrings option was added.
5810 For this to work, an undocumented --magic_docstrings option was added.
5807
5811
5808 2002-03-13 Fernando Perez <fperez@colorado.edu>
5812 2002-03-13 Fernando Perez <fperez@colorado.edu>
5809
5813
5810 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5814 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5811 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5815 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5812
5816
5813 2002-03-12 Fernando Perez <fperez@colorado.edu>
5817 2002-03-12 Fernando Perez <fperez@colorado.edu>
5814
5818
5815 * IPython/ultraTB.py (TermColors): changed color escapes again to
5819 * IPython/ultraTB.py (TermColors): changed color escapes again to
5816 fix the (old, reintroduced) line-wrapping bug. Basically, if
5820 fix the (old, reintroduced) line-wrapping bug. Basically, if
5817 \001..\002 aren't given in the color escapes, lines get wrapped
5821 \001..\002 aren't given in the color escapes, lines get wrapped
5818 weirdly. But giving those screws up old xterms and emacs terms. So
5822 weirdly. But giving those screws up old xterms and emacs terms. So
5819 I added some logic for emacs terms to be ok, but I can't identify old
5823 I added some logic for emacs terms to be ok, but I can't identify old
5820 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5824 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5821
5825
5822 2002-03-10 Fernando Perez <fperez@colorado.edu>
5826 2002-03-10 Fernando Perez <fperez@colorado.edu>
5823
5827
5824 * IPython/usage.py (__doc__): Various documentation cleanups and
5828 * IPython/usage.py (__doc__): Various documentation cleanups and
5825 updates, both in usage docstrings and in the manual.
5829 updates, both in usage docstrings and in the manual.
5826
5830
5827 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5831 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5828 handling of caching. Set minimum acceptabe value for having a
5832 handling of caching. Set minimum acceptabe value for having a
5829 cache at 20 values.
5833 cache at 20 values.
5830
5834
5831 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5835 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5832 install_first_time function to a method, renamed it and added an
5836 install_first_time function to a method, renamed it and added an
5833 'upgrade' mode. Now people can update their config directory with
5837 'upgrade' mode. Now people can update their config directory with
5834 a simple command line switch (-upgrade, also new).
5838 a simple command line switch (-upgrade, also new).
5835
5839
5836 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5840 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5837 @file (convenient for automagic users under Python >= 2.2).
5841 @file (convenient for automagic users under Python >= 2.2).
5838 Removed @files (it seemed more like a plural than an abbrev. of
5842 Removed @files (it seemed more like a plural than an abbrev. of
5839 'file show').
5843 'file show').
5840
5844
5841 * IPython/iplib.py (install_first_time): Fixed crash if there were
5845 * IPython/iplib.py (install_first_time): Fixed crash if there were
5842 backup files ('~') in .ipython/ install directory.
5846 backup files ('~') in .ipython/ install directory.
5843
5847
5844 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5848 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5845 system. Things look fine, but these changes are fairly
5849 system. Things look fine, but these changes are fairly
5846 intrusive. Test them for a few days.
5850 intrusive. Test them for a few days.
5847
5851
5848 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5852 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5849 the prompts system. Now all in/out prompt strings are user
5853 the prompts system. Now all in/out prompt strings are user
5850 controllable. This is particularly useful for embedding, as one
5854 controllable. This is particularly useful for embedding, as one
5851 can tag embedded instances with particular prompts.
5855 can tag embedded instances with particular prompts.
5852
5856
5853 Also removed global use of sys.ps1/2, which now allows nested
5857 Also removed global use of sys.ps1/2, which now allows nested
5854 embeddings without any problems. Added command-line options for
5858 embeddings without any problems. Added command-line options for
5855 the prompt strings.
5859 the prompt strings.
5856
5860
5857 2002-03-08 Fernando Perez <fperez@colorado.edu>
5861 2002-03-08 Fernando Perez <fperez@colorado.edu>
5858
5862
5859 * IPython/UserConfig/example-embed-short.py (ipshell): added
5863 * IPython/UserConfig/example-embed-short.py (ipshell): added
5860 example file with the bare minimum code for embedding.
5864 example file with the bare minimum code for embedding.
5861
5865
5862 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5866 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5863 functionality for the embeddable shell to be activated/deactivated
5867 functionality for the embeddable shell to be activated/deactivated
5864 either globally or at each call.
5868 either globally or at each call.
5865
5869
5866 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5870 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5867 rewriting the prompt with '--->' for auto-inputs with proper
5871 rewriting the prompt with '--->' for auto-inputs with proper
5868 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5872 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5869 this is handled by the prompts class itself, as it should.
5873 this is handled by the prompts class itself, as it should.
5870
5874
5871 2002-03-05 Fernando Perez <fperez@colorado.edu>
5875 2002-03-05 Fernando Perez <fperez@colorado.edu>
5872
5876
5873 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5877 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5874 @logstart to avoid name clashes with the math log function.
5878 @logstart to avoid name clashes with the math log function.
5875
5879
5876 * Big updates to X/Emacs section of the manual.
5880 * Big updates to X/Emacs section of the manual.
5877
5881
5878 * Removed ipython_emacs. Milan explained to me how to pass
5882 * Removed ipython_emacs. Milan explained to me how to pass
5879 arguments to ipython through Emacs. Some day I'm going to end up
5883 arguments to ipython through Emacs. Some day I'm going to end up
5880 learning some lisp...
5884 learning some lisp...
5881
5885
5882 2002-03-04 Fernando Perez <fperez@colorado.edu>
5886 2002-03-04 Fernando Perez <fperez@colorado.edu>
5883
5887
5884 * IPython/ipython_emacs: Created script to be used as the
5888 * IPython/ipython_emacs: Created script to be used as the
5885 py-python-command Emacs variable so we can pass IPython
5889 py-python-command Emacs variable so we can pass IPython
5886 parameters. I can't figure out how to tell Emacs directly to pass
5890 parameters. I can't figure out how to tell Emacs directly to pass
5887 parameters to IPython, so a dummy shell script will do it.
5891 parameters to IPython, so a dummy shell script will do it.
5888
5892
5889 Other enhancements made for things to work better under Emacs'
5893 Other enhancements made for things to work better under Emacs'
5890 various types of terminals. Many thanks to Milan Zamazal
5894 various types of terminals. Many thanks to Milan Zamazal
5891 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5895 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5892
5896
5893 2002-03-01 Fernando Perez <fperez@colorado.edu>
5897 2002-03-01 Fernando Perez <fperez@colorado.edu>
5894
5898
5895 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5899 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5896 that loading of readline is now optional. This gives better
5900 that loading of readline is now optional. This gives better
5897 control to emacs users.
5901 control to emacs users.
5898
5902
5899 * IPython/ultraTB.py (__date__): Modified color escape sequences
5903 * IPython/ultraTB.py (__date__): Modified color escape sequences
5900 and now things work fine under xterm and in Emacs' term buffers
5904 and now things work fine under xterm and in Emacs' term buffers
5901 (though not shell ones). Well, in emacs you get colors, but all
5905 (though not shell ones). Well, in emacs you get colors, but all
5902 seem to be 'light' colors (no difference between dark and light
5906 seem to be 'light' colors (no difference between dark and light
5903 ones). But the garbage chars are gone, and also in xterms. It
5907 ones). But the garbage chars are gone, and also in xterms. It
5904 seems that now I'm using 'cleaner' ansi sequences.
5908 seems that now I'm using 'cleaner' ansi sequences.
5905
5909
5906 2002-02-21 Fernando Perez <fperez@colorado.edu>
5910 2002-02-21 Fernando Perez <fperez@colorado.edu>
5907
5911
5908 * Released 0.2.7 (mainly to publish the scoping fix).
5912 * Released 0.2.7 (mainly to publish the scoping fix).
5909
5913
5910 * IPython/Logger.py (Logger.logstate): added. A corresponding
5914 * IPython/Logger.py (Logger.logstate): added. A corresponding
5911 @logstate magic was created.
5915 @logstate magic was created.
5912
5916
5913 * IPython/Magic.py: fixed nested scoping problem under Python
5917 * IPython/Magic.py: fixed nested scoping problem under Python
5914 2.1.x (automagic wasn't working).
5918 2.1.x (automagic wasn't working).
5915
5919
5916 2002-02-20 Fernando Perez <fperez@colorado.edu>
5920 2002-02-20 Fernando Perez <fperez@colorado.edu>
5917
5921
5918 * Released 0.2.6.
5922 * Released 0.2.6.
5919
5923
5920 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5924 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5921 option so that logs can come out without any headers at all.
5925 option so that logs can come out without any headers at all.
5922
5926
5923 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5927 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5924 SciPy.
5928 SciPy.
5925
5929
5926 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5930 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5927 that embedded IPython calls don't require vars() to be explicitly
5931 that embedded IPython calls don't require vars() to be explicitly
5928 passed. Now they are extracted from the caller's frame (code
5932 passed. Now they are extracted from the caller's frame (code
5929 snatched from Eric Jones' weave). Added better documentation to
5933 snatched from Eric Jones' weave). Added better documentation to
5930 the section on embedding and the example file.
5934 the section on embedding and the example file.
5931
5935
5932 * IPython/genutils.py (page): Changed so that under emacs, it just
5936 * IPython/genutils.py (page): Changed so that under emacs, it just
5933 prints the string. You can then page up and down in the emacs
5937 prints the string. You can then page up and down in the emacs
5934 buffer itself. This is how the builtin help() works.
5938 buffer itself. This is how the builtin help() works.
5935
5939
5936 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5940 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5937 macro scoping: macros need to be executed in the user's namespace
5941 macro scoping: macros need to be executed in the user's namespace
5938 to work as if they had been typed by the user.
5942 to work as if they had been typed by the user.
5939
5943
5940 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5944 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5941 execute automatically (no need to type 'exec...'). They then
5945 execute automatically (no need to type 'exec...'). They then
5942 behave like 'true macros'. The printing system was also modified
5946 behave like 'true macros'. The printing system was also modified
5943 for this to work.
5947 for this to work.
5944
5948
5945 2002-02-19 Fernando Perez <fperez@colorado.edu>
5949 2002-02-19 Fernando Perez <fperez@colorado.edu>
5946
5950
5947 * IPython/genutils.py (page_file): new function for paging files
5951 * IPython/genutils.py (page_file): new function for paging files
5948 in an OS-independent way. Also necessary for file viewing to work
5952 in an OS-independent way. Also necessary for file viewing to work
5949 well inside Emacs buffers.
5953 well inside Emacs buffers.
5950 (page): Added checks for being in an emacs buffer.
5954 (page): Added checks for being in an emacs buffer.
5951 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5955 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5952 same bug in iplib.
5956 same bug in iplib.
5953
5957
5954 2002-02-18 Fernando Perez <fperez@colorado.edu>
5958 2002-02-18 Fernando Perez <fperez@colorado.edu>
5955
5959
5956 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5960 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5957 of readline so that IPython can work inside an Emacs buffer.
5961 of readline so that IPython can work inside an Emacs buffer.
5958
5962
5959 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5963 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5960 method signatures (they weren't really bugs, but it looks cleaner
5964 method signatures (they weren't really bugs, but it looks cleaner
5961 and keeps PyChecker happy).
5965 and keeps PyChecker happy).
5962
5966
5963 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5967 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5964 for implementing various user-defined hooks. Currently only
5968 for implementing various user-defined hooks. Currently only
5965 display is done.
5969 display is done.
5966
5970
5967 * IPython/Prompts.py (CachedOutput._display): changed display
5971 * IPython/Prompts.py (CachedOutput._display): changed display
5968 functions so that they can be dynamically changed by users easily.
5972 functions so that they can be dynamically changed by users easily.
5969
5973
5970 * IPython/Extensions/numeric_formats.py (num_display): added an
5974 * IPython/Extensions/numeric_formats.py (num_display): added an
5971 extension for printing NumPy arrays in flexible manners. It
5975 extension for printing NumPy arrays in flexible manners. It
5972 doesn't do anything yet, but all the structure is in
5976 doesn't do anything yet, but all the structure is in
5973 place. Ultimately the plan is to implement output format control
5977 place. Ultimately the plan is to implement output format control
5974 like in Octave.
5978 like in Octave.
5975
5979
5976 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5980 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5977 methods are found at run-time by all the automatic machinery.
5981 methods are found at run-time by all the automatic machinery.
5978
5982
5979 2002-02-17 Fernando Perez <fperez@colorado.edu>
5983 2002-02-17 Fernando Perez <fperez@colorado.edu>
5980
5984
5981 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5985 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5982 whole file a little.
5986 whole file a little.
5983
5987
5984 * ToDo: closed this document. Now there's a new_design.lyx
5988 * ToDo: closed this document. Now there's a new_design.lyx
5985 document for all new ideas. Added making a pdf of it for the
5989 document for all new ideas. Added making a pdf of it for the
5986 end-user distro.
5990 end-user distro.
5987
5991
5988 * IPython/Logger.py (Logger.switch_log): Created this to replace
5992 * IPython/Logger.py (Logger.switch_log): Created this to replace
5989 logon() and logoff(). It also fixes a nasty crash reported by
5993 logon() and logoff(). It also fixes a nasty crash reported by
5990 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5994 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5991
5995
5992 * IPython/iplib.py (complete): got auto-completion to work with
5996 * IPython/iplib.py (complete): got auto-completion to work with
5993 automagic (I had wanted this for a long time).
5997 automagic (I had wanted this for a long time).
5994
5998
5995 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5999 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5996 to @file, since file() is now a builtin and clashes with automagic
6000 to @file, since file() is now a builtin and clashes with automagic
5997 for @file.
6001 for @file.
5998
6002
5999 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6003 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6000 of this was previously in iplib, which had grown to more than 2000
6004 of this was previously in iplib, which had grown to more than 2000
6001 lines, way too long. No new functionality, but it makes managing
6005 lines, way too long. No new functionality, but it makes managing
6002 the code a bit easier.
6006 the code a bit easier.
6003
6007
6004 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6008 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6005 information to crash reports.
6009 information to crash reports.
6006
6010
6007 2002-02-12 Fernando Perez <fperez@colorado.edu>
6011 2002-02-12 Fernando Perez <fperez@colorado.edu>
6008
6012
6009 * Released 0.2.5.
6013 * Released 0.2.5.
6010
6014
6011 2002-02-11 Fernando Perez <fperez@colorado.edu>
6015 2002-02-11 Fernando Perez <fperez@colorado.edu>
6012
6016
6013 * Wrote a relatively complete Windows installer. It puts
6017 * Wrote a relatively complete Windows installer. It puts
6014 everything in place, creates Start Menu entries and fixes the
6018 everything in place, creates Start Menu entries and fixes the
6015 color issues. Nothing fancy, but it works.
6019 color issues. Nothing fancy, but it works.
6016
6020
6017 2002-02-10 Fernando Perez <fperez@colorado.edu>
6021 2002-02-10 Fernando Perez <fperez@colorado.edu>
6018
6022
6019 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6023 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6020 os.path.expanduser() call so that we can type @run ~/myfile.py and
6024 os.path.expanduser() call so that we can type @run ~/myfile.py and
6021 have thigs work as expected.
6025 have thigs work as expected.
6022
6026
6023 * IPython/genutils.py (page): fixed exception handling so things
6027 * IPython/genutils.py (page): fixed exception handling so things
6024 work both in Unix and Windows correctly. Quitting a pager triggers
6028 work both in Unix and Windows correctly. Quitting a pager triggers
6025 an IOError/broken pipe in Unix, and in windows not finding a pager
6029 an IOError/broken pipe in Unix, and in windows not finding a pager
6026 is also an IOError, so I had to actually look at the return value
6030 is also an IOError, so I had to actually look at the return value
6027 of the exception, not just the exception itself. Should be ok now.
6031 of the exception, not just the exception itself. Should be ok now.
6028
6032
6029 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6033 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6030 modified to allow case-insensitive color scheme changes.
6034 modified to allow case-insensitive color scheme changes.
6031
6035
6032 2002-02-09 Fernando Perez <fperez@colorado.edu>
6036 2002-02-09 Fernando Perez <fperez@colorado.edu>
6033
6037
6034 * IPython/genutils.py (native_line_ends): new function to leave
6038 * IPython/genutils.py (native_line_ends): new function to leave
6035 user config files with os-native line-endings.
6039 user config files with os-native line-endings.
6036
6040
6037 * README and manual updates.
6041 * README and manual updates.
6038
6042
6039 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6043 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6040 instead of StringType to catch Unicode strings.
6044 instead of StringType to catch Unicode strings.
6041
6045
6042 * IPython/genutils.py (filefind): fixed bug for paths with
6046 * IPython/genutils.py (filefind): fixed bug for paths with
6043 embedded spaces (very common in Windows).
6047 embedded spaces (very common in Windows).
6044
6048
6045 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6049 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6046 files under Windows, so that they get automatically associated
6050 files under Windows, so that they get automatically associated
6047 with a text editor. Windows makes it a pain to handle
6051 with a text editor. Windows makes it a pain to handle
6048 extension-less files.
6052 extension-less files.
6049
6053
6050 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6054 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6051 warning about readline only occur for Posix. In Windows there's no
6055 warning about readline only occur for Posix. In Windows there's no
6052 way to get readline, so why bother with the warning.
6056 way to get readline, so why bother with the warning.
6053
6057
6054 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6058 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6055 for __str__ instead of dir(self), since dir() changed in 2.2.
6059 for __str__ instead of dir(self), since dir() changed in 2.2.
6056
6060
6057 * Ported to Windows! Tested on XP, I suspect it should work fine
6061 * Ported to Windows! Tested on XP, I suspect it should work fine
6058 on NT/2000, but I don't think it will work on 98 et al. That
6062 on NT/2000, but I don't think it will work on 98 et al. That
6059 series of Windows is such a piece of junk anyway that I won't try
6063 series of Windows is such a piece of junk anyway that I won't try
6060 porting it there. The XP port was straightforward, showed a few
6064 porting it there. The XP port was straightforward, showed a few
6061 bugs here and there (fixed all), in particular some string
6065 bugs here and there (fixed all), in particular some string
6062 handling stuff which required considering Unicode strings (which
6066 handling stuff which required considering Unicode strings (which
6063 Windows uses). This is good, but hasn't been too tested :) No
6067 Windows uses). This is good, but hasn't been too tested :) No
6064 fancy installer yet, I'll put a note in the manual so people at
6068 fancy installer yet, I'll put a note in the manual so people at
6065 least make manually a shortcut.
6069 least make manually a shortcut.
6066
6070
6067 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6071 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6068 into a single one, "colors". This now controls both prompt and
6072 into a single one, "colors". This now controls both prompt and
6069 exception color schemes, and can be changed both at startup
6073 exception color schemes, and can be changed both at startup
6070 (either via command-line switches or via ipythonrc files) and at
6074 (either via command-line switches or via ipythonrc files) and at
6071 runtime, with @colors.
6075 runtime, with @colors.
6072 (Magic.magic_run): renamed @prun to @run and removed the old
6076 (Magic.magic_run): renamed @prun to @run and removed the old
6073 @run. The two were too similar to warrant keeping both.
6077 @run. The two were too similar to warrant keeping both.
6074
6078
6075 2002-02-03 Fernando Perez <fperez@colorado.edu>
6079 2002-02-03 Fernando Perez <fperez@colorado.edu>
6076
6080
6077 * IPython/iplib.py (install_first_time): Added comment on how to
6081 * IPython/iplib.py (install_first_time): Added comment on how to
6078 configure the color options for first-time users. Put a <return>
6082 configure the color options for first-time users. Put a <return>
6079 request at the end so that small-terminal users get a chance to
6083 request at the end so that small-terminal users get a chance to
6080 read the startup info.
6084 read the startup info.
6081
6085
6082 2002-01-23 Fernando Perez <fperez@colorado.edu>
6086 2002-01-23 Fernando Perez <fperez@colorado.edu>
6083
6087
6084 * IPython/iplib.py (CachedOutput.update): Changed output memory
6088 * IPython/iplib.py (CachedOutput.update): Changed output memory
6085 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6089 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6086 input history we still use _i. Did this b/c these variable are
6090 input history we still use _i. Did this b/c these variable are
6087 very commonly used in interactive work, so the less we need to
6091 very commonly used in interactive work, so the less we need to
6088 type the better off we are.
6092 type the better off we are.
6089 (Magic.magic_prun): updated @prun to better handle the namespaces
6093 (Magic.magic_prun): updated @prun to better handle the namespaces
6090 the file will run in, including a fix for __name__ not being set
6094 the file will run in, including a fix for __name__ not being set
6091 before.
6095 before.
6092
6096
6093 2002-01-20 Fernando Perez <fperez@colorado.edu>
6097 2002-01-20 Fernando Perez <fperez@colorado.edu>
6094
6098
6095 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6099 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6096 extra garbage for Python 2.2. Need to look more carefully into
6100 extra garbage for Python 2.2. Need to look more carefully into
6097 this later.
6101 this later.
6098
6102
6099 2002-01-19 Fernando Perez <fperez@colorado.edu>
6103 2002-01-19 Fernando Perez <fperez@colorado.edu>
6100
6104
6101 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6105 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6102 display SyntaxError exceptions properly formatted when they occur
6106 display SyntaxError exceptions properly formatted when they occur
6103 (they can be triggered by imported code).
6107 (they can be triggered by imported code).
6104
6108
6105 2002-01-18 Fernando Perez <fperez@colorado.edu>
6109 2002-01-18 Fernando Perez <fperez@colorado.edu>
6106
6110
6107 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6111 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6108 SyntaxError exceptions are reported nicely formatted, instead of
6112 SyntaxError exceptions are reported nicely formatted, instead of
6109 spitting out only offset information as before.
6113 spitting out only offset information as before.
6110 (Magic.magic_prun): Added the @prun function for executing
6114 (Magic.magic_prun): Added the @prun function for executing
6111 programs with command line args inside IPython.
6115 programs with command line args inside IPython.
6112
6116
6113 2002-01-16 Fernando Perez <fperez@colorado.edu>
6117 2002-01-16 Fernando Perez <fperez@colorado.edu>
6114
6118
6115 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6119 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6116 to *not* include the last item given in a range. This brings their
6120 to *not* include the last item given in a range. This brings their
6117 behavior in line with Python's slicing:
6121 behavior in line with Python's slicing:
6118 a[n1:n2] -> a[n1]...a[n2-1]
6122 a[n1:n2] -> a[n1]...a[n2-1]
6119 It may be a bit less convenient, but I prefer to stick to Python's
6123 It may be a bit less convenient, but I prefer to stick to Python's
6120 conventions *everywhere*, so users never have to wonder.
6124 conventions *everywhere*, so users never have to wonder.
6121 (Magic.magic_macro): Added @macro function to ease the creation of
6125 (Magic.magic_macro): Added @macro function to ease the creation of
6122 macros.
6126 macros.
6123
6127
6124 2002-01-05 Fernando Perez <fperez@colorado.edu>
6128 2002-01-05 Fernando Perez <fperez@colorado.edu>
6125
6129
6126 * Released 0.2.4.
6130 * Released 0.2.4.
6127
6131
6128 * IPython/iplib.py (Magic.magic_pdef):
6132 * IPython/iplib.py (Magic.magic_pdef):
6129 (InteractiveShell.safe_execfile): report magic lines and error
6133 (InteractiveShell.safe_execfile): report magic lines and error
6130 lines without line numbers so one can easily copy/paste them for
6134 lines without line numbers so one can easily copy/paste them for
6131 re-execution.
6135 re-execution.
6132
6136
6133 * Updated manual with recent changes.
6137 * Updated manual with recent changes.
6134
6138
6135 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6139 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6136 docstring printing when class? is called. Very handy for knowing
6140 docstring printing when class? is called. Very handy for knowing
6137 how to create class instances (as long as __init__ is well
6141 how to create class instances (as long as __init__ is well
6138 documented, of course :)
6142 documented, of course :)
6139 (Magic.magic_doc): print both class and constructor docstrings.
6143 (Magic.magic_doc): print both class and constructor docstrings.
6140 (Magic.magic_pdef): give constructor info if passed a class and
6144 (Magic.magic_pdef): give constructor info if passed a class and
6141 __call__ info for callable object instances.
6145 __call__ info for callable object instances.
6142
6146
6143 2002-01-04 Fernando Perez <fperez@colorado.edu>
6147 2002-01-04 Fernando Perez <fperez@colorado.edu>
6144
6148
6145 * Made deep_reload() off by default. It doesn't always work
6149 * Made deep_reload() off by default. It doesn't always work
6146 exactly as intended, so it's probably safer to have it off. It's
6150 exactly as intended, so it's probably safer to have it off. It's
6147 still available as dreload() anyway, so nothing is lost.
6151 still available as dreload() anyway, so nothing is lost.
6148
6152
6149 2002-01-02 Fernando Perez <fperez@colorado.edu>
6153 2002-01-02 Fernando Perez <fperez@colorado.edu>
6150
6154
6151 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6155 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6152 so I wanted an updated release).
6156 so I wanted an updated release).
6153
6157
6154 2001-12-27 Fernando Perez <fperez@colorado.edu>
6158 2001-12-27 Fernando Perez <fperez@colorado.edu>
6155
6159
6156 * IPython/iplib.py (InteractiveShell.interact): Added the original
6160 * IPython/iplib.py (InteractiveShell.interact): Added the original
6157 code from 'code.py' for this module in order to change the
6161 code from 'code.py' for this module in order to change the
6158 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6162 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6159 the history cache would break when the user hit Ctrl-C, and
6163 the history cache would break when the user hit Ctrl-C, and
6160 interact() offers no way to add any hooks to it.
6164 interact() offers no way to add any hooks to it.
6161
6165
6162 2001-12-23 Fernando Perez <fperez@colorado.edu>
6166 2001-12-23 Fernando Perez <fperez@colorado.edu>
6163
6167
6164 * setup.py: added check for 'MANIFEST' before trying to remove
6168 * setup.py: added check for 'MANIFEST' before trying to remove
6165 it. Thanks to Sean Reifschneider.
6169 it. Thanks to Sean Reifschneider.
6166
6170
6167 2001-12-22 Fernando Perez <fperez@colorado.edu>
6171 2001-12-22 Fernando Perez <fperez@colorado.edu>
6168
6172
6169 * Released 0.2.2.
6173 * Released 0.2.2.
6170
6174
6171 * Finished (reasonably) writing the manual. Later will add the
6175 * Finished (reasonably) writing the manual. Later will add the
6172 python-standard navigation stylesheets, but for the time being
6176 python-standard navigation stylesheets, but for the time being
6173 it's fairly complete. Distribution will include html and pdf
6177 it's fairly complete. Distribution will include html and pdf
6174 versions.
6178 versions.
6175
6179
6176 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6180 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6177 (MayaVi author).
6181 (MayaVi author).
6178
6182
6179 2001-12-21 Fernando Perez <fperez@colorado.edu>
6183 2001-12-21 Fernando Perez <fperez@colorado.edu>
6180
6184
6181 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6185 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6182 good public release, I think (with the manual and the distutils
6186 good public release, I think (with the manual and the distutils
6183 installer). The manual can use some work, but that can go
6187 installer). The manual can use some work, but that can go
6184 slowly. Otherwise I think it's quite nice for end users. Next
6188 slowly. Otherwise I think it's quite nice for end users. Next
6185 summer, rewrite the guts of it...
6189 summer, rewrite the guts of it...
6186
6190
6187 * Changed format of ipythonrc files to use whitespace as the
6191 * Changed format of ipythonrc files to use whitespace as the
6188 separator instead of an explicit '='. Cleaner.
6192 separator instead of an explicit '='. Cleaner.
6189
6193
6190 2001-12-20 Fernando Perez <fperez@colorado.edu>
6194 2001-12-20 Fernando Perez <fperez@colorado.edu>
6191
6195
6192 * Started a manual in LyX. For now it's just a quick merge of the
6196 * Started a manual in LyX. For now it's just a quick merge of the
6193 various internal docstrings and READMEs. Later it may grow into a
6197 various internal docstrings and READMEs. Later it may grow into a
6194 nice, full-blown manual.
6198 nice, full-blown manual.
6195
6199
6196 * Set up a distutils based installer. Installation should now be
6200 * Set up a distutils based installer. Installation should now be
6197 trivially simple for end-users.
6201 trivially simple for end-users.
6198
6202
6199 2001-12-11 Fernando Perez <fperez@colorado.edu>
6203 2001-12-11 Fernando Perez <fperez@colorado.edu>
6200
6204
6201 * Released 0.2.0. First public release, announced it at
6205 * Released 0.2.0. First public release, announced it at
6202 comp.lang.python. From now on, just bugfixes...
6206 comp.lang.python. From now on, just bugfixes...
6203
6207
6204 * Went through all the files, set copyright/license notices and
6208 * Went through all the files, set copyright/license notices and
6205 cleaned up things. Ready for release.
6209 cleaned up things. Ready for release.
6206
6210
6207 2001-12-10 Fernando Perez <fperez@colorado.edu>
6211 2001-12-10 Fernando Perez <fperez@colorado.edu>
6208
6212
6209 * Changed the first-time installer not to use tarfiles. It's more
6213 * Changed the first-time installer not to use tarfiles. It's more
6210 robust now and less unix-dependent. Also makes it easier for
6214 robust now and less unix-dependent. Also makes it easier for
6211 people to later upgrade versions.
6215 people to later upgrade versions.
6212
6216
6213 * Changed @exit to @abort to reflect the fact that it's pretty
6217 * Changed @exit to @abort to reflect the fact that it's pretty
6214 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6218 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6215 becomes significant only when IPyhton is embedded: in that case,
6219 becomes significant only when IPyhton is embedded: in that case,
6216 C-D closes IPython only, but @abort kills the enclosing program
6220 C-D closes IPython only, but @abort kills the enclosing program
6217 too (unless it had called IPython inside a try catching
6221 too (unless it had called IPython inside a try catching
6218 SystemExit).
6222 SystemExit).
6219
6223
6220 * Created Shell module which exposes the actuall IPython Shell
6224 * Created Shell module which exposes the actuall IPython Shell
6221 classes, currently the normal and the embeddable one. This at
6225 classes, currently the normal and the embeddable one. This at
6222 least offers a stable interface we won't need to change when
6226 least offers a stable interface we won't need to change when
6223 (later) the internals are rewritten. That rewrite will be confined
6227 (later) the internals are rewritten. That rewrite will be confined
6224 to iplib and ipmaker, but the Shell interface should remain as is.
6228 to iplib and ipmaker, but the Shell interface should remain as is.
6225
6229
6226 * Added embed module which offers an embeddable IPShell object,
6230 * Added embed module which offers an embeddable IPShell object,
6227 useful to fire up IPython *inside* a running program. Great for
6231 useful to fire up IPython *inside* a running program. Great for
6228 debugging or dynamical data analysis.
6232 debugging or dynamical data analysis.
6229
6233
6230 2001-12-08 Fernando Perez <fperez@colorado.edu>
6234 2001-12-08 Fernando Perez <fperez@colorado.edu>
6231
6235
6232 * Fixed small bug preventing seeing info from methods of defined
6236 * Fixed small bug preventing seeing info from methods of defined
6233 objects (incorrect namespace in _ofind()).
6237 objects (incorrect namespace in _ofind()).
6234
6238
6235 * Documentation cleanup. Moved the main usage docstrings to a
6239 * Documentation cleanup. Moved the main usage docstrings to a
6236 separate file, usage.py (cleaner to maintain, and hopefully in the
6240 separate file, usage.py (cleaner to maintain, and hopefully in the
6237 future some perlpod-like way of producing interactive, man and
6241 future some perlpod-like way of producing interactive, man and
6238 html docs out of it will be found).
6242 html docs out of it will be found).
6239
6243
6240 * Added @profile to see your profile at any time.
6244 * Added @profile to see your profile at any time.
6241
6245
6242 * Added @p as an alias for 'print'. It's especially convenient if
6246 * Added @p as an alias for 'print'. It's especially convenient if
6243 using automagic ('p x' prints x).
6247 using automagic ('p x' prints x).
6244
6248
6245 * Small cleanups and fixes after a pychecker run.
6249 * Small cleanups and fixes after a pychecker run.
6246
6250
6247 * Changed the @cd command to handle @cd - and @cd -<n> for
6251 * Changed the @cd command to handle @cd - and @cd -<n> for
6248 visiting any directory in _dh.
6252 visiting any directory in _dh.
6249
6253
6250 * Introduced _dh, a history of visited directories. @dhist prints
6254 * Introduced _dh, a history of visited directories. @dhist prints
6251 it out with numbers.
6255 it out with numbers.
6252
6256
6253 2001-12-07 Fernando Perez <fperez@colorado.edu>
6257 2001-12-07 Fernando Perez <fperez@colorado.edu>
6254
6258
6255 * Released 0.1.22
6259 * Released 0.1.22
6256
6260
6257 * Made initialization a bit more robust against invalid color
6261 * Made initialization a bit more robust against invalid color
6258 options in user input (exit, not traceback-crash).
6262 options in user input (exit, not traceback-crash).
6259
6263
6260 * Changed the bug crash reporter to write the report only in the
6264 * Changed the bug crash reporter to write the report only in the
6261 user's .ipython directory. That way IPython won't litter people's
6265 user's .ipython directory. That way IPython won't litter people's
6262 hard disks with crash files all over the place. Also print on
6266 hard disks with crash files all over the place. Also print on
6263 screen the necessary mail command.
6267 screen the necessary mail command.
6264
6268
6265 * With the new ultraTB, implemented LightBG color scheme for light
6269 * With the new ultraTB, implemented LightBG color scheme for light
6266 background terminals. A lot of people like white backgrounds, so I
6270 background terminals. A lot of people like white backgrounds, so I
6267 guess we should at least give them something readable.
6271 guess we should at least give them something readable.
6268
6272
6269 2001-12-06 Fernando Perez <fperez@colorado.edu>
6273 2001-12-06 Fernando Perez <fperez@colorado.edu>
6270
6274
6271 * Modified the structure of ultraTB. Now there's a proper class
6275 * Modified the structure of ultraTB. Now there's a proper class
6272 for tables of color schemes which allow adding schemes easily and
6276 for tables of color schemes which allow adding schemes easily and
6273 switching the active scheme without creating a new instance every
6277 switching the active scheme without creating a new instance every
6274 time (which was ridiculous). The syntax for creating new schemes
6278 time (which was ridiculous). The syntax for creating new schemes
6275 is also cleaner. I think ultraTB is finally done, with a clean
6279 is also cleaner. I think ultraTB is finally done, with a clean
6276 class structure. Names are also much cleaner (now there's proper
6280 class structure. Names are also much cleaner (now there's proper
6277 color tables, no need for every variable to also have 'color' in
6281 color tables, no need for every variable to also have 'color' in
6278 its name).
6282 its name).
6279
6283
6280 * Broke down genutils into separate files. Now genutils only
6284 * Broke down genutils into separate files. Now genutils only
6281 contains utility functions, and classes have been moved to their
6285 contains utility functions, and classes have been moved to their
6282 own files (they had enough independent functionality to warrant
6286 own files (they had enough independent functionality to warrant
6283 it): ConfigLoader, OutputTrap, Struct.
6287 it): ConfigLoader, OutputTrap, Struct.
6284
6288
6285 2001-12-05 Fernando Perez <fperez@colorado.edu>
6289 2001-12-05 Fernando Perez <fperez@colorado.edu>
6286
6290
6287 * IPython turns 21! Released version 0.1.21, as a candidate for
6291 * IPython turns 21! Released version 0.1.21, as a candidate for
6288 public consumption. If all goes well, release in a few days.
6292 public consumption. If all goes well, release in a few days.
6289
6293
6290 * Fixed path bug (files in Extensions/ directory wouldn't be found
6294 * Fixed path bug (files in Extensions/ directory wouldn't be found
6291 unless IPython/ was explicitly in sys.path).
6295 unless IPython/ was explicitly in sys.path).
6292
6296
6293 * Extended the FlexCompleter class as MagicCompleter to allow
6297 * Extended the FlexCompleter class as MagicCompleter to allow
6294 completion of @-starting lines.
6298 completion of @-starting lines.
6295
6299
6296 * Created __release__.py file as a central repository for release
6300 * Created __release__.py file as a central repository for release
6297 info that other files can read from.
6301 info that other files can read from.
6298
6302
6299 * Fixed small bug in logging: when logging was turned on in
6303 * Fixed small bug in logging: when logging was turned on in
6300 mid-session, old lines with special meanings (!@?) were being
6304 mid-session, old lines with special meanings (!@?) were being
6301 logged without the prepended comment, which is necessary since
6305 logged without the prepended comment, which is necessary since
6302 they are not truly valid python syntax. This should make session
6306 they are not truly valid python syntax. This should make session
6303 restores produce less errors.
6307 restores produce less errors.
6304
6308
6305 * The namespace cleanup forced me to make a FlexCompleter class
6309 * The namespace cleanup forced me to make a FlexCompleter class
6306 which is nothing but a ripoff of rlcompleter, but with selectable
6310 which is nothing but a ripoff of rlcompleter, but with selectable
6307 namespace (rlcompleter only works in __main__.__dict__). I'll try
6311 namespace (rlcompleter only works in __main__.__dict__). I'll try
6308 to submit a note to the authors to see if this change can be
6312 to submit a note to the authors to see if this change can be
6309 incorporated in future rlcompleter releases (Dec.6: done)
6313 incorporated in future rlcompleter releases (Dec.6: done)
6310
6314
6311 * More fixes to namespace handling. It was a mess! Now all
6315 * More fixes to namespace handling. It was a mess! Now all
6312 explicit references to __main__.__dict__ are gone (except when
6316 explicit references to __main__.__dict__ are gone (except when
6313 really needed) and everything is handled through the namespace
6317 really needed) and everything is handled through the namespace
6314 dicts in the IPython instance. We seem to be getting somewhere
6318 dicts in the IPython instance. We seem to be getting somewhere
6315 with this, finally...
6319 with this, finally...
6316
6320
6317 * Small documentation updates.
6321 * Small documentation updates.
6318
6322
6319 * Created the Extensions directory under IPython (with an
6323 * Created the Extensions directory under IPython (with an
6320 __init__.py). Put the PhysicalQ stuff there. This directory should
6324 __init__.py). Put the PhysicalQ stuff there. This directory should
6321 be used for all special-purpose extensions.
6325 be used for all special-purpose extensions.
6322
6326
6323 * File renaming:
6327 * File renaming:
6324 ipythonlib --> ipmaker
6328 ipythonlib --> ipmaker
6325 ipplib --> iplib
6329 ipplib --> iplib
6326 This makes a bit more sense in terms of what these files actually do.
6330 This makes a bit more sense in terms of what these files actually do.
6327
6331
6328 * Moved all the classes and functions in ipythonlib to ipplib, so
6332 * Moved all the classes and functions in ipythonlib to ipplib, so
6329 now ipythonlib only has make_IPython(). This will ease up its
6333 now ipythonlib only has make_IPython(). This will ease up its
6330 splitting in smaller functional chunks later.
6334 splitting in smaller functional chunks later.
6331
6335
6332 * Cleaned up (done, I think) output of @whos. Better column
6336 * Cleaned up (done, I think) output of @whos. Better column
6333 formatting, and now shows str(var) for as much as it can, which is
6337 formatting, and now shows str(var) for as much as it can, which is
6334 typically what one gets with a 'print var'.
6338 typically what one gets with a 'print var'.
6335
6339
6336 2001-12-04 Fernando Perez <fperez@colorado.edu>
6340 2001-12-04 Fernando Perez <fperez@colorado.edu>
6337
6341
6338 * Fixed namespace problems. Now builtin/IPyhton/user names get
6342 * Fixed namespace problems. Now builtin/IPyhton/user names get
6339 properly reported in their namespace. Internal namespace handling
6343 properly reported in their namespace. Internal namespace handling
6340 is finally getting decent (not perfect yet, but much better than
6344 is finally getting decent (not perfect yet, but much better than
6341 the ad-hoc mess we had).
6345 the ad-hoc mess we had).
6342
6346
6343 * Removed -exit option. If people just want to run a python
6347 * Removed -exit option. If people just want to run a python
6344 script, that's what the normal interpreter is for. Less
6348 script, that's what the normal interpreter is for. Less
6345 unnecessary options, less chances for bugs.
6349 unnecessary options, less chances for bugs.
6346
6350
6347 * Added a crash handler which generates a complete post-mortem if
6351 * Added a crash handler which generates a complete post-mortem if
6348 IPython crashes. This will help a lot in tracking bugs down the
6352 IPython crashes. This will help a lot in tracking bugs down the
6349 road.
6353 road.
6350
6354
6351 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6355 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6352 which were boud to functions being reassigned would bypass the
6356 which were boud to functions being reassigned would bypass the
6353 logger, breaking the sync of _il with the prompt counter. This
6357 logger, breaking the sync of _il with the prompt counter. This
6354 would then crash IPython later when a new line was logged.
6358 would then crash IPython later when a new line was logged.
6355
6359
6356 2001-12-02 Fernando Perez <fperez@colorado.edu>
6360 2001-12-02 Fernando Perez <fperez@colorado.edu>
6357
6361
6358 * Made IPython a package. This means people don't have to clutter
6362 * Made IPython a package. This means people don't have to clutter
6359 their sys.path with yet another directory. Changed the INSTALL
6363 their sys.path with yet another directory. Changed the INSTALL
6360 file accordingly.
6364 file accordingly.
6361
6365
6362 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6366 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6363 sorts its output (so @who shows it sorted) and @whos formats the
6367 sorts its output (so @who shows it sorted) and @whos formats the
6364 table according to the width of the first column. Nicer, easier to
6368 table according to the width of the first column. Nicer, easier to
6365 read. Todo: write a generic table_format() which takes a list of
6369 read. Todo: write a generic table_format() which takes a list of
6366 lists and prints it nicely formatted, with optional row/column
6370 lists and prints it nicely formatted, with optional row/column
6367 separators and proper padding and justification.
6371 separators and proper padding and justification.
6368
6372
6369 * Released 0.1.20
6373 * Released 0.1.20
6370
6374
6371 * Fixed bug in @log which would reverse the inputcache list (a
6375 * Fixed bug in @log which would reverse the inputcache list (a
6372 copy operation was missing).
6376 copy operation was missing).
6373
6377
6374 * Code cleanup. @config was changed to use page(). Better, since
6378 * Code cleanup. @config was changed to use page(). Better, since
6375 its output is always quite long.
6379 its output is always quite long.
6376
6380
6377 * Itpl is back as a dependency. I was having too many problems
6381 * Itpl is back as a dependency. I was having too many problems
6378 getting the parametric aliases to work reliably, and it's just
6382 getting the parametric aliases to work reliably, and it's just
6379 easier to code weird string operations with it than playing %()s
6383 easier to code weird string operations with it than playing %()s
6380 games. It's only ~6k, so I don't think it's too big a deal.
6384 games. It's only ~6k, so I don't think it's too big a deal.
6381
6385
6382 * Found (and fixed) a very nasty bug with history. !lines weren't
6386 * Found (and fixed) a very nasty bug with history. !lines weren't
6383 getting cached, and the out of sync caches would crash
6387 getting cached, and the out of sync caches would crash
6384 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6388 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6385 division of labor a bit better. Bug fixed, cleaner structure.
6389 division of labor a bit better. Bug fixed, cleaner structure.
6386
6390
6387 2001-12-01 Fernando Perez <fperez@colorado.edu>
6391 2001-12-01 Fernando Perez <fperez@colorado.edu>
6388
6392
6389 * Released 0.1.19
6393 * Released 0.1.19
6390
6394
6391 * Added option -n to @hist to prevent line number printing. Much
6395 * Added option -n to @hist to prevent line number printing. Much
6392 easier to copy/paste code this way.
6396 easier to copy/paste code this way.
6393
6397
6394 * Created global _il to hold the input list. Allows easy
6398 * Created global _il to hold the input list. Allows easy
6395 re-execution of blocks of code by slicing it (inspired by Janko's
6399 re-execution of blocks of code by slicing it (inspired by Janko's
6396 comment on 'macros').
6400 comment on 'macros').
6397
6401
6398 * Small fixes and doc updates.
6402 * Small fixes and doc updates.
6399
6403
6400 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6404 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6401 much too fragile with automagic. Handles properly multi-line
6405 much too fragile with automagic. Handles properly multi-line
6402 statements and takes parameters.
6406 statements and takes parameters.
6403
6407
6404 2001-11-30 Fernando Perez <fperez@colorado.edu>
6408 2001-11-30 Fernando Perez <fperez@colorado.edu>
6405
6409
6406 * Version 0.1.18 released.
6410 * Version 0.1.18 released.
6407
6411
6408 * Fixed nasty namespace bug in initial module imports.
6412 * Fixed nasty namespace bug in initial module imports.
6409
6413
6410 * Added copyright/license notes to all code files (except
6414 * Added copyright/license notes to all code files (except
6411 DPyGetOpt). For the time being, LGPL. That could change.
6415 DPyGetOpt). For the time being, LGPL. That could change.
6412
6416
6413 * Rewrote a much nicer README, updated INSTALL, cleaned up
6417 * Rewrote a much nicer README, updated INSTALL, cleaned up
6414 ipythonrc-* samples.
6418 ipythonrc-* samples.
6415
6419
6416 * Overall code/documentation cleanup. Basically ready for
6420 * Overall code/documentation cleanup. Basically ready for
6417 release. Only remaining thing: licence decision (LGPL?).
6421 release. Only remaining thing: licence decision (LGPL?).
6418
6422
6419 * Converted load_config to a class, ConfigLoader. Now recursion
6423 * Converted load_config to a class, ConfigLoader. Now recursion
6420 control is better organized. Doesn't include the same file twice.
6424 control is better organized. Doesn't include the same file twice.
6421
6425
6422 2001-11-29 Fernando Perez <fperez@colorado.edu>
6426 2001-11-29 Fernando Perez <fperez@colorado.edu>
6423
6427
6424 * Got input history working. Changed output history variables from
6428 * Got input history working. Changed output history variables from
6425 _p to _o so that _i is for input and _o for output. Just cleaner
6429 _p to _o so that _i is for input and _o for output. Just cleaner
6426 convention.
6430 convention.
6427
6431
6428 * Implemented parametric aliases. This pretty much allows the
6432 * Implemented parametric aliases. This pretty much allows the
6429 alias system to offer full-blown shell convenience, I think.
6433 alias system to offer full-blown shell convenience, I think.
6430
6434
6431 * Version 0.1.17 released, 0.1.18 opened.
6435 * Version 0.1.17 released, 0.1.18 opened.
6432
6436
6433 * dot_ipython/ipythonrc (alias): added documentation.
6437 * dot_ipython/ipythonrc (alias): added documentation.
6434 (xcolor): Fixed small bug (xcolors -> xcolor)
6438 (xcolor): Fixed small bug (xcolors -> xcolor)
6435
6439
6436 * Changed the alias system. Now alias is a magic command to define
6440 * Changed the alias system. Now alias is a magic command to define
6437 aliases just like the shell. Rationale: the builtin magics should
6441 aliases just like the shell. Rationale: the builtin magics should
6438 be there for things deeply connected to IPython's
6442 be there for things deeply connected to IPython's
6439 architecture. And this is a much lighter system for what I think
6443 architecture. And this is a much lighter system for what I think
6440 is the really important feature: allowing users to define quickly
6444 is the really important feature: allowing users to define quickly
6441 magics that will do shell things for them, so they can customize
6445 magics that will do shell things for them, so they can customize
6442 IPython easily to match their work habits. If someone is really
6446 IPython easily to match their work habits. If someone is really
6443 desperate to have another name for a builtin alias, they can
6447 desperate to have another name for a builtin alias, they can
6444 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6448 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6445 works.
6449 works.
6446
6450
6447 2001-11-28 Fernando Perez <fperez@colorado.edu>
6451 2001-11-28 Fernando Perez <fperez@colorado.edu>
6448
6452
6449 * Changed @file so that it opens the source file at the proper
6453 * Changed @file so that it opens the source file at the proper
6450 line. Since it uses less, if your EDITOR environment is
6454 line. Since it uses less, if your EDITOR environment is
6451 configured, typing v will immediately open your editor of choice
6455 configured, typing v will immediately open your editor of choice
6452 right at the line where the object is defined. Not as quick as
6456 right at the line where the object is defined. Not as quick as
6453 having a direct @edit command, but for all intents and purposes it
6457 having a direct @edit command, but for all intents and purposes it
6454 works. And I don't have to worry about writing @edit to deal with
6458 works. And I don't have to worry about writing @edit to deal with
6455 all the editors, less does that.
6459 all the editors, less does that.
6456
6460
6457 * Version 0.1.16 released, 0.1.17 opened.
6461 * Version 0.1.16 released, 0.1.17 opened.
6458
6462
6459 * Fixed some nasty bugs in the page/page_dumb combo that could
6463 * Fixed some nasty bugs in the page/page_dumb combo that could
6460 crash IPython.
6464 crash IPython.
6461
6465
6462 2001-11-27 Fernando Perez <fperez@colorado.edu>
6466 2001-11-27 Fernando Perez <fperez@colorado.edu>
6463
6467
6464 * Version 0.1.15 released, 0.1.16 opened.
6468 * Version 0.1.15 released, 0.1.16 opened.
6465
6469
6466 * Finally got ? and ?? to work for undefined things: now it's
6470 * Finally got ? and ?? to work for undefined things: now it's
6467 possible to type {}.get? and get information about the get method
6471 possible to type {}.get? and get information about the get method
6468 of dicts, or os.path? even if only os is defined (so technically
6472 of dicts, or os.path? even if only os is defined (so technically
6469 os.path isn't). Works at any level. For example, after import os,
6473 os.path isn't). Works at any level. For example, after import os,
6470 os?, os.path?, os.path.abspath? all work. This is great, took some
6474 os?, os.path?, os.path.abspath? all work. This is great, took some
6471 work in _ofind.
6475 work in _ofind.
6472
6476
6473 * Fixed more bugs with logging. The sanest way to do it was to add
6477 * Fixed more bugs with logging. The sanest way to do it was to add
6474 to @log a 'mode' parameter. Killed two in one shot (this mode
6478 to @log a 'mode' parameter. Killed two in one shot (this mode
6475 option was a request of Janko's). I think it's finally clean
6479 option was a request of Janko's). I think it's finally clean
6476 (famous last words).
6480 (famous last words).
6477
6481
6478 * Added a page_dumb() pager which does a decent job of paging on
6482 * Added a page_dumb() pager which does a decent job of paging on
6479 screen, if better things (like less) aren't available. One less
6483 screen, if better things (like less) aren't available. One less
6480 unix dependency (someday maybe somebody will port this to
6484 unix dependency (someday maybe somebody will port this to
6481 windows).
6485 windows).
6482
6486
6483 * Fixed problem in magic_log: would lock of logging out if log
6487 * Fixed problem in magic_log: would lock of logging out if log
6484 creation failed (because it would still think it had succeeded).
6488 creation failed (because it would still think it had succeeded).
6485
6489
6486 * Improved the page() function using curses to auto-detect screen
6490 * Improved the page() function using curses to auto-detect screen
6487 size. Now it can make a much better decision on whether to print
6491 size. Now it can make a much better decision on whether to print
6488 or page a string. Option screen_length was modified: a value 0
6492 or page a string. Option screen_length was modified: a value 0
6489 means auto-detect, and that's the default now.
6493 means auto-detect, and that's the default now.
6490
6494
6491 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6495 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6492 go out. I'll test it for a few days, then talk to Janko about
6496 go out. I'll test it for a few days, then talk to Janko about
6493 licences and announce it.
6497 licences and announce it.
6494
6498
6495 * Fixed the length of the auto-generated ---> prompt which appears
6499 * Fixed the length of the auto-generated ---> prompt which appears
6496 for auto-parens and auto-quotes. Getting this right isn't trivial,
6500 for auto-parens and auto-quotes. Getting this right isn't trivial,
6497 with all the color escapes, different prompt types and optional
6501 with all the color escapes, different prompt types and optional
6498 separators. But it seems to be working in all the combinations.
6502 separators. But it seems to be working in all the combinations.
6499
6503
6500 2001-11-26 Fernando Perez <fperez@colorado.edu>
6504 2001-11-26 Fernando Perez <fperez@colorado.edu>
6501
6505
6502 * Wrote a regexp filter to get option types from the option names
6506 * Wrote a regexp filter to get option types from the option names
6503 string. This eliminates the need to manually keep two duplicate
6507 string. This eliminates the need to manually keep two duplicate
6504 lists.
6508 lists.
6505
6509
6506 * Removed the unneeded check_option_names. Now options are handled
6510 * Removed the unneeded check_option_names. Now options are handled
6507 in a much saner manner and it's easy to visually check that things
6511 in a much saner manner and it's easy to visually check that things
6508 are ok.
6512 are ok.
6509
6513
6510 * Updated version numbers on all files I modified to carry a
6514 * Updated version numbers on all files I modified to carry a
6511 notice so Janko and Nathan have clear version markers.
6515 notice so Janko and Nathan have clear version markers.
6512
6516
6513 * Updated docstring for ultraTB with my changes. I should send
6517 * Updated docstring for ultraTB with my changes. I should send
6514 this to Nathan.
6518 this to Nathan.
6515
6519
6516 * Lots of small fixes. Ran everything through pychecker again.
6520 * Lots of small fixes. Ran everything through pychecker again.
6517
6521
6518 * Made loading of deep_reload an cmd line option. If it's not too
6522 * Made loading of deep_reload an cmd line option. If it's not too
6519 kosher, now people can just disable it. With -nodeep_reload it's
6523 kosher, now people can just disable it. With -nodeep_reload it's
6520 still available as dreload(), it just won't overwrite reload().
6524 still available as dreload(), it just won't overwrite reload().
6521
6525
6522 * Moved many options to the no| form (-opt and -noopt
6526 * Moved many options to the no| form (-opt and -noopt
6523 accepted). Cleaner.
6527 accepted). Cleaner.
6524
6528
6525 * Changed magic_log so that if called with no parameters, it uses
6529 * Changed magic_log so that if called with no parameters, it uses
6526 'rotate' mode. That way auto-generated logs aren't automatically
6530 'rotate' mode. That way auto-generated logs aren't automatically
6527 over-written. For normal logs, now a backup is made if it exists
6531 over-written. For normal logs, now a backup is made if it exists
6528 (only 1 level of backups). A new 'backup' mode was added to the
6532 (only 1 level of backups). A new 'backup' mode was added to the
6529 Logger class to support this. This was a request by Janko.
6533 Logger class to support this. This was a request by Janko.
6530
6534
6531 * Added @logoff/@logon to stop/restart an active log.
6535 * Added @logoff/@logon to stop/restart an active log.
6532
6536
6533 * Fixed a lot of bugs in log saving/replay. It was pretty
6537 * Fixed a lot of bugs in log saving/replay. It was pretty
6534 broken. Now special lines (!@,/) appear properly in the command
6538 broken. Now special lines (!@,/) appear properly in the command
6535 history after a log replay.
6539 history after a log replay.
6536
6540
6537 * Tried and failed to implement full session saving via pickle. My
6541 * Tried and failed to implement full session saving via pickle. My
6538 idea was to pickle __main__.__dict__, but modules can't be
6542 idea was to pickle __main__.__dict__, but modules can't be
6539 pickled. This would be a better alternative to replaying logs, but
6543 pickled. This would be a better alternative to replaying logs, but
6540 seems quite tricky to get to work. Changed -session to be called
6544 seems quite tricky to get to work. Changed -session to be called
6541 -logplay, which more accurately reflects what it does. And if we
6545 -logplay, which more accurately reflects what it does. And if we
6542 ever get real session saving working, -session is now available.
6546 ever get real session saving working, -session is now available.
6543
6547
6544 * Implemented color schemes for prompts also. As for tracebacks,
6548 * Implemented color schemes for prompts also. As for tracebacks,
6545 currently only NoColor and Linux are supported. But now the
6549 currently only NoColor and Linux are supported. But now the
6546 infrastructure is in place, based on a generic ColorScheme
6550 infrastructure is in place, based on a generic ColorScheme
6547 class. So writing and activating new schemes both for the prompts
6551 class. So writing and activating new schemes both for the prompts
6548 and the tracebacks should be straightforward.
6552 and the tracebacks should be straightforward.
6549
6553
6550 * Version 0.1.13 released, 0.1.14 opened.
6554 * Version 0.1.13 released, 0.1.14 opened.
6551
6555
6552 * Changed handling of options for output cache. Now counter is
6556 * Changed handling of options for output cache. Now counter is
6553 hardwired starting at 1 and one specifies the maximum number of
6557 hardwired starting at 1 and one specifies the maximum number of
6554 entries *in the outcache* (not the max prompt counter). This is
6558 entries *in the outcache* (not the max prompt counter). This is
6555 much better, since many statements won't increase the cache
6559 much better, since many statements won't increase the cache
6556 count. It also eliminated some confusing options, now there's only
6560 count. It also eliminated some confusing options, now there's only
6557 one: cache_size.
6561 one: cache_size.
6558
6562
6559 * Added 'alias' magic function and magic_alias option in the
6563 * Added 'alias' magic function and magic_alias option in the
6560 ipythonrc file. Now the user can easily define whatever names he
6564 ipythonrc file. Now the user can easily define whatever names he
6561 wants for the magic functions without having to play weird
6565 wants for the magic functions without having to play weird
6562 namespace games. This gives IPython a real shell-like feel.
6566 namespace games. This gives IPython a real shell-like feel.
6563
6567
6564 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6568 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6565 @ or not).
6569 @ or not).
6566
6570
6567 This was one of the last remaining 'visible' bugs (that I know
6571 This was one of the last remaining 'visible' bugs (that I know
6568 of). I think if I can clean up the session loading so it works
6572 of). I think if I can clean up the session loading so it works
6569 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6573 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6570 about licensing).
6574 about licensing).
6571
6575
6572 2001-11-25 Fernando Perez <fperez@colorado.edu>
6576 2001-11-25 Fernando Perez <fperez@colorado.edu>
6573
6577
6574 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6578 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6575 there's a cleaner distinction between what ? and ?? show.
6579 there's a cleaner distinction between what ? and ?? show.
6576
6580
6577 * Added screen_length option. Now the user can define his own
6581 * Added screen_length option. Now the user can define his own
6578 screen size for page() operations.
6582 screen size for page() operations.
6579
6583
6580 * Implemented magic shell-like functions with automatic code
6584 * Implemented magic shell-like functions with automatic code
6581 generation. Now adding another function is just a matter of adding
6585 generation. Now adding another function is just a matter of adding
6582 an entry to a dict, and the function is dynamically generated at
6586 an entry to a dict, and the function is dynamically generated at
6583 run-time. Python has some really cool features!
6587 run-time. Python has some really cool features!
6584
6588
6585 * Renamed many options to cleanup conventions a little. Now all
6589 * Renamed many options to cleanup conventions a little. Now all
6586 are lowercase, and only underscores where needed. Also in the code
6590 are lowercase, and only underscores where needed. Also in the code
6587 option name tables are clearer.
6591 option name tables are clearer.
6588
6592
6589 * Changed prompts a little. Now input is 'In [n]:' instead of
6593 * Changed prompts a little. Now input is 'In [n]:' instead of
6590 'In[n]:='. This allows it the numbers to be aligned with the
6594 'In[n]:='. This allows it the numbers to be aligned with the
6591 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6595 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6592 Python (it was a Mathematica thing). The '...' continuation prompt
6596 Python (it was a Mathematica thing). The '...' continuation prompt
6593 was also changed a little to align better.
6597 was also changed a little to align better.
6594
6598
6595 * Fixed bug when flushing output cache. Not all _p<n> variables
6599 * Fixed bug when flushing output cache. Not all _p<n> variables
6596 exist, so their deletion needs to be wrapped in a try:
6600 exist, so their deletion needs to be wrapped in a try:
6597
6601
6598 * Figured out how to properly use inspect.formatargspec() (it
6602 * Figured out how to properly use inspect.formatargspec() (it
6599 requires the args preceded by *). So I removed all the code from
6603 requires the args preceded by *). So I removed all the code from
6600 _get_pdef in Magic, which was just replicating that.
6604 _get_pdef in Magic, which was just replicating that.
6601
6605
6602 * Added test to prefilter to allow redefining magic function names
6606 * Added test to prefilter to allow redefining magic function names
6603 as variables. This is ok, since the @ form is always available,
6607 as variables. This is ok, since the @ form is always available,
6604 but whe should allow the user to define a variable called 'ls' if
6608 but whe should allow the user to define a variable called 'ls' if
6605 he needs it.
6609 he needs it.
6606
6610
6607 * Moved the ToDo information from README into a separate ToDo.
6611 * Moved the ToDo information from README into a separate ToDo.
6608
6612
6609 * General code cleanup and small bugfixes. I think it's close to a
6613 * General code cleanup and small bugfixes. I think it's close to a
6610 state where it can be released, obviously with a big 'beta'
6614 state where it can be released, obviously with a big 'beta'
6611 warning on it.
6615 warning on it.
6612
6616
6613 * Got the magic function split to work. Now all magics are defined
6617 * Got the magic function split to work. Now all magics are defined
6614 in a separate class. It just organizes things a bit, and now
6618 in a separate class. It just organizes things a bit, and now
6615 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6619 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6616 was too long).
6620 was too long).
6617
6621
6618 * Changed @clear to @reset to avoid potential confusions with
6622 * Changed @clear to @reset to avoid potential confusions with
6619 the shell command clear. Also renamed @cl to @clear, which does
6623 the shell command clear. Also renamed @cl to @clear, which does
6620 exactly what people expect it to from their shell experience.
6624 exactly what people expect it to from their shell experience.
6621
6625
6622 Added a check to the @reset command (since it's so
6626 Added a check to the @reset command (since it's so
6623 destructive, it's probably a good idea to ask for confirmation).
6627 destructive, it's probably a good idea to ask for confirmation).
6624 But now reset only works for full namespace resetting. Since the
6628 But now reset only works for full namespace resetting. Since the
6625 del keyword is already there for deleting a few specific
6629 del keyword is already there for deleting a few specific
6626 variables, I don't see the point of having a redundant magic
6630 variables, I don't see the point of having a redundant magic
6627 function for the same task.
6631 function for the same task.
6628
6632
6629 2001-11-24 Fernando Perez <fperez@colorado.edu>
6633 2001-11-24 Fernando Perez <fperez@colorado.edu>
6630
6634
6631 * Updated the builtin docs (esp. the ? ones).
6635 * Updated the builtin docs (esp. the ? ones).
6632
6636
6633 * Ran all the code through pychecker. Not terribly impressed with
6637 * Ran all the code through pychecker. Not terribly impressed with
6634 it: lots of spurious warnings and didn't really find anything of
6638 it: lots of spurious warnings and didn't really find anything of
6635 substance (just a few modules being imported and not used).
6639 substance (just a few modules being imported and not used).
6636
6640
6637 * Implemented the new ultraTB functionality into IPython. New
6641 * Implemented the new ultraTB functionality into IPython. New
6638 option: xcolors. This chooses color scheme. xmode now only selects
6642 option: xcolors. This chooses color scheme. xmode now only selects
6639 between Plain and Verbose. Better orthogonality.
6643 between Plain and Verbose. Better orthogonality.
6640
6644
6641 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6645 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6642 mode and color scheme for the exception handlers. Now it's
6646 mode and color scheme for the exception handlers. Now it's
6643 possible to have the verbose traceback with no coloring.
6647 possible to have the verbose traceback with no coloring.
6644
6648
6645 2001-11-23 Fernando Perez <fperez@colorado.edu>
6649 2001-11-23 Fernando Perez <fperez@colorado.edu>
6646
6650
6647 * Version 0.1.12 released, 0.1.13 opened.
6651 * Version 0.1.12 released, 0.1.13 opened.
6648
6652
6649 * Removed option to set auto-quote and auto-paren escapes by
6653 * Removed option to set auto-quote and auto-paren escapes by
6650 user. The chances of breaking valid syntax are just too high. If
6654 user. The chances of breaking valid syntax are just too high. If
6651 someone *really* wants, they can always dig into the code.
6655 someone *really* wants, they can always dig into the code.
6652
6656
6653 * Made prompt separators configurable.
6657 * Made prompt separators configurable.
6654
6658
6655 2001-11-22 Fernando Perez <fperez@colorado.edu>
6659 2001-11-22 Fernando Perez <fperez@colorado.edu>
6656
6660
6657 * Small bugfixes in many places.
6661 * Small bugfixes in many places.
6658
6662
6659 * Removed the MyCompleter class from ipplib. It seemed redundant
6663 * Removed the MyCompleter class from ipplib. It seemed redundant
6660 with the C-p,C-n history search functionality. Less code to
6664 with the C-p,C-n history search functionality. Less code to
6661 maintain.
6665 maintain.
6662
6666
6663 * Moved all the original ipython.py code into ipythonlib.py. Right
6667 * Moved all the original ipython.py code into ipythonlib.py. Right
6664 now it's just one big dump into a function called make_IPython, so
6668 now it's just one big dump into a function called make_IPython, so
6665 no real modularity has been gained. But at least it makes the
6669 no real modularity has been gained. But at least it makes the
6666 wrapper script tiny, and since ipythonlib is a module, it gets
6670 wrapper script tiny, and since ipythonlib is a module, it gets
6667 compiled and startup is much faster.
6671 compiled and startup is much faster.
6668
6672
6669 This is a reasobably 'deep' change, so we should test it for a
6673 This is a reasobably 'deep' change, so we should test it for a
6670 while without messing too much more with the code.
6674 while without messing too much more with the code.
6671
6675
6672 2001-11-21 Fernando Perez <fperez@colorado.edu>
6676 2001-11-21 Fernando Perez <fperez@colorado.edu>
6673
6677
6674 * Version 0.1.11 released, 0.1.12 opened for further work.
6678 * Version 0.1.11 released, 0.1.12 opened for further work.
6675
6679
6676 * Removed dependency on Itpl. It was only needed in one place. It
6680 * Removed dependency on Itpl. It was only needed in one place. It
6677 would be nice if this became part of python, though. It makes life
6681 would be nice if this became part of python, though. It makes life
6678 *a lot* easier in some cases.
6682 *a lot* easier in some cases.
6679
6683
6680 * Simplified the prefilter code a bit. Now all handlers are
6684 * Simplified the prefilter code a bit. Now all handlers are
6681 expected to explicitly return a value (at least a blank string).
6685 expected to explicitly return a value (at least a blank string).
6682
6686
6683 * Heavy edits in ipplib. Removed the help system altogether. Now
6687 * Heavy edits in ipplib. Removed the help system altogether. Now
6684 obj?/?? is used for inspecting objects, a magic @doc prints
6688 obj?/?? is used for inspecting objects, a magic @doc prints
6685 docstrings, and full-blown Python help is accessed via the 'help'
6689 docstrings, and full-blown Python help is accessed via the 'help'
6686 keyword. This cleans up a lot of code (less to maintain) and does
6690 keyword. This cleans up a lot of code (less to maintain) and does
6687 the job. Since 'help' is now a standard Python component, might as
6691 the job. Since 'help' is now a standard Python component, might as
6688 well use it and remove duplicate functionality.
6692 well use it and remove duplicate functionality.
6689
6693
6690 Also removed the option to use ipplib as a standalone program. By
6694 Also removed the option to use ipplib as a standalone program. By
6691 now it's too dependent on other parts of IPython to function alone.
6695 now it's too dependent on other parts of IPython to function alone.
6692
6696
6693 * Fixed bug in genutils.pager. It would crash if the pager was
6697 * Fixed bug in genutils.pager. It would crash if the pager was
6694 exited immediately after opening (broken pipe).
6698 exited immediately after opening (broken pipe).
6695
6699
6696 * Trimmed down the VerboseTB reporting a little. The header is
6700 * Trimmed down the VerboseTB reporting a little. The header is
6697 much shorter now and the repeated exception arguments at the end
6701 much shorter now and the repeated exception arguments at the end
6698 have been removed. For interactive use the old header seemed a bit
6702 have been removed. For interactive use the old header seemed a bit
6699 excessive.
6703 excessive.
6700
6704
6701 * Fixed small bug in output of @whos for variables with multi-word
6705 * Fixed small bug in output of @whos for variables with multi-word
6702 types (only first word was displayed).
6706 types (only first word was displayed).
6703
6707
6704 2001-11-17 Fernando Perez <fperez@colorado.edu>
6708 2001-11-17 Fernando Perez <fperez@colorado.edu>
6705
6709
6706 * Version 0.1.10 released, 0.1.11 opened for further work.
6710 * Version 0.1.10 released, 0.1.11 opened for further work.
6707
6711
6708 * Modified dirs and friends. dirs now *returns* the stack (not
6712 * Modified dirs and friends. dirs now *returns* the stack (not
6709 prints), so one can manipulate it as a variable. Convenient to
6713 prints), so one can manipulate it as a variable. Convenient to
6710 travel along many directories.
6714 travel along many directories.
6711
6715
6712 * Fixed bug in magic_pdef: would only work with functions with
6716 * Fixed bug in magic_pdef: would only work with functions with
6713 arguments with default values.
6717 arguments with default values.
6714
6718
6715 2001-11-14 Fernando Perez <fperez@colorado.edu>
6719 2001-11-14 Fernando Perez <fperez@colorado.edu>
6716
6720
6717 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6721 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6718 example with IPython. Various other minor fixes and cleanups.
6722 example with IPython. Various other minor fixes and cleanups.
6719
6723
6720 * Version 0.1.9 released, 0.1.10 opened for further work.
6724 * Version 0.1.9 released, 0.1.10 opened for further work.
6721
6725
6722 * Added sys.path to the list of directories searched in the
6726 * Added sys.path to the list of directories searched in the
6723 execfile= option. It used to be the current directory and the
6727 execfile= option. It used to be the current directory and the
6724 user's IPYTHONDIR only.
6728 user's IPYTHONDIR only.
6725
6729
6726 2001-11-13 Fernando Perez <fperez@colorado.edu>
6730 2001-11-13 Fernando Perez <fperez@colorado.edu>
6727
6731
6728 * Reinstated the raw_input/prefilter separation that Janko had
6732 * Reinstated the raw_input/prefilter separation that Janko had
6729 initially. This gives a more convenient setup for extending the
6733 initially. This gives a more convenient setup for extending the
6730 pre-processor from the outside: raw_input always gets a string,
6734 pre-processor from the outside: raw_input always gets a string,
6731 and prefilter has to process it. We can then redefine prefilter
6735 and prefilter has to process it. We can then redefine prefilter
6732 from the outside and implement extensions for special
6736 from the outside and implement extensions for special
6733 purposes.
6737 purposes.
6734
6738
6735 Today I got one for inputting PhysicalQuantity objects
6739 Today I got one for inputting PhysicalQuantity objects
6736 (from Scientific) without needing any function calls at
6740 (from Scientific) without needing any function calls at
6737 all. Extremely convenient, and it's all done as a user-level
6741 all. Extremely convenient, and it's all done as a user-level
6738 extension (no IPython code was touched). Now instead of:
6742 extension (no IPython code was touched). Now instead of:
6739 a = PhysicalQuantity(4.2,'m/s**2')
6743 a = PhysicalQuantity(4.2,'m/s**2')
6740 one can simply say
6744 one can simply say
6741 a = 4.2 m/s**2
6745 a = 4.2 m/s**2
6742 or even
6746 or even
6743 a = 4.2 m/s^2
6747 a = 4.2 m/s^2
6744
6748
6745 I use this, but it's also a proof of concept: IPython really is
6749 I use this, but it's also a proof of concept: IPython really is
6746 fully user-extensible, even at the level of the parsing of the
6750 fully user-extensible, even at the level of the parsing of the
6747 command line. It's not trivial, but it's perfectly doable.
6751 command line. It's not trivial, but it's perfectly doable.
6748
6752
6749 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6753 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6750 the problem of modules being loaded in the inverse order in which
6754 the problem of modules being loaded in the inverse order in which
6751 they were defined in
6755 they were defined in
6752
6756
6753 * Version 0.1.8 released, 0.1.9 opened for further work.
6757 * Version 0.1.8 released, 0.1.9 opened for further work.
6754
6758
6755 * Added magics pdef, source and file. They respectively show the
6759 * Added magics pdef, source and file. They respectively show the
6756 definition line ('prototype' in C), source code and full python
6760 definition line ('prototype' in C), source code and full python
6757 file for any callable object. The object inspector oinfo uses
6761 file for any callable object. The object inspector oinfo uses
6758 these to show the same information.
6762 these to show the same information.
6759
6763
6760 * Version 0.1.7 released, 0.1.8 opened for further work.
6764 * Version 0.1.7 released, 0.1.8 opened for further work.
6761
6765
6762 * Separated all the magic functions into a class called Magic. The
6766 * Separated all the magic functions into a class called Magic. The
6763 InteractiveShell class was becoming too big for Xemacs to handle
6767 InteractiveShell class was becoming too big for Xemacs to handle
6764 (de-indenting a line would lock it up for 10 seconds while it
6768 (de-indenting a line would lock it up for 10 seconds while it
6765 backtracked on the whole class!)
6769 backtracked on the whole class!)
6766
6770
6767 FIXME: didn't work. It can be done, but right now namespaces are
6771 FIXME: didn't work. It can be done, but right now namespaces are
6768 all messed up. Do it later (reverted it for now, so at least
6772 all messed up. Do it later (reverted it for now, so at least
6769 everything works as before).
6773 everything works as before).
6770
6774
6771 * Got the object introspection system (magic_oinfo) working! I
6775 * Got the object introspection system (magic_oinfo) working! I
6772 think this is pretty much ready for release to Janko, so he can
6776 think this is pretty much ready for release to Janko, so he can
6773 test it for a while and then announce it. Pretty much 100% of what
6777 test it for a while and then announce it. Pretty much 100% of what
6774 I wanted for the 'phase 1' release is ready. Happy, tired.
6778 I wanted for the 'phase 1' release is ready. Happy, tired.
6775
6779
6776 2001-11-12 Fernando Perez <fperez@colorado.edu>
6780 2001-11-12 Fernando Perez <fperez@colorado.edu>
6777
6781
6778 * Version 0.1.6 released, 0.1.7 opened for further work.
6782 * Version 0.1.6 released, 0.1.7 opened for further work.
6779
6783
6780 * Fixed bug in printing: it used to test for truth before
6784 * Fixed bug in printing: it used to test for truth before
6781 printing, so 0 wouldn't print. Now checks for None.
6785 printing, so 0 wouldn't print. Now checks for None.
6782
6786
6783 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6787 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6784 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6788 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6785 reaches by hand into the outputcache. Think of a better way to do
6789 reaches by hand into the outputcache. Think of a better way to do
6786 this later.
6790 this later.
6787
6791
6788 * Various small fixes thanks to Nathan's comments.
6792 * Various small fixes thanks to Nathan's comments.
6789
6793
6790 * Changed magic_pprint to magic_Pprint. This way it doesn't
6794 * Changed magic_pprint to magic_Pprint. This way it doesn't
6791 collide with pprint() and the name is consistent with the command
6795 collide with pprint() and the name is consistent with the command
6792 line option.
6796 line option.
6793
6797
6794 * Changed prompt counter behavior to be fully like
6798 * Changed prompt counter behavior to be fully like
6795 Mathematica's. That is, even input that doesn't return a result
6799 Mathematica's. That is, even input that doesn't return a result
6796 raises the prompt counter. The old behavior was kind of confusing
6800 raises the prompt counter. The old behavior was kind of confusing
6797 (getting the same prompt number several times if the operation
6801 (getting the same prompt number several times if the operation
6798 didn't return a result).
6802 didn't return a result).
6799
6803
6800 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6804 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6801
6805
6802 * Fixed -Classic mode (wasn't working anymore).
6806 * Fixed -Classic mode (wasn't working anymore).
6803
6807
6804 * Added colored prompts using Nathan's new code. Colors are
6808 * Added colored prompts using Nathan's new code. Colors are
6805 currently hardwired, they can be user-configurable. For
6809 currently hardwired, they can be user-configurable. For
6806 developers, they can be chosen in file ipythonlib.py, at the
6810 developers, they can be chosen in file ipythonlib.py, at the
6807 beginning of the CachedOutput class def.
6811 beginning of the CachedOutput class def.
6808
6812
6809 2001-11-11 Fernando Perez <fperez@colorado.edu>
6813 2001-11-11 Fernando Perez <fperez@colorado.edu>
6810
6814
6811 * Version 0.1.5 released, 0.1.6 opened for further work.
6815 * Version 0.1.5 released, 0.1.6 opened for further work.
6812
6816
6813 * Changed magic_env to *return* the environment as a dict (not to
6817 * Changed magic_env to *return* the environment as a dict (not to
6814 print it). This way it prints, but it can also be processed.
6818 print it). This way it prints, but it can also be processed.
6815
6819
6816 * Added Verbose exception reporting to interactive
6820 * Added Verbose exception reporting to interactive
6817 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6821 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6818 traceback. Had to make some changes to the ultraTB file. This is
6822 traceback. Had to make some changes to the ultraTB file. This is
6819 probably the last 'big' thing in my mental todo list. This ties
6823 probably the last 'big' thing in my mental todo list. This ties
6820 in with the next entry:
6824 in with the next entry:
6821
6825
6822 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6826 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6823 has to specify is Plain, Color or Verbose for all exception
6827 has to specify is Plain, Color or Verbose for all exception
6824 handling.
6828 handling.
6825
6829
6826 * Removed ShellServices option. All this can really be done via
6830 * Removed ShellServices option. All this can really be done via
6827 the magic system. It's easier to extend, cleaner and has automatic
6831 the magic system. It's easier to extend, cleaner and has automatic
6828 namespace protection and documentation.
6832 namespace protection and documentation.
6829
6833
6830 2001-11-09 Fernando Perez <fperez@colorado.edu>
6834 2001-11-09 Fernando Perez <fperez@colorado.edu>
6831
6835
6832 * Fixed bug in output cache flushing (missing parameter to
6836 * Fixed bug in output cache flushing (missing parameter to
6833 __init__). Other small bugs fixed (found using pychecker).
6837 __init__). Other small bugs fixed (found using pychecker).
6834
6838
6835 * Version 0.1.4 opened for bugfixing.
6839 * Version 0.1.4 opened for bugfixing.
6836
6840
6837 2001-11-07 Fernando Perez <fperez@colorado.edu>
6841 2001-11-07 Fernando Perez <fperez@colorado.edu>
6838
6842
6839 * Version 0.1.3 released, mainly because of the raw_input bug.
6843 * Version 0.1.3 released, mainly because of the raw_input bug.
6840
6844
6841 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6845 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6842 and when testing for whether things were callable, a call could
6846 and when testing for whether things were callable, a call could
6843 actually be made to certain functions. They would get called again
6847 actually be made to certain functions. They would get called again
6844 once 'really' executed, with a resulting double call. A disaster
6848 once 'really' executed, with a resulting double call. A disaster
6845 in many cases (list.reverse() would never work!).
6849 in many cases (list.reverse() would never work!).
6846
6850
6847 * Removed prefilter() function, moved its code to raw_input (which
6851 * Removed prefilter() function, moved its code to raw_input (which
6848 after all was just a near-empty caller for prefilter). This saves
6852 after all was just a near-empty caller for prefilter). This saves
6849 a function call on every prompt, and simplifies the class a tiny bit.
6853 a function call on every prompt, and simplifies the class a tiny bit.
6850
6854
6851 * Fix _ip to __ip name in magic example file.
6855 * Fix _ip to __ip name in magic example file.
6852
6856
6853 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6857 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6854 work with non-gnu versions of tar.
6858 work with non-gnu versions of tar.
6855
6859
6856 2001-11-06 Fernando Perez <fperez@colorado.edu>
6860 2001-11-06 Fernando Perez <fperez@colorado.edu>
6857
6861
6858 * Version 0.1.2. Just to keep track of the recent changes.
6862 * Version 0.1.2. Just to keep track of the recent changes.
6859
6863
6860 * Fixed nasty bug in output prompt routine. It used to check 'if
6864 * Fixed nasty bug in output prompt routine. It used to check 'if
6861 arg != None...'. Problem is, this fails if arg implements a
6865 arg != None...'. Problem is, this fails if arg implements a
6862 special comparison (__cmp__) which disallows comparing to
6866 special comparison (__cmp__) which disallows comparing to
6863 None. Found it when trying to use the PhysicalQuantity module from
6867 None. Found it when trying to use the PhysicalQuantity module from
6864 ScientificPython.
6868 ScientificPython.
6865
6869
6866 2001-11-05 Fernando Perez <fperez@colorado.edu>
6870 2001-11-05 Fernando Perez <fperez@colorado.edu>
6867
6871
6868 * Also added dirs. Now the pushd/popd/dirs family functions
6872 * Also added dirs. Now the pushd/popd/dirs family functions
6869 basically like the shell, with the added convenience of going home
6873 basically like the shell, with the added convenience of going home
6870 when called with no args.
6874 when called with no args.
6871
6875
6872 * pushd/popd slightly modified to mimic shell behavior more
6876 * pushd/popd slightly modified to mimic shell behavior more
6873 closely.
6877 closely.
6874
6878
6875 * Added env,pushd,popd from ShellServices as magic functions. I
6879 * Added env,pushd,popd from ShellServices as magic functions. I
6876 think the cleanest will be to port all desired functions from
6880 think the cleanest will be to port all desired functions from
6877 ShellServices as magics and remove ShellServices altogether. This
6881 ShellServices as magics and remove ShellServices altogether. This
6878 will provide a single, clean way of adding functionality
6882 will provide a single, clean way of adding functionality
6879 (shell-type or otherwise) to IP.
6883 (shell-type or otherwise) to IP.
6880
6884
6881 2001-11-04 Fernando Perez <fperez@colorado.edu>
6885 2001-11-04 Fernando Perez <fperez@colorado.edu>
6882
6886
6883 * Added .ipython/ directory to sys.path. This way users can keep
6887 * Added .ipython/ directory to sys.path. This way users can keep
6884 customizations there and access them via import.
6888 customizations there and access them via import.
6885
6889
6886 2001-11-03 Fernando Perez <fperez@colorado.edu>
6890 2001-11-03 Fernando Perez <fperez@colorado.edu>
6887
6891
6888 * Opened version 0.1.1 for new changes.
6892 * Opened version 0.1.1 for new changes.
6889
6893
6890 * Changed version number to 0.1.0: first 'public' release, sent to
6894 * Changed version number to 0.1.0: first 'public' release, sent to
6891 Nathan and Janko.
6895 Nathan and Janko.
6892
6896
6893 * Lots of small fixes and tweaks.
6897 * Lots of small fixes and tweaks.
6894
6898
6895 * Minor changes to whos format. Now strings are shown, snipped if
6899 * Minor changes to whos format. Now strings are shown, snipped if
6896 too long.
6900 too long.
6897
6901
6898 * Changed ShellServices to work on __main__ so they show up in @who
6902 * Changed ShellServices to work on __main__ so they show up in @who
6899
6903
6900 * Help also works with ? at the end of a line:
6904 * Help also works with ? at the end of a line:
6901 ?sin and sin?
6905 ?sin and sin?
6902 both produce the same effect. This is nice, as often I use the
6906 both produce the same effect. This is nice, as often I use the
6903 tab-complete to find the name of a method, but I used to then have
6907 tab-complete to find the name of a method, but I used to then have
6904 to go to the beginning of the line to put a ? if I wanted more
6908 to go to the beginning of the line to put a ? if I wanted more
6905 info. Now I can just add the ? and hit return. Convenient.
6909 info. Now I can just add the ? and hit return. Convenient.
6906
6910
6907 2001-11-02 Fernando Perez <fperez@colorado.edu>
6911 2001-11-02 Fernando Perez <fperez@colorado.edu>
6908
6912
6909 * Python version check (>=2.1) added.
6913 * Python version check (>=2.1) added.
6910
6914
6911 * Added LazyPython documentation. At this point the docs are quite
6915 * Added LazyPython documentation. At this point the docs are quite
6912 a mess. A cleanup is in order.
6916 a mess. A cleanup is in order.
6913
6917
6914 * Auto-installer created. For some bizarre reason, the zipfiles
6918 * Auto-installer created. For some bizarre reason, the zipfiles
6915 module isn't working on my system. So I made a tar version
6919 module isn't working on my system. So I made a tar version
6916 (hopefully the command line options in various systems won't kill
6920 (hopefully the command line options in various systems won't kill
6917 me).
6921 me).
6918
6922
6919 * Fixes to Struct in genutils. Now all dictionary-like methods are
6923 * Fixes to Struct in genutils. Now all dictionary-like methods are
6920 protected (reasonably).
6924 protected (reasonably).
6921
6925
6922 * Added pager function to genutils and changed ? to print usage
6926 * Added pager function to genutils and changed ? to print usage
6923 note through it (it was too long).
6927 note through it (it was too long).
6924
6928
6925 * Added the LazyPython functionality. Works great! I changed the
6929 * Added the LazyPython functionality. Works great! I changed the
6926 auto-quote escape to ';', it's on home row and next to '. But
6930 auto-quote escape to ';', it's on home row and next to '. But
6927 both auto-quote and auto-paren (still /) escapes are command-line
6931 both auto-quote and auto-paren (still /) escapes are command-line
6928 parameters.
6932 parameters.
6929
6933
6930
6934
6931 2001-11-01 Fernando Perez <fperez@colorado.edu>
6935 2001-11-01 Fernando Perez <fperez@colorado.edu>
6932
6936
6933 * Version changed to 0.0.7. Fairly large change: configuration now
6937 * Version changed to 0.0.7. Fairly large change: configuration now
6934 is all stored in a directory, by default .ipython. There, all
6938 is all stored in a directory, by default .ipython. There, all
6935 config files have normal looking names (not .names)
6939 config files have normal looking names (not .names)
6936
6940
6937 * Version 0.0.6 Released first to Lucas and Archie as a test
6941 * Version 0.0.6 Released first to Lucas and Archie as a test
6938 run. Since it's the first 'semi-public' release, change version to
6942 run. Since it's the first 'semi-public' release, change version to
6939 > 0.0.6 for any changes now.
6943 > 0.0.6 for any changes now.
6940
6944
6941 * Stuff I had put in the ipplib.py changelog:
6945 * Stuff I had put in the ipplib.py changelog:
6942
6946
6943 Changes to InteractiveShell:
6947 Changes to InteractiveShell:
6944
6948
6945 - Made the usage message a parameter.
6949 - Made the usage message a parameter.
6946
6950
6947 - Require the name of the shell variable to be given. It's a bit
6951 - Require the name of the shell variable to be given. It's a bit
6948 of a hack, but allows the name 'shell' not to be hardwired in the
6952 of a hack, but allows the name 'shell' not to be hardwired in the
6949 magic (@) handler, which is problematic b/c it requires
6953 magic (@) handler, which is problematic b/c it requires
6950 polluting the global namespace with 'shell'. This in turn is
6954 polluting the global namespace with 'shell'. This in turn is
6951 fragile: if a user redefines a variable called shell, things
6955 fragile: if a user redefines a variable called shell, things
6952 break.
6956 break.
6953
6957
6954 - magic @: all functions available through @ need to be defined
6958 - magic @: all functions available through @ need to be defined
6955 as magic_<name>, even though they can be called simply as
6959 as magic_<name>, even though they can be called simply as
6956 @<name>. This allows the special command @magic to gather
6960 @<name>. This allows the special command @magic to gather
6957 information automatically about all existing magic functions,
6961 information automatically about all existing magic functions,
6958 even if they are run-time user extensions, by parsing the shell
6962 even if they are run-time user extensions, by parsing the shell
6959 instance __dict__ looking for special magic_ names.
6963 instance __dict__ looking for special magic_ names.
6960
6964
6961 - mainloop: added *two* local namespace parameters. This allows
6965 - mainloop: added *two* local namespace parameters. This allows
6962 the class to differentiate between parameters which were there
6966 the class to differentiate between parameters which were there
6963 before and after command line initialization was processed. This
6967 before and after command line initialization was processed. This
6964 way, later @who can show things loaded at startup by the
6968 way, later @who can show things loaded at startup by the
6965 user. This trick was necessary to make session saving/reloading
6969 user. This trick was necessary to make session saving/reloading
6966 really work: ideally after saving/exiting/reloading a session,
6970 really work: ideally after saving/exiting/reloading a session,
6967 *everything* should look the same, including the output of @who. I
6971 *everything* should look the same, including the output of @who. I
6968 was only able to make this work with this double namespace
6972 was only able to make this work with this double namespace
6969 trick.
6973 trick.
6970
6974
6971 - added a header to the logfile which allows (almost) full
6975 - added a header to the logfile which allows (almost) full
6972 session restoring.
6976 session restoring.
6973
6977
6974 - prepend lines beginning with @ or !, with a and log
6978 - prepend lines beginning with @ or !, with a and log
6975 them. Why? !lines: may be useful to know what you did @lines:
6979 them. Why? !lines: may be useful to know what you did @lines:
6976 they may affect session state. So when restoring a session, at
6980 they may affect session state. So when restoring a session, at
6977 least inform the user of their presence. I couldn't quite get
6981 least inform the user of their presence. I couldn't quite get
6978 them to properly re-execute, but at least the user is warned.
6982 them to properly re-execute, but at least the user is warned.
6979
6983
6980 * Started ChangeLog.
6984 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now