##// END OF EJS Templates
- New profile with doctest support (two way: for generating doctests and for...
fperez -
Show More
@@ -0,0 +1,40 b''
1 """Config file for 'doctest' profile.
2
3 This profile modifies the prompts to be the standard Python ones, so that you
4 can generate easily doctests from an IPython session.
5
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
8 docstrings. This allows you to easily re-run existing doctests and iteratively
9 work on them as part of your development workflow.
10
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."""
13
14 # get various stuff that are there for historical / familiarity reasons
15 import ipy_legacy
16
17 from IPython import ipapi
18
19 from IPython.Extensions import InterpreterPasteInput
20
21 def main():
22 ip = ipapi.get()
23 o = ip.options
24
25 # Set the prompts similar to the defaults
26 o.prompt_in1 = '>>> '
27 o.prompt_in2 = '... '
28 o.prompt_out = ''
29
30 # No separation between successive inputs
31 o.separate_in = ''
32
33 # Disable pprint, so that outputs are printed as similarly to standard
34 # python as possible
35 o.pprint = 0
36
37 # Use plain exceptions, to also resemble normal pyhton.
38 o.xmode = 'plain'
39
40 main()
@@ -1,91 +1,118 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Modified input prompt for entering text with >>> or ... at the start.
2 """Modified input prompt for entering text with >>> or ... at the start.
3
3
4 We define a special input line filter to allow typing lines which begin with
4 We define a special input line filter to allow typing lines which begin with
5 '>>> ' or '... '. These two strings, if present at the start of the input
5 '>>> ' or '... '. These two strings, if present at the start of the input
6 line, are stripped. This allows for direct pasting of code from examples such
6 line, are stripped. This allows for direct pasting of code from examples such
7 as those available in the standard Python tutorial.
7 as those available in the standard Python tutorial.
8
8
9 Normally pasting such code is one chunk is impossible because of the
9 Normally pasting such code is one chunk is impossible because of the
10 extraneous >>> and ..., requiring one to do a line by line paste with careful
10 extraneous >>> and ..., requiring one to do a line by line paste with careful
11 removal of those characters. This module allows pasting that kind of
11 removal of those characters. This module allows pasting that kind of
12 multi-line examples in one pass.
12 multi-line examples in one pass.
13
13
14 Here is an 'screenshot' of a section of the tutorial pasted into IPython with
14 Here is an 'screenshot' of a section of the tutorial pasted into IPython with
15 this feature enabled:
15 this feature enabled:
16
16
17 In [1]: >>> def fib2(n): # return Fibonacci series up to n
17 In [1]: >>> def fib2(n): # return Fibonacci series up to n
18 ...: ... '''Return a list containing the Fibonacci series up to n.'''
18 ...: ... '''Return a list containing the Fibonacci series up to n.'''
19 ...: ... result = []
19 ...: ... result = []
20 ...: ... a, b = 0, 1
20 ...: ... a, b = 0, 1
21 ...: ... while b < n:
21 ...: ... while b < n:
22 ...: ... result.append(b) # see below
22 ...: ... result.append(b) # see below
23 ...: ... a, b = b, a+b
23 ...: ... a, b = b, a+b
24 ...: ... return result
24 ...: ... return result
25 ...:
25 ...:
26
26
27 In [2]: fib2(10)
27 In [2]: fib2(10)
28 Out[2]: [1, 1, 2, 3, 5, 8]
28 Out[2]: [1, 1, 2, 3, 5, 8]
29
29
30 The >>> and ... are stripped from the input so that the python interpreter
30 The >>> and ... are stripped from the input so that the python interpreter
31 only sees the real part of the code.
31 only sees the real part of the code.
32
32
33 All other input is processed normally.
33 All other input is processed normally.
34
35 Notes
36 =====
37
38 * You can even paste code that has extra initial spaces, such as is common in
39 doctests:
40
41 In [3]: >>> a = ['Mary', 'had', 'a', 'little', 'lamb']
42
43 In [4]: >>> for i in range(len(a)):
44 ...: ... print i, a[i]
45 ...: ...
46 0 Mary
47 1 had
48 2 a
49 3 little
50 4 lamb
34 """
51 """
52
35 #*****************************************************************************
53 #*****************************************************************************
36 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
54 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
37 #
55 #
38 # Distributed under the terms of the BSD License. The full license is in
56 # Distributed under the terms of the BSD License. The full license is in
39 # the file COPYING, distributed as part of this software.
57 # the file COPYING, distributed as part of this software.
40 #*****************************************************************************
58 #*****************************************************************************
41
59
42 from IPython import Release
60 from IPython import Release
43 __author__ = '%s <%s>' % Release.authors['Fernando']
61 __author__ = '%s <%s>' % Release.authors['Fernando']
44 __license__ = Release.license
62 __license__ = Release.license
45
63
46 # This file is an example of how to modify IPython's line-processing behavior
64 # This file is an example of how to modify IPython's line-processing behavior
47 # without touching the internal code. We'll define an alternate pre-processing
65 # without touching the internal code. We'll define an alternate pre-processing
48 # stage which allows a special form of input (which is invalid Python syntax)
66 # stage which allows a special form of input (which is invalid Python syntax)
49 # for certain quantities, rewrites a line of proper Python in those cases, and
67 # for certain quantities, rewrites a line of proper Python in those cases, and
50 # then passes it off to IPython's normal processor for further work.
68 # then passes it off to IPython's normal processor for further work.
51
69
52 # With this kind of customization, IPython can be adapted for many
70 # With this kind of customization, IPython can be adapted for many
53 # special-purpose scenarios providing alternate input syntaxes.
71 # special-purpose scenarios providing alternate input syntaxes.
54
72
55 # This file can be imported like a regular module.
73 # This file can be imported like a regular module.
56
74
57 # IPython has a prefilter() function that analyzes each input line. We redefine
75 # IPython has a prefilter() function that analyzes each input line. We redefine
58 # it here to first pre-process certain forms of input
76 # it here to first pre-process certain forms of input
59
77
60 # The prototype of any alternate prefilter must be like this one (the name
78 # The prototype of any alternate prefilter must be like this one (the name
61 # doesn't matter):
79 # doesn't matter):
62 # - line is a string containing the user input line.
80 # - line is a string containing the user input line.
63 # - continuation is a parameter which tells us if we are processing a first line of
81 # - continuation is a parameter which tells us if we are processing a first
64 # user input or the second or higher of a multi-line statement.
82 # line of user input or the second or higher of a multi-line statement.
83
84 import re
85
86 PROMPT_RE = re.compile(r'(^[ \t]*>>> |^[ \t]*\.\.\. )')
65
87
66 def prefilter_paste(self,line,continuation):
88 def prefilter_paste(self,line,continuation):
67 """Alternate prefilter for input of pasted code from an interpreter.
89 """Alternate prefilter for input of pasted code from an interpreter.
68 """
90 """
69
91 if not line:
70 from re import match
92 return ''
71
93 m = PROMPT_RE.match(line)
72 if match(r'^>>> |^\.\.\. ',line):
94 if m:
73 # In the end, always call the default IPython _prefilter() function.
95 # In the end, always call the default IPython _prefilter() function.
74 # Note that self must be passed explicitly, b/c we're calling the
96 # Note that self must be passed explicitly, b/c we're calling the
75 # unbound class method (since this method will overwrite the instance
97 # unbound class method (since this method will overwrite the instance
76 # prefilter())
98 # prefilter())
77 return self._prefilter(line[4:],continuation)
99 return self._prefilter(line[len(m.group(0)):],continuation)
78 elif line.strip() == '...':
100 elif line.strip() == '...':
79 return self._prefilter('',continuation)
101 return self._prefilter('',continuation)
102 elif line.isspace():
103 # This allows us to recognize multiple input prompts separated by blank
104 # lines and pasted in a single chunk, very common when pasting doctests
105 # or long tutorial passages.
106 return ''
80 else:
107 else:
81 return self._prefilter(line,continuation)
108 return self._prefilter(line,continuation)
82
109
83 # Rebind this to be the new IPython prefilter:
110 # Rebind this to be the new IPython prefilter:
84 from IPython.iplib import InteractiveShell
111 from IPython.iplib import InteractiveShell
85 InteractiveShell.prefilter = prefilter_paste
112 InteractiveShell.prefilter = prefilter_paste
86
113
87 # Clean up the namespace.
114 # Clean up the namespace.
88 del InteractiveShell,prefilter_paste
115 del InteractiveShell,prefilter_paste
89
116
90 # Just a heads up at the console
117 # Just a heads up at the console
91 print '*** Pasting of code with ">>>" or "..." has been enabled.'
118 print '*** Pasting of code with ">>>" or "..." has been enabled.'
@@ -1,2475 +1,2486 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 IPython -- An enhanced Interactive Python
3 IPython -- An enhanced Interactive Python
4
4
5 Requires Python 2.3 or newer.
5 Requires Python 2.3 or newer.
6
6
7 This file contains all the classes and helper functions specific to IPython.
7 This file contains all the classes and helper functions specific to IPython.
8
8
9 $Id: iplib.py 2577 2007-08-02 23:50:02Z fperez $
9 $Id: iplib.py 2581 2007-08-04 20:52:05Z fperez $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 #
15 #
16 # Distributed under the terms of the BSD License. The full license is in
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
17 # the file COPYING, distributed as part of this software.
18 #
18 #
19 # Note: this code originally subclassed code.InteractiveConsole from the
19 # Note: this code originally subclassed code.InteractiveConsole from the
20 # Python standard library. Over time, all of that class has been copied
20 # Python standard library. Over time, all of that class has been copied
21 # verbatim here for modifications which could not be accomplished by
21 # verbatim here for modifications which could not be accomplished by
22 # subclassing. At this point, there are no dependencies at all on the code
22 # subclassing. At this point, there are no dependencies at all on the code
23 # module anymore (it is not even imported). The Python License (sec. 2)
23 # module anymore (it is not even imported). The Python License (sec. 2)
24 # allows for this, but it's always nice to acknowledge credit where credit is
24 # allows for this, but it's always nice to acknowledge credit where credit is
25 # due.
25 # due.
26 #*****************************************************************************
26 #*****************************************************************************
27
27
28 #****************************************************************************
28 #****************************************************************************
29 # Modules and globals
29 # Modules and globals
30
30
31 from IPython import Release
31 from IPython import Release
32 __author__ = '%s <%s>\n%s <%s>' % \
32 __author__ = '%s <%s>\n%s <%s>' % \
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 __license__ = Release.license
34 __license__ = Release.license
35 __version__ = Release.version
35 __version__ = Release.version
36
36
37 # Python standard modules
37 # Python standard modules
38 import __main__
38 import __main__
39 import __builtin__
39 import __builtin__
40 import StringIO
40 import StringIO
41 import bdb
41 import bdb
42 import cPickle as pickle
42 import cPickle as pickle
43 import codeop
43 import codeop
44 import exceptions
44 import exceptions
45 import glob
45 import glob
46 import inspect
46 import inspect
47 import keyword
47 import keyword
48 import new
48 import new
49 import os
49 import os
50 import pydoc
50 import pydoc
51 import re
51 import re
52 import shutil
52 import shutil
53 import string
53 import string
54 import sys
54 import sys
55 import tempfile
55 import tempfile
56 import traceback
56 import traceback
57 import types
57 import types
58 import pickleshare
58 import pickleshare
59 from sets import Set
59 from sets import Set
60 from pprint import pprint, pformat
60 from pprint import pprint, pformat
61
61
62 # IPython's own modules
62 # IPython's own modules
63 #import IPython
63 #import IPython
64 from IPython import Debugger,OInspect,PyColorize,ultraTB
64 from IPython import Debugger,OInspect,PyColorize,ultraTB
65 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
65 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
66 from IPython.FakeModule import FakeModule
66 from IPython.FakeModule import FakeModule
67 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
67 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 from IPython.Logger import Logger
68 from IPython.Logger import Logger
69 from IPython.Magic import Magic
69 from IPython.Magic import Magic
70 from IPython.Prompts import CachedOutput
70 from IPython.Prompts import CachedOutput
71 from IPython.ipstruct import Struct
71 from IPython.ipstruct import Struct
72 from IPython.background_jobs import BackgroundJobManager
72 from IPython.background_jobs import BackgroundJobManager
73 from IPython.usage import cmd_line_usage,interactive_usage
73 from IPython.usage import cmd_line_usage,interactive_usage
74 from IPython.genutils import *
74 from IPython.genutils import *
75 from IPython.strdispatch import StrDispatch
75 from IPython.strdispatch import StrDispatch
76 import IPython.ipapi
76 import IPython.ipapi
77 import IPython.history
77 import IPython.history
78 import IPython.prefilter as prefilter
78 import IPython.prefilter as prefilter
79 import IPython.shadowns
79 import IPython.shadowns
80 # Globals
80 # Globals
81
81
82 # store the builtin raw_input globally, and use this always, in case user code
82 # store the builtin raw_input globally, and use this always, in case user code
83 # overwrites it (like wx.py.PyShell does)
83 # overwrites it (like wx.py.PyShell does)
84 raw_input_original = raw_input
84 raw_input_original = raw_input
85
85
86 # compiled regexps for autoindent management
86 # compiled regexps for autoindent management
87 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
87 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
88
88
89
89
90 #****************************************************************************
90 #****************************************************************************
91 # Some utility function definitions
91 # Some utility function definitions
92
92
93 ini_spaces_re = re.compile(r'^(\s+)')
93 ini_spaces_re = re.compile(r'^(\s+)')
94
94
95 def num_ini_spaces(strng):
95 def num_ini_spaces(strng):
96 """Return the number of initial spaces in a string"""
96 """Return the number of initial spaces in a string"""
97
97
98 ini_spaces = ini_spaces_re.match(strng)
98 ini_spaces = ini_spaces_re.match(strng)
99 if ini_spaces:
99 if ini_spaces:
100 return ini_spaces.end()
100 return ini_spaces.end()
101 else:
101 else:
102 return 0
102 return 0
103
103
104 def softspace(file, newvalue):
104 def softspace(file, newvalue):
105 """Copied from code.py, to remove the dependency"""
105 """Copied from code.py, to remove the dependency"""
106
106
107 oldvalue = 0
107 oldvalue = 0
108 try:
108 try:
109 oldvalue = file.softspace
109 oldvalue = file.softspace
110 except AttributeError:
110 except AttributeError:
111 pass
111 pass
112 try:
112 try:
113 file.softspace = newvalue
113 file.softspace = newvalue
114 except (AttributeError, TypeError):
114 except (AttributeError, TypeError):
115 # "attribute-less object" or "read-only attributes"
115 # "attribute-less object" or "read-only attributes"
116 pass
116 pass
117 return oldvalue
117 return oldvalue
118
118
119
119
120 #****************************************************************************
120 #****************************************************************************
121 # Local use exceptions
121 # Local use exceptions
122 class SpaceInInput(exceptions.Exception): pass
122 class SpaceInInput(exceptions.Exception): pass
123
123
124
124
125 #****************************************************************************
125 #****************************************************************************
126 # Local use classes
126 # Local use classes
127 class Bunch: pass
127 class Bunch: pass
128
128
129 class Undefined: pass
129 class Undefined: pass
130
130
131 class Quitter(object):
131 class Quitter(object):
132 """Simple class to handle exit, similar to Python 2.5's.
132 """Simple class to handle exit, similar to Python 2.5's.
133
133
134 It handles exiting in an ipython-safe manner, which the one in Python 2.5
134 It handles exiting in an ipython-safe manner, which the one in Python 2.5
135 doesn't do (obviously, since it doesn't know about ipython)."""
135 doesn't do (obviously, since it doesn't know about ipython)."""
136
136
137 def __init__(self,shell,name):
137 def __init__(self,shell,name):
138 self.shell = shell
138 self.shell = shell
139 self.name = name
139 self.name = name
140
140
141 def __repr__(self):
141 def __repr__(self):
142 return 'Type %s() to exit.' % self.name
142 return 'Type %s() to exit.' % self.name
143 __str__ = __repr__
143 __str__ = __repr__
144
144
145 def __call__(self):
145 def __call__(self):
146 self.shell.exit()
146 self.shell.exit()
147
147
148 class InputList(list):
148 class InputList(list):
149 """Class to store user input.
149 """Class to store user input.
150
150
151 It's basically a list, but slices return a string instead of a list, thus
151 It's basically a list, but slices return a string instead of a list, thus
152 allowing things like (assuming 'In' is an instance):
152 allowing things like (assuming 'In' is an instance):
153
153
154 exec In[4:7]
154 exec In[4:7]
155
155
156 or
156 or
157
157
158 exec In[5:9] + In[14] + In[21:25]"""
158 exec In[5:9] + In[14] + In[21:25]"""
159
159
160 def __getslice__(self,i,j):
160 def __getslice__(self,i,j):
161 return ''.join(list.__getslice__(self,i,j))
161 return ''.join(list.__getslice__(self,i,j))
162
162
163 class SyntaxTB(ultraTB.ListTB):
163 class SyntaxTB(ultraTB.ListTB):
164 """Extension which holds some state: the last exception value"""
164 """Extension which holds some state: the last exception value"""
165
165
166 def __init__(self,color_scheme = 'NoColor'):
166 def __init__(self,color_scheme = 'NoColor'):
167 ultraTB.ListTB.__init__(self,color_scheme)
167 ultraTB.ListTB.__init__(self,color_scheme)
168 self.last_syntax_error = None
168 self.last_syntax_error = None
169
169
170 def __call__(self, etype, value, elist):
170 def __call__(self, etype, value, elist):
171 self.last_syntax_error = value
171 self.last_syntax_error = value
172 ultraTB.ListTB.__call__(self,etype,value,elist)
172 ultraTB.ListTB.__call__(self,etype,value,elist)
173
173
174 def clear_err_state(self):
174 def clear_err_state(self):
175 """Return the current error state and clear it"""
175 """Return the current error state and clear it"""
176 e = self.last_syntax_error
176 e = self.last_syntax_error
177 self.last_syntax_error = None
177 self.last_syntax_error = None
178 return e
178 return e
179
179
180 #****************************************************************************
180 #****************************************************************************
181 # Main IPython class
181 # Main IPython class
182
182
183 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
183 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
184 # until a full rewrite is made. I've cleaned all cross-class uses of
184 # until a full rewrite is made. I've cleaned all cross-class uses of
185 # attributes and methods, but too much user code out there relies on the
185 # attributes and methods, but too much user code out there relies on the
186 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
186 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
187 #
187 #
188 # But at least now, all the pieces have been separated and we could, in
188 # But at least now, all the pieces have been separated and we could, in
189 # principle, stop using the mixin. This will ease the transition to the
189 # principle, stop using the mixin. This will ease the transition to the
190 # chainsaw branch.
190 # chainsaw branch.
191
191
192 # For reference, the following is the list of 'self.foo' uses in the Magic
192 # For reference, the following is the list of 'self.foo' uses in the Magic
193 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
193 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
194 # class, to prevent clashes.
194 # class, to prevent clashes.
195
195
196 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
196 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
197 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
197 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
198 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
198 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
199 # 'self.value']
199 # 'self.value']
200
200
201 class InteractiveShell(object,Magic):
201 class InteractiveShell(object,Magic):
202 """An enhanced console for Python."""
202 """An enhanced console for Python."""
203
203
204 # class attribute to indicate whether the class supports threads or not.
204 # class attribute to indicate whether the class supports threads or not.
205 # Subclasses with thread support should override this as needed.
205 # Subclasses with thread support should override this as needed.
206 isthreaded = False
206 isthreaded = False
207
207
208 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
208 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
209 user_ns = None,user_global_ns=None,banner2='',
209 user_ns = None,user_global_ns=None,banner2='',
210 custom_exceptions=((),None),embedded=False):
210 custom_exceptions=((),None),embedded=False):
211
211
212 # log system
212 # log system
213 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
213 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
214
214
215 # some minimal strict typechecks. For some core data structures, I
215 # some minimal strict typechecks. For some core data structures, I
216 # want actual basic python types, not just anything that looks like
216 # want actual basic python types, not just anything that looks like
217 # one. This is especially true for namespaces.
217 # one. This is especially true for namespaces.
218 for ns in (user_ns,user_global_ns):
218 for ns in (user_ns,user_global_ns):
219 if ns is not None and type(ns) != types.DictType:
219 if ns is not None and type(ns) != types.DictType:
220 raise TypeError,'namespace must be a dictionary'
220 raise TypeError,'namespace must be a dictionary'
221
221
222 # Job manager (for jobs run as background threads)
222 # Job manager (for jobs run as background threads)
223 self.jobs = BackgroundJobManager()
223 self.jobs = BackgroundJobManager()
224
224
225 # Store the actual shell's name
225 # Store the actual shell's name
226 self.name = name
226 self.name = name
227
227
228 # We need to know whether the instance is meant for embedding, since
228 # We need to know whether the instance is meant for embedding, since
229 # global/local namespaces need to be handled differently in that case
229 # global/local namespaces need to be handled differently in that case
230 self.embedded = embedded
230 self.embedded = embedded
231 if embedded:
231 if embedded:
232 # Control variable so users can, from within the embedded instance,
232 # Control variable so users can, from within the embedded instance,
233 # permanently deactivate it.
233 # permanently deactivate it.
234 self.embedded_active = True
234 self.embedded_active = True
235
235
236 # command compiler
236 # command compiler
237 self.compile = codeop.CommandCompiler()
237 self.compile = codeop.CommandCompiler()
238
238
239 # User input buffer
239 # User input buffer
240 self.buffer = []
240 self.buffer = []
241
241
242 # Default name given in compilation of code
242 # Default name given in compilation of code
243 self.filename = '<ipython console>'
243 self.filename = '<ipython console>'
244
244
245 # Install our own quitter instead of the builtins. For python2.3-2.4,
245 # Install our own quitter instead of the builtins. For python2.3-2.4,
246 # this brings in behavior like 2.5, and for 2.5 it's identical.
246 # this brings in behavior like 2.5, and for 2.5 it's identical.
247 __builtin__.exit = Quitter(self,'exit')
247 __builtin__.exit = Quitter(self,'exit')
248 __builtin__.quit = Quitter(self,'quit')
248 __builtin__.quit = Quitter(self,'quit')
249
249
250 # Make an empty namespace, which extension writers can rely on both
250 # Make an empty namespace, which extension writers can rely on both
251 # existing and NEVER being used by ipython itself. This gives them a
251 # existing and NEVER being used by ipython itself. This gives them a
252 # convenient location for storing additional information and state
252 # convenient location for storing additional information and state
253 # their extensions may require, without fear of collisions with other
253 # their extensions may require, without fear of collisions with other
254 # ipython names that may develop later.
254 # ipython names that may develop later.
255 self.meta = Struct()
255 self.meta = Struct()
256
256
257 # Create the namespace where the user will operate. user_ns is
257 # Create the namespace where the user will operate. user_ns is
258 # normally the only one used, and it is passed to the exec calls as
258 # normally the only one used, and it is passed to the exec calls as
259 # the locals argument. But we do carry a user_global_ns namespace
259 # the locals argument. But we do carry a user_global_ns namespace
260 # given as the exec 'globals' argument, This is useful in embedding
260 # given as the exec 'globals' argument, This is useful in embedding
261 # situations where the ipython shell opens in a context where the
261 # situations where the ipython shell opens in a context where the
262 # distinction between locals and globals is meaningful.
262 # distinction between locals and globals is meaningful.
263
263
264 # FIXME. For some strange reason, __builtins__ is showing up at user
264 # FIXME. For some strange reason, __builtins__ is showing up at user
265 # level as a dict instead of a module. This is a manual fix, but I
265 # level as a dict instead of a module. This is a manual fix, but I
266 # should really track down where the problem is coming from. Alex
266 # should really track down where the problem is coming from. Alex
267 # Schmolck reported this problem first.
267 # Schmolck reported this problem first.
268
268
269 # A useful post by Alex Martelli on this topic:
269 # A useful post by Alex Martelli on this topic:
270 # Re: inconsistent value from __builtins__
270 # Re: inconsistent value from __builtins__
271 # Von: Alex Martelli <aleaxit@yahoo.com>
271 # Von: Alex Martelli <aleaxit@yahoo.com>
272 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
272 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
273 # Gruppen: comp.lang.python
273 # Gruppen: comp.lang.python
274
274
275 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
275 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
276 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
276 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
277 # > <type 'dict'>
277 # > <type 'dict'>
278 # > >>> print type(__builtins__)
278 # > >>> print type(__builtins__)
279 # > <type 'module'>
279 # > <type 'module'>
280 # > Is this difference in return value intentional?
280 # > Is this difference in return value intentional?
281
281
282 # Well, it's documented that '__builtins__' can be either a dictionary
282 # Well, it's documented that '__builtins__' can be either a dictionary
283 # or a module, and it's been that way for a long time. Whether it's
283 # or a module, and it's been that way for a long time. Whether it's
284 # intentional (or sensible), I don't know. In any case, the idea is
284 # intentional (or sensible), I don't know. In any case, the idea is
285 # that if you need to access the built-in namespace directly, you
285 # that if you need to access the built-in namespace directly, you
286 # should start with "import __builtin__" (note, no 's') which will
286 # should start with "import __builtin__" (note, no 's') which will
287 # definitely give you a module. Yeah, it's somewhat confusing:-(.
287 # definitely give you a module. Yeah, it's somewhat confusing:-(.
288
288
289 # These routines return properly built dicts as needed by the rest of
289 # These routines return properly built dicts as needed by the rest of
290 # the code, and can also be used by extension writers to generate
290 # the code, and can also be used by extension writers to generate
291 # properly initialized namespaces.
291 # properly initialized namespaces.
292 user_ns = IPython.ipapi.make_user_ns(user_ns)
292 user_ns = IPython.ipapi.make_user_ns(user_ns)
293 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
293 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
294
294
295 # Assign namespaces
295 # Assign namespaces
296 # This is the namespace where all normal user variables live
296 # This is the namespace where all normal user variables live
297 self.user_ns = user_ns
297 self.user_ns = user_ns
298 # Embedded instances require a separate namespace for globals.
298 # Embedded instances require a separate namespace for globals.
299 # Normally this one is unused by non-embedded instances.
299 # Normally this one is unused by non-embedded instances.
300 self.user_global_ns = user_global_ns
300 self.user_global_ns = user_global_ns
301 # A namespace to keep track of internal data structures to prevent
301 # A namespace to keep track of internal data structures to prevent
302 # them from cluttering user-visible stuff. Will be updated later
302 # them from cluttering user-visible stuff. Will be updated later
303 self.internal_ns = {}
303 self.internal_ns = {}
304
304
305 # Namespace of system aliases. Each entry in the alias
305 # Namespace of system aliases. Each entry in the alias
306 # table must be a 2-tuple of the form (N,name), where N is the number
306 # table must be a 2-tuple of the form (N,name), where N is the number
307 # of positional arguments of the alias.
307 # of positional arguments of the alias.
308 self.alias_table = {}
308 self.alias_table = {}
309
309
310 # A table holding all the namespaces IPython deals with, so that
310 # A table holding all the namespaces IPython deals with, so that
311 # introspection facilities can search easily.
311 # introspection facilities can search easily.
312 self.ns_table = {'user':user_ns,
312 self.ns_table = {'user':user_ns,
313 'user_global':user_global_ns,
313 'user_global':user_global_ns,
314 'alias':self.alias_table,
314 'alias':self.alias_table,
315 'internal':self.internal_ns,
315 'internal':self.internal_ns,
316 'builtin':__builtin__.__dict__
316 'builtin':__builtin__.__dict__
317 }
317 }
318
318
319 # The user namespace MUST have a pointer to the shell itself.
319 # The user namespace MUST have a pointer to the shell itself.
320 self.user_ns[name] = self
320 self.user_ns[name] = self
321
321
322 # We need to insert into sys.modules something that looks like a
322 # We need to insert into sys.modules something that looks like a
323 # module but which accesses the IPython namespace, for shelve and
323 # module but which accesses the IPython namespace, for shelve and
324 # pickle to work interactively. Normally they rely on getting
324 # pickle to work interactively. Normally they rely on getting
325 # everything out of __main__, but for embedding purposes each IPython
325 # everything out of __main__, but for embedding purposes each IPython
326 # instance has its own private namespace, so we can't go shoving
326 # instance has its own private namespace, so we can't go shoving
327 # everything into __main__.
327 # everything into __main__.
328
328
329 # note, however, that we should only do this for non-embedded
329 # note, however, that we should only do this for non-embedded
330 # ipythons, which really mimic the __main__.__dict__ with their own
330 # ipythons, which really mimic the __main__.__dict__ with their own
331 # namespace. Embedded instances, on the other hand, should not do
331 # namespace. Embedded instances, on the other hand, should not do
332 # this because they need to manage the user local/global namespaces
332 # this because they need to manage the user local/global namespaces
333 # only, but they live within a 'normal' __main__ (meaning, they
333 # only, but they live within a 'normal' __main__ (meaning, they
334 # shouldn't overtake the execution environment of the script they're
334 # shouldn't overtake the execution environment of the script they're
335 # embedded in).
335 # embedded in).
336
336
337 if not embedded:
337 if not embedded:
338 try:
338 try:
339 main_name = self.user_ns['__name__']
339 main_name = self.user_ns['__name__']
340 except KeyError:
340 except KeyError:
341 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
341 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
342 else:
342 else:
343 #print "pickle hack in place" # dbg
343 #print "pickle hack in place" # dbg
344 #print 'main_name:',main_name # dbg
344 #print 'main_name:',main_name # dbg
345 sys.modules[main_name] = FakeModule(self.user_ns)
345 sys.modules[main_name] = FakeModule(self.user_ns)
346
346
347 # List of input with multi-line handling.
347 # List of input with multi-line handling.
348 # Fill its zero entry, user counter starts at 1
348 # Fill its zero entry, user counter starts at 1
349 self.input_hist = InputList(['\n'])
349 self.input_hist = InputList(['\n'])
350 # This one will hold the 'raw' input history, without any
350 # This one will hold the 'raw' input history, without any
351 # pre-processing. This will allow users to retrieve the input just as
351 # pre-processing. This will allow users to retrieve the input just as
352 # it was exactly typed in by the user, with %hist -r.
352 # it was exactly typed in by the user, with %hist -r.
353 self.input_hist_raw = InputList(['\n'])
353 self.input_hist_raw = InputList(['\n'])
354
354
355 # list of visited directories
355 # list of visited directories
356 try:
356 try:
357 self.dir_hist = [os.getcwd()]
357 self.dir_hist = [os.getcwd()]
358 except OSError:
358 except OSError:
359 self.dir_hist = []
359 self.dir_hist = []
360
360
361 # dict of output history
361 # dict of output history
362 self.output_hist = {}
362 self.output_hist = {}
363
363
364 # Get system encoding at startup time. Certain terminals (like Emacs
364 # Get system encoding at startup time. Certain terminals (like Emacs
365 # under Win32 have it set to None, and we need to have a known valid
365 # under Win32 have it set to None, and we need to have a known valid
366 # encoding to use in the raw_input() method
366 # encoding to use in the raw_input() method
367 self.stdin_encoding = sys.stdin.encoding or 'ascii'
367 self.stdin_encoding = sys.stdin.encoding or 'ascii'
368
368
369 # dict of things NOT to alias (keywords, builtins and some magics)
369 # dict of things NOT to alias (keywords, builtins and some magics)
370 no_alias = {}
370 no_alias = {}
371 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
371 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
372 for key in keyword.kwlist + no_alias_magics:
372 for key in keyword.kwlist + no_alias_magics:
373 no_alias[key] = 1
373 no_alias[key] = 1
374 no_alias.update(__builtin__.__dict__)
374 no_alias.update(__builtin__.__dict__)
375 self.no_alias = no_alias
375 self.no_alias = no_alias
376
376
377 # make global variables for user access to these
377 # make global variables for user access to these
378 self.user_ns['_ih'] = self.input_hist
378 self.user_ns['_ih'] = self.input_hist
379 self.user_ns['_oh'] = self.output_hist
379 self.user_ns['_oh'] = self.output_hist
380 self.user_ns['_dh'] = self.dir_hist
380 self.user_ns['_dh'] = self.dir_hist
381
381
382 # user aliases to input and output histories
382 # user aliases to input and output histories
383 self.user_ns['In'] = self.input_hist
383 self.user_ns['In'] = self.input_hist
384 self.user_ns['Out'] = self.output_hist
384 self.user_ns['Out'] = self.output_hist
385
385
386 self.user_ns['_sh'] = IPython.shadowns
386 self.user_ns['_sh'] = IPython.shadowns
387 # Object variable to store code object waiting execution. This is
387 # Object variable to store code object waiting execution. This is
388 # used mainly by the multithreaded shells, but it can come in handy in
388 # used mainly by the multithreaded shells, but it can come in handy in
389 # other situations. No need to use a Queue here, since it's a single
389 # other situations. No need to use a Queue here, since it's a single
390 # item which gets cleared once run.
390 # item which gets cleared once run.
391 self.code_to_run = None
391 self.code_to_run = None
392
392
393 # escapes for automatic behavior on the command line
393 # escapes for automatic behavior on the command line
394 self.ESC_SHELL = '!'
394 self.ESC_SHELL = '!'
395 self.ESC_SH_CAP = '!!'
395 self.ESC_SH_CAP = '!!'
396 self.ESC_HELP = '?'
396 self.ESC_HELP = '?'
397 self.ESC_MAGIC = '%'
397 self.ESC_MAGIC = '%'
398 self.ESC_QUOTE = ','
398 self.ESC_QUOTE = ','
399 self.ESC_QUOTE2 = ';'
399 self.ESC_QUOTE2 = ';'
400 self.ESC_PAREN = '/'
400 self.ESC_PAREN = '/'
401
401
402 # And their associated handlers
402 # And their associated handlers
403 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
403 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
404 self.ESC_QUOTE : self.handle_auto,
404 self.ESC_QUOTE : self.handle_auto,
405 self.ESC_QUOTE2 : self.handle_auto,
405 self.ESC_QUOTE2 : self.handle_auto,
406 self.ESC_MAGIC : self.handle_magic,
406 self.ESC_MAGIC : self.handle_magic,
407 self.ESC_HELP : self.handle_help,
407 self.ESC_HELP : self.handle_help,
408 self.ESC_SHELL : self.handle_shell_escape,
408 self.ESC_SHELL : self.handle_shell_escape,
409 self.ESC_SH_CAP : self.handle_shell_escape,
409 self.ESC_SH_CAP : self.handle_shell_escape,
410 }
410 }
411
411
412 # class initializations
412 # class initializations
413 Magic.__init__(self,self)
413 Magic.__init__(self,self)
414
414
415 # Python source parser/formatter for syntax highlighting
415 # Python source parser/formatter for syntax highlighting
416 pyformat = PyColorize.Parser().format
416 pyformat = PyColorize.Parser().format
417 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
417 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
418
418
419 # hooks holds pointers used for user-side customizations
419 # hooks holds pointers used for user-side customizations
420 self.hooks = Struct()
420 self.hooks = Struct()
421
421
422 self.strdispatchers = {}
422 self.strdispatchers = {}
423
423
424 # Set all default hooks, defined in the IPython.hooks module.
424 # Set all default hooks, defined in the IPython.hooks module.
425 hooks = IPython.hooks
425 hooks = IPython.hooks
426 for hook_name in hooks.__all__:
426 for hook_name in hooks.__all__:
427 # default hooks have priority 100, i.e. low; user hooks should have
427 # default hooks have priority 100, i.e. low; user hooks should have
428 # 0-100 priority
428 # 0-100 priority
429 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
429 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
430 #print "bound hook",hook_name
430 #print "bound hook",hook_name
431
431
432 # Flag to mark unconditional exit
432 # Flag to mark unconditional exit
433 self.exit_now = False
433 self.exit_now = False
434
434
435 self.usage_min = """\
435 self.usage_min = """\
436 An enhanced console for Python.
436 An enhanced console for Python.
437 Some of its features are:
437 Some of its features are:
438 - Readline support if the readline library is present.
438 - Readline support if the readline library is present.
439 - Tab completion in the local namespace.
439 - Tab completion in the local namespace.
440 - Logging of input, see command-line options.
440 - Logging of input, see command-line options.
441 - System shell escape via ! , eg !ls.
441 - System shell escape via ! , eg !ls.
442 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
442 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
443 - Keeps track of locally defined variables via %who, %whos.
443 - Keeps track of locally defined variables via %who, %whos.
444 - Show object information with a ? eg ?x or x? (use ?? for more info).
444 - Show object information with a ? eg ?x or x? (use ?? for more info).
445 """
445 """
446 if usage: self.usage = usage
446 if usage: self.usage = usage
447 else: self.usage = self.usage_min
447 else: self.usage = self.usage_min
448
448
449 # Storage
449 # Storage
450 self.rc = rc # This will hold all configuration information
450 self.rc = rc # This will hold all configuration information
451 self.pager = 'less'
451 self.pager = 'less'
452 # temporary files used for various purposes. Deleted at exit.
452 # temporary files used for various purposes. Deleted at exit.
453 self.tempfiles = []
453 self.tempfiles = []
454
454
455 # Keep track of readline usage (later set by init_readline)
455 # Keep track of readline usage (later set by init_readline)
456 self.has_readline = False
456 self.has_readline = False
457
457
458 # template for logfile headers. It gets resolved at runtime by the
458 # template for logfile headers. It gets resolved at runtime by the
459 # logstart method.
459 # logstart method.
460 self.loghead_tpl = \
460 self.loghead_tpl = \
461 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
461 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
462 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
462 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
463 #log# opts = %s
463 #log# opts = %s
464 #log# args = %s
464 #log# args = %s
465 #log# It is safe to make manual edits below here.
465 #log# It is safe to make manual edits below here.
466 #log#-----------------------------------------------------------------------
466 #log#-----------------------------------------------------------------------
467 """
467 """
468 # for pushd/popd management
468 # for pushd/popd management
469 try:
469 try:
470 self.home_dir = get_home_dir()
470 self.home_dir = get_home_dir()
471 except HomeDirError,msg:
471 except HomeDirError,msg:
472 fatal(msg)
472 fatal(msg)
473
473
474 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
474 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
475
475
476 # Functions to call the underlying shell.
476 # Functions to call the underlying shell.
477
477
478 # The first is similar to os.system, but it doesn't return a value,
478 # The first is similar to os.system, but it doesn't return a value,
479 # and it allows interpolation of variables in the user's namespace.
479 # and it allows interpolation of variables in the user's namespace.
480 self.system = lambda cmd: \
480 self.system = lambda cmd: \
481 shell(self.var_expand(cmd,depth=2),
481 shell(self.var_expand(cmd,depth=2),
482 header=self.rc.system_header,
482 header=self.rc.system_header,
483 verbose=self.rc.system_verbose)
483 verbose=self.rc.system_verbose)
484
484
485 # These are for getoutput and getoutputerror:
485 # These are for getoutput and getoutputerror:
486 self.getoutput = lambda cmd: \
486 self.getoutput = lambda cmd: \
487 getoutput(self.var_expand(cmd,depth=2),
487 getoutput(self.var_expand(cmd,depth=2),
488 header=self.rc.system_header,
488 header=self.rc.system_header,
489 verbose=self.rc.system_verbose)
489 verbose=self.rc.system_verbose)
490
490
491 self.getoutputerror = lambda cmd: \
491 self.getoutputerror = lambda cmd: \
492 getoutputerror(self.var_expand(cmd,depth=2),
492 getoutputerror(self.var_expand(cmd,depth=2),
493 header=self.rc.system_header,
493 header=self.rc.system_header,
494 verbose=self.rc.system_verbose)
494 verbose=self.rc.system_verbose)
495
495
496
496
497 # keep track of where we started running (mainly for crash post-mortem)
497 # keep track of where we started running (mainly for crash post-mortem)
498 self.starting_dir = os.getcwd()
498 self.starting_dir = os.getcwd()
499
499
500 # Various switches which can be set
500 # Various switches which can be set
501 self.CACHELENGTH = 5000 # this is cheap, it's just text
501 self.CACHELENGTH = 5000 # this is cheap, it's just text
502 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
502 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
503 self.banner2 = banner2
503 self.banner2 = banner2
504
504
505 # TraceBack handlers:
505 # TraceBack handlers:
506
506
507 # Syntax error handler.
507 # Syntax error handler.
508 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
508 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
509
509
510 # The interactive one is initialized with an offset, meaning we always
510 # The interactive one is initialized with an offset, meaning we always
511 # want to remove the topmost item in the traceback, which is our own
511 # want to remove the topmost item in the traceback, which is our own
512 # internal code. Valid modes: ['Plain','Context','Verbose']
512 # internal code. Valid modes: ['Plain','Context','Verbose']
513 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
513 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
514 color_scheme='NoColor',
514 color_scheme='NoColor',
515 tb_offset = 1)
515 tb_offset = 1)
516
516
517 # IPython itself shouldn't crash. This will produce a detailed
517 # IPython itself shouldn't crash. This will produce a detailed
518 # post-mortem if it does. But we only install the crash handler for
518 # post-mortem if it does. But we only install the crash handler for
519 # non-threaded shells, the threaded ones use a normal verbose reporter
519 # non-threaded shells, the threaded ones use a normal verbose reporter
520 # and lose the crash handler. This is because exceptions in the main
520 # and lose the crash handler. This is because exceptions in the main
521 # thread (such as in GUI code) propagate directly to sys.excepthook,
521 # thread (such as in GUI code) propagate directly to sys.excepthook,
522 # and there's no point in printing crash dumps for every user exception.
522 # and there's no point in printing crash dumps for every user exception.
523 if self.isthreaded:
523 if self.isthreaded:
524 ipCrashHandler = ultraTB.FormattedTB()
524 ipCrashHandler = ultraTB.FormattedTB()
525 else:
525 else:
526 from IPython import CrashHandler
526 from IPython import CrashHandler
527 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
527 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
528 self.set_crash_handler(ipCrashHandler)
528 self.set_crash_handler(ipCrashHandler)
529
529
530 # and add any custom exception handlers the user may have specified
530 # and add any custom exception handlers the user may have specified
531 self.set_custom_exc(*custom_exceptions)
531 self.set_custom_exc(*custom_exceptions)
532
532
533 # indentation management
533 # indentation management
534 self.autoindent = False
534 self.autoindent = False
535 self.indent_current_nsp = 0
535 self.indent_current_nsp = 0
536
536
537 # Make some aliases automatically
537 # Make some aliases automatically
538 # Prepare list of shell aliases to auto-define
538 # Prepare list of shell aliases to auto-define
539 if os.name == 'posix':
539 if os.name == 'posix':
540 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
540 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
541 'mv mv -i','rm rm -i','cp cp -i',
541 'mv mv -i','rm rm -i','cp cp -i',
542 'cat cat','less less','clear clear',
542 'cat cat','less less','clear clear',
543 # a better ls
543 # a better ls
544 'ls ls -F',
544 'ls ls -F',
545 # long ls
545 # long ls
546 'll ls -lF')
546 'll ls -lF')
547 # Extra ls aliases with color, which need special treatment on BSD
547 # Extra ls aliases with color, which need special treatment on BSD
548 # variants
548 # variants
549 ls_extra = ( # color ls
549 ls_extra = ( # color ls
550 'lc ls -F -o --color',
550 'lc ls -F -o --color',
551 # ls normal files only
551 # ls normal files only
552 'lf ls -F -o --color %l | grep ^-',
552 'lf ls -F -o --color %l | grep ^-',
553 # ls symbolic links
553 # ls symbolic links
554 'lk ls -F -o --color %l | grep ^l',
554 'lk ls -F -o --color %l | grep ^l',
555 # directories or links to directories,
555 # directories or links to directories,
556 'ldir ls -F -o --color %l | grep /$',
556 'ldir ls -F -o --color %l | grep /$',
557 # things which are executable
557 # things which are executable
558 'lx ls -F -o --color %l | grep ^-..x',
558 'lx ls -F -o --color %l | grep ^-..x',
559 )
559 )
560 # The BSDs don't ship GNU ls, so they don't understand the
560 # The BSDs don't ship GNU ls, so they don't understand the
561 # --color switch out of the box
561 # --color switch out of the box
562 if 'bsd' in sys.platform:
562 if 'bsd' in sys.platform:
563 ls_extra = ( # ls normal files only
563 ls_extra = ( # ls normal files only
564 'lf ls -lF | grep ^-',
564 'lf ls -lF | grep ^-',
565 # ls symbolic links
565 # ls symbolic links
566 'lk ls -lF | grep ^l',
566 'lk ls -lF | grep ^l',
567 # directories or links to directories,
567 # directories or links to directories,
568 'ldir ls -lF | grep /$',
568 'ldir ls -lF | grep /$',
569 # things which are executable
569 # things which are executable
570 'lx ls -lF | grep ^-..x',
570 'lx ls -lF | grep ^-..x',
571 )
571 )
572 auto_alias = auto_alias + ls_extra
572 auto_alias = auto_alias + ls_extra
573 elif os.name in ['nt','dos']:
573 elif os.name in ['nt','dos']:
574 auto_alias = ('dir dir /on', 'ls dir /on',
574 auto_alias = ('dir dir /on', 'ls dir /on',
575 'ddir dir /ad /on', 'ldir dir /ad /on',
575 'ddir dir /ad /on', 'ldir dir /ad /on',
576 'mkdir mkdir','rmdir rmdir','echo echo',
576 'mkdir mkdir','rmdir rmdir','echo echo',
577 'ren ren','cls cls','copy copy')
577 'ren ren','cls cls','copy copy')
578 else:
578 else:
579 auto_alias = ()
579 auto_alias = ()
580 self.auto_alias = [s.split(None,1) for s in auto_alias]
580 self.auto_alias = [s.split(None,1) for s in auto_alias]
581 # Call the actual (public) initializer
581 # Call the actual (public) initializer
582 self.init_auto_alias()
582 self.init_auto_alias()
583
583
584 # Produce a public API instance
584 # Produce a public API instance
585 self.api = IPython.ipapi.IPApi(self)
585 self.api = IPython.ipapi.IPApi(self)
586
586
587 # track which builtins we add, so we can clean up later
587 # track which builtins we add, so we can clean up later
588 self.builtins_added = {}
588 self.builtins_added = {}
589 # This method will add the necessary builtins for operation, but
589 # This method will add the necessary builtins for operation, but
590 # tracking what it did via the builtins_added dict.
590 # tracking what it did via the builtins_added dict.
591 self.add_builtins()
591 self.add_builtins()
592
592
593 # end __init__
593 # end __init__
594
594
595 def var_expand(self,cmd,depth=0):
595 def var_expand(self,cmd,depth=0):
596 """Expand python variables in a string.
596 """Expand python variables in a string.
597
597
598 The depth argument indicates how many frames above the caller should
598 The depth argument indicates how many frames above the caller should
599 be walked to look for the local namespace where to expand variables.
599 be walked to look for the local namespace where to expand variables.
600
600
601 The global namespace for expansion is always the user's interactive
601 The global namespace for expansion is always the user's interactive
602 namespace.
602 namespace.
603 """
603 """
604
604
605 return str(ItplNS(cmd.replace('#','\#'),
605 return str(ItplNS(cmd.replace('#','\#'),
606 self.user_ns, # globals
606 self.user_ns, # globals
607 # Skip our own frame in searching for locals:
607 # Skip our own frame in searching for locals:
608 sys._getframe(depth+1).f_locals # locals
608 sys._getframe(depth+1).f_locals # locals
609 ))
609 ))
610
610
611 def pre_config_initialization(self):
611 def pre_config_initialization(self):
612 """Pre-configuration init method
612 """Pre-configuration init method
613
613
614 This is called before the configuration files are processed to
614 This is called before the configuration files are processed to
615 prepare the services the config files might need.
615 prepare the services the config files might need.
616
616
617 self.rc already has reasonable default values at this point.
617 self.rc already has reasonable default values at this point.
618 """
618 """
619 rc = self.rc
619 rc = self.rc
620 try:
620 try:
621 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
621 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
622 except exceptions.UnicodeDecodeError:
622 except exceptions.UnicodeDecodeError:
623 print "Your ipythondir can't be decoded to unicode!"
623 print "Your ipythondir can't be decoded to unicode!"
624 print "Please set HOME environment variable to something that"
624 print "Please set HOME environment variable to something that"
625 print r"only has ASCII characters, e.g. c:\home"
625 print r"only has ASCII characters, e.g. c:\home"
626 print "Now it is",rc.ipythondir
626 print "Now it is",rc.ipythondir
627 sys.exit()
627 sys.exit()
628 self.shadowhist = IPython.history.ShadowHist(self.db)
628 self.shadowhist = IPython.history.ShadowHist(self.db)
629
629
630
630
631 def post_config_initialization(self):
631 def post_config_initialization(self):
632 """Post configuration init method
632 """Post configuration init method
633
633
634 This is called after the configuration files have been processed to
634 This is called after the configuration files have been processed to
635 'finalize' the initialization."""
635 'finalize' the initialization."""
636
636
637 rc = self.rc
637 rc = self.rc
638
638
639 # Object inspector
639 # Object inspector
640 self.inspector = OInspect.Inspector(OInspect.InspectColors,
640 self.inspector = OInspect.Inspector(OInspect.InspectColors,
641 PyColorize.ANSICodeColors,
641 PyColorize.ANSICodeColors,
642 'NoColor',
642 'NoColor',
643 rc.object_info_string_level)
643 rc.object_info_string_level)
644
644
645 self.rl_next_input = None
645 self.rl_next_input = None
646 self.rl_do_indent = False
646 self.rl_do_indent = False
647 # Load readline proper
647 # Load readline proper
648 if rc.readline:
648 if rc.readline:
649 self.init_readline()
649 self.init_readline()
650
650
651
651
652 # local shortcut, this is used a LOT
652 # local shortcut, this is used a LOT
653 self.log = self.logger.log
653 self.log = self.logger.log
654
654
655 # Initialize cache, set in/out prompts and printing system
655 # Initialize cache, set in/out prompts and printing system
656 self.outputcache = CachedOutput(self,
656 self.outputcache = CachedOutput(self,
657 rc.cache_size,
657 rc.cache_size,
658 rc.pprint,
658 rc.pprint,
659 input_sep = rc.separate_in,
659 input_sep = rc.separate_in,
660 output_sep = rc.separate_out,
660 output_sep = rc.separate_out,
661 output_sep2 = rc.separate_out2,
661 output_sep2 = rc.separate_out2,
662 ps1 = rc.prompt_in1,
662 ps1 = rc.prompt_in1,
663 ps2 = rc.prompt_in2,
663 ps2 = rc.prompt_in2,
664 ps_out = rc.prompt_out,
664 ps_out = rc.prompt_out,
665 pad_left = rc.prompts_pad_left)
665 pad_left = rc.prompts_pad_left)
666
666
667 # user may have over-ridden the default print hook:
667 # user may have over-ridden the default print hook:
668 try:
668 try:
669 self.outputcache.__class__.display = self.hooks.display
669 self.outputcache.__class__.display = self.hooks.display
670 except AttributeError:
670 except AttributeError:
671 pass
671 pass
672
672
673 # I don't like assigning globally to sys, because it means when
673 # I don't like assigning globally to sys, because it means when
674 # embedding instances, each embedded instance overrides the previous
674 # embedding instances, each embedded instance overrides the previous
675 # choice. But sys.displayhook seems to be called internally by exec,
675 # choice. But sys.displayhook seems to be called internally by exec,
676 # so I don't see a way around it. We first save the original and then
676 # so I don't see a way around it. We first save the original and then
677 # overwrite it.
677 # overwrite it.
678 self.sys_displayhook = sys.displayhook
678 self.sys_displayhook = sys.displayhook
679 sys.displayhook = self.outputcache
679 sys.displayhook = self.outputcache
680
680
681 # Set user colors (don't do it in the constructor above so that it
681 # Set user colors (don't do it in the constructor above so that it
682 # doesn't crash if colors option is invalid)
682 # doesn't crash if colors option is invalid)
683 self.magic_colors(rc.colors)
683 self.magic_colors(rc.colors)
684
684
685 # Set calling of pdb on exceptions
685 # Set calling of pdb on exceptions
686 self.call_pdb = rc.pdb
686 self.call_pdb = rc.pdb
687
687
688 # Load user aliases
688 # Load user aliases
689 for alias in rc.alias:
689 for alias in rc.alias:
690 self.magic_alias(alias)
690 self.magic_alias(alias)
691 self.hooks.late_startup_hook()
691 self.hooks.late_startup_hook()
692
692
693 batchrun = False
693 batchrun = False
694 for batchfile in [path(arg) for arg in self.rc.args
694 for batchfile in [path(arg) for arg in self.rc.args
695 if arg.lower().endswith('.ipy')]:
695 if arg.lower().endswith('.ipy')]:
696 if not batchfile.isfile():
696 if not batchfile.isfile():
697 print "No such batch file:", batchfile
697 print "No such batch file:", batchfile
698 continue
698 continue
699 self.api.runlines(batchfile.text())
699 self.api.runlines(batchfile.text())
700 batchrun = True
700 batchrun = True
701 if batchrun:
701 if batchrun:
702 self.exit_now = True
702 self.exit_now = True
703
703
704 def add_builtins(self):
704 def add_builtins(self):
705 """Store ipython references into the builtin namespace.
705 """Store ipython references into the builtin namespace.
706
706
707 Some parts of ipython operate via builtins injected here, which hold a
707 Some parts of ipython operate via builtins injected here, which hold a
708 reference to IPython itself."""
708 reference to IPython itself."""
709
709
710 # TODO: deprecate all except _ip; 'jobs' should be installed
710 # TODO: deprecate all except _ip; 'jobs' should be installed
711 # by an extension and the rest are under _ip, ipalias is redundant
711 # by an extension and the rest are under _ip, ipalias is redundant
712 builtins_new = dict(__IPYTHON__ = self,
712 builtins_new = dict(__IPYTHON__ = self,
713 ip_set_hook = self.set_hook,
713 ip_set_hook = self.set_hook,
714 jobs = self.jobs,
714 jobs = self.jobs,
715 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
715 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
716 ipalias = wrap_deprecated(self.ipalias),
716 ipalias = wrap_deprecated(self.ipalias),
717 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
717 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
718 _ip = self.api
718 _ip = self.api
719 )
719 )
720 for biname,bival in builtins_new.items():
720 for biname,bival in builtins_new.items():
721 try:
721 try:
722 # store the orignal value so we can restore it
722 # store the orignal value so we can restore it
723 self.builtins_added[biname] = __builtin__.__dict__[biname]
723 self.builtins_added[biname] = __builtin__.__dict__[biname]
724 except KeyError:
724 except KeyError:
725 # or mark that it wasn't defined, and we'll just delete it at
725 # or mark that it wasn't defined, and we'll just delete it at
726 # cleanup
726 # cleanup
727 self.builtins_added[biname] = Undefined
727 self.builtins_added[biname] = Undefined
728 __builtin__.__dict__[biname] = bival
728 __builtin__.__dict__[biname] = bival
729
729
730 # Keep in the builtins a flag for when IPython is active. We set it
730 # Keep in the builtins a flag for when IPython is active. We set it
731 # with setdefault so that multiple nested IPythons don't clobber one
731 # with setdefault so that multiple nested IPythons don't clobber one
732 # another. Each will increase its value by one upon being activated,
732 # another. Each will increase its value by one upon being activated,
733 # which also gives us a way to determine the nesting level.
733 # which also gives us a way to determine the nesting level.
734 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
734 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
735
735
736 def clean_builtins(self):
736 def clean_builtins(self):
737 """Remove any builtins which might have been added by add_builtins, or
737 """Remove any builtins which might have been added by add_builtins, or
738 restore overwritten ones to their previous values."""
738 restore overwritten ones to their previous values."""
739 for biname,bival in self.builtins_added.items():
739 for biname,bival in self.builtins_added.items():
740 if bival is Undefined:
740 if bival is Undefined:
741 del __builtin__.__dict__[biname]
741 del __builtin__.__dict__[biname]
742 else:
742 else:
743 __builtin__.__dict__[biname] = bival
743 __builtin__.__dict__[biname] = bival
744 self.builtins_added.clear()
744 self.builtins_added.clear()
745
745
746 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
746 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
747 """set_hook(name,hook) -> sets an internal IPython hook.
747 """set_hook(name,hook) -> sets an internal IPython hook.
748
748
749 IPython exposes some of its internal API as user-modifiable hooks. By
749 IPython exposes some of its internal API as user-modifiable hooks. By
750 adding your function to one of these hooks, you can modify IPython's
750 adding your function to one of these hooks, you can modify IPython's
751 behavior to call at runtime your own routines."""
751 behavior to call at runtime your own routines."""
752
752
753 # At some point in the future, this should validate the hook before it
753 # At some point in the future, this should validate the hook before it
754 # accepts it. Probably at least check that the hook takes the number
754 # accepts it. Probably at least check that the hook takes the number
755 # of args it's supposed to.
755 # of args it's supposed to.
756
756
757 f = new.instancemethod(hook,self,self.__class__)
757 f = new.instancemethod(hook,self,self.__class__)
758
758
759 # check if the hook is for strdispatcher first
759 # check if the hook is for strdispatcher first
760 if str_key is not None:
760 if str_key is not None:
761 sdp = self.strdispatchers.get(name, StrDispatch())
761 sdp = self.strdispatchers.get(name, StrDispatch())
762 sdp.add_s(str_key, f, priority )
762 sdp.add_s(str_key, f, priority )
763 self.strdispatchers[name] = sdp
763 self.strdispatchers[name] = sdp
764 return
764 return
765 if re_key is not None:
765 if re_key is not None:
766 sdp = self.strdispatchers.get(name, StrDispatch())
766 sdp = self.strdispatchers.get(name, StrDispatch())
767 sdp.add_re(re.compile(re_key), f, priority )
767 sdp.add_re(re.compile(re_key), f, priority )
768 self.strdispatchers[name] = sdp
768 self.strdispatchers[name] = sdp
769 return
769 return
770
770
771 dp = getattr(self.hooks, name, None)
771 dp = getattr(self.hooks, name, None)
772 if name not in IPython.hooks.__all__:
772 if name not in IPython.hooks.__all__:
773 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
773 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
774 if not dp:
774 if not dp:
775 dp = IPython.hooks.CommandChainDispatcher()
775 dp = IPython.hooks.CommandChainDispatcher()
776
776
777 try:
777 try:
778 dp.add(f,priority)
778 dp.add(f,priority)
779 except AttributeError:
779 except AttributeError:
780 # it was not commandchain, plain old func - replace
780 # it was not commandchain, plain old func - replace
781 dp = f
781 dp = f
782
782
783 setattr(self.hooks,name, dp)
783 setattr(self.hooks,name, dp)
784
784
785
785
786 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
786 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
787
787
788 def set_crash_handler(self,crashHandler):
788 def set_crash_handler(self,crashHandler):
789 """Set the IPython crash handler.
789 """Set the IPython crash handler.
790
790
791 This must be a callable with a signature suitable for use as
791 This must be a callable with a signature suitable for use as
792 sys.excepthook."""
792 sys.excepthook."""
793
793
794 # Install the given crash handler as the Python exception hook
794 # Install the given crash handler as the Python exception hook
795 sys.excepthook = crashHandler
795 sys.excepthook = crashHandler
796
796
797 # The instance will store a pointer to this, so that runtime code
797 # The instance will store a pointer to this, so that runtime code
798 # (such as magics) can access it. This is because during the
798 # (such as magics) can access it. This is because during the
799 # read-eval loop, it gets temporarily overwritten (to deal with GUI
799 # read-eval loop, it gets temporarily overwritten (to deal with GUI
800 # frameworks).
800 # frameworks).
801 self.sys_excepthook = sys.excepthook
801 self.sys_excepthook = sys.excepthook
802
802
803
803
804 def set_custom_exc(self,exc_tuple,handler):
804 def set_custom_exc(self,exc_tuple,handler):
805 """set_custom_exc(exc_tuple,handler)
805 """set_custom_exc(exc_tuple,handler)
806
806
807 Set a custom exception handler, which will be called if any of the
807 Set a custom exception handler, which will be called if any of the
808 exceptions in exc_tuple occur in the mainloop (specifically, in the
808 exceptions in exc_tuple occur in the mainloop (specifically, in the
809 runcode() method.
809 runcode() method.
810
810
811 Inputs:
811 Inputs:
812
812
813 - exc_tuple: a *tuple* of valid exceptions to call the defined
813 - exc_tuple: a *tuple* of valid exceptions to call the defined
814 handler for. It is very important that you use a tuple, and NOT A
814 handler for. It is very important that you use a tuple, and NOT A
815 LIST here, because of the way Python's except statement works. If
815 LIST here, because of the way Python's except statement works. If
816 you only want to trap a single exception, use a singleton tuple:
816 you only want to trap a single exception, use a singleton tuple:
817
817
818 exc_tuple == (MyCustomException,)
818 exc_tuple == (MyCustomException,)
819
819
820 - handler: this must be defined as a function with the following
820 - handler: this must be defined as a function with the following
821 basic interface: def my_handler(self,etype,value,tb).
821 basic interface: def my_handler(self,etype,value,tb).
822
822
823 This will be made into an instance method (via new.instancemethod)
823 This will be made into an instance method (via new.instancemethod)
824 of IPython itself, and it will be called if any of the exceptions
824 of IPython itself, and it will be called if any of the exceptions
825 listed in the exc_tuple are caught. If the handler is None, an
825 listed in the exc_tuple are caught. If the handler is None, an
826 internal basic one is used, which just prints basic info.
826 internal basic one is used, which just prints basic info.
827
827
828 WARNING: by putting in your own exception handler into IPython's main
828 WARNING: by putting in your own exception handler into IPython's main
829 execution loop, you run a very good chance of nasty crashes. This
829 execution loop, you run a very good chance of nasty crashes. This
830 facility should only be used if you really know what you are doing."""
830 facility should only be used if you really know what you are doing."""
831
831
832 assert type(exc_tuple)==type(()) , \
832 assert type(exc_tuple)==type(()) , \
833 "The custom exceptions must be given AS A TUPLE."
833 "The custom exceptions must be given AS A TUPLE."
834
834
835 def dummy_handler(self,etype,value,tb):
835 def dummy_handler(self,etype,value,tb):
836 print '*** Simple custom exception handler ***'
836 print '*** Simple custom exception handler ***'
837 print 'Exception type :',etype
837 print 'Exception type :',etype
838 print 'Exception value:',value
838 print 'Exception value:',value
839 print 'Traceback :',tb
839 print 'Traceback :',tb
840 print 'Source code :','\n'.join(self.buffer)
840 print 'Source code :','\n'.join(self.buffer)
841
841
842 if handler is None: handler = dummy_handler
842 if handler is None: handler = dummy_handler
843
843
844 self.CustomTB = new.instancemethod(handler,self,self.__class__)
844 self.CustomTB = new.instancemethod(handler,self,self.__class__)
845 self.custom_exceptions = exc_tuple
845 self.custom_exceptions = exc_tuple
846
846
847 def set_custom_completer(self,completer,pos=0):
847 def set_custom_completer(self,completer,pos=0):
848 """set_custom_completer(completer,pos=0)
848 """set_custom_completer(completer,pos=0)
849
849
850 Adds a new custom completer function.
850 Adds a new custom completer function.
851
851
852 The position argument (defaults to 0) is the index in the completers
852 The position argument (defaults to 0) is the index in the completers
853 list where you want the completer to be inserted."""
853 list where you want the completer to be inserted."""
854
854
855 newcomp = new.instancemethod(completer,self.Completer,
855 newcomp = new.instancemethod(completer,self.Completer,
856 self.Completer.__class__)
856 self.Completer.__class__)
857 self.Completer.matchers.insert(pos,newcomp)
857 self.Completer.matchers.insert(pos,newcomp)
858
858
859 def set_completer(self):
859 def set_completer(self):
860 """reset readline's completer to be our own."""
860 """reset readline's completer to be our own."""
861 self.readline.set_completer(self.Completer.complete)
861 self.readline.set_completer(self.Completer.complete)
862
862
863 def _get_call_pdb(self):
863 def _get_call_pdb(self):
864 return self._call_pdb
864 return self._call_pdb
865
865
866 def _set_call_pdb(self,val):
866 def _set_call_pdb(self,val):
867
867
868 if val not in (0,1,False,True):
868 if val not in (0,1,False,True):
869 raise ValueError,'new call_pdb value must be boolean'
869 raise ValueError,'new call_pdb value must be boolean'
870
870
871 # store value in instance
871 # store value in instance
872 self._call_pdb = val
872 self._call_pdb = val
873
873
874 # notify the actual exception handlers
874 # notify the actual exception handlers
875 self.InteractiveTB.call_pdb = val
875 self.InteractiveTB.call_pdb = val
876 if self.isthreaded:
876 if self.isthreaded:
877 try:
877 try:
878 self.sys_excepthook.call_pdb = val
878 self.sys_excepthook.call_pdb = val
879 except:
879 except:
880 warn('Failed to activate pdb for threaded exception handler')
880 warn('Failed to activate pdb for threaded exception handler')
881
881
882 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
882 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
883 'Control auto-activation of pdb at exceptions')
883 'Control auto-activation of pdb at exceptions')
884
884
885
885
886 # These special functions get installed in the builtin namespace, to
886 # These special functions get installed in the builtin namespace, to
887 # provide programmatic (pure python) access to magics, aliases and system
887 # provide programmatic (pure python) access to magics, aliases and system
888 # calls. This is important for logging, user scripting, and more.
888 # calls. This is important for logging, user scripting, and more.
889
889
890 # We are basically exposing, via normal python functions, the three
890 # We are basically exposing, via normal python functions, the three
891 # mechanisms in which ipython offers special call modes (magics for
891 # mechanisms in which ipython offers special call modes (magics for
892 # internal control, aliases for direct system access via pre-selected
892 # internal control, aliases for direct system access via pre-selected
893 # names, and !cmd for calling arbitrary system commands).
893 # names, and !cmd for calling arbitrary system commands).
894
894
895 def ipmagic(self,arg_s):
895 def ipmagic(self,arg_s):
896 """Call a magic function by name.
896 """Call a magic function by name.
897
897
898 Input: a string containing the name of the magic function to call and any
898 Input: a string containing the name of the magic function to call and any
899 additional arguments to be passed to the magic.
899 additional arguments to be passed to the magic.
900
900
901 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
901 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
902 prompt:
902 prompt:
903
903
904 In[1]: %name -opt foo bar
904 In[1]: %name -opt foo bar
905
905
906 To call a magic without arguments, simply use ipmagic('name').
906 To call a magic without arguments, simply use ipmagic('name').
907
907
908 This provides a proper Python function to call IPython's magics in any
908 This provides a proper Python function to call IPython's magics in any
909 valid Python code you can type at the interpreter, including loops and
909 valid Python code you can type at the interpreter, including loops and
910 compound statements. It is added by IPython to the Python builtin
910 compound statements. It is added by IPython to the Python builtin
911 namespace upon initialization."""
911 namespace upon initialization."""
912
912
913 args = arg_s.split(' ',1)
913 args = arg_s.split(' ',1)
914 magic_name = args[0]
914 magic_name = args[0]
915 magic_name = magic_name.lstrip(self.ESC_MAGIC)
915 magic_name = magic_name.lstrip(self.ESC_MAGIC)
916
916
917 try:
917 try:
918 magic_args = args[1]
918 magic_args = args[1]
919 except IndexError:
919 except IndexError:
920 magic_args = ''
920 magic_args = ''
921 fn = getattr(self,'magic_'+magic_name,None)
921 fn = getattr(self,'magic_'+magic_name,None)
922 if fn is None:
922 if fn is None:
923 error("Magic function `%s` not found." % magic_name)
923 error("Magic function `%s` not found." % magic_name)
924 else:
924 else:
925 magic_args = self.var_expand(magic_args,1)
925 magic_args = self.var_expand(magic_args,1)
926 return fn(magic_args)
926 return fn(magic_args)
927
927
928 def ipalias(self,arg_s):
928 def ipalias(self,arg_s):
929 """Call an alias by name.
929 """Call an alias by name.
930
930
931 Input: a string containing the name of the alias to call and any
931 Input: a string containing the name of the alias to call and any
932 additional arguments to be passed to the magic.
932 additional arguments to be passed to the magic.
933
933
934 ipalias('name -opt foo bar') is equivalent to typing at the ipython
934 ipalias('name -opt foo bar') is equivalent to typing at the ipython
935 prompt:
935 prompt:
936
936
937 In[1]: name -opt foo bar
937 In[1]: name -opt foo bar
938
938
939 To call an alias without arguments, simply use ipalias('name').
939 To call an alias without arguments, simply use ipalias('name').
940
940
941 This provides a proper Python function to call IPython's aliases in any
941 This provides a proper Python function to call IPython's aliases in any
942 valid Python code you can type at the interpreter, including loops and
942 valid Python code you can type at the interpreter, including loops and
943 compound statements. It is added by IPython to the Python builtin
943 compound statements. It is added by IPython to the Python builtin
944 namespace upon initialization."""
944 namespace upon initialization."""
945
945
946 args = arg_s.split(' ',1)
946 args = arg_s.split(' ',1)
947 alias_name = args[0]
947 alias_name = args[0]
948 try:
948 try:
949 alias_args = args[1]
949 alias_args = args[1]
950 except IndexError:
950 except IndexError:
951 alias_args = ''
951 alias_args = ''
952 if alias_name in self.alias_table:
952 if alias_name in self.alias_table:
953 self.call_alias(alias_name,alias_args)
953 self.call_alias(alias_name,alias_args)
954 else:
954 else:
955 error("Alias `%s` not found." % alias_name)
955 error("Alias `%s` not found." % alias_name)
956
956
957 def ipsystem(self,arg_s):
957 def ipsystem(self,arg_s):
958 """Make a system call, using IPython."""
958 """Make a system call, using IPython."""
959
959
960 self.system(arg_s)
960 self.system(arg_s)
961
961
962 def complete(self,text):
962 def complete(self,text):
963 """Return a sorted list of all possible completions on text.
963 """Return a sorted list of all possible completions on text.
964
964
965 Inputs:
965 Inputs:
966
966
967 - text: a string of text to be completed on.
967 - text: a string of text to be completed on.
968
968
969 This is a wrapper around the completion mechanism, similar to what
969 This is a wrapper around the completion mechanism, similar to what
970 readline does at the command line when the TAB key is hit. By
970 readline does at the command line when the TAB key is hit. By
971 exposing it as a method, it can be used by other non-readline
971 exposing it as a method, it can be used by other non-readline
972 environments (such as GUIs) for text completion.
972 environments (such as GUIs) for text completion.
973
973
974 Simple usage example:
974 Simple usage example:
975
975
976 In [1]: x = 'hello'
976 In [1]: x = 'hello'
977
977
978 In [2]: __IP.complete('x.l')
978 In [2]: __IP.complete('x.l')
979 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
979 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
980
980
981 complete = self.Completer.complete
981 complete = self.Completer.complete
982 state = 0
982 state = 0
983 # use a dict so we get unique keys, since ipyhton's multiple
983 # use a dict so we get unique keys, since ipyhton's multiple
984 # completers can return duplicates. When we make 2.4 a requirement,
984 # completers can return duplicates. When we make 2.4 a requirement,
985 # start using sets instead, which are faster.
985 # start using sets instead, which are faster.
986 comps = {}
986 comps = {}
987 while True:
987 while True:
988 newcomp = complete(text,state,line_buffer=text)
988 newcomp = complete(text,state,line_buffer=text)
989 if newcomp is None:
989 if newcomp is None:
990 break
990 break
991 comps[newcomp] = 1
991 comps[newcomp] = 1
992 state += 1
992 state += 1
993 outcomps = comps.keys()
993 outcomps = comps.keys()
994 outcomps.sort()
994 outcomps.sort()
995 return outcomps
995 return outcomps
996
996
997 def set_completer_frame(self, frame=None):
997 def set_completer_frame(self, frame=None):
998 if frame:
998 if frame:
999 self.Completer.namespace = frame.f_locals
999 self.Completer.namespace = frame.f_locals
1000 self.Completer.global_namespace = frame.f_globals
1000 self.Completer.global_namespace = frame.f_globals
1001 else:
1001 else:
1002 self.Completer.namespace = self.user_ns
1002 self.Completer.namespace = self.user_ns
1003 self.Completer.global_namespace = self.user_global_ns
1003 self.Completer.global_namespace = self.user_global_ns
1004
1004
1005 def init_auto_alias(self):
1005 def init_auto_alias(self):
1006 """Define some aliases automatically.
1006 """Define some aliases automatically.
1007
1007
1008 These are ALL parameter-less aliases"""
1008 These are ALL parameter-less aliases"""
1009
1009
1010 for alias,cmd in self.auto_alias:
1010 for alias,cmd in self.auto_alias:
1011 self.alias_table[alias] = (0,cmd)
1011 self.alias_table[alias] = (0,cmd)
1012
1012
1013 def alias_table_validate(self,verbose=0):
1013 def alias_table_validate(self,verbose=0):
1014 """Update information about the alias table.
1014 """Update information about the alias table.
1015
1015
1016 In particular, make sure no Python keywords/builtins are in it."""
1016 In particular, make sure no Python keywords/builtins are in it."""
1017
1017
1018 no_alias = self.no_alias
1018 no_alias = self.no_alias
1019 for k in self.alias_table.keys():
1019 for k in self.alias_table.keys():
1020 if k in no_alias:
1020 if k in no_alias:
1021 del self.alias_table[k]
1021 del self.alias_table[k]
1022 if verbose:
1022 if verbose:
1023 print ("Deleting alias <%s>, it's a Python "
1023 print ("Deleting alias <%s>, it's a Python "
1024 "keyword or builtin." % k)
1024 "keyword or builtin." % k)
1025
1025
1026 def set_autoindent(self,value=None):
1026 def set_autoindent(self,value=None):
1027 """Set the autoindent flag, checking for readline support.
1027 """Set the autoindent flag, checking for readline support.
1028
1028
1029 If called with no arguments, it acts as a toggle."""
1029 If called with no arguments, it acts as a toggle."""
1030
1030
1031 if not self.has_readline:
1031 if not self.has_readline:
1032 if os.name == 'posix':
1032 if os.name == 'posix':
1033 warn("The auto-indent feature requires the readline library")
1033 warn("The auto-indent feature requires the readline library")
1034 self.autoindent = 0
1034 self.autoindent = 0
1035 return
1035 return
1036 if value is None:
1036 if value is None:
1037 self.autoindent = not self.autoindent
1037 self.autoindent = not self.autoindent
1038 else:
1038 else:
1039 self.autoindent = value
1039 self.autoindent = value
1040
1040
1041 def rc_set_toggle(self,rc_field,value=None):
1041 def rc_set_toggle(self,rc_field,value=None):
1042 """Set or toggle a field in IPython's rc config. structure.
1042 """Set or toggle a field in IPython's rc config. structure.
1043
1043
1044 If called with no arguments, it acts as a toggle.
1044 If called with no arguments, it acts as a toggle.
1045
1045
1046 If called with a non-existent field, the resulting AttributeError
1046 If called with a non-existent field, the resulting AttributeError
1047 exception will propagate out."""
1047 exception will propagate out."""
1048
1048
1049 rc_val = getattr(self.rc,rc_field)
1049 rc_val = getattr(self.rc,rc_field)
1050 if value is None:
1050 if value is None:
1051 value = not rc_val
1051 value = not rc_val
1052 setattr(self.rc,rc_field,value)
1052 setattr(self.rc,rc_field,value)
1053
1053
1054 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1054 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1055 """Install the user configuration directory.
1055 """Install the user configuration directory.
1056
1056
1057 Can be called when running for the first time or to upgrade the user's
1057 Can be called when running for the first time or to upgrade the user's
1058 .ipython/ directory with the mode parameter. Valid modes are 'install'
1058 .ipython/ directory with the mode parameter. Valid modes are 'install'
1059 and 'upgrade'."""
1059 and 'upgrade'."""
1060
1060
1061 def wait():
1061 def wait():
1062 try:
1062 try:
1063 raw_input("Please press <RETURN> to start IPython.")
1063 raw_input("Please press <RETURN> to start IPython.")
1064 except EOFError:
1064 except EOFError:
1065 print >> Term.cout
1065 print >> Term.cout
1066 print '*'*70
1066 print '*'*70
1067
1067
1068 cwd = os.getcwd() # remember where we started
1068 cwd = os.getcwd() # remember where we started
1069 glb = glob.glob
1069 glb = glob.glob
1070 print '*'*70
1070 print '*'*70
1071 if mode == 'install':
1071 if mode == 'install':
1072 print \
1072 print \
1073 """Welcome to IPython. I will try to create a personal configuration directory
1073 """Welcome to IPython. I will try to create a personal configuration directory
1074 where you can customize many aspects of IPython's functionality in:\n"""
1074 where you can customize many aspects of IPython's functionality in:\n"""
1075 else:
1075 else:
1076 print 'I am going to upgrade your configuration in:'
1076 print 'I am going to upgrade your configuration in:'
1077
1077
1078 print ipythondir
1078 print ipythondir
1079
1079
1080 rcdirend = os.path.join('IPython','UserConfig')
1080 rcdirend = os.path.join('IPython','UserConfig')
1081 cfg = lambda d: os.path.join(d,rcdirend)
1081 cfg = lambda d: os.path.join(d,rcdirend)
1082 try:
1082 try:
1083 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1083 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1084 except IOError:
1084 except IOError:
1085 warning = """
1085 warning = """
1086 Installation error. IPython's directory was not found.
1086 Installation error. IPython's directory was not found.
1087
1087
1088 Check the following:
1088 Check the following:
1089
1089
1090 The ipython/IPython directory should be in a directory belonging to your
1090 The ipython/IPython directory should be in a directory belonging to your
1091 PYTHONPATH environment variable (that is, it should be in a directory
1091 PYTHONPATH environment variable (that is, it should be in a directory
1092 belonging to sys.path). You can copy it explicitly there or just link to it.
1092 belonging to sys.path). You can copy it explicitly there or just link to it.
1093
1093
1094 IPython will proceed with builtin defaults.
1094 IPython will proceed with builtin defaults.
1095 """
1095 """
1096 warn(warning)
1096 warn(warning)
1097 wait()
1097 wait()
1098 return
1098 return
1099
1099
1100 if mode == 'install':
1100 if mode == 'install':
1101 try:
1101 try:
1102 shutil.copytree(rcdir,ipythondir)
1102 shutil.copytree(rcdir,ipythondir)
1103 os.chdir(ipythondir)
1103 os.chdir(ipythondir)
1104 rc_files = glb("ipythonrc*")
1104 rc_files = glb("ipythonrc*")
1105 for rc_file in rc_files:
1105 for rc_file in rc_files:
1106 os.rename(rc_file,rc_file+rc_suffix)
1106 os.rename(rc_file,rc_file+rc_suffix)
1107 except:
1107 except:
1108 warning = """
1108 warning = """
1109
1109
1110 There was a problem with the installation:
1110 There was a problem with the installation:
1111 %s
1111 %s
1112 Try to correct it or contact the developers if you think it's a bug.
1112 Try to correct it or contact the developers if you think it's a bug.
1113 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1113 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1114 warn(warning)
1114 warn(warning)
1115 wait()
1115 wait()
1116 return
1116 return
1117
1117
1118 elif mode == 'upgrade':
1118 elif mode == 'upgrade':
1119 try:
1119 try:
1120 os.chdir(ipythondir)
1120 os.chdir(ipythondir)
1121 except:
1121 except:
1122 print """
1122 print """
1123 Can not upgrade: changing to directory %s failed. Details:
1123 Can not upgrade: changing to directory %s failed. Details:
1124 %s
1124 %s
1125 """ % (ipythondir,sys.exc_info()[1])
1125 """ % (ipythondir,sys.exc_info()[1])
1126 wait()
1126 wait()
1127 return
1127 return
1128 else:
1128 else:
1129 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1129 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1130 for new_full_path in sources:
1130 for new_full_path in sources:
1131 new_filename = os.path.basename(new_full_path)
1131 new_filename = os.path.basename(new_full_path)
1132 if new_filename.startswith('ipythonrc'):
1132 if new_filename.startswith('ipythonrc'):
1133 new_filename = new_filename + rc_suffix
1133 new_filename = new_filename + rc_suffix
1134 # The config directory should only contain files, skip any
1134 # The config directory should only contain files, skip any
1135 # directories which may be there (like CVS)
1135 # directories which may be there (like CVS)
1136 if os.path.isdir(new_full_path):
1136 if os.path.isdir(new_full_path):
1137 continue
1137 continue
1138 if os.path.exists(new_filename):
1138 if os.path.exists(new_filename):
1139 old_file = new_filename+'.old'
1139 old_file = new_filename+'.old'
1140 if os.path.exists(old_file):
1140 if os.path.exists(old_file):
1141 os.remove(old_file)
1141 os.remove(old_file)
1142 os.rename(new_filename,old_file)
1142 os.rename(new_filename,old_file)
1143 shutil.copy(new_full_path,new_filename)
1143 shutil.copy(new_full_path,new_filename)
1144 else:
1144 else:
1145 raise ValueError,'unrecognized mode for install:',`mode`
1145 raise ValueError,'unrecognized mode for install:',`mode`
1146
1146
1147 # Fix line-endings to those native to each platform in the config
1147 # Fix line-endings to those native to each platform in the config
1148 # directory.
1148 # directory.
1149 try:
1149 try:
1150 os.chdir(ipythondir)
1150 os.chdir(ipythondir)
1151 except:
1151 except:
1152 print """
1152 print """
1153 Problem: changing to directory %s failed.
1153 Problem: changing to directory %s failed.
1154 Details:
1154 Details:
1155 %s
1155 %s
1156
1156
1157 Some configuration files may have incorrect line endings. This should not
1157 Some configuration files may have incorrect line endings. This should not
1158 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1158 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1159 wait()
1159 wait()
1160 else:
1160 else:
1161 for fname in glb('ipythonrc*'):
1161 for fname in glb('ipythonrc*'):
1162 try:
1162 try:
1163 native_line_ends(fname,backup=0)
1163 native_line_ends(fname,backup=0)
1164 except IOError:
1164 except IOError:
1165 pass
1165 pass
1166
1166
1167 if mode == 'install':
1167 if mode == 'install':
1168 print """
1168 print """
1169 Successful installation!
1169 Successful installation!
1170
1170
1171 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1171 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1172 IPython manual (there are both HTML and PDF versions supplied with the
1172 IPython manual (there are both HTML and PDF versions supplied with the
1173 distribution) to make sure that your system environment is properly configured
1173 distribution) to make sure that your system environment is properly configured
1174 to take advantage of IPython's features.
1174 to take advantage of IPython's features.
1175
1175
1176 Important note: the configuration system has changed! The old system is
1176 Important note: the configuration system has changed! The old system is
1177 still in place, but its setting may be partly overridden by the settings in
1177 still in place, but its setting may be partly overridden by the settings in
1178 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1178 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1179 if some of the new settings bother you.
1179 if some of the new settings bother you.
1180
1180
1181 """
1181 """
1182 else:
1182 else:
1183 print """
1183 print """
1184 Successful upgrade!
1184 Successful upgrade!
1185
1185
1186 All files in your directory:
1186 All files in your directory:
1187 %(ipythondir)s
1187 %(ipythondir)s
1188 which would have been overwritten by the upgrade were backed up with a .old
1188 which would have been overwritten by the upgrade were backed up with a .old
1189 extension. If you had made particular customizations in those files you may
1189 extension. If you had made particular customizations in those files you may
1190 want to merge them back into the new files.""" % locals()
1190 want to merge them back into the new files.""" % locals()
1191 wait()
1191 wait()
1192 os.chdir(cwd)
1192 os.chdir(cwd)
1193 # end user_setup()
1193 # end user_setup()
1194
1194
1195 def atexit_operations(self):
1195 def atexit_operations(self):
1196 """This will be executed at the time of exit.
1196 """This will be executed at the time of exit.
1197
1197
1198 Saving of persistent data should be performed here. """
1198 Saving of persistent data should be performed here. """
1199
1199
1200 #print '*** IPython exit cleanup ***' # dbg
1200 #print '*** IPython exit cleanup ***' # dbg
1201 # input history
1201 # input history
1202 self.savehist()
1202 self.savehist()
1203
1203
1204 # Cleanup all tempfiles left around
1204 # Cleanup all tempfiles left around
1205 for tfile in self.tempfiles:
1205 for tfile in self.tempfiles:
1206 try:
1206 try:
1207 os.unlink(tfile)
1207 os.unlink(tfile)
1208 except OSError:
1208 except OSError:
1209 pass
1209 pass
1210
1210
1211 self.hooks.shutdown_hook()
1211 self.hooks.shutdown_hook()
1212
1212
1213 def savehist(self):
1213 def savehist(self):
1214 """Save input history to a file (via readline library)."""
1214 """Save input history to a file (via readline library)."""
1215 try:
1215 try:
1216 self.readline.write_history_file(self.histfile)
1216 self.readline.write_history_file(self.histfile)
1217 except:
1217 except:
1218 print 'Unable to save IPython command history to file: ' + \
1218 print 'Unable to save IPython command history to file: ' + \
1219 `self.histfile`
1219 `self.histfile`
1220
1220
1221 def reloadhist(self):
1221 def reloadhist(self):
1222 """Reload the input history from disk file."""
1222 """Reload the input history from disk file."""
1223
1223
1224 if self.has_readline:
1224 if self.has_readline:
1225 self.readline.clear_history()
1225 self.readline.clear_history()
1226 self.readline.read_history_file(self.shell.histfile)
1226 self.readline.read_history_file(self.shell.histfile)
1227
1227
1228 def history_saving_wrapper(self, func):
1228 def history_saving_wrapper(self, func):
1229 """ Wrap func for readline history saving
1229 """ Wrap func for readline history saving
1230
1230
1231 Convert func into callable that saves & restores
1231 Convert func into callable that saves & restores
1232 history around the call """
1232 history around the call """
1233
1233
1234 if not self.has_readline:
1234 if not self.has_readline:
1235 return func
1235 return func
1236
1236
1237 def wrapper():
1237 def wrapper():
1238 self.savehist()
1238 self.savehist()
1239 try:
1239 try:
1240 func()
1240 func()
1241 finally:
1241 finally:
1242 readline.read_history_file(self.histfile)
1242 readline.read_history_file(self.histfile)
1243 return wrapper
1243 return wrapper
1244
1244
1245
1245
1246 def pre_readline(self):
1246 def pre_readline(self):
1247 """readline hook to be used at the start of each line.
1247 """readline hook to be used at the start of each line.
1248
1248
1249 Currently it handles auto-indent only."""
1249 Currently it handles auto-indent only."""
1250
1250
1251 #debugx('self.indent_current_nsp','pre_readline:')
1251 #debugx('self.indent_current_nsp','pre_readline:')
1252
1252
1253 if self.rl_do_indent:
1253 if self.rl_do_indent:
1254 self.readline.insert_text(self.indent_current_str())
1254 self.readline.insert_text(self.indent_current_str())
1255 if self.rl_next_input is not None:
1255 if self.rl_next_input is not None:
1256 self.readline.insert_text(self.rl_next_input)
1256 self.readline.insert_text(self.rl_next_input)
1257 self.rl_next_input = None
1257 self.rl_next_input = None
1258
1258
1259 def init_readline(self):
1259 def init_readline(self):
1260 """Command history completion/saving/reloading."""
1260 """Command history completion/saving/reloading."""
1261
1261
1262 import IPython.rlineimpl as readline
1262 import IPython.rlineimpl as readline
1263 if not readline.have_readline:
1263 if not readline.have_readline:
1264 self.has_readline = 0
1264 self.has_readline = 0
1265 self.readline = None
1265 self.readline = None
1266 # no point in bugging windows users with this every time:
1266 # no point in bugging windows users with this every time:
1267 warn('Readline services not available on this platform.')
1267 warn('Readline services not available on this platform.')
1268 else:
1268 else:
1269 sys.modules['readline'] = readline
1269 sys.modules['readline'] = readline
1270 import atexit
1270 import atexit
1271 from IPython.completer import IPCompleter
1271 from IPython.completer import IPCompleter
1272 self.Completer = IPCompleter(self,
1272 self.Completer = IPCompleter(self,
1273 self.user_ns,
1273 self.user_ns,
1274 self.user_global_ns,
1274 self.user_global_ns,
1275 self.rc.readline_omit__names,
1275 self.rc.readline_omit__names,
1276 self.alias_table)
1276 self.alias_table)
1277 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1277 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1278 self.strdispatchers['complete_command'] = sdisp
1278 self.strdispatchers['complete_command'] = sdisp
1279 self.Completer.custom_completers = sdisp
1279 self.Completer.custom_completers = sdisp
1280 # Platform-specific configuration
1280 # Platform-specific configuration
1281 if os.name == 'nt':
1281 if os.name == 'nt':
1282 self.readline_startup_hook = readline.set_pre_input_hook
1282 self.readline_startup_hook = readline.set_pre_input_hook
1283 else:
1283 else:
1284 self.readline_startup_hook = readline.set_startup_hook
1284 self.readline_startup_hook = readline.set_startup_hook
1285
1285
1286 # Load user's initrc file (readline config)
1286 # Load user's initrc file (readline config)
1287 inputrc_name = os.environ.get('INPUTRC')
1287 inputrc_name = os.environ.get('INPUTRC')
1288 if inputrc_name is None:
1288 if inputrc_name is None:
1289 home_dir = get_home_dir()
1289 home_dir = get_home_dir()
1290 if home_dir is not None:
1290 if home_dir is not None:
1291 inputrc_name = os.path.join(home_dir,'.inputrc')
1291 inputrc_name = os.path.join(home_dir,'.inputrc')
1292 if os.path.isfile(inputrc_name):
1292 if os.path.isfile(inputrc_name):
1293 try:
1293 try:
1294 readline.read_init_file(inputrc_name)
1294 readline.read_init_file(inputrc_name)
1295 except:
1295 except:
1296 warn('Problems reading readline initialization file <%s>'
1296 warn('Problems reading readline initialization file <%s>'
1297 % inputrc_name)
1297 % inputrc_name)
1298
1298
1299 self.has_readline = 1
1299 self.has_readline = 1
1300 self.readline = readline
1300 self.readline = readline
1301 # save this in sys so embedded copies can restore it properly
1301 # save this in sys so embedded copies can restore it properly
1302 sys.ipcompleter = self.Completer.complete
1302 sys.ipcompleter = self.Completer.complete
1303 self.set_completer()
1303 self.set_completer()
1304
1304
1305 # Configure readline according to user's prefs
1305 # Configure readline according to user's prefs
1306 for rlcommand in self.rc.readline_parse_and_bind:
1306 for rlcommand in self.rc.readline_parse_and_bind:
1307 readline.parse_and_bind(rlcommand)
1307 readline.parse_and_bind(rlcommand)
1308
1308
1309 # remove some chars from the delimiters list
1309 # remove some chars from the delimiters list
1310 delims = readline.get_completer_delims()
1310 delims = readline.get_completer_delims()
1311 delims = delims.translate(string._idmap,
1311 delims = delims.translate(string._idmap,
1312 self.rc.readline_remove_delims)
1312 self.rc.readline_remove_delims)
1313 readline.set_completer_delims(delims)
1313 readline.set_completer_delims(delims)
1314 # otherwise we end up with a monster history after a while:
1314 # otherwise we end up with a monster history after a while:
1315 readline.set_history_length(1000)
1315 readline.set_history_length(1000)
1316 try:
1316 try:
1317 #print '*** Reading readline history' # dbg
1317 #print '*** Reading readline history' # dbg
1318 readline.read_history_file(self.histfile)
1318 readline.read_history_file(self.histfile)
1319 except IOError:
1319 except IOError:
1320 pass # It doesn't exist yet.
1320 pass # It doesn't exist yet.
1321
1321
1322 atexit.register(self.atexit_operations)
1322 atexit.register(self.atexit_operations)
1323 del atexit
1323 del atexit
1324
1324
1325 # Configure auto-indent for all platforms
1325 # Configure auto-indent for all platforms
1326 self.set_autoindent(self.rc.autoindent)
1326 self.set_autoindent(self.rc.autoindent)
1327
1327
1328 def ask_yes_no(self,prompt,default=True):
1328 def ask_yes_no(self,prompt,default=True):
1329 if self.rc.quiet:
1329 if self.rc.quiet:
1330 return True
1330 return True
1331 return ask_yes_no(prompt,default)
1331 return ask_yes_no(prompt,default)
1332
1332
1333 def _should_recompile(self,e):
1333 def _should_recompile(self,e):
1334 """Utility routine for edit_syntax_error"""
1334 """Utility routine for edit_syntax_error"""
1335
1335
1336 if e.filename in ('<ipython console>','<input>','<string>',
1336 if e.filename in ('<ipython console>','<input>','<string>',
1337 '<console>','<BackgroundJob compilation>',
1337 '<console>','<BackgroundJob compilation>',
1338 None):
1338 None):
1339
1339
1340 return False
1340 return False
1341 try:
1341 try:
1342 if (self.rc.autoedit_syntax and
1342 if (self.rc.autoedit_syntax and
1343 not self.ask_yes_no('Return to editor to correct syntax error? '
1343 not self.ask_yes_no('Return to editor to correct syntax error? '
1344 '[Y/n] ','y')):
1344 '[Y/n] ','y')):
1345 return False
1345 return False
1346 except EOFError:
1346 except EOFError:
1347 return False
1347 return False
1348
1348
1349 def int0(x):
1349 def int0(x):
1350 try:
1350 try:
1351 return int(x)
1351 return int(x)
1352 except TypeError:
1352 except TypeError:
1353 return 0
1353 return 0
1354 # always pass integer line and offset values to editor hook
1354 # always pass integer line and offset values to editor hook
1355 self.hooks.fix_error_editor(e.filename,
1355 self.hooks.fix_error_editor(e.filename,
1356 int0(e.lineno),int0(e.offset),e.msg)
1356 int0(e.lineno),int0(e.offset),e.msg)
1357 return True
1357 return True
1358
1358
1359 def edit_syntax_error(self):
1359 def edit_syntax_error(self):
1360 """The bottom half of the syntax error handler called in the main loop.
1360 """The bottom half of the syntax error handler called in the main loop.
1361
1361
1362 Loop until syntax error is fixed or user cancels.
1362 Loop until syntax error is fixed or user cancels.
1363 """
1363 """
1364
1364
1365 while self.SyntaxTB.last_syntax_error:
1365 while self.SyntaxTB.last_syntax_error:
1366 # copy and clear last_syntax_error
1366 # copy and clear last_syntax_error
1367 err = self.SyntaxTB.clear_err_state()
1367 err = self.SyntaxTB.clear_err_state()
1368 if not self._should_recompile(err):
1368 if not self._should_recompile(err):
1369 return
1369 return
1370 try:
1370 try:
1371 # may set last_syntax_error again if a SyntaxError is raised
1371 # may set last_syntax_error again if a SyntaxError is raised
1372 self.safe_execfile(err.filename,self.user_ns)
1372 self.safe_execfile(err.filename,self.user_ns)
1373 except:
1373 except:
1374 self.showtraceback()
1374 self.showtraceback()
1375 else:
1375 else:
1376 try:
1376 try:
1377 f = file(err.filename)
1377 f = file(err.filename)
1378 try:
1378 try:
1379 sys.displayhook(f.read())
1379 sys.displayhook(f.read())
1380 finally:
1380 finally:
1381 f.close()
1381 f.close()
1382 except:
1382 except:
1383 self.showtraceback()
1383 self.showtraceback()
1384
1384
1385 def showsyntaxerror(self, filename=None):
1385 def showsyntaxerror(self, filename=None):
1386 """Display the syntax error that just occurred.
1386 """Display the syntax error that just occurred.
1387
1387
1388 This doesn't display a stack trace because there isn't one.
1388 This doesn't display a stack trace because there isn't one.
1389
1389
1390 If a filename is given, it is stuffed in the exception instead
1390 If a filename is given, it is stuffed in the exception instead
1391 of what was there before (because Python's parser always uses
1391 of what was there before (because Python's parser always uses
1392 "<string>" when reading from a string).
1392 "<string>" when reading from a string).
1393 """
1393 """
1394 etype, value, last_traceback = sys.exc_info()
1394 etype, value, last_traceback = sys.exc_info()
1395
1395
1396 # See note about these variables in showtraceback() below
1396 # See note about these variables in showtraceback() below
1397 sys.last_type = etype
1397 sys.last_type = etype
1398 sys.last_value = value
1398 sys.last_value = value
1399 sys.last_traceback = last_traceback
1399 sys.last_traceback = last_traceback
1400
1400
1401 if filename and etype is SyntaxError:
1401 if filename and etype is SyntaxError:
1402 # Work hard to stuff the correct filename in the exception
1402 # Work hard to stuff the correct filename in the exception
1403 try:
1403 try:
1404 msg, (dummy_filename, lineno, offset, line) = value
1404 msg, (dummy_filename, lineno, offset, line) = value
1405 except:
1405 except:
1406 # Not the format we expect; leave it alone
1406 # Not the format we expect; leave it alone
1407 pass
1407 pass
1408 else:
1408 else:
1409 # Stuff in the right filename
1409 # Stuff in the right filename
1410 try:
1410 try:
1411 # Assume SyntaxError is a class exception
1411 # Assume SyntaxError is a class exception
1412 value = SyntaxError(msg, (filename, lineno, offset, line))
1412 value = SyntaxError(msg, (filename, lineno, offset, line))
1413 except:
1413 except:
1414 # If that failed, assume SyntaxError is a string
1414 # If that failed, assume SyntaxError is a string
1415 value = msg, (filename, lineno, offset, line)
1415 value = msg, (filename, lineno, offset, line)
1416 self.SyntaxTB(etype,value,[])
1416 self.SyntaxTB(etype,value,[])
1417
1417
1418 def debugger(self,force=False):
1418 def debugger(self,force=False):
1419 """Call the pydb/pdb debugger.
1419 """Call the pydb/pdb debugger.
1420
1420
1421 Keywords:
1421 Keywords:
1422
1422
1423 - force(False): by default, this routine checks the instance call_pdb
1423 - force(False): by default, this routine checks the instance call_pdb
1424 flag and does not actually invoke the debugger if the flag is false.
1424 flag and does not actually invoke the debugger if the flag is false.
1425 The 'force' option forces the debugger to activate even if the flag
1425 The 'force' option forces the debugger to activate even if the flag
1426 is false.
1426 is false.
1427 """
1427 """
1428
1428
1429 if not (force or self.call_pdb):
1429 if not (force or self.call_pdb):
1430 return
1430 return
1431
1431
1432 if not hasattr(sys,'last_traceback'):
1432 if not hasattr(sys,'last_traceback'):
1433 error('No traceback has been produced, nothing to debug.')
1433 error('No traceback has been produced, nothing to debug.')
1434 return
1434 return
1435
1435
1436 # use pydb if available
1436 # use pydb if available
1437 if Debugger.has_pydb:
1437 if Debugger.has_pydb:
1438 from pydb import pm
1438 from pydb import pm
1439 else:
1439 else:
1440 # fallback to our internal debugger
1440 # fallback to our internal debugger
1441 pm = lambda : self.InteractiveTB.debugger(force=True)
1441 pm = lambda : self.InteractiveTB.debugger(force=True)
1442 self.history_saving_wrapper(pm)()
1442 self.history_saving_wrapper(pm)()
1443
1443
1444 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1444 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1445 """Display the exception that just occurred.
1445 """Display the exception that just occurred.
1446
1446
1447 If nothing is known about the exception, this is the method which
1447 If nothing is known about the exception, this is the method which
1448 should be used throughout the code for presenting user tracebacks,
1448 should be used throughout the code for presenting user tracebacks,
1449 rather than directly invoking the InteractiveTB object.
1449 rather than directly invoking the InteractiveTB object.
1450
1450
1451 A specific showsyntaxerror() also exists, but this method can take
1451 A specific showsyntaxerror() also exists, but this method can take
1452 care of calling it if needed, so unless you are explicitly catching a
1452 care of calling it if needed, so unless you are explicitly catching a
1453 SyntaxError exception, don't try to analyze the stack manually and
1453 SyntaxError exception, don't try to analyze the stack manually and
1454 simply call this method."""
1454 simply call this method."""
1455
1455
1456
1456
1457 # Though this won't be called by syntax errors in the input line,
1457 # Though this won't be called by syntax errors in the input line,
1458 # there may be SyntaxError cases whith imported code.
1458 # there may be SyntaxError cases whith imported code.
1459
1459
1460
1460
1461 if exc_tuple is None:
1461 if exc_tuple is None:
1462 etype, value, tb = sys.exc_info()
1462 etype, value, tb = sys.exc_info()
1463 else:
1463 else:
1464 etype, value, tb = exc_tuple
1464 etype, value, tb = exc_tuple
1465
1465
1466 if etype is SyntaxError:
1466 if etype is SyntaxError:
1467 self.showsyntaxerror(filename)
1467 self.showsyntaxerror(filename)
1468 else:
1468 else:
1469 # WARNING: these variables are somewhat deprecated and not
1469 # WARNING: these variables are somewhat deprecated and not
1470 # necessarily safe to use in a threaded environment, but tools
1470 # necessarily safe to use in a threaded environment, but tools
1471 # like pdb depend on their existence, so let's set them. If we
1471 # like pdb depend on their existence, so let's set them. If we
1472 # find problems in the field, we'll need to revisit their use.
1472 # find problems in the field, we'll need to revisit their use.
1473 sys.last_type = etype
1473 sys.last_type = etype
1474 sys.last_value = value
1474 sys.last_value = value
1475 sys.last_traceback = tb
1475 sys.last_traceback = tb
1476
1476
1477 if etype in self.custom_exceptions:
1477 if etype in self.custom_exceptions:
1478 self.CustomTB(etype,value,tb)
1478 self.CustomTB(etype,value,tb)
1479 else:
1479 else:
1480 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1480 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1481 if self.InteractiveTB.call_pdb and self.has_readline:
1481 if self.InteractiveTB.call_pdb and self.has_readline:
1482 # pdb mucks up readline, fix it back
1482 # pdb mucks up readline, fix it back
1483 self.set_completer()
1483 self.set_completer()
1484
1484
1485
1485
1486 def mainloop(self,banner=None):
1486 def mainloop(self,banner=None):
1487 """Creates the local namespace and starts the mainloop.
1487 """Creates the local namespace and starts the mainloop.
1488
1488
1489 If an optional banner argument is given, it will override the
1489 If an optional banner argument is given, it will override the
1490 internally created default banner."""
1490 internally created default banner."""
1491
1491
1492 if self.rc.c: # Emulate Python's -c option
1492 if self.rc.c: # Emulate Python's -c option
1493 self.exec_init_cmd()
1493 self.exec_init_cmd()
1494 if banner is None:
1494 if banner is None:
1495 if not self.rc.banner:
1495 if not self.rc.banner:
1496 banner = ''
1496 banner = ''
1497 # banner is string? Use it directly!
1497 # banner is string? Use it directly!
1498 elif isinstance(self.rc.banner,basestring):
1498 elif isinstance(self.rc.banner,basestring):
1499 banner = self.rc.banner
1499 banner = self.rc.banner
1500 else:
1500 else:
1501 banner = self.BANNER+self.banner2
1501 banner = self.BANNER+self.banner2
1502
1502
1503 self.interact(banner)
1503 self.interact(banner)
1504
1504
1505 def exec_init_cmd(self):
1505 def exec_init_cmd(self):
1506 """Execute a command given at the command line.
1506 """Execute a command given at the command line.
1507
1507
1508 This emulates Python's -c option."""
1508 This emulates Python's -c option."""
1509
1509
1510 #sys.argv = ['-c']
1510 #sys.argv = ['-c']
1511 self.push(self.prefilter(self.rc.c, False))
1511 self.push(self.prefilter(self.rc.c, False))
1512 self.exit_now = True
1512 self.exit_now = True
1513
1513
1514 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1514 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1515 """Embeds IPython into a running python program.
1515 """Embeds IPython into a running python program.
1516
1516
1517 Input:
1517 Input:
1518
1518
1519 - header: An optional header message can be specified.
1519 - header: An optional header message can be specified.
1520
1520
1521 - local_ns, global_ns: working namespaces. If given as None, the
1521 - local_ns, global_ns: working namespaces. If given as None, the
1522 IPython-initialized one is updated with __main__.__dict__, so that
1522 IPython-initialized one is updated with __main__.__dict__, so that
1523 program variables become visible but user-specific configuration
1523 program variables become visible but user-specific configuration
1524 remains possible.
1524 remains possible.
1525
1525
1526 - stack_depth: specifies how many levels in the stack to go to
1526 - stack_depth: specifies how many levels in the stack to go to
1527 looking for namespaces (when local_ns and global_ns are None). This
1527 looking for namespaces (when local_ns and global_ns are None). This
1528 allows an intermediate caller to make sure that this function gets
1528 allows an intermediate caller to make sure that this function gets
1529 the namespace from the intended level in the stack. By default (0)
1529 the namespace from the intended level in the stack. By default (0)
1530 it will get its locals and globals from the immediate caller.
1530 it will get its locals and globals from the immediate caller.
1531
1531
1532 Warning: it's possible to use this in a program which is being run by
1532 Warning: it's possible to use this in a program which is being run by
1533 IPython itself (via %run), but some funny things will happen (a few
1533 IPython itself (via %run), but some funny things will happen (a few
1534 globals get overwritten). In the future this will be cleaned up, as
1534 globals get overwritten). In the future this will be cleaned up, as
1535 there is no fundamental reason why it can't work perfectly."""
1535 there is no fundamental reason why it can't work perfectly."""
1536
1536
1537 # Get locals and globals from caller
1537 # Get locals and globals from caller
1538 if local_ns is None or global_ns is None:
1538 if local_ns is None or global_ns is None:
1539 call_frame = sys._getframe(stack_depth).f_back
1539 call_frame = sys._getframe(stack_depth).f_back
1540
1540
1541 if local_ns is None:
1541 if local_ns is None:
1542 local_ns = call_frame.f_locals
1542 local_ns = call_frame.f_locals
1543 if global_ns is None:
1543 if global_ns is None:
1544 global_ns = call_frame.f_globals
1544 global_ns = call_frame.f_globals
1545
1545
1546 # Update namespaces and fire up interpreter
1546 # Update namespaces and fire up interpreter
1547
1547
1548 # The global one is easy, we can just throw it in
1548 # The global one is easy, we can just throw it in
1549 self.user_global_ns = global_ns
1549 self.user_global_ns = global_ns
1550
1550
1551 # but the user/local one is tricky: ipython needs it to store internal
1551 # but the user/local one is tricky: ipython needs it to store internal
1552 # data, but we also need the locals. We'll copy locals in the user
1552 # data, but we also need the locals. We'll copy locals in the user
1553 # one, but will track what got copied so we can delete them at exit.
1553 # one, but will track what got copied so we can delete them at exit.
1554 # This is so that a later embedded call doesn't see locals from a
1554 # This is so that a later embedded call doesn't see locals from a
1555 # previous call (which most likely existed in a separate scope).
1555 # previous call (which most likely existed in a separate scope).
1556 local_varnames = local_ns.keys()
1556 local_varnames = local_ns.keys()
1557 self.user_ns.update(local_ns)
1557 self.user_ns.update(local_ns)
1558
1558
1559 # Patch for global embedding to make sure that things don't overwrite
1559 # Patch for global embedding to make sure that things don't overwrite
1560 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1560 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1561 # FIXME. Test this a bit more carefully (the if.. is new)
1561 # FIXME. Test this a bit more carefully (the if.. is new)
1562 if local_ns is None and global_ns is None:
1562 if local_ns is None and global_ns is None:
1563 self.user_global_ns.update(__main__.__dict__)
1563 self.user_global_ns.update(__main__.__dict__)
1564
1564
1565 # make sure the tab-completer has the correct frame information, so it
1565 # make sure the tab-completer has the correct frame information, so it
1566 # actually completes using the frame's locals/globals
1566 # actually completes using the frame's locals/globals
1567 self.set_completer_frame()
1567 self.set_completer_frame()
1568
1568
1569 # before activating the interactive mode, we need to make sure that
1569 # before activating the interactive mode, we need to make sure that
1570 # all names in the builtin namespace needed by ipython point to
1570 # all names in the builtin namespace needed by ipython point to
1571 # ourselves, and not to other instances.
1571 # ourselves, and not to other instances.
1572 self.add_builtins()
1572 self.add_builtins()
1573
1573
1574 self.interact(header)
1574 self.interact(header)
1575
1575
1576 # now, purge out the user namespace from anything we might have added
1576 # now, purge out the user namespace from anything we might have added
1577 # from the caller's local namespace
1577 # from the caller's local namespace
1578 delvar = self.user_ns.pop
1578 delvar = self.user_ns.pop
1579 for var in local_varnames:
1579 for var in local_varnames:
1580 delvar(var,None)
1580 delvar(var,None)
1581 # and clean builtins we may have overridden
1581 # and clean builtins we may have overridden
1582 self.clean_builtins()
1582 self.clean_builtins()
1583
1583
1584 def interact(self, banner=None):
1584 def interact(self, banner=None):
1585 """Closely emulate the interactive Python console.
1585 """Closely emulate the interactive Python console.
1586
1586
1587 The optional banner argument specify the banner to print
1587 The optional banner argument specify the banner to print
1588 before the first interaction; by default it prints a banner
1588 before the first interaction; by default it prints a banner
1589 similar to the one printed by the real Python interpreter,
1589 similar to the one printed by the real Python interpreter,
1590 followed by the current class name in parentheses (so as not
1590 followed by the current class name in parentheses (so as not
1591 to confuse this with the real interpreter -- since it's so
1591 to confuse this with the real interpreter -- since it's so
1592 close!).
1592 close!).
1593
1593
1594 """
1594 """
1595
1595
1596 if self.exit_now:
1596 if self.exit_now:
1597 # batch run -> do not interact
1597 # batch run -> do not interact
1598 return
1598 return
1599 cprt = 'Type "copyright", "credits" or "license" for more information.'
1599 cprt = 'Type "copyright", "credits" or "license" for more information.'
1600 if banner is None:
1600 if banner is None:
1601 self.write("Python %s on %s\n%s\n(%s)\n" %
1601 self.write("Python %s on %s\n%s\n(%s)\n" %
1602 (sys.version, sys.platform, cprt,
1602 (sys.version, sys.platform, cprt,
1603 self.__class__.__name__))
1603 self.__class__.__name__))
1604 else:
1604 else:
1605 self.write(banner)
1605 self.write(banner)
1606
1606
1607 more = 0
1607 more = 0
1608
1608
1609 # Mark activity in the builtins
1609 # Mark activity in the builtins
1610 __builtin__.__dict__['__IPYTHON__active'] += 1
1610 __builtin__.__dict__['__IPYTHON__active'] += 1
1611
1611
1612 if readline.have_readline:
1612 if readline.have_readline:
1613 self.readline_startup_hook(self.pre_readline)
1613 self.readline_startup_hook(self.pre_readline)
1614 # exit_now is set by a call to %Exit or %Quit
1614 # exit_now is set by a call to %Exit or %Quit
1615
1615
1616 while not self.exit_now:
1616 while not self.exit_now:
1617 if more:
1617 if more:
1618 prompt = self.hooks.generate_prompt(True)
1618 prompt = self.hooks.generate_prompt(True)
1619 if self.autoindent:
1619 if self.autoindent:
1620 self.rl_do_indent = True
1620 self.rl_do_indent = True
1621
1621
1622 else:
1622 else:
1623 prompt = self.hooks.generate_prompt(False)
1623 prompt = self.hooks.generate_prompt(False)
1624 try:
1624 try:
1625 line = self.raw_input(prompt,more)
1625 line = self.raw_input(prompt,more)
1626 if self.exit_now:
1626 if self.exit_now:
1627 # quick exit on sys.std[in|out] close
1627 # quick exit on sys.std[in|out] close
1628 break
1628 break
1629 if self.autoindent:
1629 if self.autoindent:
1630 self.rl_do_indent = False
1630 self.rl_do_indent = False
1631
1631
1632 except KeyboardInterrupt:
1632 except KeyboardInterrupt:
1633 self.write('\nKeyboardInterrupt\n')
1633 self.write('\nKeyboardInterrupt\n')
1634 self.resetbuffer()
1634 self.resetbuffer()
1635 # keep cache in sync with the prompt counter:
1635 # keep cache in sync with the prompt counter:
1636 self.outputcache.prompt_count -= 1
1636 self.outputcache.prompt_count -= 1
1637
1637
1638 if self.autoindent:
1638 if self.autoindent:
1639 self.indent_current_nsp = 0
1639 self.indent_current_nsp = 0
1640 more = 0
1640 more = 0
1641 except EOFError:
1641 except EOFError:
1642 if self.autoindent:
1642 if self.autoindent:
1643 self.rl_do_indent = False
1643 self.rl_do_indent = False
1644 self.readline_startup_hook(None)
1644 self.readline_startup_hook(None)
1645 self.write('\n')
1645 self.write('\n')
1646 self.exit()
1646 self.exit()
1647 except bdb.BdbQuit:
1647 except bdb.BdbQuit:
1648 warn('The Python debugger has exited with a BdbQuit exception.\n'
1648 warn('The Python debugger has exited with a BdbQuit exception.\n'
1649 'Because of how pdb handles the stack, it is impossible\n'
1649 'Because of how pdb handles the stack, it is impossible\n'
1650 'for IPython to properly format this particular exception.\n'
1650 'for IPython to properly format this particular exception.\n'
1651 'IPython will resume normal operation.')
1651 'IPython will resume normal operation.')
1652 except:
1652 except:
1653 # exceptions here are VERY RARE, but they can be triggered
1653 # exceptions here are VERY RARE, but they can be triggered
1654 # asynchronously by signal handlers, for example.
1654 # asynchronously by signal handlers, for example.
1655 self.showtraceback()
1655 self.showtraceback()
1656 else:
1656 else:
1657 more = self.push(line)
1657 more = self.push(line)
1658 if (self.SyntaxTB.last_syntax_error and
1658 if (self.SyntaxTB.last_syntax_error and
1659 self.rc.autoedit_syntax):
1659 self.rc.autoedit_syntax):
1660 self.edit_syntax_error()
1660 self.edit_syntax_error()
1661
1661
1662 # We are off again...
1662 # We are off again...
1663 __builtin__.__dict__['__IPYTHON__active'] -= 1
1663 __builtin__.__dict__['__IPYTHON__active'] -= 1
1664
1664
1665 def excepthook(self, etype, value, tb):
1665 def excepthook(self, etype, value, tb):
1666 """One more defense for GUI apps that call sys.excepthook.
1666 """One more defense for GUI apps that call sys.excepthook.
1667
1667
1668 GUI frameworks like wxPython trap exceptions and call
1668 GUI frameworks like wxPython trap exceptions and call
1669 sys.excepthook themselves. I guess this is a feature that
1669 sys.excepthook themselves. I guess this is a feature that
1670 enables them to keep running after exceptions that would
1670 enables them to keep running after exceptions that would
1671 otherwise kill their mainloop. This is a bother for IPython
1671 otherwise kill their mainloop. This is a bother for IPython
1672 which excepts to catch all of the program exceptions with a try:
1672 which excepts to catch all of the program exceptions with a try:
1673 except: statement.
1673 except: statement.
1674
1674
1675 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1675 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1676 any app directly invokes sys.excepthook, it will look to the user like
1676 any app directly invokes sys.excepthook, it will look to the user like
1677 IPython crashed. In order to work around this, we can disable the
1677 IPython crashed. In order to work around this, we can disable the
1678 CrashHandler and replace it with this excepthook instead, which prints a
1678 CrashHandler and replace it with this excepthook instead, which prints a
1679 regular traceback using our InteractiveTB. In this fashion, apps which
1679 regular traceback using our InteractiveTB. In this fashion, apps which
1680 call sys.excepthook will generate a regular-looking exception from
1680 call sys.excepthook will generate a regular-looking exception from
1681 IPython, and the CrashHandler will only be triggered by real IPython
1681 IPython, and the CrashHandler will only be triggered by real IPython
1682 crashes.
1682 crashes.
1683
1683
1684 This hook should be used sparingly, only in places which are not likely
1684 This hook should be used sparingly, only in places which are not likely
1685 to be true IPython errors.
1685 to be true IPython errors.
1686 """
1686 """
1687 self.showtraceback((etype,value,tb),tb_offset=0)
1687 self.showtraceback((etype,value,tb),tb_offset=0)
1688
1688
1689 def expand_aliases(self,fn,rest):
1689 def expand_aliases(self,fn,rest):
1690 """ Expand multiple levels of aliases:
1690 """ Expand multiple levels of aliases:
1691
1691
1692 if:
1692 if:
1693
1693
1694 alias foo bar /tmp
1694 alias foo bar /tmp
1695 alias baz foo
1695 alias baz foo
1696
1696
1697 then:
1697 then:
1698
1698
1699 baz huhhahhei -> bar /tmp huhhahhei
1699 baz huhhahhei -> bar /tmp huhhahhei
1700
1700
1701 """
1701 """
1702 line = fn + " " + rest
1702 line = fn + " " + rest
1703
1703
1704 done = Set()
1704 done = Set()
1705 while 1:
1705 while 1:
1706 pre,fn,rest = prefilter.splitUserInput(line,
1706 pre,fn,rest = prefilter.splitUserInput(line,
1707 prefilter.shell_line_split)
1707 prefilter.shell_line_split)
1708 if fn in self.alias_table:
1708 if fn in self.alias_table:
1709 if fn in done:
1709 if fn in done:
1710 warn("Cyclic alias definition, repeated '%s'" % fn)
1710 warn("Cyclic alias definition, repeated '%s'" % fn)
1711 return ""
1711 return ""
1712 done.add(fn)
1712 done.add(fn)
1713
1713
1714 l2 = self.transform_alias(fn,rest)
1714 l2 = self.transform_alias(fn,rest)
1715 # dir -> dir
1715 # dir -> dir
1716 # print "alias",line, "->",l2 #dbg
1716 # print "alias",line, "->",l2 #dbg
1717 if l2 == line:
1717 if l2 == line:
1718 break
1718 break
1719 # ls -> ls -F should not recurse forever
1719 # ls -> ls -F should not recurse forever
1720 if l2.split(None,1)[0] == line.split(None,1)[0]:
1720 if l2.split(None,1)[0] == line.split(None,1)[0]:
1721 line = l2
1721 line = l2
1722 break
1722 break
1723
1723
1724 line=l2
1724 line=l2
1725
1725
1726
1726
1727 # print "al expand to",line #dbg
1727 # print "al expand to",line #dbg
1728 else:
1728 else:
1729 break
1729 break
1730
1730
1731 return line
1731 return line
1732
1732
1733 def transform_alias(self, alias,rest=''):
1733 def transform_alias(self, alias,rest=''):
1734 """ Transform alias to system command string.
1734 """ Transform alias to system command string.
1735 """
1735 """
1736 nargs,cmd = self.alias_table[alias]
1736 nargs,cmd = self.alias_table[alias]
1737 if ' ' in cmd and os.path.isfile(cmd):
1737 if ' ' in cmd and os.path.isfile(cmd):
1738 cmd = '"%s"' % cmd
1738 cmd = '"%s"' % cmd
1739
1739
1740 # Expand the %l special to be the user's input line
1740 # Expand the %l special to be the user's input line
1741 if cmd.find('%l') >= 0:
1741 if cmd.find('%l') >= 0:
1742 cmd = cmd.replace('%l',rest)
1742 cmd = cmd.replace('%l',rest)
1743 rest = ''
1743 rest = ''
1744 if nargs==0:
1744 if nargs==0:
1745 # Simple, argument-less aliases
1745 # Simple, argument-less aliases
1746 cmd = '%s %s' % (cmd,rest)
1746 cmd = '%s %s' % (cmd,rest)
1747 else:
1747 else:
1748 # Handle aliases with positional arguments
1748 # Handle aliases with positional arguments
1749 args = rest.split(None,nargs)
1749 args = rest.split(None,nargs)
1750 if len(args)< nargs:
1750 if len(args)< nargs:
1751 error('Alias <%s> requires %s arguments, %s given.' %
1751 error('Alias <%s> requires %s arguments, %s given.' %
1752 (alias,nargs,len(args)))
1752 (alias,nargs,len(args)))
1753 return None
1753 return None
1754 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1754 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1755 # Now call the macro, evaluating in the user's namespace
1755 # Now call the macro, evaluating in the user's namespace
1756 #print 'new command: <%r>' % cmd # dbg
1756 #print 'new command: <%r>' % cmd # dbg
1757 return cmd
1757 return cmd
1758
1758
1759 def call_alias(self,alias,rest=''):
1759 def call_alias(self,alias,rest=''):
1760 """Call an alias given its name and the rest of the line.
1760 """Call an alias given its name and the rest of the line.
1761
1761
1762 This is only used to provide backwards compatibility for users of
1762 This is only used to provide backwards compatibility for users of
1763 ipalias(), use of which is not recommended for anymore."""
1763 ipalias(), use of which is not recommended for anymore."""
1764
1764
1765 # Now call the macro, evaluating in the user's namespace
1765 # Now call the macro, evaluating in the user's namespace
1766 cmd = self.transform_alias(alias, rest)
1766 cmd = self.transform_alias(alias, rest)
1767 try:
1767 try:
1768 self.system(cmd)
1768 self.system(cmd)
1769 except:
1769 except:
1770 self.showtraceback()
1770 self.showtraceback()
1771
1771
1772 def indent_current_str(self):
1772 def indent_current_str(self):
1773 """return the current level of indentation as a string"""
1773 """return the current level of indentation as a string"""
1774 return self.indent_current_nsp * ' '
1774 return self.indent_current_nsp * ' '
1775
1775
1776 def autoindent_update(self,line):
1776 def autoindent_update(self,line):
1777 """Keep track of the indent level."""
1777 """Keep track of the indent level."""
1778
1778
1779 #debugx('line')
1779 #debugx('line')
1780 #debugx('self.indent_current_nsp')
1780 #debugx('self.indent_current_nsp')
1781 if self.autoindent:
1781 if self.autoindent:
1782 if line:
1782 if line:
1783 inisp = num_ini_spaces(line)
1783 inisp = num_ini_spaces(line)
1784 if inisp < self.indent_current_nsp:
1784 if inisp < self.indent_current_nsp:
1785 self.indent_current_nsp = inisp
1785 self.indent_current_nsp = inisp
1786
1786
1787 if line[-1] == ':':
1787 if line[-1] == ':':
1788 self.indent_current_nsp += 4
1788 self.indent_current_nsp += 4
1789 elif dedent_re.match(line):
1789 elif dedent_re.match(line):
1790 self.indent_current_nsp -= 4
1790 self.indent_current_nsp -= 4
1791 else:
1791 else:
1792 self.indent_current_nsp = 0
1792 self.indent_current_nsp = 0
1793 def runlines(self,lines):
1793 def runlines(self,lines):
1794 """Run a string of one or more lines of source.
1794 """Run a string of one or more lines of source.
1795
1795
1796 This method is capable of running a string containing multiple source
1796 This method is capable of running a string containing multiple source
1797 lines, as if they had been entered at the IPython prompt. Since it
1797 lines, as if they had been entered at the IPython prompt. Since it
1798 exposes IPython's processing machinery, the given strings can contain
1798 exposes IPython's processing machinery, the given strings can contain
1799 magic calls (%magic), special shell access (!cmd), etc."""
1799 magic calls (%magic), special shell access (!cmd), etc."""
1800
1800
1801 # We must start with a clean buffer, in case this is run from an
1801 # We must start with a clean buffer, in case this is run from an
1802 # interactive IPython session (via a magic, for example).
1802 # interactive IPython session (via a magic, for example).
1803 self.resetbuffer()
1803 self.resetbuffer()
1804 lines = lines.split('\n')
1804 lines = lines.split('\n')
1805 more = 0
1805 more = 0
1806
1806
1807 for line in lines:
1807 for line in lines:
1808 # skip blank lines so we don't mess up the prompt counter, but do
1808 # skip blank lines so we don't mess up the prompt counter, but do
1809 # NOT skip even a blank line if we are in a code block (more is
1809 # NOT skip even a blank line if we are in a code block (more is
1810 # true)
1810 # true)
1811
1811
1812
1812
1813 if line or more:
1813 if line or more:
1814 # push to raw history, so hist line numbers stay in sync
1814 # push to raw history, so hist line numbers stay in sync
1815 self.input_hist_raw.append("# " + line + "\n")
1815 self.input_hist_raw.append("# " + line + "\n")
1816 more = self.push(self.prefilter(line,more))
1816 more = self.push(self.prefilter(line,more))
1817 # IPython's runsource returns None if there was an error
1817 # IPython's runsource returns None if there was an error
1818 # compiling the code. This allows us to stop processing right
1818 # compiling the code. This allows us to stop processing right
1819 # away, so the user gets the error message at the right place.
1819 # away, so the user gets the error message at the right place.
1820 if more is None:
1820 if more is None:
1821 break
1821 break
1822 # final newline in case the input didn't have it, so that the code
1822 # final newline in case the input didn't have it, so that the code
1823 # actually does get executed
1823 # actually does get executed
1824 if more:
1824 if more:
1825 self.push('\n')
1825 self.push('\n')
1826
1826
1827 def runsource(self, source, filename='<input>', symbol='single'):
1827 def runsource(self, source, filename='<input>', symbol='single'):
1828 """Compile and run some source in the interpreter.
1828 """Compile and run some source in the interpreter.
1829
1829
1830 Arguments are as for compile_command().
1830 Arguments are as for compile_command().
1831
1831
1832 One several things can happen:
1832 One several things can happen:
1833
1833
1834 1) The input is incorrect; compile_command() raised an
1834 1) The input is incorrect; compile_command() raised an
1835 exception (SyntaxError or OverflowError). A syntax traceback
1835 exception (SyntaxError or OverflowError). A syntax traceback
1836 will be printed by calling the showsyntaxerror() method.
1836 will be printed by calling the showsyntaxerror() method.
1837
1837
1838 2) The input is incomplete, and more input is required;
1838 2) The input is incomplete, and more input is required;
1839 compile_command() returned None. Nothing happens.
1839 compile_command() returned None. Nothing happens.
1840
1840
1841 3) The input is complete; compile_command() returned a code
1841 3) The input is complete; compile_command() returned a code
1842 object. The code is executed by calling self.runcode() (which
1842 object. The code is executed by calling self.runcode() (which
1843 also handles run-time exceptions, except for SystemExit).
1843 also handles run-time exceptions, except for SystemExit).
1844
1844
1845 The return value is:
1845 The return value is:
1846
1846
1847 - True in case 2
1847 - True in case 2
1848
1848
1849 - False in the other cases, unless an exception is raised, where
1849 - False in the other cases, unless an exception is raised, where
1850 None is returned instead. This can be used by external callers to
1850 None is returned instead. This can be used by external callers to
1851 know whether to continue feeding input or not.
1851 know whether to continue feeding input or not.
1852
1852
1853 The return value can be used to decide whether to use sys.ps1 or
1853 The return value can be used to decide whether to use sys.ps1 or
1854 sys.ps2 to prompt the next line."""
1854 sys.ps2 to prompt the next line."""
1855
1855
1856 # if the source code has leading blanks, add 'if 1:\n' to it
1856 # if the source code has leading blanks, add 'if 1:\n' to it
1857 # this allows execution of indented pasted code. It is tempting
1857 # this allows execution of indented pasted code. It is tempting
1858 # to add '\n' at the end of source to run commands like ' a=1'
1858 # to add '\n' at the end of source to run commands like ' a=1'
1859 # directly, but this fails for more complicated scenarios
1859 # directly, but this fails for more complicated scenarios
1860 if source[:1] in [' ', '\t']:
1860 if source[:1] in [' ', '\t']:
1861 source = 'if 1:\n%s' % source
1861 source = 'if 1:\n%s' % source
1862
1862
1863 try:
1863 try:
1864 code = self.compile(source,filename,symbol)
1864 code = self.compile(source,filename,symbol)
1865 except (OverflowError, SyntaxError, ValueError):
1865 except (OverflowError, SyntaxError, ValueError):
1866 # Case 1
1866 # Case 1
1867 self.showsyntaxerror(filename)
1867 self.showsyntaxerror(filename)
1868 return None
1868 return None
1869
1869
1870 if code is None:
1870 if code is None:
1871 # Case 2
1871 # Case 2
1872 return True
1872 return True
1873
1873
1874 # Case 3
1874 # Case 3
1875 # We store the code object so that threaded shells and
1875 # We store the code object so that threaded shells and
1876 # custom exception handlers can access all this info if needed.
1876 # custom exception handlers can access all this info if needed.
1877 # The source corresponding to this can be obtained from the
1877 # The source corresponding to this can be obtained from the
1878 # buffer attribute as '\n'.join(self.buffer).
1878 # buffer attribute as '\n'.join(self.buffer).
1879 self.code_to_run = code
1879 self.code_to_run = code
1880 # now actually execute the code object
1880 # now actually execute the code object
1881 if self.runcode(code) == 0:
1881 if self.runcode(code) == 0:
1882 return False
1882 return False
1883 else:
1883 else:
1884 return None
1884 return None
1885
1885
1886 def runcode(self,code_obj):
1886 def runcode(self,code_obj):
1887 """Execute a code object.
1887 """Execute a code object.
1888
1888
1889 When an exception occurs, self.showtraceback() is called to display a
1889 When an exception occurs, self.showtraceback() is called to display a
1890 traceback.
1890 traceback.
1891
1891
1892 Return value: a flag indicating whether the code to be run completed
1892 Return value: a flag indicating whether the code to be run completed
1893 successfully:
1893 successfully:
1894
1894
1895 - 0: successful execution.
1895 - 0: successful execution.
1896 - 1: an error occurred.
1896 - 1: an error occurred.
1897 """
1897 """
1898
1898
1899 # Set our own excepthook in case the user code tries to call it
1899 # Set our own excepthook in case the user code tries to call it
1900 # directly, so that the IPython crash handler doesn't get triggered
1900 # directly, so that the IPython crash handler doesn't get triggered
1901 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1901 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1902
1902
1903 # we save the original sys.excepthook in the instance, in case config
1903 # we save the original sys.excepthook in the instance, in case config
1904 # code (such as magics) needs access to it.
1904 # code (such as magics) needs access to it.
1905 self.sys_excepthook = old_excepthook
1905 self.sys_excepthook = old_excepthook
1906 outflag = 1 # happens in more places, so it's easier as default
1906 outflag = 1 # happens in more places, so it's easier as default
1907 try:
1907 try:
1908 try:
1908 try:
1909 # Embedded instances require separate global/local namespaces
1909 # Embedded instances require separate global/local namespaces
1910 # so they can see both the surrounding (local) namespace and
1910 # so they can see both the surrounding (local) namespace and
1911 # the module-level globals when called inside another function.
1911 # the module-level globals when called inside another function.
1912 if self.embedded:
1912 if self.embedded:
1913 exec code_obj in self.user_global_ns, self.user_ns
1913 exec code_obj in self.user_global_ns, self.user_ns
1914 # Normal (non-embedded) instances should only have a single
1914 # Normal (non-embedded) instances should only have a single
1915 # namespace for user code execution, otherwise functions won't
1915 # namespace for user code execution, otherwise functions won't
1916 # see interactive top-level globals.
1916 # see interactive top-level globals.
1917 else:
1917 else:
1918 exec code_obj in self.user_ns
1918 exec code_obj in self.user_ns
1919 finally:
1919 finally:
1920 # Reset our crash handler in place
1920 # Reset our crash handler in place
1921 sys.excepthook = old_excepthook
1921 sys.excepthook = old_excepthook
1922 except SystemExit:
1922 except SystemExit:
1923 self.resetbuffer()
1923 self.resetbuffer()
1924 self.showtraceback()
1924 self.showtraceback()
1925 warn("Type %exit or %quit to exit IPython "
1925 warn("Type %exit or %quit to exit IPython "
1926 "(%Exit or %Quit do so unconditionally).",level=1)
1926 "(%Exit or %Quit do so unconditionally).",level=1)
1927 except self.custom_exceptions:
1927 except self.custom_exceptions:
1928 etype,value,tb = sys.exc_info()
1928 etype,value,tb = sys.exc_info()
1929 self.CustomTB(etype,value,tb)
1929 self.CustomTB(etype,value,tb)
1930 except:
1930 except:
1931 self.showtraceback()
1931 self.showtraceback()
1932 else:
1932 else:
1933 outflag = 0
1933 outflag = 0
1934 if softspace(sys.stdout, 0):
1934 if softspace(sys.stdout, 0):
1935 print
1935 print
1936 # Flush out code object which has been run (and source)
1936 # Flush out code object which has been run (and source)
1937 self.code_to_run = None
1937 self.code_to_run = None
1938 return outflag
1938 return outflag
1939
1939
1940 def push(self, line):
1940 def push(self, line):
1941 """Push a line to the interpreter.
1941 """Push a line to the interpreter.
1942
1942
1943 The line should not have a trailing newline; it may have
1943 The line should not have a trailing newline; it may have
1944 internal newlines. The line is appended to a buffer and the
1944 internal newlines. The line is appended to a buffer and the
1945 interpreter's runsource() method is called with the
1945 interpreter's runsource() method is called with the
1946 concatenated contents of the buffer as source. If this
1946 concatenated contents of the buffer as source. If this
1947 indicates that the command was executed or invalid, the buffer
1947 indicates that the command was executed or invalid, the buffer
1948 is reset; otherwise, the command is incomplete, and the buffer
1948 is reset; otherwise, the command is incomplete, and the buffer
1949 is left as it was after the line was appended. The return
1949 is left as it was after the line was appended. The return
1950 value is 1 if more input is required, 0 if the line was dealt
1950 value is 1 if more input is required, 0 if the line was dealt
1951 with in some way (this is the same as runsource()).
1951 with in some way (this is the same as runsource()).
1952 """
1952 """
1953
1953
1954 # autoindent management should be done here, and not in the
1954 # autoindent management should be done here, and not in the
1955 # interactive loop, since that one is only seen by keyboard input. We
1955 # interactive loop, since that one is only seen by keyboard input. We
1956 # need this done correctly even for code run via runlines (which uses
1956 # need this done correctly even for code run via runlines (which uses
1957 # push).
1957 # push).
1958
1958
1959 #print 'push line: <%s>' % line # dbg
1959 #print 'push line: <%s>' % line # dbg
1960 for subline in line.splitlines():
1960 for subline in line.splitlines():
1961 self.autoindent_update(subline)
1961 self.autoindent_update(subline)
1962 self.buffer.append(line)
1962 self.buffer.append(line)
1963 more = self.runsource('\n'.join(self.buffer), self.filename)
1963 more = self.runsource('\n'.join(self.buffer), self.filename)
1964 if not more:
1964 if not more:
1965 self.resetbuffer()
1965 self.resetbuffer()
1966 return more
1966 return more
1967
1967
1968 def split_user_input(self, line):
1968 def split_user_input(self, line):
1969 # This is really a hold-over to support ipapi and some extensions
1969 # This is really a hold-over to support ipapi and some extensions
1970 return prefilter.splitUserInput(line)
1970 return prefilter.splitUserInput(line)
1971
1971
1972 def resetbuffer(self):
1972 def resetbuffer(self):
1973 """Reset the input buffer."""
1973 """Reset the input buffer."""
1974 self.buffer[:] = []
1974 self.buffer[:] = []
1975
1975
1976 def raw_input(self,prompt='',continue_prompt=False):
1976 def raw_input(self,prompt='',continue_prompt=False):
1977 """Write a prompt and read a line.
1977 """Write a prompt and read a line.
1978
1978
1979 The returned line does not include the trailing newline.
1979 The returned line does not include the trailing newline.
1980 When the user enters the EOF key sequence, EOFError is raised.
1980 When the user enters the EOF key sequence, EOFError is raised.
1981
1981
1982 Optional inputs:
1982 Optional inputs:
1983
1983
1984 - prompt(''): a string to be printed to prompt the user.
1984 - prompt(''): a string to be printed to prompt the user.
1985
1985
1986 - continue_prompt(False): whether this line is the first one or a
1986 - continue_prompt(False): whether this line is the first one or a
1987 continuation in a sequence of inputs.
1987 continuation in a sequence of inputs.
1988 """
1988 """
1989
1989
1990 # Code run by the user may have modified the readline completer state.
1990 # Code run by the user may have modified the readline completer state.
1991 # We must ensure that our completer is back in place.
1991 # We must ensure that our completer is back in place.
1992 if self.has_readline:
1992 if self.has_readline:
1993 self.set_completer()
1993 self.set_completer()
1994
1994
1995 try:
1995 try:
1996 line = raw_input_original(prompt).decode(self.stdin_encoding)
1996 line = raw_input_original(prompt).decode(self.stdin_encoding)
1997 except ValueError:
1997 except ValueError:
1998 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
1998 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
1999 " or sys.stdout.close()!\nExiting IPython!")
1999 " or sys.stdout.close()!\nExiting IPython!")
2000 self.exit_now = True
2000 self.exit_now = True
2001 return ""
2001 return ""
2002
2002
2003 # Try to be reasonably smart about not re-indenting pasted input more
2003 # Try to be reasonably smart about not re-indenting pasted input more
2004 # than necessary. We do this by trimming out the auto-indent initial
2004 # than necessary. We do this by trimming out the auto-indent initial
2005 # spaces, if the user's actual input started itself with whitespace.
2005 # spaces, if the user's actual input started itself with whitespace.
2006 #debugx('self.buffer[-1]')
2006 #debugx('self.buffer[-1]')
2007
2007
2008 if self.autoindent:
2008 if self.autoindent:
2009 if num_ini_spaces(line) > self.indent_current_nsp:
2009 if num_ini_spaces(line) > self.indent_current_nsp:
2010 line = line[self.indent_current_nsp:]
2010 line = line[self.indent_current_nsp:]
2011 self.indent_current_nsp = 0
2011 self.indent_current_nsp = 0
2012
2012
2013 # store the unfiltered input before the user has any chance to modify
2013 # store the unfiltered input before the user has any chance to modify
2014 # it.
2014 # it.
2015 if line.strip():
2015 if line.strip():
2016 if continue_prompt:
2016 if continue_prompt:
2017 self.input_hist_raw[-1] += '%s\n' % line
2017 self.input_hist_raw[-1] += '%s\n' % line
2018 if self.has_readline: # and some config option is set?
2018 if self.has_readline: # and some config option is set?
2019 try:
2019 try:
2020 histlen = self.readline.get_current_history_length()
2020 histlen = self.readline.get_current_history_length()
2021 newhist = self.input_hist_raw[-1].rstrip()
2021 newhist = self.input_hist_raw[-1].rstrip()
2022 self.readline.remove_history_item(histlen-1)
2022 self.readline.remove_history_item(histlen-1)
2023 self.readline.replace_history_item(histlen-2,newhist)
2023 self.readline.replace_history_item(histlen-2,newhist)
2024 except AttributeError:
2024 except AttributeError:
2025 pass # re{move,place}_history_item are new in 2.4.
2025 pass # re{move,place}_history_item are new in 2.4.
2026 else:
2026 else:
2027 self.input_hist_raw.append('%s\n' % line)
2027 self.input_hist_raw.append('%s\n' % line)
2028
2028
2029 if line.lstrip() == line:
2029 if line.lstrip() == line:
2030 self.shadowhist.add(line.strip())
2030 self.shadowhist.add(line.strip())
2031
2031
2032 try:
2032 try:
2033 lineout = self.prefilter(line,continue_prompt)
2033 lineout = self.prefilter(line,continue_prompt)
2034 except:
2034 except:
2035 # blanket except, in case a user-defined prefilter crashes, so it
2035 # blanket except, in case a user-defined prefilter crashes, so it
2036 # can't take all of ipython with it.
2036 # can't take all of ipython with it.
2037 self.showtraceback()
2037 self.showtraceback()
2038 return ''
2038 return ''
2039 else:
2039 else:
2040 return lineout
2040 return lineout
2041
2041
2042 def _prefilter(self, line, continue_prompt):
2042 def _prefilter(self, line, continue_prompt):
2043 """Calls different preprocessors, depending on the form of line."""
2043 """Calls different preprocessors, depending on the form of line."""
2044
2044
2045 # All handlers *must* return a value, even if it's blank ('').
2045 # All handlers *must* return a value, even if it's blank ('').
2046
2046
2047 # Lines are NOT logged here. Handlers should process the line as
2047 # Lines are NOT logged here. Handlers should process the line as
2048 # needed, update the cache AND log it (so that the input cache array
2048 # needed, update the cache AND log it (so that the input cache array
2049 # stays synced).
2049 # stays synced).
2050
2050
2051 #.....................................................................
2051 #.....................................................................
2052 # Code begins
2052 # Code begins
2053
2053
2054 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2054 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2055
2055
2056 # save the line away in case we crash, so the post-mortem handler can
2056 # save the line away in case we crash, so the post-mortem handler can
2057 # record it
2057 # record it
2058 self._last_input_line = line
2058 self._last_input_line = line
2059
2059
2060 #print '***line: <%s>' % line # dbg
2060 #print '***line: <%s>' % line # dbg
2061
2061
2062 if not line:
2063 # Return immediately on purely empty lines, so that if the user
2064 # previously typed some whitespace that started a continuation
2065 # prompt, he can break out of that loop with just an empty line.
2066 # This is how the default python prompt works.
2067
2068 # Only return if the accumulated input buffer was just whitespace!
2069 if ''.join(self.buffer).isspace():
2070 self.buffer[:] = []
2071 return ''
2072
2062 line_info = prefilter.LineInfo(line, continue_prompt)
2073 line_info = prefilter.LineInfo(line, continue_prompt)
2063
2074
2064 # the input history needs to track even empty lines
2075 # the input history needs to track even empty lines
2065 stripped = line.strip()
2076 stripped = line.strip()
2066
2077
2067 if not stripped:
2078 if not stripped:
2068 if not continue_prompt:
2079 if not continue_prompt:
2069 self.outputcache.prompt_count -= 1
2080 self.outputcache.prompt_count -= 1
2070 return self.handle_normal(line_info)
2081 return self.handle_normal(line_info)
2071
2082
2072 # print '***cont',continue_prompt # dbg
2083 # print '***cont',continue_prompt # dbg
2073 # special handlers are only allowed for single line statements
2084 # special handlers are only allowed for single line statements
2074 if continue_prompt and not self.rc.multi_line_specials:
2085 if continue_prompt and not self.rc.multi_line_specials:
2075 return self.handle_normal(line_info)
2086 return self.handle_normal(line_info)
2076
2087
2077
2088
2078 # See whether any pre-existing handler can take care of it
2089 # See whether any pre-existing handler can take care of it
2079 rewritten = self.hooks.input_prefilter(stripped)
2090 rewritten = self.hooks.input_prefilter(stripped)
2080 if rewritten != stripped: # ok, some prefilter did something
2091 if rewritten != stripped: # ok, some prefilter did something
2081 rewritten = line_info.pre + rewritten # add indentation
2092 rewritten = line_info.pre + rewritten # add indentation
2082 return self.handle_normal(prefilter.LineInfo(rewritten,
2093 return self.handle_normal(prefilter.LineInfo(rewritten,
2083 continue_prompt))
2094 continue_prompt))
2084
2095
2085 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2096 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2086
2097
2087 return prefilter.prefilter(line_info, self)
2098 return prefilter.prefilter(line_info, self)
2088
2099
2089
2100
2090 def _prefilter_dumb(self, line, continue_prompt):
2101 def _prefilter_dumb(self, line, continue_prompt):
2091 """simple prefilter function, for debugging"""
2102 """simple prefilter function, for debugging"""
2092 return self.handle_normal(line,continue_prompt)
2103 return self.handle_normal(line,continue_prompt)
2093
2104
2094
2105
2095 def multiline_prefilter(self, line, continue_prompt):
2106 def multiline_prefilter(self, line, continue_prompt):
2096 """ Run _prefilter for each line of input
2107 """ Run _prefilter for each line of input
2097
2108
2098 Covers cases where there are multiple lines in the user entry,
2109 Covers cases where there are multiple lines in the user entry,
2099 which is the case when the user goes back to a multiline history
2110 which is the case when the user goes back to a multiline history
2100 entry and presses enter.
2111 entry and presses enter.
2101
2112
2102 """
2113 """
2103 out = []
2114 out = []
2104 for l in line.rstrip('\n').split('\n'):
2115 for l in line.rstrip('\n').split('\n'):
2105 out.append(self._prefilter(l, continue_prompt))
2116 out.append(self._prefilter(l, continue_prompt))
2106 return '\n'.join(out)
2117 return '\n'.join(out)
2107
2118
2108 # Set the default prefilter() function (this can be user-overridden)
2119 # Set the default prefilter() function (this can be user-overridden)
2109 prefilter = multiline_prefilter
2120 prefilter = multiline_prefilter
2110
2121
2111 def handle_normal(self,line_info):
2122 def handle_normal(self,line_info):
2112 """Handle normal input lines. Use as a template for handlers."""
2123 """Handle normal input lines. Use as a template for handlers."""
2113
2124
2114 # With autoindent on, we need some way to exit the input loop, and I
2125 # With autoindent on, we need some way to exit the input loop, and I
2115 # don't want to force the user to have to backspace all the way to
2126 # don't want to force the user to have to backspace all the way to
2116 # clear the line. The rule will be in this case, that either two
2127 # clear the line. The rule will be in this case, that either two
2117 # lines of pure whitespace in a row, or a line of pure whitespace but
2128 # lines of pure whitespace in a row, or a line of pure whitespace but
2118 # of a size different to the indent level, will exit the input loop.
2129 # of a size different to the indent level, will exit the input loop.
2119 line = line_info.line
2130 line = line_info.line
2120 continue_prompt = line_info.continue_prompt
2131 continue_prompt = line_info.continue_prompt
2121
2132
2122 if (continue_prompt and self.autoindent and line.isspace() and
2133 if (continue_prompt and self.autoindent and line.isspace() and
2123 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2134 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2124 (self.buffer[-1]).isspace() )):
2135 (self.buffer[-1]).isspace() )):
2125 line = ''
2136 line = ''
2126
2137
2127 self.log(line,line,continue_prompt)
2138 self.log(line,line,continue_prompt)
2128 return line
2139 return line
2129
2140
2130 def handle_alias(self,line_info):
2141 def handle_alias(self,line_info):
2131 """Handle alias input lines. """
2142 """Handle alias input lines. """
2132 tgt = self.alias_table[line_info.iFun]
2143 tgt = self.alias_table[line_info.iFun]
2133 # print "=>",tgt #dbg
2144 # print "=>",tgt #dbg
2134 if callable(tgt):
2145 if callable(tgt):
2135 line_out = "_sh." + line_info.iFun + '(r"""' + line_info.theRest + '""")'
2146 line_out = "_sh." + line_info.iFun + '(r"""' + line_info.theRest + '""")'
2136 else:
2147 else:
2137 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2148 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2138
2149
2139 # pre is needed, because it carries the leading whitespace. Otherwise
2150 # pre is needed, because it carries the leading whitespace. Otherwise
2140 # aliases won't work in indented sections.
2151 # aliases won't work in indented sections.
2141 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2152 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2142 make_quoted_expr( transformed ))
2153 make_quoted_expr( transformed ))
2143
2154
2144 self.log(line_info.line,line_out,line_info.continue_prompt)
2155 self.log(line_info.line,line_out,line_info.continue_prompt)
2145 #print 'line out:',line_out # dbg
2156 #print 'line out:',line_out # dbg
2146 return line_out
2157 return line_out
2147
2158
2148 def handle_shell_escape(self, line_info):
2159 def handle_shell_escape(self, line_info):
2149 """Execute the line in a shell, empty return value"""
2160 """Execute the line in a shell, empty return value"""
2150 #print 'line in :', `line` # dbg
2161 #print 'line in :', `line` # dbg
2151 line = line_info.line
2162 line = line_info.line
2152 if line.lstrip().startswith('!!'):
2163 if line.lstrip().startswith('!!'):
2153 # rewrite LineInfo's line, iFun and theRest to properly hold the
2164 # rewrite LineInfo's line, iFun and theRest to properly hold the
2154 # call to %sx and the actual command to be executed, so
2165 # call to %sx and the actual command to be executed, so
2155 # handle_magic can work correctly. Note that this works even if
2166 # handle_magic can work correctly. Note that this works even if
2156 # the line is indented, so it handles multi_line_specials
2167 # the line is indented, so it handles multi_line_specials
2157 # properly.
2168 # properly.
2158 new_rest = line.lstrip()[2:]
2169 new_rest = line.lstrip()[2:]
2159 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2170 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2160 line_info.iFun = 'sx'
2171 line_info.iFun = 'sx'
2161 line_info.theRest = new_rest
2172 line_info.theRest = new_rest
2162 return self.handle_magic(line_info)
2173 return self.handle_magic(line_info)
2163 else:
2174 else:
2164 cmd = line.lstrip().lstrip('!')
2175 cmd = line.lstrip().lstrip('!')
2165 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2176 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2166 make_quoted_expr(cmd))
2177 make_quoted_expr(cmd))
2167 # update cache/log and return
2178 # update cache/log and return
2168 self.log(line,line_out,line_info.continue_prompt)
2179 self.log(line,line_out,line_info.continue_prompt)
2169 return line_out
2180 return line_out
2170
2181
2171 def handle_magic(self, line_info):
2182 def handle_magic(self, line_info):
2172 """Execute magic functions."""
2183 """Execute magic functions."""
2173 iFun = line_info.iFun
2184 iFun = line_info.iFun
2174 theRest = line_info.theRest
2185 theRest = line_info.theRest
2175 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2186 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2176 make_quoted_expr(iFun + " " + theRest))
2187 make_quoted_expr(iFun + " " + theRest))
2177 self.log(line_info.line,cmd,line_info.continue_prompt)
2188 self.log(line_info.line,cmd,line_info.continue_prompt)
2178 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2189 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2179 return cmd
2190 return cmd
2180
2191
2181 def handle_auto(self, line_info):
2192 def handle_auto(self, line_info):
2182 """Hande lines which can be auto-executed, quoting if requested."""
2193 """Hande lines which can be auto-executed, quoting if requested."""
2183
2194
2184 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2195 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2185 line = line_info.line
2196 line = line_info.line
2186 iFun = line_info.iFun
2197 iFun = line_info.iFun
2187 theRest = line_info.theRest
2198 theRest = line_info.theRest
2188 pre = line_info.pre
2199 pre = line_info.pre
2189 continue_prompt = line_info.continue_prompt
2200 continue_prompt = line_info.continue_prompt
2190 obj = line_info.ofind(self)['obj']
2201 obj = line_info.ofind(self)['obj']
2191
2202
2192 # This should only be active for single-line input!
2203 # This should only be active for single-line input!
2193 if continue_prompt:
2204 if continue_prompt:
2194 self.log(line,line,continue_prompt)
2205 self.log(line,line,continue_prompt)
2195 return line
2206 return line
2196
2207
2197 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2208 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2198 auto_rewrite = True
2209 auto_rewrite = True
2199
2210
2200 if pre == self.ESC_QUOTE:
2211 if pre == self.ESC_QUOTE:
2201 # Auto-quote splitting on whitespace
2212 # Auto-quote splitting on whitespace
2202 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2213 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2203 elif pre == self.ESC_QUOTE2:
2214 elif pre == self.ESC_QUOTE2:
2204 # Auto-quote whole string
2215 # Auto-quote whole string
2205 newcmd = '%s("%s")' % (iFun,theRest)
2216 newcmd = '%s("%s")' % (iFun,theRest)
2206 elif pre == self.ESC_PAREN:
2217 elif pre == self.ESC_PAREN:
2207 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2218 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2208 else:
2219 else:
2209 # Auto-paren.
2220 # Auto-paren.
2210 # We only apply it to argument-less calls if the autocall
2221 # We only apply it to argument-less calls if the autocall
2211 # parameter is set to 2. We only need to check that autocall is <
2222 # parameter is set to 2. We only need to check that autocall is <
2212 # 2, since this function isn't called unless it's at least 1.
2223 # 2, since this function isn't called unless it's at least 1.
2213 if not theRest and (self.rc.autocall < 2) and not force_auto:
2224 if not theRest and (self.rc.autocall < 2) and not force_auto:
2214 newcmd = '%s %s' % (iFun,theRest)
2225 newcmd = '%s %s' % (iFun,theRest)
2215 auto_rewrite = False
2226 auto_rewrite = False
2216 else:
2227 else:
2217 if not force_auto and theRest.startswith('['):
2228 if not force_auto and theRest.startswith('['):
2218 if hasattr(obj,'__getitem__'):
2229 if hasattr(obj,'__getitem__'):
2219 # Don't autocall in this case: item access for an object
2230 # Don't autocall in this case: item access for an object
2220 # which is BOTH callable and implements __getitem__.
2231 # which is BOTH callable and implements __getitem__.
2221 newcmd = '%s %s' % (iFun,theRest)
2232 newcmd = '%s %s' % (iFun,theRest)
2222 auto_rewrite = False
2233 auto_rewrite = False
2223 else:
2234 else:
2224 # if the object doesn't support [] access, go ahead and
2235 # if the object doesn't support [] access, go ahead and
2225 # autocall
2236 # autocall
2226 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2237 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2227 elif theRest.endswith(';'):
2238 elif theRest.endswith(';'):
2228 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2239 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2229 else:
2240 else:
2230 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2241 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2231
2242
2232 if auto_rewrite:
2243 if auto_rewrite:
2233 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2244 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2234
2245
2235 try:
2246 try:
2236 # plain ascii works better w/ pyreadline, on some machines, so
2247 # plain ascii works better w/ pyreadline, on some machines, so
2237 # we use it and only print uncolored rewrite if we have unicode
2248 # we use it and only print uncolored rewrite if we have unicode
2238 rw = str(rw)
2249 rw = str(rw)
2239 print >>Term.cout, rw
2250 print >>Term.cout, rw
2240 except UnicodeEncodeError:
2251 except UnicodeEncodeError:
2241 print "-------------->" + newcmd
2252 print "-------------->" + newcmd
2242
2253
2243 # log what is now valid Python, not the actual user input (without the
2254 # log what is now valid Python, not the actual user input (without the
2244 # final newline)
2255 # final newline)
2245 self.log(line,newcmd,continue_prompt)
2256 self.log(line,newcmd,continue_prompt)
2246 return newcmd
2257 return newcmd
2247
2258
2248 def handle_help(self, line_info):
2259 def handle_help(self, line_info):
2249 """Try to get some help for the object.
2260 """Try to get some help for the object.
2250
2261
2251 obj? or ?obj -> basic information.
2262 obj? or ?obj -> basic information.
2252 obj?? or ??obj -> more details.
2263 obj?? or ??obj -> more details.
2253 """
2264 """
2254
2265
2255 line = line_info.line
2266 line = line_info.line
2256 # We need to make sure that we don't process lines which would be
2267 # We need to make sure that we don't process lines which would be
2257 # otherwise valid python, such as "x=1 # what?"
2268 # otherwise valid python, such as "x=1 # what?"
2258 try:
2269 try:
2259 codeop.compile_command(line)
2270 codeop.compile_command(line)
2260 except SyntaxError:
2271 except SyntaxError:
2261 # We should only handle as help stuff which is NOT valid syntax
2272 # We should only handle as help stuff which is NOT valid syntax
2262 if line[0]==self.ESC_HELP:
2273 if line[0]==self.ESC_HELP:
2263 line = line[1:]
2274 line = line[1:]
2264 elif line[-1]==self.ESC_HELP:
2275 elif line[-1]==self.ESC_HELP:
2265 line = line[:-1]
2276 line = line[:-1]
2266 self.log(line,'#?'+line,line_info.continue_prompt)
2277 self.log(line,'#?'+line,line_info.continue_prompt)
2267 if line:
2278 if line:
2268 #print 'line:<%r>' % line # dbg
2279 #print 'line:<%r>' % line # dbg
2269 self.magic_pinfo(line)
2280 self.magic_pinfo(line)
2270 else:
2281 else:
2271 page(self.usage,screen_lines=self.rc.screen_length)
2282 page(self.usage,screen_lines=self.rc.screen_length)
2272 return '' # Empty string is needed here!
2283 return '' # Empty string is needed here!
2273 except:
2284 except:
2274 # Pass any other exceptions through to the normal handler
2285 # Pass any other exceptions through to the normal handler
2275 return self.handle_normal(line_info)
2286 return self.handle_normal(line_info)
2276 else:
2287 else:
2277 # If the code compiles ok, we should handle it normally
2288 # If the code compiles ok, we should handle it normally
2278 return self.handle_normal(line_info)
2289 return self.handle_normal(line_info)
2279
2290
2280 def getapi(self):
2291 def getapi(self):
2281 """ Get an IPApi object for this shell instance
2292 """ Get an IPApi object for this shell instance
2282
2293
2283 Getting an IPApi object is always preferable to accessing the shell
2294 Getting an IPApi object is always preferable to accessing the shell
2284 directly, but this holds true especially for extensions.
2295 directly, but this holds true especially for extensions.
2285
2296
2286 It should always be possible to implement an extension with IPApi
2297 It should always be possible to implement an extension with IPApi
2287 alone. If not, contact maintainer to request an addition.
2298 alone. If not, contact maintainer to request an addition.
2288
2299
2289 """
2300 """
2290 return self.api
2301 return self.api
2291
2302
2292 def handle_emacs(self, line_info):
2303 def handle_emacs(self, line_info):
2293 """Handle input lines marked by python-mode."""
2304 """Handle input lines marked by python-mode."""
2294
2305
2295 # Currently, nothing is done. Later more functionality can be added
2306 # Currently, nothing is done. Later more functionality can be added
2296 # here if needed.
2307 # here if needed.
2297
2308
2298 # The input cache shouldn't be updated
2309 # The input cache shouldn't be updated
2299 return line_info.line
2310 return line_info.line
2300
2311
2301
2312
2302 def mktempfile(self,data=None):
2313 def mktempfile(self,data=None):
2303 """Make a new tempfile and return its filename.
2314 """Make a new tempfile and return its filename.
2304
2315
2305 This makes a call to tempfile.mktemp, but it registers the created
2316 This makes a call to tempfile.mktemp, but it registers the created
2306 filename internally so ipython cleans it up at exit time.
2317 filename internally so ipython cleans it up at exit time.
2307
2318
2308 Optional inputs:
2319 Optional inputs:
2309
2320
2310 - data(None): if data is given, it gets written out to the temp file
2321 - data(None): if data is given, it gets written out to the temp file
2311 immediately, and the file is closed again."""
2322 immediately, and the file is closed again."""
2312
2323
2313 filename = tempfile.mktemp('.py','ipython_edit_')
2324 filename = tempfile.mktemp('.py','ipython_edit_')
2314 self.tempfiles.append(filename)
2325 self.tempfiles.append(filename)
2315
2326
2316 if data:
2327 if data:
2317 tmp_file = open(filename,'w')
2328 tmp_file = open(filename,'w')
2318 tmp_file.write(data)
2329 tmp_file.write(data)
2319 tmp_file.close()
2330 tmp_file.close()
2320 return filename
2331 return filename
2321
2332
2322 def write(self,data):
2333 def write(self,data):
2323 """Write a string to the default output"""
2334 """Write a string to the default output"""
2324 Term.cout.write(data)
2335 Term.cout.write(data)
2325
2336
2326 def write_err(self,data):
2337 def write_err(self,data):
2327 """Write a string to the default error output"""
2338 """Write a string to the default error output"""
2328 Term.cerr.write(data)
2339 Term.cerr.write(data)
2329
2340
2330 def exit(self):
2341 def exit(self):
2331 """Handle interactive exit.
2342 """Handle interactive exit.
2332
2343
2333 This method sets the exit_now attribute."""
2344 This method sets the exit_now attribute."""
2334
2345
2335 if self.rc.confirm_exit:
2346 if self.rc.confirm_exit:
2336 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2347 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2337 self.exit_now = True
2348 self.exit_now = True
2338 else:
2349 else:
2339 self.exit_now = True
2350 self.exit_now = True
2340
2351
2341 def safe_execfile(self,fname,*where,**kw):
2352 def safe_execfile(self,fname,*where,**kw):
2342 """A safe version of the builtin execfile().
2353 """A safe version of the builtin execfile().
2343
2354
2344 This version will never throw an exception, and knows how to handle
2355 This version will never throw an exception, and knows how to handle
2345 ipython logs as well."""
2356 ipython logs as well."""
2346
2357
2347 def syspath_cleanup():
2358 def syspath_cleanup():
2348 """Internal cleanup routine for sys.path."""
2359 """Internal cleanup routine for sys.path."""
2349 if add_dname:
2360 if add_dname:
2350 try:
2361 try:
2351 sys.path.remove(dname)
2362 sys.path.remove(dname)
2352 except ValueError:
2363 except ValueError:
2353 # For some reason the user has already removed it, ignore.
2364 # For some reason the user has already removed it, ignore.
2354 pass
2365 pass
2355
2366
2356 fname = os.path.expanduser(fname)
2367 fname = os.path.expanduser(fname)
2357
2368
2358 # Find things also in current directory. This is needed to mimic the
2369 # Find things also in current directory. This is needed to mimic the
2359 # behavior of running a script from the system command line, where
2370 # behavior of running a script from the system command line, where
2360 # Python inserts the script's directory into sys.path
2371 # Python inserts the script's directory into sys.path
2361 dname = os.path.dirname(os.path.abspath(fname))
2372 dname = os.path.dirname(os.path.abspath(fname))
2362 add_dname = False
2373 add_dname = False
2363 if dname not in sys.path:
2374 if dname not in sys.path:
2364 sys.path.insert(0,dname)
2375 sys.path.insert(0,dname)
2365 add_dname = True
2376 add_dname = True
2366
2377
2367 try:
2378 try:
2368 xfile = open(fname)
2379 xfile = open(fname)
2369 except:
2380 except:
2370 print >> Term.cerr, \
2381 print >> Term.cerr, \
2371 'Could not open file <%s> for safe execution.' % fname
2382 'Could not open file <%s> for safe execution.' % fname
2372 syspath_cleanup()
2383 syspath_cleanup()
2373 return None
2384 return None
2374
2385
2375 kw.setdefault('islog',0)
2386 kw.setdefault('islog',0)
2376 kw.setdefault('quiet',1)
2387 kw.setdefault('quiet',1)
2377 kw.setdefault('exit_ignore',0)
2388 kw.setdefault('exit_ignore',0)
2378 first = xfile.readline()
2389 first = xfile.readline()
2379 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2390 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2380 xfile.close()
2391 xfile.close()
2381 # line by line execution
2392 # line by line execution
2382 if first.startswith(loghead) or kw['islog']:
2393 if first.startswith(loghead) or kw['islog']:
2383 print 'Loading log file <%s> one line at a time...' % fname
2394 print 'Loading log file <%s> one line at a time...' % fname
2384 if kw['quiet']:
2395 if kw['quiet']:
2385 stdout_save = sys.stdout
2396 stdout_save = sys.stdout
2386 sys.stdout = StringIO.StringIO()
2397 sys.stdout = StringIO.StringIO()
2387 try:
2398 try:
2388 globs,locs = where[0:2]
2399 globs,locs = where[0:2]
2389 except:
2400 except:
2390 try:
2401 try:
2391 globs = locs = where[0]
2402 globs = locs = where[0]
2392 except:
2403 except:
2393 globs = locs = globals()
2404 globs = locs = globals()
2394 badblocks = []
2405 badblocks = []
2395
2406
2396 # we also need to identify indented blocks of code when replaying
2407 # we also need to identify indented blocks of code when replaying
2397 # logs and put them together before passing them to an exec
2408 # logs and put them together before passing them to an exec
2398 # statement. This takes a bit of regexp and look-ahead work in the
2409 # statement. This takes a bit of regexp and look-ahead work in the
2399 # file. It's easiest if we swallow the whole thing in memory
2410 # file. It's easiest if we swallow the whole thing in memory
2400 # first, and manually walk through the lines list moving the
2411 # first, and manually walk through the lines list moving the
2401 # counter ourselves.
2412 # counter ourselves.
2402 indent_re = re.compile('\s+\S')
2413 indent_re = re.compile('\s+\S')
2403 xfile = open(fname)
2414 xfile = open(fname)
2404 filelines = xfile.readlines()
2415 filelines = xfile.readlines()
2405 xfile.close()
2416 xfile.close()
2406 nlines = len(filelines)
2417 nlines = len(filelines)
2407 lnum = 0
2418 lnum = 0
2408 while lnum < nlines:
2419 while lnum < nlines:
2409 line = filelines[lnum]
2420 line = filelines[lnum]
2410 lnum += 1
2421 lnum += 1
2411 # don't re-insert logger status info into cache
2422 # don't re-insert logger status info into cache
2412 if line.startswith('#log#'):
2423 if line.startswith('#log#'):
2413 continue
2424 continue
2414 else:
2425 else:
2415 # build a block of code (maybe a single line) for execution
2426 # build a block of code (maybe a single line) for execution
2416 block = line
2427 block = line
2417 try:
2428 try:
2418 next = filelines[lnum] # lnum has already incremented
2429 next = filelines[lnum] # lnum has already incremented
2419 except:
2430 except:
2420 next = None
2431 next = None
2421 while next and indent_re.match(next):
2432 while next and indent_re.match(next):
2422 block += next
2433 block += next
2423 lnum += 1
2434 lnum += 1
2424 try:
2435 try:
2425 next = filelines[lnum]
2436 next = filelines[lnum]
2426 except:
2437 except:
2427 next = None
2438 next = None
2428 # now execute the block of one or more lines
2439 # now execute the block of one or more lines
2429 try:
2440 try:
2430 exec block in globs,locs
2441 exec block in globs,locs
2431 except SystemExit:
2442 except SystemExit:
2432 pass
2443 pass
2433 except:
2444 except:
2434 badblocks.append(block.rstrip())
2445 badblocks.append(block.rstrip())
2435 if kw['quiet']: # restore stdout
2446 if kw['quiet']: # restore stdout
2436 sys.stdout.close()
2447 sys.stdout.close()
2437 sys.stdout = stdout_save
2448 sys.stdout = stdout_save
2438 print 'Finished replaying log file <%s>' % fname
2449 print 'Finished replaying log file <%s>' % fname
2439 if badblocks:
2450 if badblocks:
2440 print >> sys.stderr, ('\nThe following lines/blocks in file '
2451 print >> sys.stderr, ('\nThe following lines/blocks in file '
2441 '<%s> reported errors:' % fname)
2452 '<%s> reported errors:' % fname)
2442
2453
2443 for badline in badblocks:
2454 for badline in badblocks:
2444 print >> sys.stderr, badline
2455 print >> sys.stderr, badline
2445 else: # regular file execution
2456 else: # regular file execution
2446 try:
2457 try:
2447 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2458 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2448 # Work around a bug in Python for Windows. The bug was
2459 # Work around a bug in Python for Windows. The bug was
2449 # fixed in in Python 2.5 r54159 and 54158, but that's still
2460 # fixed in in Python 2.5 r54159 and 54158, but that's still
2450 # SVN Python as of March/07. For details, see:
2461 # SVN Python as of March/07. For details, see:
2451 # http://projects.scipy.org/ipython/ipython/ticket/123
2462 # http://projects.scipy.org/ipython/ipython/ticket/123
2452 try:
2463 try:
2453 globs,locs = where[0:2]
2464 globs,locs = where[0:2]
2454 except:
2465 except:
2455 try:
2466 try:
2456 globs = locs = where[0]
2467 globs = locs = where[0]
2457 except:
2468 except:
2458 globs = locs = globals()
2469 globs = locs = globals()
2459 exec file(fname) in globs,locs
2470 exec file(fname) in globs,locs
2460 else:
2471 else:
2461 execfile(fname,*where)
2472 execfile(fname,*where)
2462 except SyntaxError:
2473 except SyntaxError:
2463 self.showsyntaxerror()
2474 self.showsyntaxerror()
2464 warn('Failure executing file: <%s>' % fname)
2475 warn('Failure executing file: <%s>' % fname)
2465 except SystemExit,status:
2476 except SystemExit,status:
2466 if not kw['exit_ignore']:
2477 if not kw['exit_ignore']:
2467 self.showtraceback()
2478 self.showtraceback()
2468 warn('Failure executing file: <%s>' % fname)
2479 warn('Failure executing file: <%s>' % fname)
2469 except:
2480 except:
2470 self.showtraceback()
2481 self.showtraceback()
2471 warn('Failure executing file: <%s>' % fname)
2482 warn('Failure executing file: <%s>' % fname)
2472
2483
2473 syspath_cleanup()
2484 syspath_cleanup()
2474
2485
2475 #************************* end of file <iplib.py> *****************************
2486 #************************* end of file <iplib.py> *****************************
@@ -1,6911 +1,6932 b''
1 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/Extensions/ipy_profile_doctest.py: New profile for
4 doctest support. It sets prompts/exceptions as similar to
5 standard Python as possible, so that ipython sessions in this
6 profile can be easily pasted as doctests with minimal
7 modifications. It also enables pasting of doctests from external
8 sources (even if they have leading whitespace), so that you can
9 rerun doctests from existing sources.
10
11 * IPython/iplib.py (_prefilter): fix a buglet where after entering
12 some whitespace, the prompt would become a continuation prompt
13 with no way of exiting it other than Ctrl-C. This fix brings us
14 into conformity with how the default python prompt works.
15
16 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
17 Add support for pasting not only lines that start with '>>>', but
18 also with ' >>>'. That is, arbitrary whitespace can now precede
19 the prompts. This makes the system useful for pasting doctests
20 from docstrings back into a normal session.
21
1 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
22 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
2
23
3 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
24 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
4 r1357, which had killed multiple invocations of an embedded
25 r1357, which had killed multiple invocations of an embedded
5 ipython (this means that example-embed has been broken for over 1
26 ipython (this means that example-embed has been broken for over 1
6 year!!!). Rather than possibly breaking the batch stuff for which
27 year!!!). Rather than possibly breaking the batch stuff for which
7 the code in iplib.py/interact was introduced, I worked around the
28 the code in iplib.py/interact was introduced, I worked around the
8 problem in the embedding class in Shell.py. We really need a
29 problem in the embedding class in Shell.py. We really need a
9 bloody test suite for this code, I'm sick of finding stuff that
30 bloody test suite for this code, I'm sick of finding stuff that
10 used to work breaking left and right every time I use an old
31 used to work breaking left and right every time I use an old
11 feature I hadn't touched in a few months.
32 feature I hadn't touched in a few months.
12 (kill_embedded): Add a new magic that only shows up in embedded
33 (kill_embedded): Add a new magic that only shows up in embedded
13 mode, to allow users to permanently deactivate an embedded instance.
34 mode, to allow users to permanently deactivate an embedded instance.
14
35
15 2007-08-01 Ville Vainio <vivainio@gmail.com>
36 2007-08-01 Ville Vainio <vivainio@gmail.com>
16
37
17 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
38 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
18 history gets out of sync on runlines (e.g. when running macros).
39 history gets out of sync on runlines (e.g. when running macros).
19
40
20 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
41 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
21
42
22 * IPython/Magic.py (magic_colors): fix win32-related error message
43 * IPython/Magic.py (magic_colors): fix win32-related error message
23 that could appear under *nix when readline was missing. Patch by
44 that could appear under *nix when readline was missing. Patch by
24 Scott Jackson, closes #175.
45 Scott Jackson, closes #175.
25
46
26 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
47 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
27
48
28 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
49 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
29 completer that it traits-aware, so that traits objects don't show
50 completer that it traits-aware, so that traits objects don't show
30 all of their internal attributes all the time.
51 all of their internal attributes all the time.
31
52
32 * IPython/genutils.py (dir2): moved this code from inside
53 * IPython/genutils.py (dir2): moved this code from inside
33 completer.py to expose it publicly, so I could use it in the
54 completer.py to expose it publicly, so I could use it in the
34 wildcards bugfix.
55 wildcards bugfix.
35
56
36 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
57 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
37 Stefan with Traits.
58 Stefan with Traits.
38
59
39 * IPython/completer.py (Completer.attr_matches): change internal
60 * IPython/completer.py (Completer.attr_matches): change internal
40 var name from 'object' to 'obj', since 'object' is now a builtin
61 var name from 'object' to 'obj', since 'object' is now a builtin
41 and this can lead to weird bugs if reusing this code elsewhere.
62 and this can lead to weird bugs if reusing this code elsewhere.
42
63
43 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
64 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
44
65
45 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
66 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
46 'foo?' and update the code to prevent printing of default
67 'foo?' and update the code to prevent printing of default
47 docstrings that started appearing after I added support for
68 docstrings that started appearing after I added support for
48 new-style classes. The approach I'm using isn't ideal (I just
69 new-style classes. The approach I'm using isn't ideal (I just
49 special-case those strings) but I'm not sure how to more robustly
70 special-case those strings) but I'm not sure how to more robustly
50 differentiate between truly user-written strings and Python's
71 differentiate between truly user-written strings and Python's
51 automatic ones.
72 automatic ones.
52
73
53 2007-07-09 Ville Vainio <vivainio@gmail.com>
74 2007-07-09 Ville Vainio <vivainio@gmail.com>
54
75
55 * completer.py: Applied Matthew Neeley's patch:
76 * completer.py: Applied Matthew Neeley's patch:
56 Dynamic attributes from trait_names and _getAttributeNames are added
77 Dynamic attributes from trait_names and _getAttributeNames are added
57 to the list of tab completions, but when this happens, the attribute
78 to the list of tab completions, but when this happens, the attribute
58 list is turned into a set, so the attributes are unordered when
79 list is turned into a set, so the attributes are unordered when
59 printed, which makes it hard to find the right completion. This patch
80 printed, which makes it hard to find the right completion. This patch
60 turns this set back into a list and sort it.
81 turns this set back into a list and sort it.
61
82
62 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
83 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
63
84
64 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
85 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
65 classes in various inspector functions.
86 classes in various inspector functions.
66
87
67 2007-06-28 Ville Vainio <vivainio@gmail.com>
88 2007-06-28 Ville Vainio <vivainio@gmail.com>
68
89
69 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
90 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
70 Implement "shadow" namespace, and callable aliases that reside there.
91 Implement "shadow" namespace, and callable aliases that reside there.
71 Use them by:
92 Use them by:
72
93
73 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
94 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
74
95
75 foo hello world
96 foo hello world
76 (gets translated to:)
97 (gets translated to:)
77 _sh.foo(r"""hello world""")
98 _sh.foo(r"""hello world""")
78
99
79 In practice, this kind of alias can take the role of a magic function
100 In practice, this kind of alias can take the role of a magic function
80
101
81 * New generic inspect_object, called on obj? and obj??
102 * New generic inspect_object, called on obj? and obj??
82
103
83 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
104 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
84
105
85 * IPython/ultraTB.py (findsource): fix a problem with
106 * IPython/ultraTB.py (findsource): fix a problem with
86 inspect.getfile that can cause crashes during traceback construction.
107 inspect.getfile that can cause crashes during traceback construction.
87
108
88 2007-06-14 Ville Vainio <vivainio@gmail.com>
109 2007-06-14 Ville Vainio <vivainio@gmail.com>
89
110
90 * iplib.py (handle_auto): Try to use ascii for printing "--->"
111 * iplib.py (handle_auto): Try to use ascii for printing "--->"
91 autocall rewrite indication, becausesometimes unicode fails to print
112 autocall rewrite indication, becausesometimes unicode fails to print
92 properly (and you get ' - - - '). Use plain uncoloured ---> for
113 properly (and you get ' - - - '). Use plain uncoloured ---> for
93 unicode.
114 unicode.
94
115
95 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
116 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
96
117
97 . pickleshare 'hash' commands (hget, hset, hcompress,
118 . pickleshare 'hash' commands (hget, hset, hcompress,
98 hdict) for efficient shadow history storage.
119 hdict) for efficient shadow history storage.
99
120
100 2007-06-13 Ville Vainio <vivainio@gmail.com>
121 2007-06-13 Ville Vainio <vivainio@gmail.com>
101
122
102 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
123 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
103 Added kw arg 'interactive', tell whether vars should be visible
124 Added kw arg 'interactive', tell whether vars should be visible
104 with %whos.
125 with %whos.
105
126
106 2007-06-11 Ville Vainio <vivainio@gmail.com>
127 2007-06-11 Ville Vainio <vivainio@gmail.com>
107
128
108 * pspersistence.py, Magic.py, iplib.py: directory history now saved
129 * pspersistence.py, Magic.py, iplib.py: directory history now saved
109 to db
130 to db
110
131
111 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
132 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
112 Also, it exits IPython immediately after evaluating the command (just like
133 Also, it exits IPython immediately after evaluating the command (just like
113 std python)
134 std python)
114
135
115 2007-06-05 Walter Doerwald <walter@livinglogic.de>
136 2007-06-05 Walter Doerwald <walter@livinglogic.de>
116
137
117 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
138 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
118 Python string and captures the output. (Idea and original patch by
139 Python string and captures the output. (Idea and original patch by
119 StοΏ½fan van der Walt)
140 StοΏ½fan van der Walt)
120
141
121 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
142 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
122
143
123 * IPython/ultraTB.py (VerboseTB.text): update printing of
144 * IPython/ultraTB.py (VerboseTB.text): update printing of
124 exception types for Python 2.5 (now all exceptions in the stdlib
145 exception types for Python 2.5 (now all exceptions in the stdlib
125 are new-style classes).
146 are new-style classes).
126
147
127 2007-05-31 Walter Doerwald <walter@livinglogic.de>
148 2007-05-31 Walter Doerwald <walter@livinglogic.de>
128
149
129 * IPython/Extensions/igrid.py: Add new commands refresh and
150 * IPython/Extensions/igrid.py: Add new commands refresh and
130 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
151 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
131 the iterator once (refresh) or after every x seconds (refresh_timer).
152 the iterator once (refresh) or after every x seconds (refresh_timer).
132 Add a working implementation of "searchexpression", where the text
153 Add a working implementation of "searchexpression", where the text
133 entered is not the text to search for, but an expression that must
154 entered is not the text to search for, but an expression that must
134 be true. Added display of shortcuts to the menu. Added commands "pickinput"
155 be true. Added display of shortcuts to the menu. Added commands "pickinput"
135 and "pickinputattr" that put the object or attribute under the cursor
156 and "pickinputattr" that put the object or attribute under the cursor
136 in the input line. Split the statusbar to be able to display the currently
157 in the input line. Split the statusbar to be able to display the currently
137 active refresh interval. (Patch by Nik Tautenhahn)
158 active refresh interval. (Patch by Nik Tautenhahn)
138
159
139 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
160 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
140
161
141 * fixing set_term_title to use ctypes as default
162 * fixing set_term_title to use ctypes as default
142
163
143 * fixing set_term_title fallback to work when curent dir
164 * fixing set_term_title fallback to work when curent dir
144 is on a windows network share
165 is on a windows network share
145
166
146 2007-05-28 Ville Vainio <vivainio@gmail.com>
167 2007-05-28 Ville Vainio <vivainio@gmail.com>
147
168
148 * %cpaste: strip + with > from left (diffs).
169 * %cpaste: strip + with > from left (diffs).
149
170
150 * iplib.py: Fix crash when readline not installed
171 * iplib.py: Fix crash when readline not installed
151
172
152 2007-05-26 Ville Vainio <vivainio@gmail.com>
173 2007-05-26 Ville Vainio <vivainio@gmail.com>
153
174
154 * generics.py: intruduce easy to extend result_display generic
175 * generics.py: intruduce easy to extend result_display generic
155 function (using simplegeneric.py).
176 function (using simplegeneric.py).
156
177
157 * Fixed the append functionality of %set.
178 * Fixed the append functionality of %set.
158
179
159 2007-05-25 Ville Vainio <vivainio@gmail.com>
180 2007-05-25 Ville Vainio <vivainio@gmail.com>
160
181
161 * New magic: %rep (fetch / run old commands from history)
182 * New magic: %rep (fetch / run old commands from history)
162
183
163 * New extension: mglob (%mglob magic), for powerful glob / find /filter
184 * New extension: mglob (%mglob magic), for powerful glob / find /filter
164 like functionality
185 like functionality
165
186
166 % maghistory.py: %hist -g PATTERM greps the history for pattern
187 % maghistory.py: %hist -g PATTERM greps the history for pattern
167
188
168 2007-05-24 Walter Doerwald <walter@livinglogic.de>
189 2007-05-24 Walter Doerwald <walter@livinglogic.de>
169
190
170 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
191 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
171 browse the IPython input history
192 browse the IPython input history
172
193
173 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
194 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
174 (mapped to "i") can be used to put the object under the curser in the input
195 (mapped to "i") can be used to put the object under the curser in the input
175 line. pickinputattr (mapped to "I") does the same for the attribute under
196 line. pickinputattr (mapped to "I") does the same for the attribute under
176 the cursor.
197 the cursor.
177
198
178 2007-05-24 Ville Vainio <vivainio@gmail.com>
199 2007-05-24 Ville Vainio <vivainio@gmail.com>
179
200
180 * Grand magic cleansing (changeset [2380]):
201 * Grand magic cleansing (changeset [2380]):
181
202
182 * Introduce ipy_legacy.py where the following magics were
203 * Introduce ipy_legacy.py where the following magics were
183 moved:
204 moved:
184
205
185 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
206 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
186
207
187 If you need them, either use default profile or "import ipy_legacy"
208 If you need them, either use default profile or "import ipy_legacy"
188 in your ipy_user_conf.py
209 in your ipy_user_conf.py
189
210
190 * Move sh and scipy profile to Extensions from UserConfig. this implies
211 * Move sh and scipy profile to Extensions from UserConfig. this implies
191 you should not edit them, but you don't need to run %upgrade when
212 you should not edit them, but you don't need to run %upgrade when
192 upgrading IPython anymore.
213 upgrading IPython anymore.
193
214
194 * %hist/%history now operates in "raw" mode by default. To get the old
215 * %hist/%history now operates in "raw" mode by default. To get the old
195 behaviour, run '%hist -n' (native mode).
216 behaviour, run '%hist -n' (native mode).
196
217
197 * split ipy_stock_completers.py to ipy_stock_completers.py and
218 * split ipy_stock_completers.py to ipy_stock_completers.py and
198 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
219 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
199 installed as default.
220 installed as default.
200
221
201 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
222 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
202 handling.
223 handling.
203
224
204 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
225 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
205 input if readline is available.
226 input if readline is available.
206
227
207 2007-05-23 Ville Vainio <vivainio@gmail.com>
228 2007-05-23 Ville Vainio <vivainio@gmail.com>
208
229
209 * macro.py: %store uses __getstate__ properly
230 * macro.py: %store uses __getstate__ properly
210
231
211 * exesetup.py: added new setup script for creating
232 * exesetup.py: added new setup script for creating
212 standalone IPython executables with py2exe (i.e.
233 standalone IPython executables with py2exe (i.e.
213 no python installation required).
234 no python installation required).
214
235
215 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
236 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
216 its place.
237 its place.
217
238
218 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
239 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
219
240
220 2007-05-21 Ville Vainio <vivainio@gmail.com>
241 2007-05-21 Ville Vainio <vivainio@gmail.com>
221
242
222 * platutil_win32.py (set_term_title): handle
243 * platutil_win32.py (set_term_title): handle
223 failure of 'title' system call properly.
244 failure of 'title' system call properly.
224
245
225 2007-05-17 Walter Doerwald <walter@livinglogic.de>
246 2007-05-17 Walter Doerwald <walter@livinglogic.de>
226
247
227 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
248 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
228 (Bug detected by Paul Mueller).
249 (Bug detected by Paul Mueller).
229
250
230 2007-05-16 Ville Vainio <vivainio@gmail.com>
251 2007-05-16 Ville Vainio <vivainio@gmail.com>
231
252
232 * ipy_profile_sci.py, ipython_win_post_install.py: Create
253 * ipy_profile_sci.py, ipython_win_post_install.py: Create
233 new "sci" profile, effectively a modern version of the old
254 new "sci" profile, effectively a modern version of the old
234 "scipy" profile (which is now slated for deprecation).
255 "scipy" profile (which is now slated for deprecation).
235
256
236 2007-05-15 Ville Vainio <vivainio@gmail.com>
257 2007-05-15 Ville Vainio <vivainio@gmail.com>
237
258
238 * pycolorize.py, pycolor.1: Paul Mueller's patches that
259 * pycolorize.py, pycolor.1: Paul Mueller's patches that
239 make pycolorize read input from stdin when run without arguments.
260 make pycolorize read input from stdin when run without arguments.
240
261
241 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
262 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
242
263
243 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
264 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
244 it in sh profile (instead of ipy_system_conf.py).
265 it in sh profile (instead of ipy_system_conf.py).
245
266
246 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
267 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
247 aliases are now lower case on windows (MyCommand.exe => mycommand).
268 aliases are now lower case on windows (MyCommand.exe => mycommand).
248
269
249 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
270 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
250 Macros are now callable objects that inherit from ipapi.IPyAutocall,
271 Macros are now callable objects that inherit from ipapi.IPyAutocall,
251 i.e. get autocalled regardless of system autocall setting.
272 i.e. get autocalled regardless of system autocall setting.
252
273
253 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
274 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
254
275
255 * IPython/rlineimpl.py: check for clear_history in readline and
276 * IPython/rlineimpl.py: check for clear_history in readline and
256 make it a dummy no-op if not available. This function isn't
277 make it a dummy no-op if not available. This function isn't
257 guaranteed to be in the API and appeared in Python 2.4, so we need
278 guaranteed to be in the API and appeared in Python 2.4, so we need
258 to check it ourselves. Also, clean up this file quite a bit.
279 to check it ourselves. Also, clean up this file quite a bit.
259
280
260 * ipython.1: update man page and full manual with information
281 * ipython.1: update man page and full manual with information
261 about threads (remove outdated warning). Closes #151.
282 about threads (remove outdated warning). Closes #151.
262
283
263 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
284 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
264
285
265 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
286 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
266 in trunk (note that this made it into the 0.8.1 release already,
287 in trunk (note that this made it into the 0.8.1 release already,
267 but the changelogs didn't get coordinated). Many thanks to Gael
288 but the changelogs didn't get coordinated). Many thanks to Gael
268 Varoquaux <gael.varoquaux-AT-normalesup.org>
289 Varoquaux <gael.varoquaux-AT-normalesup.org>
269
290
270 2007-05-09 *** Released version 0.8.1
291 2007-05-09 *** Released version 0.8.1
271
292
272 2007-05-10 Walter Doerwald <walter@livinglogic.de>
293 2007-05-10 Walter Doerwald <walter@livinglogic.de>
273
294
274 * IPython/Extensions/igrid.py: Incorporate html help into
295 * IPython/Extensions/igrid.py: Incorporate html help into
275 the module, so we don't have to search for the file.
296 the module, so we don't have to search for the file.
276
297
277 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
298 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
278
299
279 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
300 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
280
301
281 2007-04-30 Ville Vainio <vivainio@gmail.com>
302 2007-04-30 Ville Vainio <vivainio@gmail.com>
282
303
283 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
304 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
284 user has illegal (non-ascii) home directory name
305 user has illegal (non-ascii) home directory name
285
306
286 2007-04-27 Ville Vainio <vivainio@gmail.com>
307 2007-04-27 Ville Vainio <vivainio@gmail.com>
287
308
288 * platutils_win32.py: implement set_term_title for windows
309 * platutils_win32.py: implement set_term_title for windows
289
310
290 * Update version number
311 * Update version number
291
312
292 * ipy_profile_sh.py: more informative prompt (2 dir levels)
313 * ipy_profile_sh.py: more informative prompt (2 dir levels)
293
314
294 2007-04-26 Walter Doerwald <walter@livinglogic.de>
315 2007-04-26 Walter Doerwald <walter@livinglogic.de>
295
316
296 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
317 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
297 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
318 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
298 bug discovered by Ville).
319 bug discovered by Ville).
299
320
300 2007-04-26 Ville Vainio <vivainio@gmail.com>
321 2007-04-26 Ville Vainio <vivainio@gmail.com>
301
322
302 * Extensions/ipy_completers.py: Olivier's module completer now
323 * Extensions/ipy_completers.py: Olivier's module completer now
303 saves the list of root modules if it takes > 4 secs on the first run.
324 saves the list of root modules if it takes > 4 secs on the first run.
304
325
305 * Magic.py (%rehashx): %rehashx now clears the completer cache
326 * Magic.py (%rehashx): %rehashx now clears the completer cache
306
327
307
328
308 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
329 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
309
330
310 * ipython.el: fix incorrect color scheme, reported by Stefan.
331 * ipython.el: fix incorrect color scheme, reported by Stefan.
311 Closes #149.
332 Closes #149.
312
333
313 * IPython/PyColorize.py (Parser.format2): fix state-handling
334 * IPython/PyColorize.py (Parser.format2): fix state-handling
314 logic. I still don't like how that code handles state, but at
335 logic. I still don't like how that code handles state, but at
315 least now it should be correct, if inelegant. Closes #146.
336 least now it should be correct, if inelegant. Closes #146.
316
337
317 2007-04-25 Ville Vainio <vivainio@gmail.com>
338 2007-04-25 Ville Vainio <vivainio@gmail.com>
318
339
319 * Extensions/ipy_which.py: added extension for %which magic, works
340 * Extensions/ipy_which.py: added extension for %which magic, works
320 a lot like unix 'which' but also finds and expands aliases, and
341 a lot like unix 'which' but also finds and expands aliases, and
321 allows wildcards.
342 allows wildcards.
322
343
323 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
344 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
324 as opposed to returning nothing.
345 as opposed to returning nothing.
325
346
326 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
347 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
327 ipy_stock_completers on default profile, do import on sh profile.
348 ipy_stock_completers on default profile, do import on sh profile.
328
349
329 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
350 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
330
351
331 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
352 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
332 like ipython.py foo.py which raised a IndexError.
353 like ipython.py foo.py which raised a IndexError.
333
354
334 2007-04-21 Ville Vainio <vivainio@gmail.com>
355 2007-04-21 Ville Vainio <vivainio@gmail.com>
335
356
336 * Extensions/ipy_extutil.py: added extension to manage other ipython
357 * Extensions/ipy_extutil.py: added extension to manage other ipython
337 extensions. Now only supports 'ls' == list extensions.
358 extensions. Now only supports 'ls' == list extensions.
338
359
339 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
360 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
340
361
341 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
362 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
342 would prevent use of the exception system outside of a running
363 would prevent use of the exception system outside of a running
343 IPython instance.
364 IPython instance.
344
365
345 2007-04-20 Ville Vainio <vivainio@gmail.com>
366 2007-04-20 Ville Vainio <vivainio@gmail.com>
346
367
347 * Extensions/ipy_render.py: added extension for easy
368 * Extensions/ipy_render.py: added extension for easy
348 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
369 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
349 'Iptl' template notation,
370 'Iptl' template notation,
350
371
351 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
372 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
352 safer & faster 'import' completer.
373 safer & faster 'import' completer.
353
374
354 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
375 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
355 and _ip.defalias(name, command).
376 and _ip.defalias(name, command).
356
377
357 * Extensions/ipy_exportdb.py: New extension for exporting all the
378 * Extensions/ipy_exportdb.py: New extension for exporting all the
358 %store'd data in a portable format (normal ipapi calls like
379 %store'd data in a portable format (normal ipapi calls like
359 defmacro() etc.)
380 defmacro() etc.)
360
381
361 2007-04-19 Ville Vainio <vivainio@gmail.com>
382 2007-04-19 Ville Vainio <vivainio@gmail.com>
362
383
363 * upgrade_dir.py: skip junk files like *.pyc
384 * upgrade_dir.py: skip junk files like *.pyc
364
385
365 * Release.py: version number to 0.8.1
386 * Release.py: version number to 0.8.1
366
387
367 2007-04-18 Ville Vainio <vivainio@gmail.com>
388 2007-04-18 Ville Vainio <vivainio@gmail.com>
368
389
369 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
390 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
370 and later on win32.
391 and later on win32.
371
392
372 2007-04-16 Ville Vainio <vivainio@gmail.com>
393 2007-04-16 Ville Vainio <vivainio@gmail.com>
373
394
374 * iplib.py (showtraceback): Do not crash when running w/o readline.
395 * iplib.py (showtraceback): Do not crash when running w/o readline.
375
396
376 2007-04-12 Walter Doerwald <walter@livinglogic.de>
397 2007-04-12 Walter Doerwald <walter@livinglogic.de>
377
398
378 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
399 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
379 sorted (case sensitive with files and dirs mixed).
400 sorted (case sensitive with files and dirs mixed).
380
401
381 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
402 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
382
403
383 * IPython/Release.py (version): Open trunk for 0.8.1 development.
404 * IPython/Release.py (version): Open trunk for 0.8.1 development.
384
405
385 2007-04-10 *** Released version 0.8.0
406 2007-04-10 *** Released version 0.8.0
386
407
387 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
408 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
388
409
389 * Tag 0.8.0 for release.
410 * Tag 0.8.0 for release.
390
411
391 * IPython/iplib.py (reloadhist): add API function to cleanly
412 * IPython/iplib.py (reloadhist): add API function to cleanly
392 reload the readline history, which was growing inappropriately on
413 reload the readline history, which was growing inappropriately on
393 every %run call.
414 every %run call.
394
415
395 * win32_manual_post_install.py (run): apply last part of Nicolas
416 * win32_manual_post_install.py (run): apply last part of Nicolas
396 Pernetty's patch (I'd accidentally applied it in a different
417 Pernetty's patch (I'd accidentally applied it in a different
397 directory and this particular file didn't get patched).
418 directory and this particular file didn't get patched).
398
419
399 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
420 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
400
421
401 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
422 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
402 find the main thread id and use the proper API call. Thanks to
423 find the main thread id and use the proper API call. Thanks to
403 Stefan for the fix.
424 Stefan for the fix.
404
425
405 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
426 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
406 unit tests to reflect fixed ticket #52, and add more tests sent by
427 unit tests to reflect fixed ticket #52, and add more tests sent by
407 him.
428 him.
408
429
409 * IPython/iplib.py (raw_input): restore the readline completer
430 * IPython/iplib.py (raw_input): restore the readline completer
410 state on every input, in case third-party code messed it up.
431 state on every input, in case third-party code messed it up.
411 (_prefilter): revert recent addition of early-escape checks which
432 (_prefilter): revert recent addition of early-escape checks which
412 prevent many valid alias calls from working.
433 prevent many valid alias calls from working.
413
434
414 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
435 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
415 flag for sigint handler so we don't run a full signal() call on
436 flag for sigint handler so we don't run a full signal() call on
416 each runcode access.
437 each runcode access.
417
438
418 * IPython/Magic.py (magic_whos): small improvement to diagnostic
439 * IPython/Magic.py (magic_whos): small improvement to diagnostic
419 message.
440 message.
420
441
421 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
442 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
422
443
423 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
444 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
424 asynchronous exceptions working, i.e., Ctrl-C can actually
445 asynchronous exceptions working, i.e., Ctrl-C can actually
425 interrupt long-running code in the multithreaded shells.
446 interrupt long-running code in the multithreaded shells.
426
447
427 This is using Tomer Filiba's great ctypes-based trick:
448 This is using Tomer Filiba's great ctypes-based trick:
428 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
449 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
429 this in the past, but hadn't been able to make it work before. So
450 this in the past, but hadn't been able to make it work before. So
430 far it looks like it's actually running, but this needs more
451 far it looks like it's actually running, but this needs more
431 testing. If it really works, I'll be *very* happy, and we'll owe
452 testing. If it really works, I'll be *very* happy, and we'll owe
432 a huge thank you to Tomer. My current implementation is ugly,
453 a huge thank you to Tomer. My current implementation is ugly,
433 hackish and uses nasty globals, but I don't want to try and clean
454 hackish and uses nasty globals, but I don't want to try and clean
434 anything up until we know if it actually works.
455 anything up until we know if it actually works.
435
456
436 NOTE: this feature needs ctypes to work. ctypes is included in
457 NOTE: this feature needs ctypes to work. ctypes is included in
437 Python2.5, but 2.4 users will need to manually install it. This
458 Python2.5, but 2.4 users will need to manually install it. This
438 feature makes multi-threaded shells so much more usable that it's
459 feature makes multi-threaded shells so much more usable that it's
439 a minor price to pay (ctypes is very easy to install, already a
460 a minor price to pay (ctypes is very easy to install, already a
440 requirement for win32 and available in major linux distros).
461 requirement for win32 and available in major linux distros).
441
462
442 2007-04-04 Ville Vainio <vivainio@gmail.com>
463 2007-04-04 Ville Vainio <vivainio@gmail.com>
443
464
444 * Extensions/ipy_completers.py, ipy_stock_completers.py:
465 * Extensions/ipy_completers.py, ipy_stock_completers.py:
445 Moved implementations of 'bundled' completers to ipy_completers.py,
466 Moved implementations of 'bundled' completers to ipy_completers.py,
446 they are only enabled in ipy_stock_completers.py.
467 they are only enabled in ipy_stock_completers.py.
447
468
448 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
469 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
449
470
450 * IPython/PyColorize.py (Parser.format2): Fix identation of
471 * IPython/PyColorize.py (Parser.format2): Fix identation of
451 colorzied output and return early if color scheme is NoColor, to
472 colorzied output and return early if color scheme is NoColor, to
452 avoid unnecessary and expensive tokenization. Closes #131.
473 avoid unnecessary and expensive tokenization. Closes #131.
453
474
454 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
475 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
455
476
456 * IPython/Debugger.py: disable the use of pydb version 1.17. It
477 * IPython/Debugger.py: disable the use of pydb version 1.17. It
457 has a critical bug (a missing import that makes post-mortem not
478 has a critical bug (a missing import that makes post-mortem not
458 work at all). Unfortunately as of this time, this is the version
479 work at all). Unfortunately as of this time, this is the version
459 shipped with Ubuntu Edgy, so quite a few people have this one. I
480 shipped with Ubuntu Edgy, so quite a few people have this one. I
460 hope Edgy will update to a more recent package.
481 hope Edgy will update to a more recent package.
461
482
462 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
483 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
463
484
464 * IPython/iplib.py (_prefilter): close #52, second part of a patch
485 * IPython/iplib.py (_prefilter): close #52, second part of a patch
465 set by Stefan (only the first part had been applied before).
486 set by Stefan (only the first part had been applied before).
466
487
467 * IPython/Extensions/ipy_stock_completers.py (module_completer):
488 * IPython/Extensions/ipy_stock_completers.py (module_completer):
468 remove usage of the dangerous pkgutil.walk_packages(). See
489 remove usage of the dangerous pkgutil.walk_packages(). See
469 details in comments left in the code.
490 details in comments left in the code.
470
491
471 * IPython/Magic.py (magic_whos): add support for numpy arrays
492 * IPython/Magic.py (magic_whos): add support for numpy arrays
472 similar to what we had for Numeric.
493 similar to what we had for Numeric.
473
494
474 * IPython/completer.py (IPCompleter.complete): extend the
495 * IPython/completer.py (IPCompleter.complete): extend the
475 complete() call API to support completions by other mechanisms
496 complete() call API to support completions by other mechanisms
476 than readline. Closes #109.
497 than readline. Closes #109.
477
498
478 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
499 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
479 protect against a bug in Python's execfile(). Closes #123.
500 protect against a bug in Python's execfile(). Closes #123.
480
501
481 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
502 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
482
503
483 * IPython/iplib.py (split_user_input): ensure that when splitting
504 * IPython/iplib.py (split_user_input): ensure that when splitting
484 user input, the part that can be treated as a python name is pure
505 user input, the part that can be treated as a python name is pure
485 ascii (Python identifiers MUST be pure ascii). Part of the
506 ascii (Python identifiers MUST be pure ascii). Part of the
486 ongoing Unicode support work.
507 ongoing Unicode support work.
487
508
488 * IPython/Prompts.py (prompt_specials_color): Add \N for the
509 * IPython/Prompts.py (prompt_specials_color): Add \N for the
489 actual prompt number, without any coloring. This allows users to
510 actual prompt number, without any coloring. This allows users to
490 produce numbered prompts with their own colors. Added after a
511 produce numbered prompts with their own colors. Added after a
491 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
512 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
492
513
493 2007-03-31 Walter Doerwald <walter@livinglogic.de>
514 2007-03-31 Walter Doerwald <walter@livinglogic.de>
494
515
495 * IPython/Extensions/igrid.py: Map the return key
516 * IPython/Extensions/igrid.py: Map the return key
496 to enter() and shift-return to enterattr().
517 to enter() and shift-return to enterattr().
497
518
498 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
519 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
499
520
500 * IPython/Magic.py (magic_psearch): add unicode support by
521 * IPython/Magic.py (magic_psearch): add unicode support by
501 encoding to ascii the input, since this routine also only deals
522 encoding to ascii the input, since this routine also only deals
502 with valid Python names. Fixes a bug reported by Stefan.
523 with valid Python names. Fixes a bug reported by Stefan.
503
524
504 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
525 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
505
526
506 * IPython/Magic.py (_inspect): convert unicode input into ascii
527 * IPython/Magic.py (_inspect): convert unicode input into ascii
507 before trying to evaluate it as a Python identifier. This fixes a
528 before trying to evaluate it as a Python identifier. This fixes a
508 problem that the new unicode support had introduced when analyzing
529 problem that the new unicode support had introduced when analyzing
509 long definition lines for functions.
530 long definition lines for functions.
510
531
511 2007-03-24 Walter Doerwald <walter@livinglogic.de>
532 2007-03-24 Walter Doerwald <walter@livinglogic.de>
512
533
513 * IPython/Extensions/igrid.py: Fix picking. Using
534 * IPython/Extensions/igrid.py: Fix picking. Using
514 igrid with wxPython 2.6 and -wthread should work now.
535 igrid with wxPython 2.6 and -wthread should work now.
515 igrid.display() simply tries to create a frame without
536 igrid.display() simply tries to create a frame without
516 an application. Only if this fails an application is created.
537 an application. Only if this fails an application is created.
517
538
518 2007-03-23 Walter Doerwald <walter@livinglogic.de>
539 2007-03-23 Walter Doerwald <walter@livinglogic.de>
519
540
520 * IPython/Extensions/path.py: Updated to version 2.2.
541 * IPython/Extensions/path.py: Updated to version 2.2.
521
542
522 2007-03-23 Ville Vainio <vivainio@gmail.com>
543 2007-03-23 Ville Vainio <vivainio@gmail.com>
523
544
524 * iplib.py: recursive alias expansion now works better, so that
545 * iplib.py: recursive alias expansion now works better, so that
525 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
546 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
526 doesn't trip up the process, if 'd' has been aliased to 'ls'.
547 doesn't trip up the process, if 'd' has been aliased to 'ls'.
527
548
528 * Extensions/ipy_gnuglobal.py added, provides %global magic
549 * Extensions/ipy_gnuglobal.py added, provides %global magic
529 for users of http://www.gnu.org/software/global
550 for users of http://www.gnu.org/software/global
530
551
531 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
552 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
532 Closes #52. Patch by Stefan van der Walt.
553 Closes #52. Patch by Stefan van der Walt.
533
554
534 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
555 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
535
556
536 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
557 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
537 respect the __file__ attribute when using %run. Thanks to a bug
558 respect the __file__ attribute when using %run. Thanks to a bug
538 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
559 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
539
560
540 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
561 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
541
562
542 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
563 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
543 input. Patch sent by Stefan.
564 input. Patch sent by Stefan.
544
565
545 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
566 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
546 * IPython/Extensions/ipy_stock_completer.py
567 * IPython/Extensions/ipy_stock_completer.py
547 shlex_split, fix bug in shlex_split. len function
568 shlex_split, fix bug in shlex_split. len function
548 call was missing an if statement. Caused shlex_split to
569 call was missing an if statement. Caused shlex_split to
549 sometimes return "" as last element.
570 sometimes return "" as last element.
550
571
551 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
572 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
552
573
553 * IPython/completer.py
574 * IPython/completer.py
554 (IPCompleter.file_matches.single_dir_expand): fix a problem
575 (IPCompleter.file_matches.single_dir_expand): fix a problem
555 reported by Stefan, where directories containign a single subdir
576 reported by Stefan, where directories containign a single subdir
556 would be completed too early.
577 would be completed too early.
557
578
558 * IPython/Shell.py (_load_pylab): Make the execution of 'from
579 * IPython/Shell.py (_load_pylab): Make the execution of 'from
559 pylab import *' when -pylab is given be optional. A new flag,
580 pylab import *' when -pylab is given be optional. A new flag,
560 pylab_import_all controls this behavior, the default is True for
581 pylab_import_all controls this behavior, the default is True for
561 backwards compatibility.
582 backwards compatibility.
562
583
563 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
584 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
564 modified) R. Bernstein's patch for fully syntax highlighted
585 modified) R. Bernstein's patch for fully syntax highlighted
565 tracebacks. The functionality is also available under ultraTB for
586 tracebacks. The functionality is also available under ultraTB for
566 non-ipython users (someone using ultraTB but outside an ipython
587 non-ipython users (someone using ultraTB but outside an ipython
567 session). They can select the color scheme by setting the
588 session). They can select the color scheme by setting the
568 module-level global DEFAULT_SCHEME. The highlight functionality
589 module-level global DEFAULT_SCHEME. The highlight functionality
569 also works when debugging.
590 also works when debugging.
570
591
571 * IPython/genutils.py (IOStream.close): small patch by
592 * IPython/genutils.py (IOStream.close): small patch by
572 R. Bernstein for improved pydb support.
593 R. Bernstein for improved pydb support.
573
594
574 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
595 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
575 DaveS <davls@telus.net> to improve support of debugging under
596 DaveS <davls@telus.net> to improve support of debugging under
576 NTEmacs, including improved pydb behavior.
597 NTEmacs, including improved pydb behavior.
577
598
578 * IPython/Magic.py (magic_prun): Fix saving of profile info for
599 * IPython/Magic.py (magic_prun): Fix saving of profile info for
579 Python 2.5, where the stats object API changed a little. Thanks
600 Python 2.5, where the stats object API changed a little. Thanks
580 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
601 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
581
602
582 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
603 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
583 Pernetty's patch to improve support for (X)Emacs under Win32.
604 Pernetty's patch to improve support for (X)Emacs under Win32.
584
605
585 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
606 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
586
607
587 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
608 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
588 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
609 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
589 a report by Nik Tautenhahn.
610 a report by Nik Tautenhahn.
590
611
591 2007-03-16 Walter Doerwald <walter@livinglogic.de>
612 2007-03-16 Walter Doerwald <walter@livinglogic.de>
592
613
593 * setup.py: Add the igrid help files to the list of data files
614 * setup.py: Add the igrid help files to the list of data files
594 to be installed alongside igrid.
615 to be installed alongside igrid.
595 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
616 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
596 Show the input object of the igrid browser as the window tile.
617 Show the input object of the igrid browser as the window tile.
597 Show the object the cursor is on in the statusbar.
618 Show the object the cursor is on in the statusbar.
598
619
599 2007-03-15 Ville Vainio <vivainio@gmail.com>
620 2007-03-15 Ville Vainio <vivainio@gmail.com>
600
621
601 * Extensions/ipy_stock_completers.py: Fixed exception
622 * Extensions/ipy_stock_completers.py: Fixed exception
602 on mismatching quotes in %run completer. Patch by
623 on mismatching quotes in %run completer. Patch by
603 JοΏ½rgen Stenarson. Closes #127.
624 JοΏ½rgen Stenarson. Closes #127.
604
625
605 2007-03-14 Ville Vainio <vivainio@gmail.com>
626 2007-03-14 Ville Vainio <vivainio@gmail.com>
606
627
607 * Extensions/ext_rehashdir.py: Do not do auto_alias
628 * Extensions/ext_rehashdir.py: Do not do auto_alias
608 in %rehashdir, it clobbers %store'd aliases.
629 in %rehashdir, it clobbers %store'd aliases.
609
630
610 * UserConfig/ipy_profile_sh.py: envpersist.py extension
631 * UserConfig/ipy_profile_sh.py: envpersist.py extension
611 (beefed up %env) imported for sh profile.
632 (beefed up %env) imported for sh profile.
612
633
613 2007-03-10 Walter Doerwald <walter@livinglogic.de>
634 2007-03-10 Walter Doerwald <walter@livinglogic.de>
614
635
615 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
636 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
616 as the default browser.
637 as the default browser.
617 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
638 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
618 As igrid displays all attributes it ever encounters, fetch() (which has
639 As igrid displays all attributes it ever encounters, fetch() (which has
619 been renamed to _fetch()) doesn't have to recalculate the display attributes
640 been renamed to _fetch()) doesn't have to recalculate the display attributes
620 every time a new item is fetched. This should speed up scrolling.
641 every time a new item is fetched. This should speed up scrolling.
621
642
622 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
643 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
623
644
624 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
645 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
625 Schmolck's recently reported tab-completion bug (my previous one
646 Schmolck's recently reported tab-completion bug (my previous one
626 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
647 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
627
648
628 2007-03-09 Walter Doerwald <walter@livinglogic.de>
649 2007-03-09 Walter Doerwald <walter@livinglogic.de>
629
650
630 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
651 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
631 Close help window if exiting igrid.
652 Close help window if exiting igrid.
632
653
633 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
654 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
634
655
635 * IPython/Extensions/ipy_defaults.py: Check if readline is available
656 * IPython/Extensions/ipy_defaults.py: Check if readline is available
636 before calling functions from readline.
657 before calling functions from readline.
637
658
638 2007-03-02 Walter Doerwald <walter@livinglogic.de>
659 2007-03-02 Walter Doerwald <walter@livinglogic.de>
639
660
640 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
661 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
641 igrid is a wxPython-based display object for ipipe. If your system has
662 igrid is a wxPython-based display object for ipipe. If your system has
642 wx installed igrid will be the default display. Without wx ipipe falls
663 wx installed igrid will be the default display. Without wx ipipe falls
643 back to ibrowse (which needs curses). If no curses is installed ipipe
664 back to ibrowse (which needs curses). If no curses is installed ipipe
644 falls back to idump.
665 falls back to idump.
645
666
646 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
667 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
647
668
648 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
669 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
649 my changes from yesterday, they introduced bugs. Will reactivate
670 my changes from yesterday, they introduced bugs. Will reactivate
650 once I get a correct solution, which will be much easier thanks to
671 once I get a correct solution, which will be much easier thanks to
651 Dan Milstein's new prefilter test suite.
672 Dan Milstein's new prefilter test suite.
652
673
653 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
674 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
654
675
655 * IPython/iplib.py (split_user_input): fix input splitting so we
676 * IPython/iplib.py (split_user_input): fix input splitting so we
656 don't attempt attribute accesses on things that can't possibly be
677 don't attempt attribute accesses on things that can't possibly be
657 valid Python attributes. After a bug report by Alex Schmolck.
678 valid Python attributes. After a bug report by Alex Schmolck.
658 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
679 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
659 %magic with explicit % prefix.
680 %magic with explicit % prefix.
660
681
661 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
682 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
662
683
663 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
684 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
664 avoid a DeprecationWarning from GTK.
685 avoid a DeprecationWarning from GTK.
665
686
666 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
687 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
667
688
668 * IPython/genutils.py (clock): I modified clock() to return total
689 * IPython/genutils.py (clock): I modified clock() to return total
669 time, user+system. This is a more commonly needed metric. I also
690 time, user+system. This is a more commonly needed metric. I also
670 introduced the new clocku/clocks to get only user/system time if
691 introduced the new clocku/clocks to get only user/system time if
671 one wants those instead.
692 one wants those instead.
672
693
673 ***WARNING: API CHANGE*** clock() used to return only user time,
694 ***WARNING: API CHANGE*** clock() used to return only user time,
674 so if you want exactly the same results as before, use clocku
695 so if you want exactly the same results as before, use clocku
675 instead.
696 instead.
676
697
677 2007-02-22 Ville Vainio <vivainio@gmail.com>
698 2007-02-22 Ville Vainio <vivainio@gmail.com>
678
699
679 * IPython/Extensions/ipy_p4.py: Extension for improved
700 * IPython/Extensions/ipy_p4.py: Extension for improved
680 p4 (perforce version control system) experience.
701 p4 (perforce version control system) experience.
681 Adds %p4 magic with p4 command completion and
702 Adds %p4 magic with p4 command completion and
682 automatic -G argument (marshall output as python dict)
703 automatic -G argument (marshall output as python dict)
683
704
684 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
705 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
685
706
686 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
707 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
687 stop marks.
708 stop marks.
688 (ClearingMixin): a simple mixin to easily make a Demo class clear
709 (ClearingMixin): a simple mixin to easily make a Demo class clear
689 the screen in between blocks and have empty marquees. The
710 the screen in between blocks and have empty marquees. The
690 ClearDemo and ClearIPDemo classes that use it are included.
711 ClearDemo and ClearIPDemo classes that use it are included.
691
712
692 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
713 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
693
714
694 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
715 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
695 protect against exceptions at Python shutdown time. Patch
716 protect against exceptions at Python shutdown time. Patch
696 sumbmitted to upstream.
717 sumbmitted to upstream.
697
718
698 2007-02-14 Walter Doerwald <walter@livinglogic.de>
719 2007-02-14 Walter Doerwald <walter@livinglogic.de>
699
720
700 * IPython/Extensions/ibrowse.py: If entering the first object level
721 * IPython/Extensions/ibrowse.py: If entering the first object level
701 (i.e. the object for which the browser has been started) fails,
722 (i.e. the object for which the browser has been started) fails,
702 now the error is raised directly (aborting the browser) instead of
723 now the error is raised directly (aborting the browser) instead of
703 running into an empty levels list later.
724 running into an empty levels list later.
704
725
705 2007-02-03 Walter Doerwald <walter@livinglogic.de>
726 2007-02-03 Walter Doerwald <walter@livinglogic.de>
706
727
707 * IPython/Extensions/ipipe.py: Add an xrepr implementation
728 * IPython/Extensions/ipipe.py: Add an xrepr implementation
708 for the noitem object.
729 for the noitem object.
709
730
710 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
731 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
711
732
712 * IPython/completer.py (Completer.attr_matches): Fix small
733 * IPython/completer.py (Completer.attr_matches): Fix small
713 tab-completion bug with Enthought Traits objects with units.
734 tab-completion bug with Enthought Traits objects with units.
714 Thanks to a bug report by Tom Denniston
735 Thanks to a bug report by Tom Denniston
715 <tom.denniston-AT-alum.dartmouth.org>.
736 <tom.denniston-AT-alum.dartmouth.org>.
716
737
717 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
738 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
718
739
719 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
740 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
720 bug where only .ipy or .py would be completed. Once the first
741 bug where only .ipy or .py would be completed. Once the first
721 argument to %run has been given, all completions are valid because
742 argument to %run has been given, all completions are valid because
722 they are the arguments to the script, which may well be non-python
743 they are the arguments to the script, which may well be non-python
723 filenames.
744 filenames.
724
745
725 * IPython/irunner.py (InteractiveRunner.run_source): major updates
746 * IPython/irunner.py (InteractiveRunner.run_source): major updates
726 to irunner to allow it to correctly support real doctesting of
747 to irunner to allow it to correctly support real doctesting of
727 out-of-process ipython code.
748 out-of-process ipython code.
728
749
729 * IPython/Magic.py (magic_cd): Make the setting of the terminal
750 * IPython/Magic.py (magic_cd): Make the setting of the terminal
730 title an option (-noterm_title) because it completely breaks
751 title an option (-noterm_title) because it completely breaks
731 doctesting.
752 doctesting.
732
753
733 * IPython/demo.py: fix IPythonDemo class that was not actually working.
754 * IPython/demo.py: fix IPythonDemo class that was not actually working.
734
755
735 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
756 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
736
757
737 * IPython/irunner.py (main): fix small bug where extensions were
758 * IPython/irunner.py (main): fix small bug where extensions were
738 not being correctly recognized.
759 not being correctly recognized.
739
760
740 2007-01-23 Walter Doerwald <walter@livinglogic.de>
761 2007-01-23 Walter Doerwald <walter@livinglogic.de>
741
762
742 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
763 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
743 a string containing a single line yields the string itself as the
764 a string containing a single line yields the string itself as the
744 only item.
765 only item.
745
766
746 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
767 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
747 object if it's the same as the one on the last level (This avoids
768 object if it's the same as the one on the last level (This avoids
748 infinite recursion for one line strings).
769 infinite recursion for one line strings).
749
770
750 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
771 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
751
772
752 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
773 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
753 all output streams before printing tracebacks. This ensures that
774 all output streams before printing tracebacks. This ensures that
754 user output doesn't end up interleaved with traceback output.
775 user output doesn't end up interleaved with traceback output.
755
776
756 2007-01-10 Ville Vainio <vivainio@gmail.com>
777 2007-01-10 Ville Vainio <vivainio@gmail.com>
757
778
758 * Extensions/envpersist.py: Turbocharged %env that remembers
779 * Extensions/envpersist.py: Turbocharged %env that remembers
759 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
780 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
760 "%env VISUAL=jed".
781 "%env VISUAL=jed".
761
782
762 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
783 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
763
784
764 * IPython/iplib.py (showtraceback): ensure that we correctly call
785 * IPython/iplib.py (showtraceback): ensure that we correctly call
765 custom handlers in all cases (some with pdb were slipping through,
786 custom handlers in all cases (some with pdb were slipping through,
766 but I'm not exactly sure why).
787 but I'm not exactly sure why).
767
788
768 * IPython/Debugger.py (Tracer.__init__): added new class to
789 * IPython/Debugger.py (Tracer.__init__): added new class to
769 support set_trace-like usage of IPython's enhanced debugger.
790 support set_trace-like usage of IPython's enhanced debugger.
770
791
771 2006-12-24 Ville Vainio <vivainio@gmail.com>
792 2006-12-24 Ville Vainio <vivainio@gmail.com>
772
793
773 * ipmaker.py: more informative message when ipy_user_conf
794 * ipmaker.py: more informative message when ipy_user_conf
774 import fails (suggest running %upgrade).
795 import fails (suggest running %upgrade).
775
796
776 * tools/run_ipy_in_profiler.py: Utility to see where
797 * tools/run_ipy_in_profiler.py: Utility to see where
777 the time during IPython startup is spent.
798 the time during IPython startup is spent.
778
799
779 2006-12-20 Ville Vainio <vivainio@gmail.com>
800 2006-12-20 Ville Vainio <vivainio@gmail.com>
780
801
781 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
802 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
782
803
783 * ipapi.py: Add new ipapi method, expand_alias.
804 * ipapi.py: Add new ipapi method, expand_alias.
784
805
785 * Release.py: Bump up version to 0.7.4.svn
806 * Release.py: Bump up version to 0.7.4.svn
786
807
787 2006-12-17 Ville Vainio <vivainio@gmail.com>
808 2006-12-17 Ville Vainio <vivainio@gmail.com>
788
809
789 * Extensions/jobctrl.py: Fixed &cmd arg arg...
810 * Extensions/jobctrl.py: Fixed &cmd arg arg...
790 to work properly on posix too
811 to work properly on posix too
791
812
792 * Release.py: Update revnum (version is still just 0.7.3).
813 * Release.py: Update revnum (version is still just 0.7.3).
793
814
794 2006-12-15 Ville Vainio <vivainio@gmail.com>
815 2006-12-15 Ville Vainio <vivainio@gmail.com>
795
816
796 * scripts/ipython_win_post_install: create ipython.py in
817 * scripts/ipython_win_post_install: create ipython.py in
797 prefix + "/scripts".
818 prefix + "/scripts".
798
819
799 * Release.py: Update version to 0.7.3.
820 * Release.py: Update version to 0.7.3.
800
821
801 2006-12-14 Ville Vainio <vivainio@gmail.com>
822 2006-12-14 Ville Vainio <vivainio@gmail.com>
802
823
803 * scripts/ipython_win_post_install: Overwrite old shortcuts
824 * scripts/ipython_win_post_install: Overwrite old shortcuts
804 if they already exist
825 if they already exist
805
826
806 * Release.py: release 0.7.3rc2
827 * Release.py: release 0.7.3rc2
807
828
808 2006-12-13 Ville Vainio <vivainio@gmail.com>
829 2006-12-13 Ville Vainio <vivainio@gmail.com>
809
830
810 * Branch and update Release.py for 0.7.3rc1
831 * Branch and update Release.py for 0.7.3rc1
811
832
812 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
833 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
813
834
814 * IPython/Shell.py (IPShellWX): update for current WX naming
835 * IPython/Shell.py (IPShellWX): update for current WX naming
815 conventions, to avoid a deprecation warning with current WX
836 conventions, to avoid a deprecation warning with current WX
816 versions. Thanks to a report by Danny Shevitz.
837 versions. Thanks to a report by Danny Shevitz.
817
838
818 2006-12-12 Ville Vainio <vivainio@gmail.com>
839 2006-12-12 Ville Vainio <vivainio@gmail.com>
819
840
820 * ipmaker.py: apply david cournapeau's patch to make
841 * ipmaker.py: apply david cournapeau's patch to make
821 import_some work properly even when ipythonrc does
842 import_some work properly even when ipythonrc does
822 import_some on empty list (it was an old bug!).
843 import_some on empty list (it was an old bug!).
823
844
824 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
845 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
825 Add deprecation note to ipythonrc and a url to wiki
846 Add deprecation note to ipythonrc and a url to wiki
826 in ipy_user_conf.py
847 in ipy_user_conf.py
827
848
828
849
829 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
850 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
830 as if it was typed on IPython command prompt, i.e.
851 as if it was typed on IPython command prompt, i.e.
831 as IPython script.
852 as IPython script.
832
853
833 * example-magic.py, magic_grepl.py: remove outdated examples
854 * example-magic.py, magic_grepl.py: remove outdated examples
834
855
835 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
856 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
836
857
837 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
858 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
838 is called before any exception has occurred.
859 is called before any exception has occurred.
839
860
840 2006-12-08 Ville Vainio <vivainio@gmail.com>
861 2006-12-08 Ville Vainio <vivainio@gmail.com>
841
862
842 * Extensions/ipy_stock_completers.py: fix cd completer
863 * Extensions/ipy_stock_completers.py: fix cd completer
843 to translate /'s to \'s again.
864 to translate /'s to \'s again.
844
865
845 * completer.py: prevent traceback on file completions w/
866 * completer.py: prevent traceback on file completions w/
846 backslash.
867 backslash.
847
868
848 * Release.py: Update release number to 0.7.3b3 for release
869 * Release.py: Update release number to 0.7.3b3 for release
849
870
850 2006-12-07 Ville Vainio <vivainio@gmail.com>
871 2006-12-07 Ville Vainio <vivainio@gmail.com>
851
872
852 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
873 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
853 while executing external code. Provides more shell-like behaviour
874 while executing external code. Provides more shell-like behaviour
854 and overall better response to ctrl + C / ctrl + break.
875 and overall better response to ctrl + C / ctrl + break.
855
876
856 * tools/make_tarball.py: new script to create tarball straight from svn
877 * tools/make_tarball.py: new script to create tarball straight from svn
857 (setup.py sdist doesn't work on win32).
878 (setup.py sdist doesn't work on win32).
858
879
859 * Extensions/ipy_stock_completers.py: fix cd completer to give up
880 * Extensions/ipy_stock_completers.py: fix cd completer to give up
860 on dirnames with spaces and use the default completer instead.
881 on dirnames with spaces and use the default completer instead.
861
882
862 * Revision.py: Change version to 0.7.3b2 for release.
883 * Revision.py: Change version to 0.7.3b2 for release.
863
884
864 2006-12-05 Ville Vainio <vivainio@gmail.com>
885 2006-12-05 Ville Vainio <vivainio@gmail.com>
865
886
866 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
887 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
867 pydb patch 4 (rm debug printing, py 2.5 checking)
888 pydb patch 4 (rm debug printing, py 2.5 checking)
868
889
869 2006-11-30 Walter Doerwald <walter@livinglogic.de>
890 2006-11-30 Walter Doerwald <walter@livinglogic.de>
870 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
891 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
871 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
892 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
872 "refreshfind" (mapped to "R") does the same but tries to go back to the same
893 "refreshfind" (mapped to "R") does the same but tries to go back to the same
873 object the cursor was on before the refresh. The command "markrange" is
894 object the cursor was on before the refresh. The command "markrange" is
874 mapped to "%" now.
895 mapped to "%" now.
875 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
896 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
876
897
877 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
898 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
878
899
879 * IPython/Magic.py (magic_debug): new %debug magic to activate the
900 * IPython/Magic.py (magic_debug): new %debug magic to activate the
880 interactive debugger on the last traceback, without having to call
901 interactive debugger on the last traceback, without having to call
881 %pdb and rerun your code. Made minor changes in various modules,
902 %pdb and rerun your code. Made minor changes in various modules,
882 should automatically recognize pydb if available.
903 should automatically recognize pydb if available.
883
904
884 2006-11-28 Ville Vainio <vivainio@gmail.com>
905 2006-11-28 Ville Vainio <vivainio@gmail.com>
885
906
886 * completer.py: If the text start with !, show file completions
907 * completer.py: If the text start with !, show file completions
887 properly. This helps when trying to complete command name
908 properly. This helps when trying to complete command name
888 for shell escapes.
909 for shell escapes.
889
910
890 2006-11-27 Ville Vainio <vivainio@gmail.com>
911 2006-11-27 Ville Vainio <vivainio@gmail.com>
891
912
892 * ipy_stock_completers.py: bzr completer submitted by Stefan van
913 * ipy_stock_completers.py: bzr completer submitted by Stefan van
893 der Walt. Clean up svn and hg completers by using a common
914 der Walt. Clean up svn and hg completers by using a common
894 vcs_completer.
915 vcs_completer.
895
916
896 2006-11-26 Ville Vainio <vivainio@gmail.com>
917 2006-11-26 Ville Vainio <vivainio@gmail.com>
897
918
898 * Remove ipconfig and %config; you should use _ip.options structure
919 * Remove ipconfig and %config; you should use _ip.options structure
899 directly instead!
920 directly instead!
900
921
901 * genutils.py: add wrap_deprecated function for deprecating callables
922 * genutils.py: add wrap_deprecated function for deprecating callables
902
923
903 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
924 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
904 _ip.system instead. ipalias is redundant.
925 _ip.system instead. ipalias is redundant.
905
926
906 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
927 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
907 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
928 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
908 explicit.
929 explicit.
909
930
910 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
931 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
911 completer. Try it by entering 'hg ' and pressing tab.
932 completer. Try it by entering 'hg ' and pressing tab.
912
933
913 * macro.py: Give Macro a useful __repr__ method
934 * macro.py: Give Macro a useful __repr__ method
914
935
915 * Magic.py: %whos abbreviates the typename of Macro for brevity.
936 * Magic.py: %whos abbreviates the typename of Macro for brevity.
916
937
917 2006-11-24 Walter Doerwald <walter@livinglogic.de>
938 2006-11-24 Walter Doerwald <walter@livinglogic.de>
918 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
939 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
919 we don't get a duplicate ipipe module, where registration of the xrepr
940 we don't get a duplicate ipipe module, where registration of the xrepr
920 implementation for Text is useless.
941 implementation for Text is useless.
921
942
922 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
943 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
923
944
924 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
945 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
925
946
926 2006-11-24 Ville Vainio <vivainio@gmail.com>
947 2006-11-24 Ville Vainio <vivainio@gmail.com>
927
948
928 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
949 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
929 try to use "cProfile" instead of the slower pure python
950 try to use "cProfile" instead of the slower pure python
930 "profile"
951 "profile"
931
952
932 2006-11-23 Ville Vainio <vivainio@gmail.com>
953 2006-11-23 Ville Vainio <vivainio@gmail.com>
933
954
934 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
955 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
935 Qt+IPython+Designer link in documentation.
956 Qt+IPython+Designer link in documentation.
936
957
937 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
958 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
938 correct Pdb object to %pydb.
959 correct Pdb object to %pydb.
939
960
940
961
941 2006-11-22 Walter Doerwald <walter@livinglogic.de>
962 2006-11-22 Walter Doerwald <walter@livinglogic.de>
942 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
963 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
943 generic xrepr(), otherwise the list implementation would kick in.
964 generic xrepr(), otherwise the list implementation would kick in.
944
965
945 2006-11-21 Ville Vainio <vivainio@gmail.com>
966 2006-11-21 Ville Vainio <vivainio@gmail.com>
946
967
947 * upgrade_dir.py: Now actually overwrites a nonmodified user file
968 * upgrade_dir.py: Now actually overwrites a nonmodified user file
948 with one from UserConfig.
969 with one from UserConfig.
949
970
950 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
971 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
951 it was missing which broke the sh profile.
972 it was missing which broke the sh profile.
952
973
953 * completer.py: file completer now uses explicit '/' instead
974 * completer.py: file completer now uses explicit '/' instead
954 of os.path.join, expansion of 'foo' was broken on win32
975 of os.path.join, expansion of 'foo' was broken on win32
955 if there was one directory with name 'foobar'.
976 if there was one directory with name 'foobar'.
956
977
957 * A bunch of patches from Kirill Smelkov:
978 * A bunch of patches from Kirill Smelkov:
958
979
959 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
980 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
960
981
961 * [patch 7/9] Implement %page -r (page in raw mode) -
982 * [patch 7/9] Implement %page -r (page in raw mode) -
962
983
963 * [patch 5/9] ScientificPython webpage has moved
984 * [patch 5/9] ScientificPython webpage has moved
964
985
965 * [patch 4/9] The manual mentions %ds, should be %dhist
986 * [patch 4/9] The manual mentions %ds, should be %dhist
966
987
967 * [patch 3/9] Kill old bits from %prun doc.
988 * [patch 3/9] Kill old bits from %prun doc.
968
989
969 * [patch 1/9] Fix typos here and there.
990 * [patch 1/9] Fix typos here and there.
970
991
971 2006-11-08 Ville Vainio <vivainio@gmail.com>
992 2006-11-08 Ville Vainio <vivainio@gmail.com>
972
993
973 * completer.py (attr_matches): catch all exceptions raised
994 * completer.py (attr_matches): catch all exceptions raised
974 by eval of expr with dots.
995 by eval of expr with dots.
975
996
976 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
997 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
977
998
978 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
999 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
979 input if it starts with whitespace. This allows you to paste
1000 input if it starts with whitespace. This allows you to paste
980 indented input from any editor without manually having to type in
1001 indented input from any editor without manually having to type in
981 the 'if 1:', which is convenient when working interactively.
1002 the 'if 1:', which is convenient when working interactively.
982 Slightly modifed version of a patch by Bo Peng
1003 Slightly modifed version of a patch by Bo Peng
983 <bpeng-AT-rice.edu>.
1004 <bpeng-AT-rice.edu>.
984
1005
985 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1006 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
986
1007
987 * IPython/irunner.py (main): modified irunner so it automatically
1008 * IPython/irunner.py (main): modified irunner so it automatically
988 recognizes the right runner to use based on the extension (.py for
1009 recognizes the right runner to use based on the extension (.py for
989 python, .ipy for ipython and .sage for sage).
1010 python, .ipy for ipython and .sage for sage).
990
1011
991 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1012 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
992 visible in ipapi as ip.config(), to programatically control the
1013 visible in ipapi as ip.config(), to programatically control the
993 internal rc object. There's an accompanying %config magic for
1014 internal rc object. There's an accompanying %config magic for
994 interactive use, which has been enhanced to match the
1015 interactive use, which has been enhanced to match the
995 funtionality in ipconfig.
1016 funtionality in ipconfig.
996
1017
997 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1018 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
998 so it's not just a toggle, it now takes an argument. Add support
1019 so it's not just a toggle, it now takes an argument. Add support
999 for a customizable header when making system calls, as the new
1020 for a customizable header when making system calls, as the new
1000 system_header variable in the ipythonrc file.
1021 system_header variable in the ipythonrc file.
1001
1022
1002 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1023 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1003
1024
1004 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1025 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1005 generic functions (using Philip J. Eby's simplegeneric package).
1026 generic functions (using Philip J. Eby's simplegeneric package).
1006 This makes it possible to customize the display of third-party classes
1027 This makes it possible to customize the display of third-party classes
1007 without having to monkeypatch them. xiter() no longer supports a mode
1028 without having to monkeypatch them. xiter() no longer supports a mode
1008 argument and the XMode class has been removed. The same functionality can
1029 argument and the XMode class has been removed. The same functionality can
1009 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1030 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1010 One consequence of the switch to generic functions is that xrepr() and
1031 One consequence of the switch to generic functions is that xrepr() and
1011 xattrs() implementation must define the default value for the mode
1032 xattrs() implementation must define the default value for the mode
1012 argument themselves and xattrs() implementations must return real
1033 argument themselves and xattrs() implementations must return real
1013 descriptors.
1034 descriptors.
1014
1035
1015 * IPython/external: This new subpackage will contain all third-party
1036 * IPython/external: This new subpackage will contain all third-party
1016 packages that are bundled with IPython. (The first one is simplegeneric).
1037 packages that are bundled with IPython. (The first one is simplegeneric).
1017
1038
1018 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1039 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1019 directory which as been dropped in r1703.
1040 directory which as been dropped in r1703.
1020
1041
1021 * IPython/Extensions/ipipe.py (iless): Fixed.
1042 * IPython/Extensions/ipipe.py (iless): Fixed.
1022
1043
1023 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1044 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1024
1045
1025 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1046 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1026
1047
1027 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1048 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1028 handling in variable expansion so that shells and magics recognize
1049 handling in variable expansion so that shells and magics recognize
1029 function local scopes correctly. Bug reported by Brian.
1050 function local scopes correctly. Bug reported by Brian.
1030
1051
1031 * scripts/ipython: remove the very first entry in sys.path which
1052 * scripts/ipython: remove the very first entry in sys.path which
1032 Python auto-inserts for scripts, so that sys.path under IPython is
1053 Python auto-inserts for scripts, so that sys.path under IPython is
1033 as similar as possible to that under plain Python.
1054 as similar as possible to that under plain Python.
1034
1055
1035 * IPython/completer.py (IPCompleter.file_matches): Fix
1056 * IPython/completer.py (IPCompleter.file_matches): Fix
1036 tab-completion so that quotes are not closed unless the completion
1057 tab-completion so that quotes are not closed unless the completion
1037 is unambiguous. After a request by Stefan. Minor cleanups in
1058 is unambiguous. After a request by Stefan. Minor cleanups in
1038 ipy_stock_completers.
1059 ipy_stock_completers.
1039
1060
1040 2006-11-02 Ville Vainio <vivainio@gmail.com>
1061 2006-11-02 Ville Vainio <vivainio@gmail.com>
1041
1062
1042 * ipy_stock_completers.py: Add %run and %cd completers.
1063 * ipy_stock_completers.py: Add %run and %cd completers.
1043
1064
1044 * completer.py: Try running custom completer for both
1065 * completer.py: Try running custom completer for both
1045 "foo" and "%foo" if the command is just "foo". Ignore case
1066 "foo" and "%foo" if the command is just "foo". Ignore case
1046 when filtering possible completions.
1067 when filtering possible completions.
1047
1068
1048 * UserConfig/ipy_user_conf.py: install stock completers as default
1069 * UserConfig/ipy_user_conf.py: install stock completers as default
1049
1070
1050 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1071 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1051 simplified readline history save / restore through a wrapper
1072 simplified readline history save / restore through a wrapper
1052 function
1073 function
1053
1074
1054
1075
1055 2006-10-31 Ville Vainio <vivainio@gmail.com>
1076 2006-10-31 Ville Vainio <vivainio@gmail.com>
1056
1077
1057 * strdispatch.py, completer.py, ipy_stock_completers.py:
1078 * strdispatch.py, completer.py, ipy_stock_completers.py:
1058 Allow str_key ("command") in completer hooks. Implement
1079 Allow str_key ("command") in completer hooks. Implement
1059 trivial completer for 'import' (stdlib modules only). Rename
1080 trivial completer for 'import' (stdlib modules only). Rename
1060 ipy_linux_package_managers.py to ipy_stock_completers.py.
1081 ipy_linux_package_managers.py to ipy_stock_completers.py.
1061 SVN completer.
1082 SVN completer.
1062
1083
1063 * Extensions/ledit.py: %magic line editor for easily and
1084 * Extensions/ledit.py: %magic line editor for easily and
1064 incrementally manipulating lists of strings. The magic command
1085 incrementally manipulating lists of strings. The magic command
1065 name is %led.
1086 name is %led.
1066
1087
1067 2006-10-30 Ville Vainio <vivainio@gmail.com>
1088 2006-10-30 Ville Vainio <vivainio@gmail.com>
1068
1089
1069 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1090 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1070 Bernsteins's patches for pydb integration.
1091 Bernsteins's patches for pydb integration.
1071 http://bashdb.sourceforge.net/pydb/
1092 http://bashdb.sourceforge.net/pydb/
1072
1093
1073 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1094 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1074 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1095 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1075 custom completer hook to allow the users to implement their own
1096 custom completer hook to allow the users to implement their own
1076 completers. See ipy_linux_package_managers.py for example. The
1097 completers. See ipy_linux_package_managers.py for example. The
1077 hook name is 'complete_command'.
1098 hook name is 'complete_command'.
1078
1099
1079 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1100 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1080
1101
1081 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1102 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1082 Numeric leftovers.
1103 Numeric leftovers.
1083
1104
1084 * ipython.el (py-execute-region): apply Stefan's patch to fix
1105 * ipython.el (py-execute-region): apply Stefan's patch to fix
1085 garbled results if the python shell hasn't been previously started.
1106 garbled results if the python shell hasn't been previously started.
1086
1107
1087 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1108 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1088 pretty generic function and useful for other things.
1109 pretty generic function and useful for other things.
1089
1110
1090 * IPython/OInspect.py (getsource): Add customizable source
1111 * IPython/OInspect.py (getsource): Add customizable source
1091 extractor. After a request/patch form W. Stein (SAGE).
1112 extractor. After a request/patch form W. Stein (SAGE).
1092
1113
1093 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1114 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1094 window size to a more reasonable value from what pexpect does,
1115 window size to a more reasonable value from what pexpect does,
1095 since their choice causes wrapping bugs with long input lines.
1116 since their choice causes wrapping bugs with long input lines.
1096
1117
1097 2006-10-28 Ville Vainio <vivainio@gmail.com>
1118 2006-10-28 Ville Vainio <vivainio@gmail.com>
1098
1119
1099 * Magic.py (%run): Save and restore the readline history from
1120 * Magic.py (%run): Save and restore the readline history from
1100 file around %run commands to prevent side effects from
1121 file around %run commands to prevent side effects from
1101 %runned programs that might use readline (e.g. pydb).
1122 %runned programs that might use readline (e.g. pydb).
1102
1123
1103 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1124 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1104 invoking the pydb enhanced debugger.
1125 invoking the pydb enhanced debugger.
1105
1126
1106 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1127 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1107
1128
1108 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1129 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1109 call the base class method and propagate the return value to
1130 call the base class method and propagate the return value to
1110 ifile. This is now done by path itself.
1131 ifile. This is now done by path itself.
1111
1132
1112 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1133 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1113
1134
1114 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1135 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1115 api: set_crash_handler(), to expose the ability to change the
1136 api: set_crash_handler(), to expose the ability to change the
1116 internal crash handler.
1137 internal crash handler.
1117
1138
1118 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1139 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1119 the various parameters of the crash handler so that apps using
1140 the various parameters of the crash handler so that apps using
1120 IPython as their engine can customize crash handling. Ipmlemented
1141 IPython as their engine can customize crash handling. Ipmlemented
1121 at the request of SAGE.
1142 at the request of SAGE.
1122
1143
1123 2006-10-14 Ville Vainio <vivainio@gmail.com>
1144 2006-10-14 Ville Vainio <vivainio@gmail.com>
1124
1145
1125 * Magic.py, ipython.el: applied first "safe" part of Rocky
1146 * Magic.py, ipython.el: applied first "safe" part of Rocky
1126 Bernstein's patch set for pydb integration.
1147 Bernstein's patch set for pydb integration.
1127
1148
1128 * Magic.py (%unalias, %alias): %store'd aliases can now be
1149 * Magic.py (%unalias, %alias): %store'd aliases can now be
1129 removed with '%unalias'. %alias w/o args now shows most
1150 removed with '%unalias'. %alias w/o args now shows most
1130 interesting (stored / manually defined) aliases last
1151 interesting (stored / manually defined) aliases last
1131 where they catch the eye w/o scrolling.
1152 where they catch the eye w/o scrolling.
1132
1153
1133 * Magic.py (%rehashx), ext_rehashdir.py: files with
1154 * Magic.py (%rehashx), ext_rehashdir.py: files with
1134 'py' extension are always considered executable, even
1155 'py' extension are always considered executable, even
1135 when not in PATHEXT environment variable.
1156 when not in PATHEXT environment variable.
1136
1157
1137 2006-10-12 Ville Vainio <vivainio@gmail.com>
1158 2006-10-12 Ville Vainio <vivainio@gmail.com>
1138
1159
1139 * jobctrl.py: Add new "jobctrl" extension for spawning background
1160 * jobctrl.py: Add new "jobctrl" extension for spawning background
1140 processes with "&find /". 'import jobctrl' to try it out. Requires
1161 processes with "&find /". 'import jobctrl' to try it out. Requires
1141 'subprocess' module, standard in python 2.4+.
1162 'subprocess' module, standard in python 2.4+.
1142
1163
1143 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1164 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1144 so if foo -> bar and bar -> baz, then foo -> baz.
1165 so if foo -> bar and bar -> baz, then foo -> baz.
1145
1166
1146 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1167 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1147
1168
1148 * IPython/Magic.py (Magic.parse_options): add a new posix option
1169 * IPython/Magic.py (Magic.parse_options): add a new posix option
1149 to allow parsing of input args in magics that doesn't strip quotes
1170 to allow parsing of input args in magics that doesn't strip quotes
1150 (if posix=False). This also closes %timeit bug reported by
1171 (if posix=False). This also closes %timeit bug reported by
1151 Stefan.
1172 Stefan.
1152
1173
1153 2006-10-03 Ville Vainio <vivainio@gmail.com>
1174 2006-10-03 Ville Vainio <vivainio@gmail.com>
1154
1175
1155 * iplib.py (raw_input, interact): Return ValueError catching for
1176 * iplib.py (raw_input, interact): Return ValueError catching for
1156 raw_input. Fixes infinite loop for sys.stdin.close() or
1177 raw_input. Fixes infinite loop for sys.stdin.close() or
1157 sys.stdout.close().
1178 sys.stdout.close().
1158
1179
1159 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1180 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1160
1181
1161 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1182 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1162 to help in handling doctests. irunner is now pretty useful for
1183 to help in handling doctests. irunner is now pretty useful for
1163 running standalone scripts and simulate a full interactive session
1184 running standalone scripts and simulate a full interactive session
1164 in a format that can be then pasted as a doctest.
1185 in a format that can be then pasted as a doctest.
1165
1186
1166 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1187 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1167 on top of the default (useless) ones. This also fixes the nasty
1188 on top of the default (useless) ones. This also fixes the nasty
1168 way in which 2.5's Quitter() exits (reverted [1785]).
1189 way in which 2.5's Quitter() exits (reverted [1785]).
1169
1190
1170 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1191 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1171 2.5.
1192 2.5.
1172
1193
1173 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1194 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1174 color scheme is updated as well when color scheme is changed
1195 color scheme is updated as well when color scheme is changed
1175 interactively.
1196 interactively.
1176
1197
1177 2006-09-27 Ville Vainio <vivainio@gmail.com>
1198 2006-09-27 Ville Vainio <vivainio@gmail.com>
1178
1199
1179 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1200 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1180 infinite loop and just exit. It's a hack, but will do for a while.
1201 infinite loop and just exit. It's a hack, but will do for a while.
1181
1202
1182 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1203 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1183
1204
1184 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1205 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1185 the constructor, this makes it possible to get a list of only directories
1206 the constructor, this makes it possible to get a list of only directories
1186 or only files.
1207 or only files.
1187
1208
1188 2006-08-12 Ville Vainio <vivainio@gmail.com>
1209 2006-08-12 Ville Vainio <vivainio@gmail.com>
1189
1210
1190 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1211 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1191 they broke unittest
1212 they broke unittest
1192
1213
1193 2006-08-11 Ville Vainio <vivainio@gmail.com>
1214 2006-08-11 Ville Vainio <vivainio@gmail.com>
1194
1215
1195 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1216 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1196 by resolving issue properly, i.e. by inheriting FakeModule
1217 by resolving issue properly, i.e. by inheriting FakeModule
1197 from types.ModuleType. Pickling ipython interactive data
1218 from types.ModuleType. Pickling ipython interactive data
1198 should still work as usual (testing appreciated).
1219 should still work as usual (testing appreciated).
1199
1220
1200 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1221 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1201
1222
1202 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1223 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1203 running under python 2.3 with code from 2.4 to fix a bug with
1224 running under python 2.3 with code from 2.4 to fix a bug with
1204 help(). Reported by the Debian maintainers, Norbert Tretkowski
1225 help(). Reported by the Debian maintainers, Norbert Tretkowski
1205 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1226 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1206 <afayolle-AT-debian.org>.
1227 <afayolle-AT-debian.org>.
1207
1228
1208 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1229 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1209
1230
1210 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1231 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1211 (which was displaying "quit" twice).
1232 (which was displaying "quit" twice).
1212
1233
1213 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1234 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1214
1235
1215 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1236 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1216 the mode argument).
1237 the mode argument).
1217
1238
1218 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1239 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1219
1240
1220 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1241 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1221 not running under IPython.
1242 not running under IPython.
1222
1243
1223 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1244 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1224 and make it iterable (iterating over the attribute itself). Add two new
1245 and make it iterable (iterating over the attribute itself). Add two new
1225 magic strings for __xattrs__(): If the string starts with "-", the attribute
1246 magic strings for __xattrs__(): If the string starts with "-", the attribute
1226 will not be displayed in ibrowse's detail view (but it can still be
1247 will not be displayed in ibrowse's detail view (but it can still be
1227 iterated over). This makes it possible to add attributes that are large
1248 iterated over). This makes it possible to add attributes that are large
1228 lists or generator methods to the detail view. Replace magic attribute names
1249 lists or generator methods to the detail view. Replace magic attribute names
1229 and _attrname() and _getattr() with "descriptors": For each type of magic
1250 and _attrname() and _getattr() with "descriptors": For each type of magic
1230 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1251 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1231 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1252 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1232 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1253 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1233 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1254 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1234 are still supported.
1255 are still supported.
1235
1256
1236 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1257 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1237 fails in ibrowse.fetch(), the exception object is added as the last item
1258 fails in ibrowse.fetch(), the exception object is added as the last item
1238 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1259 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1239 a generator throws an exception midway through execution.
1260 a generator throws an exception midway through execution.
1240
1261
1241 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1262 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1242 encoding into methods.
1263 encoding into methods.
1243
1264
1244 2006-07-26 Ville Vainio <vivainio@gmail.com>
1265 2006-07-26 Ville Vainio <vivainio@gmail.com>
1245
1266
1246 * iplib.py: history now stores multiline input as single
1267 * iplib.py: history now stores multiline input as single
1247 history entries. Patch by Jorgen Cederlof.
1268 history entries. Patch by Jorgen Cederlof.
1248
1269
1249 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1270 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1250
1271
1251 * IPython/Extensions/ibrowse.py: Make cursor visible over
1272 * IPython/Extensions/ibrowse.py: Make cursor visible over
1252 non existing attributes.
1273 non existing attributes.
1253
1274
1254 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1275 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1255
1276
1256 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1277 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1257 error output of the running command doesn't mess up the screen.
1278 error output of the running command doesn't mess up the screen.
1258
1279
1259 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1280 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1260
1281
1261 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1282 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1262 argument. This sorts the items themselves.
1283 argument. This sorts the items themselves.
1263
1284
1264 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1285 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1265
1286
1266 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1287 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1267 Compile expression strings into code objects. This should speed
1288 Compile expression strings into code objects. This should speed
1268 up ifilter and friends somewhat.
1289 up ifilter and friends somewhat.
1269
1290
1270 2006-07-08 Ville Vainio <vivainio@gmail.com>
1291 2006-07-08 Ville Vainio <vivainio@gmail.com>
1271
1292
1272 * Magic.py: %cpaste now strips > from the beginning of lines
1293 * Magic.py: %cpaste now strips > from the beginning of lines
1273 to ease pasting quoted code from emails. Contributed by
1294 to ease pasting quoted code from emails. Contributed by
1274 Stefan van der Walt.
1295 Stefan van der Walt.
1275
1296
1276 2006-06-29 Ville Vainio <vivainio@gmail.com>
1297 2006-06-29 Ville Vainio <vivainio@gmail.com>
1277
1298
1278 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1299 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1279 mode, patch contributed by Darren Dale. NEEDS TESTING!
1300 mode, patch contributed by Darren Dale. NEEDS TESTING!
1280
1301
1281 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1302 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1282
1303
1283 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1304 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1284 a blue background. Fix fetching new display rows when the browser
1305 a blue background. Fix fetching new display rows when the browser
1285 scrolls more than a screenful (e.g. by using the goto command).
1306 scrolls more than a screenful (e.g. by using the goto command).
1286
1307
1287 2006-06-27 Ville Vainio <vivainio@gmail.com>
1308 2006-06-27 Ville Vainio <vivainio@gmail.com>
1288
1309
1289 * Magic.py (_inspect, _ofind) Apply David Huard's
1310 * Magic.py (_inspect, _ofind) Apply David Huard's
1290 patch for displaying the correct docstring for 'property'
1311 patch for displaying the correct docstring for 'property'
1291 attributes.
1312 attributes.
1292
1313
1293 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1314 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1294
1315
1295 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1316 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1296 commands into the methods implementing them.
1317 commands into the methods implementing them.
1297
1318
1298 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1319 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1299
1320
1300 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1321 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1301 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1322 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1302 autoindent support was authored by Jin Liu.
1323 autoindent support was authored by Jin Liu.
1303
1324
1304 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1325 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1305
1326
1306 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1327 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1307 for keymaps with a custom class that simplifies handling.
1328 for keymaps with a custom class that simplifies handling.
1308
1329
1309 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1330 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1310
1331
1311 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1332 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1312 resizing. This requires Python 2.5 to work.
1333 resizing. This requires Python 2.5 to work.
1313
1334
1314 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1335 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1315
1336
1316 * IPython/Extensions/ibrowse.py: Add two new commands to
1337 * IPython/Extensions/ibrowse.py: Add two new commands to
1317 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1338 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1318 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1339 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1319 attributes again. Remapped the help command to "?". Display
1340 attributes again. Remapped the help command to "?". Display
1320 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1341 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1321 as keys for the "home" and "end" commands. Add three new commands
1342 as keys for the "home" and "end" commands. Add three new commands
1322 to the input mode for "find" and friends: "delend" (CTRL-K)
1343 to the input mode for "find" and friends: "delend" (CTRL-K)
1323 deletes to the end of line. "incsearchup" searches upwards in the
1344 deletes to the end of line. "incsearchup" searches upwards in the
1324 command history for an input that starts with the text before the cursor.
1345 command history for an input that starts with the text before the cursor.
1325 "incsearchdown" does the same downwards. Removed a bogus mapping of
1346 "incsearchdown" does the same downwards. Removed a bogus mapping of
1326 the x key to "delete".
1347 the x key to "delete".
1327
1348
1328 2006-06-15 Ville Vainio <vivainio@gmail.com>
1349 2006-06-15 Ville Vainio <vivainio@gmail.com>
1329
1350
1330 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1351 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1331 used to create prompts dynamically, instead of the "old" way of
1352 used to create prompts dynamically, instead of the "old" way of
1332 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1353 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1333 way still works (it's invoked by the default hook), of course.
1354 way still works (it's invoked by the default hook), of course.
1334
1355
1335 * Prompts.py: added generate_output_prompt hook for altering output
1356 * Prompts.py: added generate_output_prompt hook for altering output
1336 prompt
1357 prompt
1337
1358
1338 * Release.py: Changed version string to 0.7.3.svn.
1359 * Release.py: Changed version string to 0.7.3.svn.
1339
1360
1340 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1361 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1341
1362
1342 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1363 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1343 the call to fetch() always tries to fetch enough data for at least one
1364 the call to fetch() always tries to fetch enough data for at least one
1344 full screen. This makes it possible to simply call moveto(0,0,True) in
1365 full screen. This makes it possible to simply call moveto(0,0,True) in
1345 the constructor. Fix typos and removed the obsolete goto attribute.
1366 the constructor. Fix typos and removed the obsolete goto attribute.
1346
1367
1347 2006-06-12 Ville Vainio <vivainio@gmail.com>
1368 2006-06-12 Ville Vainio <vivainio@gmail.com>
1348
1369
1349 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1370 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1350 allowing $variable interpolation within multiline statements,
1371 allowing $variable interpolation within multiline statements,
1351 though so far only with "sh" profile for a testing period.
1372 though so far only with "sh" profile for a testing period.
1352 The patch also enables splitting long commands with \ but it
1373 The patch also enables splitting long commands with \ but it
1353 doesn't work properly yet.
1374 doesn't work properly yet.
1354
1375
1355 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1376 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1356
1377
1357 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1378 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1358 input history and the position of the cursor in the input history for
1379 input history and the position of the cursor in the input history for
1359 the find, findbackwards and goto command.
1380 the find, findbackwards and goto command.
1360
1381
1361 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1382 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1362
1383
1363 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1384 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1364 implements the basic functionality of browser commands that require
1385 implements the basic functionality of browser commands that require
1365 input. Reimplement the goto, find and findbackwards commands as
1386 input. Reimplement the goto, find and findbackwards commands as
1366 subclasses of _CommandInput. Add an input history and keymaps to those
1387 subclasses of _CommandInput. Add an input history and keymaps to those
1367 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1388 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1368 execute commands.
1389 execute commands.
1369
1390
1370 2006-06-07 Ville Vainio <vivainio@gmail.com>
1391 2006-06-07 Ville Vainio <vivainio@gmail.com>
1371
1392
1372 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1393 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1373 running the batch files instead of leaving the session open.
1394 running the batch files instead of leaving the session open.
1374
1395
1375 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1396 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1376
1397
1377 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1398 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1378 the original fix was incomplete. Patch submitted by W. Maier.
1399 the original fix was incomplete. Patch submitted by W. Maier.
1379
1400
1380 2006-06-07 Ville Vainio <vivainio@gmail.com>
1401 2006-06-07 Ville Vainio <vivainio@gmail.com>
1381
1402
1382 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1403 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1383 Confirmation prompts can be supressed by 'quiet' option.
1404 Confirmation prompts can be supressed by 'quiet' option.
1384 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1405 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1385
1406
1386 2006-06-06 *** Released version 0.7.2
1407 2006-06-06 *** Released version 0.7.2
1387
1408
1388 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1409 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1389
1410
1390 * IPython/Release.py (version): Made 0.7.2 final for release.
1411 * IPython/Release.py (version): Made 0.7.2 final for release.
1391 Repo tagged and release cut.
1412 Repo tagged and release cut.
1392
1413
1393 2006-06-05 Ville Vainio <vivainio@gmail.com>
1414 2006-06-05 Ville Vainio <vivainio@gmail.com>
1394
1415
1395 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1416 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1396 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1417 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1397
1418
1398 * upgrade_dir.py: try import 'path' module a bit harder
1419 * upgrade_dir.py: try import 'path' module a bit harder
1399 (for %upgrade)
1420 (for %upgrade)
1400
1421
1401 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1422 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1402
1423
1403 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1424 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1404 instead of looping 20 times.
1425 instead of looping 20 times.
1405
1426
1406 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1427 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1407 correctly at initialization time. Bug reported by Krishna Mohan
1428 correctly at initialization time. Bug reported by Krishna Mohan
1408 Gundu <gkmohan-AT-gmail.com> on the user list.
1429 Gundu <gkmohan-AT-gmail.com> on the user list.
1409
1430
1410 * IPython/Release.py (version): Mark 0.7.2 version to start
1431 * IPython/Release.py (version): Mark 0.7.2 version to start
1411 testing for release on 06/06.
1432 testing for release on 06/06.
1412
1433
1413 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1434 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1414
1435
1415 * scripts/irunner: thin script interface so users don't have to
1436 * scripts/irunner: thin script interface so users don't have to
1416 find the module and call it as an executable, since modules rarely
1437 find the module and call it as an executable, since modules rarely
1417 live in people's PATH.
1438 live in people's PATH.
1418
1439
1419 * IPython/irunner.py (InteractiveRunner.__init__): added
1440 * IPython/irunner.py (InteractiveRunner.__init__): added
1420 delaybeforesend attribute to control delays with newer versions of
1441 delaybeforesend attribute to control delays with newer versions of
1421 pexpect. Thanks to detailed help from pexpect's author, Noah
1442 pexpect. Thanks to detailed help from pexpect's author, Noah
1422 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1443 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1423 correctly (it works in NoColor mode).
1444 correctly (it works in NoColor mode).
1424
1445
1425 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1446 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1426 SAGE list, from improper log() calls.
1447 SAGE list, from improper log() calls.
1427
1448
1428 2006-05-31 Ville Vainio <vivainio@gmail.com>
1449 2006-05-31 Ville Vainio <vivainio@gmail.com>
1429
1450
1430 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1451 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1431 with args in parens to work correctly with dirs that have spaces.
1452 with args in parens to work correctly with dirs that have spaces.
1432
1453
1433 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1454 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1434
1455
1435 * IPython/Logger.py (Logger.logstart): add option to log raw input
1456 * IPython/Logger.py (Logger.logstart): add option to log raw input
1436 instead of the processed one. A -r flag was added to the
1457 instead of the processed one. A -r flag was added to the
1437 %logstart magic used for controlling logging.
1458 %logstart magic used for controlling logging.
1438
1459
1439 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1460 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1440
1461
1441 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1462 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1442 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1463 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1443 recognize the option. After a bug report by Will Maier. This
1464 recognize the option. After a bug report by Will Maier. This
1444 closes #64 (will do it after confirmation from W. Maier).
1465 closes #64 (will do it after confirmation from W. Maier).
1445
1466
1446 * IPython/irunner.py: New module to run scripts as if manually
1467 * IPython/irunner.py: New module to run scripts as if manually
1447 typed into an interactive environment, based on pexpect. After a
1468 typed into an interactive environment, based on pexpect. After a
1448 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1469 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1449 ipython-user list. Simple unittests in the tests/ directory.
1470 ipython-user list. Simple unittests in the tests/ directory.
1450
1471
1451 * tools/release: add Will Maier, OpenBSD port maintainer, to
1472 * tools/release: add Will Maier, OpenBSD port maintainer, to
1452 recepients list. We are now officially part of the OpenBSD ports:
1473 recepients list. We are now officially part of the OpenBSD ports:
1453 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1474 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1454 work.
1475 work.
1455
1476
1456 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1477 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1457
1478
1458 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1479 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1459 so that it doesn't break tkinter apps.
1480 so that it doesn't break tkinter apps.
1460
1481
1461 * IPython/iplib.py (_prefilter): fix bug where aliases would
1482 * IPython/iplib.py (_prefilter): fix bug where aliases would
1462 shadow variables when autocall was fully off. Reported by SAGE
1483 shadow variables when autocall was fully off. Reported by SAGE
1463 author William Stein.
1484 author William Stein.
1464
1485
1465 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1486 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1466 at what detail level strings are computed when foo? is requested.
1487 at what detail level strings are computed when foo? is requested.
1467 This allows users to ask for example that the string form of an
1488 This allows users to ask for example that the string form of an
1468 object is only computed when foo?? is called, or even never, by
1489 object is only computed when foo?? is called, or even never, by
1469 setting the object_info_string_level >= 2 in the configuration
1490 setting the object_info_string_level >= 2 in the configuration
1470 file. This new option has been added and documented. After a
1491 file. This new option has been added and documented. After a
1471 request by SAGE to be able to control the printing of very large
1492 request by SAGE to be able to control the printing of very large
1472 objects more easily.
1493 objects more easily.
1473
1494
1474 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1495 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1475
1496
1476 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1497 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1477 from sys.argv, to be 100% consistent with how Python itself works
1498 from sys.argv, to be 100% consistent with how Python itself works
1478 (as seen for example with python -i file.py). After a bug report
1499 (as seen for example with python -i file.py). After a bug report
1479 by Jeffrey Collins.
1500 by Jeffrey Collins.
1480
1501
1481 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1502 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1482 nasty bug which was preventing custom namespaces with -pylab,
1503 nasty bug which was preventing custom namespaces with -pylab,
1483 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1504 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1484 compatibility (long gone from mpl).
1505 compatibility (long gone from mpl).
1485
1506
1486 * IPython/ipapi.py (make_session): name change: create->make. We
1507 * IPython/ipapi.py (make_session): name change: create->make. We
1487 use make in other places (ipmaker,...), it's shorter and easier to
1508 use make in other places (ipmaker,...), it's shorter and easier to
1488 type and say, etc. I'm trying to clean things before 0.7.2 so
1509 type and say, etc. I'm trying to clean things before 0.7.2 so
1489 that I can keep things stable wrt to ipapi in the chainsaw branch.
1510 that I can keep things stable wrt to ipapi in the chainsaw branch.
1490
1511
1491 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1512 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1492 python-mode recognizes our debugger mode. Add support for
1513 python-mode recognizes our debugger mode. Add support for
1493 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1514 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1494 <m.liu.jin-AT-gmail.com> originally written by
1515 <m.liu.jin-AT-gmail.com> originally written by
1495 doxgen-AT-newsmth.net (with minor modifications for xemacs
1516 doxgen-AT-newsmth.net (with minor modifications for xemacs
1496 compatibility)
1517 compatibility)
1497
1518
1498 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1519 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1499 tracebacks when walking the stack so that the stack tracking system
1520 tracebacks when walking the stack so that the stack tracking system
1500 in emacs' python-mode can identify the frames correctly.
1521 in emacs' python-mode can identify the frames correctly.
1501
1522
1502 * IPython/ipmaker.py (make_IPython): make the internal (and
1523 * IPython/ipmaker.py (make_IPython): make the internal (and
1503 default config) autoedit_syntax value false by default. Too many
1524 default config) autoedit_syntax value false by default. Too many
1504 users have complained to me (both on and off-list) about problems
1525 users have complained to me (both on and off-list) about problems
1505 with this option being on by default, so I'm making it default to
1526 with this option being on by default, so I'm making it default to
1506 off. It can still be enabled by anyone via the usual mechanisms.
1527 off. It can still be enabled by anyone via the usual mechanisms.
1507
1528
1508 * IPython/completer.py (Completer.attr_matches): add support for
1529 * IPython/completer.py (Completer.attr_matches): add support for
1509 PyCrust-style _getAttributeNames magic method. Patch contributed
1530 PyCrust-style _getAttributeNames magic method. Patch contributed
1510 by <mscott-AT-goldenspud.com>. Closes #50.
1531 by <mscott-AT-goldenspud.com>. Closes #50.
1511
1532
1512 * IPython/iplib.py (InteractiveShell.__init__): remove the
1533 * IPython/iplib.py (InteractiveShell.__init__): remove the
1513 deletion of exit/quit from __builtin__, which can break
1534 deletion of exit/quit from __builtin__, which can break
1514 third-party tools like the Zope debugging console. The
1535 third-party tools like the Zope debugging console. The
1515 %exit/%quit magics remain. In general, it's probably a good idea
1536 %exit/%quit magics remain. In general, it's probably a good idea
1516 not to delete anything from __builtin__, since we never know what
1537 not to delete anything from __builtin__, since we never know what
1517 that will break. In any case, python now (for 2.5) will support
1538 that will break. In any case, python now (for 2.5) will support
1518 'real' exit/quit, so this issue is moot. Closes #55.
1539 'real' exit/quit, so this issue is moot. Closes #55.
1519
1540
1520 * IPython/genutils.py (with_obj): rename the 'with' function to
1541 * IPython/genutils.py (with_obj): rename the 'with' function to
1521 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1542 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1522 becomes a language keyword. Closes #53.
1543 becomes a language keyword. Closes #53.
1523
1544
1524 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1545 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1525 __file__ attribute to this so it fools more things into thinking
1546 __file__ attribute to this so it fools more things into thinking
1526 it is a real module. Closes #59.
1547 it is a real module. Closes #59.
1527
1548
1528 * IPython/Magic.py (magic_edit): add -n option to open the editor
1549 * IPython/Magic.py (magic_edit): add -n option to open the editor
1529 at a specific line number. After a patch by Stefan van der Walt.
1550 at a specific line number. After a patch by Stefan van der Walt.
1530
1551
1531 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1552 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1532
1553
1533 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1554 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1534 reason the file could not be opened. After automatic crash
1555 reason the file could not be opened. After automatic crash
1535 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1556 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1536 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1557 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1537 (_should_recompile): Don't fire editor if using %bg, since there
1558 (_should_recompile): Don't fire editor if using %bg, since there
1538 is no file in the first place. From the same report as above.
1559 is no file in the first place. From the same report as above.
1539 (raw_input): protect against faulty third-party prefilters. After
1560 (raw_input): protect against faulty third-party prefilters. After
1540 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1561 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1541 while running under SAGE.
1562 while running under SAGE.
1542
1563
1543 2006-05-23 Ville Vainio <vivainio@gmail.com>
1564 2006-05-23 Ville Vainio <vivainio@gmail.com>
1544
1565
1545 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1566 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1546 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1567 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1547 now returns None (again), unless dummy is specifically allowed by
1568 now returns None (again), unless dummy is specifically allowed by
1548 ipapi.get(allow_dummy=True).
1569 ipapi.get(allow_dummy=True).
1549
1570
1550 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1571 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1551
1572
1552 * IPython: remove all 2.2-compatibility objects and hacks from
1573 * IPython: remove all 2.2-compatibility objects and hacks from
1553 everywhere, since we only support 2.3 at this point. Docs
1574 everywhere, since we only support 2.3 at this point. Docs
1554 updated.
1575 updated.
1555
1576
1556 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1577 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1557 Anything requiring extra validation can be turned into a Python
1578 Anything requiring extra validation can be turned into a Python
1558 property in the future. I used a property for the db one b/c
1579 property in the future. I used a property for the db one b/c
1559 there was a nasty circularity problem with the initialization
1580 there was a nasty circularity problem with the initialization
1560 order, which right now I don't have time to clean up.
1581 order, which right now I don't have time to clean up.
1561
1582
1562 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1583 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1563 another locking bug reported by Jorgen. I'm not 100% sure though,
1584 another locking bug reported by Jorgen. I'm not 100% sure though,
1564 so more testing is needed...
1585 so more testing is needed...
1565
1586
1566 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1587 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1567
1588
1568 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1589 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1569 local variables from any routine in user code (typically executed
1590 local variables from any routine in user code (typically executed
1570 with %run) directly into the interactive namespace. Very useful
1591 with %run) directly into the interactive namespace. Very useful
1571 when doing complex debugging.
1592 when doing complex debugging.
1572 (IPythonNotRunning): Changed the default None object to a dummy
1593 (IPythonNotRunning): Changed the default None object to a dummy
1573 whose attributes can be queried as well as called without
1594 whose attributes can be queried as well as called without
1574 exploding, to ease writing code which works transparently both in
1595 exploding, to ease writing code which works transparently both in
1575 and out of ipython and uses some of this API.
1596 and out of ipython and uses some of this API.
1576
1597
1577 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1598 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1578
1599
1579 * IPython/hooks.py (result_display): Fix the fact that our display
1600 * IPython/hooks.py (result_display): Fix the fact that our display
1580 hook was using str() instead of repr(), as the default python
1601 hook was using str() instead of repr(), as the default python
1581 console does. This had gone unnoticed b/c it only happened if
1602 console does. This had gone unnoticed b/c it only happened if
1582 %Pprint was off, but the inconsistency was there.
1603 %Pprint was off, but the inconsistency was there.
1583
1604
1584 2006-05-15 Ville Vainio <vivainio@gmail.com>
1605 2006-05-15 Ville Vainio <vivainio@gmail.com>
1585
1606
1586 * Oinspect.py: Only show docstring for nonexisting/binary files
1607 * Oinspect.py: Only show docstring for nonexisting/binary files
1587 when doing object??, closing ticket #62
1608 when doing object??, closing ticket #62
1588
1609
1589 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1610 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1590
1611
1591 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1612 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1592 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1613 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1593 was being released in a routine which hadn't checked if it had
1614 was being released in a routine which hadn't checked if it had
1594 been the one to acquire it.
1615 been the one to acquire it.
1595
1616
1596 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1617 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1597
1618
1598 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1619 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1599
1620
1600 2006-04-11 Ville Vainio <vivainio@gmail.com>
1621 2006-04-11 Ville Vainio <vivainio@gmail.com>
1601
1622
1602 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1623 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1603 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1624 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1604 prefilters, allowing stuff like magics and aliases in the file.
1625 prefilters, allowing stuff like magics and aliases in the file.
1605
1626
1606 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1627 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1607 added. Supported now are "%clear in" and "%clear out" (clear input and
1628 added. Supported now are "%clear in" and "%clear out" (clear input and
1608 output history, respectively). Also fixed CachedOutput.flush to
1629 output history, respectively). Also fixed CachedOutput.flush to
1609 properly flush the output cache.
1630 properly flush the output cache.
1610
1631
1611 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1632 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1612 half-success (and fail explicitly).
1633 half-success (and fail explicitly).
1613
1634
1614 2006-03-28 Ville Vainio <vivainio@gmail.com>
1635 2006-03-28 Ville Vainio <vivainio@gmail.com>
1615
1636
1616 * iplib.py: Fix quoting of aliases so that only argless ones
1637 * iplib.py: Fix quoting of aliases so that only argless ones
1617 are quoted
1638 are quoted
1618
1639
1619 2006-03-28 Ville Vainio <vivainio@gmail.com>
1640 2006-03-28 Ville Vainio <vivainio@gmail.com>
1620
1641
1621 * iplib.py: Quote aliases with spaces in the name.
1642 * iplib.py: Quote aliases with spaces in the name.
1622 "c:\program files\blah\bin" is now legal alias target.
1643 "c:\program files\blah\bin" is now legal alias target.
1623
1644
1624 * ext_rehashdir.py: Space no longer allowed as arg
1645 * ext_rehashdir.py: Space no longer allowed as arg
1625 separator, since space is legal in path names.
1646 separator, since space is legal in path names.
1626
1647
1627 2006-03-16 Ville Vainio <vivainio@gmail.com>
1648 2006-03-16 Ville Vainio <vivainio@gmail.com>
1628
1649
1629 * upgrade_dir.py: Take path.py from Extensions, correcting
1650 * upgrade_dir.py: Take path.py from Extensions, correcting
1630 %upgrade magic
1651 %upgrade magic
1631
1652
1632 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1653 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1633
1654
1634 * hooks.py: Only enclose editor binary in quotes if legal and
1655 * hooks.py: Only enclose editor binary in quotes if legal and
1635 necessary (space in the name, and is an existing file). Fixes a bug
1656 necessary (space in the name, and is an existing file). Fixes a bug
1636 reported by Zachary Pincus.
1657 reported by Zachary Pincus.
1637
1658
1638 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1659 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1639
1660
1640 * Manual: thanks to a tip on proper color handling for Emacs, by
1661 * Manual: thanks to a tip on proper color handling for Emacs, by
1641 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1662 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1642
1663
1643 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1664 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1644 by applying the provided patch. Thanks to Liu Jin
1665 by applying the provided patch. Thanks to Liu Jin
1645 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1666 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1646 XEmacs/Linux, I'm trusting the submitter that it actually helps
1667 XEmacs/Linux, I'm trusting the submitter that it actually helps
1647 under win32/GNU Emacs. Will revisit if any problems are reported.
1668 under win32/GNU Emacs. Will revisit if any problems are reported.
1648
1669
1649 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1670 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1650
1671
1651 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1672 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1652 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1673 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1653
1674
1654 2006-03-12 Ville Vainio <vivainio@gmail.com>
1675 2006-03-12 Ville Vainio <vivainio@gmail.com>
1655
1676
1656 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1677 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1657 Torsten Marek.
1678 Torsten Marek.
1658
1679
1659 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1680 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1660
1681
1661 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1682 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1662 line ranges works again.
1683 line ranges works again.
1663
1684
1664 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1685 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1665
1686
1666 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1687 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1667 and friends, after a discussion with Zach Pincus on ipython-user.
1688 and friends, after a discussion with Zach Pincus on ipython-user.
1668 I'm not 100% sure, but after thinking about it quite a bit, it may
1689 I'm not 100% sure, but after thinking about it quite a bit, it may
1669 be OK. Testing with the multithreaded shells didn't reveal any
1690 be OK. Testing with the multithreaded shells didn't reveal any
1670 problems, but let's keep an eye out.
1691 problems, but let's keep an eye out.
1671
1692
1672 In the process, I fixed a few things which were calling
1693 In the process, I fixed a few things which were calling
1673 self.InteractiveTB() directly (like safe_execfile), which is a
1694 self.InteractiveTB() directly (like safe_execfile), which is a
1674 mistake: ALL exception reporting should be done by calling
1695 mistake: ALL exception reporting should be done by calling
1675 self.showtraceback(), which handles state and tab-completion and
1696 self.showtraceback(), which handles state and tab-completion and
1676 more.
1697 more.
1677
1698
1678 2006-03-01 Ville Vainio <vivainio@gmail.com>
1699 2006-03-01 Ville Vainio <vivainio@gmail.com>
1679
1700
1680 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1701 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1681 To use, do "from ipipe import *".
1702 To use, do "from ipipe import *".
1682
1703
1683 2006-02-24 Ville Vainio <vivainio@gmail.com>
1704 2006-02-24 Ville Vainio <vivainio@gmail.com>
1684
1705
1685 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1706 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1686 "cleanly" and safely than the older upgrade mechanism.
1707 "cleanly" and safely than the older upgrade mechanism.
1687
1708
1688 2006-02-21 Ville Vainio <vivainio@gmail.com>
1709 2006-02-21 Ville Vainio <vivainio@gmail.com>
1689
1710
1690 * Magic.py: %save works again.
1711 * Magic.py: %save works again.
1691
1712
1692 2006-02-15 Ville Vainio <vivainio@gmail.com>
1713 2006-02-15 Ville Vainio <vivainio@gmail.com>
1693
1714
1694 * Magic.py: %Pprint works again
1715 * Magic.py: %Pprint works again
1695
1716
1696 * Extensions/ipy_sane_defaults.py: Provide everything provided
1717 * Extensions/ipy_sane_defaults.py: Provide everything provided
1697 in default ipythonrc, to make it possible to have a completely empty
1718 in default ipythonrc, to make it possible to have a completely empty
1698 ipythonrc (and thus completely rc-file free configuration)
1719 ipythonrc (and thus completely rc-file free configuration)
1699
1720
1700 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1721 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1701
1722
1702 * IPython/hooks.py (editor): quote the call to the editor command,
1723 * IPython/hooks.py (editor): quote the call to the editor command,
1703 to allow commands with spaces in them. Problem noted by watching
1724 to allow commands with spaces in them. Problem noted by watching
1704 Ian Oswald's video about textpad under win32 at
1725 Ian Oswald's video about textpad under win32 at
1705 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1726 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1706
1727
1707 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1728 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1708 describing magics (we haven't used @ for a loong time).
1729 describing magics (we haven't used @ for a loong time).
1709
1730
1710 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1731 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1711 contributed by marienz to close
1732 contributed by marienz to close
1712 http://www.scipy.net/roundup/ipython/issue53.
1733 http://www.scipy.net/roundup/ipython/issue53.
1713
1734
1714 2006-02-10 Ville Vainio <vivainio@gmail.com>
1735 2006-02-10 Ville Vainio <vivainio@gmail.com>
1715
1736
1716 * genutils.py: getoutput now works in win32 too
1737 * genutils.py: getoutput now works in win32 too
1717
1738
1718 * completer.py: alias and magic completion only invoked
1739 * completer.py: alias and magic completion only invoked
1719 at the first "item" in the line, to avoid "cd %store"
1740 at the first "item" in the line, to avoid "cd %store"
1720 nonsense.
1741 nonsense.
1721
1742
1722 2006-02-09 Ville Vainio <vivainio@gmail.com>
1743 2006-02-09 Ville Vainio <vivainio@gmail.com>
1723
1744
1724 * test/*: Added a unit testing framework (finally).
1745 * test/*: Added a unit testing framework (finally).
1725 '%run runtests.py' to run test_*.
1746 '%run runtests.py' to run test_*.
1726
1747
1727 * ipapi.py: Exposed runlines and set_custom_exc
1748 * ipapi.py: Exposed runlines and set_custom_exc
1728
1749
1729 2006-02-07 Ville Vainio <vivainio@gmail.com>
1750 2006-02-07 Ville Vainio <vivainio@gmail.com>
1730
1751
1731 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1752 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1732 instead use "f(1 2)" as before.
1753 instead use "f(1 2)" as before.
1733
1754
1734 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1755 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1735
1756
1736 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1757 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1737 facilities, for demos processed by the IPython input filter
1758 facilities, for demos processed by the IPython input filter
1738 (IPythonDemo), and for running a script one-line-at-a-time as a
1759 (IPythonDemo), and for running a script one-line-at-a-time as a
1739 demo, both for pure Python (LineDemo) and for IPython-processed
1760 demo, both for pure Python (LineDemo) and for IPython-processed
1740 input (IPythonLineDemo). After a request by Dave Kohel, from the
1761 input (IPythonLineDemo). After a request by Dave Kohel, from the
1741 SAGE team.
1762 SAGE team.
1742 (Demo.edit): added an edit() method to the demo objects, to edit
1763 (Demo.edit): added an edit() method to the demo objects, to edit
1743 the in-memory copy of the last executed block.
1764 the in-memory copy of the last executed block.
1744
1765
1745 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1766 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1746 processing to %edit, %macro and %save. These commands can now be
1767 processing to %edit, %macro and %save. These commands can now be
1747 invoked on the unprocessed input as it was typed by the user
1768 invoked on the unprocessed input as it was typed by the user
1748 (without any prefilters applied). After requests by the SAGE team
1769 (without any prefilters applied). After requests by the SAGE team
1749 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1770 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1750
1771
1751 2006-02-01 Ville Vainio <vivainio@gmail.com>
1772 2006-02-01 Ville Vainio <vivainio@gmail.com>
1752
1773
1753 * setup.py, eggsetup.py: easy_install ipython==dev works
1774 * setup.py, eggsetup.py: easy_install ipython==dev works
1754 correctly now (on Linux)
1775 correctly now (on Linux)
1755
1776
1756 * ipy_user_conf,ipmaker: user config changes, removed spurious
1777 * ipy_user_conf,ipmaker: user config changes, removed spurious
1757 warnings
1778 warnings
1758
1779
1759 * iplib: if rc.banner is string, use it as is.
1780 * iplib: if rc.banner is string, use it as is.
1760
1781
1761 * Magic: %pycat accepts a string argument and pages it's contents.
1782 * Magic: %pycat accepts a string argument and pages it's contents.
1762
1783
1763
1784
1764 2006-01-30 Ville Vainio <vivainio@gmail.com>
1785 2006-01-30 Ville Vainio <vivainio@gmail.com>
1765
1786
1766 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1787 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1767 Now %store and bookmarks work through PickleShare, meaning that
1788 Now %store and bookmarks work through PickleShare, meaning that
1768 concurrent access is possible and all ipython sessions see the
1789 concurrent access is possible and all ipython sessions see the
1769 same database situation all the time, instead of snapshot of
1790 same database situation all the time, instead of snapshot of
1770 the situation when the session was started. Hence, %bookmark
1791 the situation when the session was started. Hence, %bookmark
1771 results are immediately accessible from othes sessions. The database
1792 results are immediately accessible from othes sessions. The database
1772 is also available for use by user extensions. See:
1793 is also available for use by user extensions. See:
1773 http://www.python.org/pypi/pickleshare
1794 http://www.python.org/pypi/pickleshare
1774
1795
1775 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1796 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1776
1797
1777 * aliases can now be %store'd
1798 * aliases can now be %store'd
1778
1799
1779 * path.py moved to Extensions so that pickleshare does not need
1800 * path.py moved to Extensions so that pickleshare does not need
1780 IPython-specific import. Extensions added to pythonpath right
1801 IPython-specific import. Extensions added to pythonpath right
1781 at __init__.
1802 at __init__.
1782
1803
1783 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1804 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1784 called with _ip.system and the pre-transformed command string.
1805 called with _ip.system and the pre-transformed command string.
1785
1806
1786 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1807 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1787
1808
1788 * IPython/iplib.py (interact): Fix that we were not catching
1809 * IPython/iplib.py (interact): Fix that we were not catching
1789 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1810 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1790 logic here had to change, but it's fixed now.
1811 logic here had to change, but it's fixed now.
1791
1812
1792 2006-01-29 Ville Vainio <vivainio@gmail.com>
1813 2006-01-29 Ville Vainio <vivainio@gmail.com>
1793
1814
1794 * iplib.py: Try to import pyreadline on Windows.
1815 * iplib.py: Try to import pyreadline on Windows.
1795
1816
1796 2006-01-27 Ville Vainio <vivainio@gmail.com>
1817 2006-01-27 Ville Vainio <vivainio@gmail.com>
1797
1818
1798 * iplib.py: Expose ipapi as _ip in builtin namespace.
1819 * iplib.py: Expose ipapi as _ip in builtin namespace.
1799 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1820 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1800 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1821 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1801 syntax now produce _ip.* variant of the commands.
1822 syntax now produce _ip.* variant of the commands.
1802
1823
1803 * "_ip.options().autoedit_syntax = 2" automatically throws
1824 * "_ip.options().autoedit_syntax = 2" automatically throws
1804 user to editor for syntax error correction without prompting.
1825 user to editor for syntax error correction without prompting.
1805
1826
1806 2006-01-27 Ville Vainio <vivainio@gmail.com>
1827 2006-01-27 Ville Vainio <vivainio@gmail.com>
1807
1828
1808 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1829 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1809 'ipython' at argv[0]) executed through command line.
1830 'ipython' at argv[0]) executed through command line.
1810 NOTE: this DEPRECATES calling ipython with multiple scripts
1831 NOTE: this DEPRECATES calling ipython with multiple scripts
1811 ("ipython a.py b.py c.py")
1832 ("ipython a.py b.py c.py")
1812
1833
1813 * iplib.py, hooks.py: Added configurable input prefilter,
1834 * iplib.py, hooks.py: Added configurable input prefilter,
1814 named 'input_prefilter'. See ext_rescapture.py for example
1835 named 'input_prefilter'. See ext_rescapture.py for example
1815 usage.
1836 usage.
1816
1837
1817 * ext_rescapture.py, Magic.py: Better system command output capture
1838 * ext_rescapture.py, Magic.py: Better system command output capture
1818 through 'var = !ls' (deprecates user-visible %sc). Same notation
1839 through 'var = !ls' (deprecates user-visible %sc). Same notation
1819 applies for magics, 'var = %alias' assigns alias list to var.
1840 applies for magics, 'var = %alias' assigns alias list to var.
1820
1841
1821 * ipapi.py: added meta() for accessing extension-usable data store.
1842 * ipapi.py: added meta() for accessing extension-usable data store.
1822
1843
1823 * iplib.py: added InteractiveShell.getapi(). New magics should be
1844 * iplib.py: added InteractiveShell.getapi(). New magics should be
1824 written doing self.getapi() instead of using the shell directly.
1845 written doing self.getapi() instead of using the shell directly.
1825
1846
1826 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1847 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1827 %store foo >> ~/myfoo.txt to store variables to files (in clean
1848 %store foo >> ~/myfoo.txt to store variables to files (in clean
1828 textual form, not a restorable pickle).
1849 textual form, not a restorable pickle).
1829
1850
1830 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1851 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1831
1852
1832 * usage.py, Magic.py: added %quickref
1853 * usage.py, Magic.py: added %quickref
1833
1854
1834 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1855 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1835
1856
1836 * GetoptErrors when invoking magics etc. with wrong args
1857 * GetoptErrors when invoking magics etc. with wrong args
1837 are now more helpful:
1858 are now more helpful:
1838 GetoptError: option -l not recognized (allowed: "qb" )
1859 GetoptError: option -l not recognized (allowed: "qb" )
1839
1860
1840 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1861 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1841
1862
1842 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1863 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1843 computationally intensive blocks don't appear to stall the demo.
1864 computationally intensive blocks don't appear to stall the demo.
1844
1865
1845 2006-01-24 Ville Vainio <vivainio@gmail.com>
1866 2006-01-24 Ville Vainio <vivainio@gmail.com>
1846
1867
1847 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1868 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1848 value to manipulate resulting history entry.
1869 value to manipulate resulting history entry.
1849
1870
1850 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1871 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1851 to instance methods of IPApi class, to make extending an embedded
1872 to instance methods of IPApi class, to make extending an embedded
1852 IPython feasible. See ext_rehashdir.py for example usage.
1873 IPython feasible. See ext_rehashdir.py for example usage.
1853
1874
1854 * Merged 1071-1076 from branches/0.7.1
1875 * Merged 1071-1076 from branches/0.7.1
1855
1876
1856
1877
1857 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1878 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1858
1879
1859 * tools/release (daystamp): Fix build tools to use the new
1880 * tools/release (daystamp): Fix build tools to use the new
1860 eggsetup.py script to build lightweight eggs.
1881 eggsetup.py script to build lightweight eggs.
1861
1882
1862 * Applied changesets 1062 and 1064 before 0.7.1 release.
1883 * Applied changesets 1062 and 1064 before 0.7.1 release.
1863
1884
1864 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1885 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1865 see the raw input history (without conversions like %ls ->
1886 see the raw input history (without conversions like %ls ->
1866 ipmagic("ls")). After a request from W. Stein, SAGE
1887 ipmagic("ls")). After a request from W. Stein, SAGE
1867 (http://modular.ucsd.edu/sage) developer. This information is
1888 (http://modular.ucsd.edu/sage) developer. This information is
1868 stored in the input_hist_raw attribute of the IPython instance, so
1889 stored in the input_hist_raw attribute of the IPython instance, so
1869 developers can access it if needed (it's an InputList instance).
1890 developers can access it if needed (it's an InputList instance).
1870
1891
1871 * Versionstring = 0.7.2.svn
1892 * Versionstring = 0.7.2.svn
1872
1893
1873 * eggsetup.py: A separate script for constructing eggs, creates
1894 * eggsetup.py: A separate script for constructing eggs, creates
1874 proper launch scripts even on Windows (an .exe file in
1895 proper launch scripts even on Windows (an .exe file in
1875 \python24\scripts).
1896 \python24\scripts).
1876
1897
1877 * ipapi.py: launch_new_instance, launch entry point needed for the
1898 * ipapi.py: launch_new_instance, launch entry point needed for the
1878 egg.
1899 egg.
1879
1900
1880 2006-01-23 Ville Vainio <vivainio@gmail.com>
1901 2006-01-23 Ville Vainio <vivainio@gmail.com>
1881
1902
1882 * Added %cpaste magic for pasting python code
1903 * Added %cpaste magic for pasting python code
1883
1904
1884 2006-01-22 Ville Vainio <vivainio@gmail.com>
1905 2006-01-22 Ville Vainio <vivainio@gmail.com>
1885
1906
1886 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1907 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1887
1908
1888 * Versionstring = 0.7.2.svn
1909 * Versionstring = 0.7.2.svn
1889
1910
1890 * eggsetup.py: A separate script for constructing eggs, creates
1911 * eggsetup.py: A separate script for constructing eggs, creates
1891 proper launch scripts even on Windows (an .exe file in
1912 proper launch scripts even on Windows (an .exe file in
1892 \python24\scripts).
1913 \python24\scripts).
1893
1914
1894 * ipapi.py: launch_new_instance, launch entry point needed for the
1915 * ipapi.py: launch_new_instance, launch entry point needed for the
1895 egg.
1916 egg.
1896
1917
1897 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1918 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1898
1919
1899 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1920 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1900 %pfile foo would print the file for foo even if it was a binary.
1921 %pfile foo would print the file for foo even if it was a binary.
1901 Now, extensions '.so' and '.dll' are skipped.
1922 Now, extensions '.so' and '.dll' are skipped.
1902
1923
1903 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1924 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1904 bug, where macros would fail in all threaded modes. I'm not 100%
1925 bug, where macros would fail in all threaded modes. I'm not 100%
1905 sure, so I'm going to put out an rc instead of making a release
1926 sure, so I'm going to put out an rc instead of making a release
1906 today, and wait for feedback for at least a few days.
1927 today, and wait for feedback for at least a few days.
1907
1928
1908 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1929 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1909 it...) the handling of pasting external code with autoindent on.
1930 it...) the handling of pasting external code with autoindent on.
1910 To get out of a multiline input, the rule will appear for most
1931 To get out of a multiline input, the rule will appear for most
1911 users unchanged: two blank lines or change the indent level
1932 users unchanged: two blank lines or change the indent level
1912 proposed by IPython. But there is a twist now: you can
1933 proposed by IPython. But there is a twist now: you can
1913 add/subtract only *one or two spaces*. If you add/subtract three
1934 add/subtract only *one or two spaces*. If you add/subtract three
1914 or more (unless you completely delete the line), IPython will
1935 or more (unless you completely delete the line), IPython will
1915 accept that line, and you'll need to enter a second one of pure
1936 accept that line, and you'll need to enter a second one of pure
1916 whitespace. I know it sounds complicated, but I can't find a
1937 whitespace. I know it sounds complicated, but I can't find a
1917 different solution that covers all the cases, with the right
1938 different solution that covers all the cases, with the right
1918 heuristics. Hopefully in actual use, nobody will really notice
1939 heuristics. Hopefully in actual use, nobody will really notice
1919 all these strange rules and things will 'just work'.
1940 all these strange rules and things will 'just work'.
1920
1941
1921 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1942 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1922
1943
1923 * IPython/iplib.py (interact): catch exceptions which can be
1944 * IPython/iplib.py (interact): catch exceptions which can be
1924 triggered asynchronously by signal handlers. Thanks to an
1945 triggered asynchronously by signal handlers. Thanks to an
1925 automatic crash report, submitted by Colin Kingsley
1946 automatic crash report, submitted by Colin Kingsley
1926 <tercel-AT-gentoo.org>.
1947 <tercel-AT-gentoo.org>.
1927
1948
1928 2006-01-20 Ville Vainio <vivainio@gmail.com>
1949 2006-01-20 Ville Vainio <vivainio@gmail.com>
1929
1950
1930 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1951 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1931 (%rehashdir, very useful, try it out) of how to extend ipython
1952 (%rehashdir, very useful, try it out) of how to extend ipython
1932 with new magics. Also added Extensions dir to pythonpath to make
1953 with new magics. Also added Extensions dir to pythonpath to make
1933 importing extensions easy.
1954 importing extensions easy.
1934
1955
1935 * %store now complains when trying to store interactively declared
1956 * %store now complains when trying to store interactively declared
1936 classes / instances of those classes.
1957 classes / instances of those classes.
1937
1958
1938 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1959 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1939 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1960 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1940 if they exist, and ipy_user_conf.py with some defaults is created for
1961 if they exist, and ipy_user_conf.py with some defaults is created for
1941 the user.
1962 the user.
1942
1963
1943 * Startup rehashing done by the config file, not InterpreterExec.
1964 * Startup rehashing done by the config file, not InterpreterExec.
1944 This means system commands are available even without selecting the
1965 This means system commands are available even without selecting the
1945 pysh profile. It's the sensible default after all.
1966 pysh profile. It's the sensible default after all.
1946
1967
1947 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1968 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1948
1969
1949 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1970 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1950 multiline code with autoindent on working. But I am really not
1971 multiline code with autoindent on working. But I am really not
1951 sure, so this needs more testing. Will commit a debug-enabled
1972 sure, so this needs more testing. Will commit a debug-enabled
1952 version for now, while I test it some more, so that Ville and
1973 version for now, while I test it some more, so that Ville and
1953 others may also catch any problems. Also made
1974 others may also catch any problems. Also made
1954 self.indent_current_str() a method, to ensure that there's no
1975 self.indent_current_str() a method, to ensure that there's no
1955 chance of the indent space count and the corresponding string
1976 chance of the indent space count and the corresponding string
1956 falling out of sync. All code needing the string should just call
1977 falling out of sync. All code needing the string should just call
1957 the method.
1978 the method.
1958
1979
1959 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1980 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1960
1981
1961 * IPython/Magic.py (magic_edit): fix check for when users don't
1982 * IPython/Magic.py (magic_edit): fix check for when users don't
1962 save their output files, the try/except was in the wrong section.
1983 save their output files, the try/except was in the wrong section.
1963
1984
1964 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1985 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1965
1986
1966 * IPython/Magic.py (magic_run): fix __file__ global missing from
1987 * IPython/Magic.py (magic_run): fix __file__ global missing from
1967 script's namespace when executed via %run. After a report by
1988 script's namespace when executed via %run. After a report by
1968 Vivian.
1989 Vivian.
1969
1990
1970 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1991 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1971 when using python 2.4. The parent constructor changed in 2.4, and
1992 when using python 2.4. The parent constructor changed in 2.4, and
1972 we need to track it directly (we can't call it, as it messes up
1993 we need to track it directly (we can't call it, as it messes up
1973 readline and tab-completion inside our pdb would stop working).
1994 readline and tab-completion inside our pdb would stop working).
1974 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1995 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1975
1996
1976 2006-01-16 Ville Vainio <vivainio@gmail.com>
1997 2006-01-16 Ville Vainio <vivainio@gmail.com>
1977
1998
1978 * Ipython/magic.py: Reverted back to old %edit functionality
1999 * Ipython/magic.py: Reverted back to old %edit functionality
1979 that returns file contents on exit.
2000 that returns file contents on exit.
1980
2001
1981 * IPython/path.py: Added Jason Orendorff's "path" module to
2002 * IPython/path.py: Added Jason Orendorff's "path" module to
1982 IPython tree, http://www.jorendorff.com/articles/python/path/.
2003 IPython tree, http://www.jorendorff.com/articles/python/path/.
1983 You can get path objects conveniently through %sc, and !!, e.g.:
2004 You can get path objects conveniently through %sc, and !!, e.g.:
1984 sc files=ls
2005 sc files=ls
1985 for p in files.paths: # or files.p
2006 for p in files.paths: # or files.p
1986 print p,p.mtime
2007 print p,p.mtime
1987
2008
1988 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2009 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1989 now work again without considering the exclusion regexp -
2010 now work again without considering the exclusion regexp -
1990 hence, things like ',foo my/path' turn to 'foo("my/path")'
2011 hence, things like ',foo my/path' turn to 'foo("my/path")'
1991 instead of syntax error.
2012 instead of syntax error.
1992
2013
1993
2014
1994 2006-01-14 Ville Vainio <vivainio@gmail.com>
2015 2006-01-14 Ville Vainio <vivainio@gmail.com>
1995
2016
1996 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2017 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1997 ipapi decorators for python 2.4 users, options() provides access to rc
2018 ipapi decorators for python 2.4 users, options() provides access to rc
1998 data.
2019 data.
1999
2020
2000 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2021 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2001 as path separators (even on Linux ;-). Space character after
2022 as path separators (even on Linux ;-). Space character after
2002 backslash (as yielded by tab completer) is still space;
2023 backslash (as yielded by tab completer) is still space;
2003 "%cd long\ name" works as expected.
2024 "%cd long\ name" works as expected.
2004
2025
2005 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2026 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2006 as "chain of command", with priority. API stays the same,
2027 as "chain of command", with priority. API stays the same,
2007 TryNext exception raised by a hook function signals that
2028 TryNext exception raised by a hook function signals that
2008 current hook failed and next hook should try handling it, as
2029 current hook failed and next hook should try handling it, as
2009 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2030 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2010 requested configurable display hook, which is now implemented.
2031 requested configurable display hook, which is now implemented.
2011
2032
2012 2006-01-13 Ville Vainio <vivainio@gmail.com>
2033 2006-01-13 Ville Vainio <vivainio@gmail.com>
2013
2034
2014 * IPython/platutils*.py: platform specific utility functions,
2035 * IPython/platutils*.py: platform specific utility functions,
2015 so far only set_term_title is implemented (change terminal
2036 so far only set_term_title is implemented (change terminal
2016 label in windowing systems). %cd now changes the title to
2037 label in windowing systems). %cd now changes the title to
2017 current dir.
2038 current dir.
2018
2039
2019 * IPython/Release.py: Added myself to "authors" list,
2040 * IPython/Release.py: Added myself to "authors" list,
2020 had to create new files.
2041 had to create new files.
2021
2042
2022 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2043 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2023 shell escape; not a known bug but had potential to be one in the
2044 shell escape; not a known bug but had potential to be one in the
2024 future.
2045 future.
2025
2046
2026 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2047 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2027 extension API for IPython! See the module for usage example. Fix
2048 extension API for IPython! See the module for usage example. Fix
2028 OInspect for docstring-less magic functions.
2049 OInspect for docstring-less magic functions.
2029
2050
2030
2051
2031 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2052 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2032
2053
2033 * IPython/iplib.py (raw_input): temporarily deactivate all
2054 * IPython/iplib.py (raw_input): temporarily deactivate all
2034 attempts at allowing pasting of code with autoindent on. It
2055 attempts at allowing pasting of code with autoindent on. It
2035 introduced bugs (reported by Prabhu) and I can't seem to find a
2056 introduced bugs (reported by Prabhu) and I can't seem to find a
2036 robust combination which works in all cases. Will have to revisit
2057 robust combination which works in all cases. Will have to revisit
2037 later.
2058 later.
2038
2059
2039 * IPython/genutils.py: remove isspace() function. We've dropped
2060 * IPython/genutils.py: remove isspace() function. We've dropped
2040 2.2 compatibility, so it's OK to use the string method.
2061 2.2 compatibility, so it's OK to use the string method.
2041
2062
2042 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2063 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2043
2064
2044 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2065 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2045 matching what NOT to autocall on, to include all python binary
2066 matching what NOT to autocall on, to include all python binary
2046 operators (including things like 'and', 'or', 'is' and 'in').
2067 operators (including things like 'and', 'or', 'is' and 'in').
2047 Prompted by a bug report on 'foo & bar', but I realized we had
2068 Prompted by a bug report on 'foo & bar', but I realized we had
2048 many more potential bug cases with other operators. The regexp is
2069 many more potential bug cases with other operators. The regexp is
2049 self.re_exclude_auto, it's fairly commented.
2070 self.re_exclude_auto, it's fairly commented.
2050
2071
2051 2006-01-12 Ville Vainio <vivainio@gmail.com>
2072 2006-01-12 Ville Vainio <vivainio@gmail.com>
2052
2073
2053 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2074 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2054 Prettified and hardened string/backslash quoting with ipsystem(),
2075 Prettified and hardened string/backslash quoting with ipsystem(),
2055 ipalias() and ipmagic(). Now even \ characters are passed to
2076 ipalias() and ipmagic(). Now even \ characters are passed to
2056 %magics, !shell escapes and aliases exactly as they are in the
2077 %magics, !shell escapes and aliases exactly as they are in the
2057 ipython command line. Should improve backslash experience,
2078 ipython command line. Should improve backslash experience,
2058 particularly in Windows (path delimiter for some commands that
2079 particularly in Windows (path delimiter for some commands that
2059 won't understand '/'), but Unix benefits as well (regexps). %cd
2080 won't understand '/'), but Unix benefits as well (regexps). %cd
2060 magic still doesn't support backslash path delimiters, though. Also
2081 magic still doesn't support backslash path delimiters, though. Also
2061 deleted all pretense of supporting multiline command strings in
2082 deleted all pretense of supporting multiline command strings in
2062 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2083 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2063
2084
2064 * doc/build_doc_instructions.txt added. Documentation on how to
2085 * doc/build_doc_instructions.txt added. Documentation on how to
2065 use doc/update_manual.py, added yesterday. Both files contributed
2086 use doc/update_manual.py, added yesterday. Both files contributed
2066 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2087 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2067 doc/*.sh for deprecation at a later date.
2088 doc/*.sh for deprecation at a later date.
2068
2089
2069 * /ipython.py Added ipython.py to root directory for
2090 * /ipython.py Added ipython.py to root directory for
2070 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2091 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2071 ipython.py) and development convenience (no need to keep doing
2092 ipython.py) and development convenience (no need to keep doing
2072 "setup.py install" between changes).
2093 "setup.py install" between changes).
2073
2094
2074 * Made ! and !! shell escapes work (again) in multiline expressions:
2095 * Made ! and !! shell escapes work (again) in multiline expressions:
2075 if 1:
2096 if 1:
2076 !ls
2097 !ls
2077 !!ls
2098 !!ls
2078
2099
2079 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2100 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2080
2101
2081 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2102 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2082 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2103 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2083 module in case-insensitive installation. Was causing crashes
2104 module in case-insensitive installation. Was causing crashes
2084 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2105 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2085
2106
2086 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2107 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2087 <marienz-AT-gentoo.org>, closes
2108 <marienz-AT-gentoo.org>, closes
2088 http://www.scipy.net/roundup/ipython/issue51.
2109 http://www.scipy.net/roundup/ipython/issue51.
2089
2110
2090 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2111 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2091
2112
2092 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2113 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2093 problem of excessive CPU usage under *nix and keyboard lag under
2114 problem of excessive CPU usage under *nix and keyboard lag under
2094 win32.
2115 win32.
2095
2116
2096 2006-01-10 *** Released version 0.7.0
2117 2006-01-10 *** Released version 0.7.0
2097
2118
2098 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2119 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2099
2120
2100 * IPython/Release.py (revision): tag version number to 0.7.0,
2121 * IPython/Release.py (revision): tag version number to 0.7.0,
2101 ready for release.
2122 ready for release.
2102
2123
2103 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2124 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2104 it informs the user of the name of the temp. file used. This can
2125 it informs the user of the name of the temp. file used. This can
2105 help if you decide later to reuse that same file, so you know
2126 help if you decide later to reuse that same file, so you know
2106 where to copy the info from.
2127 where to copy the info from.
2107
2128
2108 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2129 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2109
2130
2110 * setup_bdist_egg.py: little script to build an egg. Added
2131 * setup_bdist_egg.py: little script to build an egg. Added
2111 support in the release tools as well.
2132 support in the release tools as well.
2112
2133
2113 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2134 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2114
2135
2115 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2136 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2116 version selection (new -wxversion command line and ipythonrc
2137 version selection (new -wxversion command line and ipythonrc
2117 parameter). Patch contributed by Arnd Baecker
2138 parameter). Patch contributed by Arnd Baecker
2118 <arnd.baecker-AT-web.de>.
2139 <arnd.baecker-AT-web.de>.
2119
2140
2120 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2141 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2121 embedded instances, for variables defined at the interactive
2142 embedded instances, for variables defined at the interactive
2122 prompt of the embedded ipython. Reported by Arnd.
2143 prompt of the embedded ipython. Reported by Arnd.
2123
2144
2124 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2145 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2125 it can be used as a (stateful) toggle, or with a direct parameter.
2146 it can be used as a (stateful) toggle, or with a direct parameter.
2126
2147
2127 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2148 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2128 could be triggered in certain cases and cause the traceback
2149 could be triggered in certain cases and cause the traceback
2129 printer not to work.
2150 printer not to work.
2130
2151
2131 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2152 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2132
2153
2133 * IPython/iplib.py (_should_recompile): Small fix, closes
2154 * IPython/iplib.py (_should_recompile): Small fix, closes
2134 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2155 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2135
2156
2136 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2157 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2137
2158
2138 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2159 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2139 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2160 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2140 Moad for help with tracking it down.
2161 Moad for help with tracking it down.
2141
2162
2142 * IPython/iplib.py (handle_auto): fix autocall handling for
2163 * IPython/iplib.py (handle_auto): fix autocall handling for
2143 objects which support BOTH __getitem__ and __call__ (so that f [x]
2164 objects which support BOTH __getitem__ and __call__ (so that f [x]
2144 is left alone, instead of becoming f([x]) automatically).
2165 is left alone, instead of becoming f([x]) automatically).
2145
2166
2146 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2167 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2147 Ville's patch.
2168 Ville's patch.
2148
2169
2149 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2170 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2150
2171
2151 * IPython/iplib.py (handle_auto): changed autocall semantics to
2172 * IPython/iplib.py (handle_auto): changed autocall semantics to
2152 include 'smart' mode, where the autocall transformation is NOT
2173 include 'smart' mode, where the autocall transformation is NOT
2153 applied if there are no arguments on the line. This allows you to
2174 applied if there are no arguments on the line. This allows you to
2154 just type 'foo' if foo is a callable to see its internal form,
2175 just type 'foo' if foo is a callable to see its internal form,
2155 instead of having it called with no arguments (typically a
2176 instead of having it called with no arguments (typically a
2156 mistake). The old 'full' autocall still exists: for that, you
2177 mistake). The old 'full' autocall still exists: for that, you
2157 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2178 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2158
2179
2159 * IPython/completer.py (Completer.attr_matches): add
2180 * IPython/completer.py (Completer.attr_matches): add
2160 tab-completion support for Enthoughts' traits. After a report by
2181 tab-completion support for Enthoughts' traits. After a report by
2161 Arnd and a patch by Prabhu.
2182 Arnd and a patch by Prabhu.
2162
2183
2163 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2184 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2164
2185
2165 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2186 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2166 Schmolck's patch to fix inspect.getinnerframes().
2187 Schmolck's patch to fix inspect.getinnerframes().
2167
2188
2168 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2189 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2169 for embedded instances, regarding handling of namespaces and items
2190 for embedded instances, regarding handling of namespaces and items
2170 added to the __builtin__ one. Multiple embedded instances and
2191 added to the __builtin__ one. Multiple embedded instances and
2171 recursive embeddings should work better now (though I'm not sure
2192 recursive embeddings should work better now (though I'm not sure
2172 I've got all the corner cases fixed, that code is a bit of a brain
2193 I've got all the corner cases fixed, that code is a bit of a brain
2173 twister).
2194 twister).
2174
2195
2175 * IPython/Magic.py (magic_edit): added support to edit in-memory
2196 * IPython/Magic.py (magic_edit): added support to edit in-memory
2176 macros (automatically creates the necessary temp files). %edit
2197 macros (automatically creates the necessary temp files). %edit
2177 also doesn't return the file contents anymore, it's just noise.
2198 also doesn't return the file contents anymore, it's just noise.
2178
2199
2179 * IPython/completer.py (Completer.attr_matches): revert change to
2200 * IPython/completer.py (Completer.attr_matches): revert change to
2180 complete only on attributes listed in __all__. I realized it
2201 complete only on attributes listed in __all__. I realized it
2181 cripples the tab-completion system as a tool for exploring the
2202 cripples the tab-completion system as a tool for exploring the
2182 internals of unknown libraries (it renders any non-__all__
2203 internals of unknown libraries (it renders any non-__all__
2183 attribute off-limits). I got bit by this when trying to see
2204 attribute off-limits). I got bit by this when trying to see
2184 something inside the dis module.
2205 something inside the dis module.
2185
2206
2186 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2207 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2187
2208
2188 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2209 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2189 namespace for users and extension writers to hold data in. This
2210 namespace for users and extension writers to hold data in. This
2190 follows the discussion in
2211 follows the discussion in
2191 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2212 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2192
2213
2193 * IPython/completer.py (IPCompleter.complete): small patch to help
2214 * IPython/completer.py (IPCompleter.complete): small patch to help
2194 tab-completion under Emacs, after a suggestion by John Barnard
2215 tab-completion under Emacs, after a suggestion by John Barnard
2195 <barnarj-AT-ccf.org>.
2216 <barnarj-AT-ccf.org>.
2196
2217
2197 * IPython/Magic.py (Magic.extract_input_slices): added support for
2218 * IPython/Magic.py (Magic.extract_input_slices): added support for
2198 the slice notation in magics to use N-M to represent numbers N...M
2219 the slice notation in magics to use N-M to represent numbers N...M
2199 (closed endpoints). This is used by %macro and %save.
2220 (closed endpoints). This is used by %macro and %save.
2200
2221
2201 * IPython/completer.py (Completer.attr_matches): for modules which
2222 * IPython/completer.py (Completer.attr_matches): for modules which
2202 define __all__, complete only on those. After a patch by Jeffrey
2223 define __all__, complete only on those. After a patch by Jeffrey
2203 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2224 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2204 speed up this routine.
2225 speed up this routine.
2205
2226
2206 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2227 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2207 don't know if this is the end of it, but the behavior now is
2228 don't know if this is the end of it, but the behavior now is
2208 certainly much more correct. Note that coupled with macros,
2229 certainly much more correct. Note that coupled with macros,
2209 slightly surprising (at first) behavior may occur: a macro will in
2230 slightly surprising (at first) behavior may occur: a macro will in
2210 general expand to multiple lines of input, so upon exiting, the
2231 general expand to multiple lines of input, so upon exiting, the
2211 in/out counters will both be bumped by the corresponding amount
2232 in/out counters will both be bumped by the corresponding amount
2212 (as if the macro's contents had been typed interactively). Typing
2233 (as if the macro's contents had been typed interactively). Typing
2213 %hist will reveal the intermediate (silently processed) lines.
2234 %hist will reveal the intermediate (silently processed) lines.
2214
2235
2215 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2236 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2216 pickle to fail (%run was overwriting __main__ and not restoring
2237 pickle to fail (%run was overwriting __main__ and not restoring
2217 it, but pickle relies on __main__ to operate).
2238 it, but pickle relies on __main__ to operate).
2218
2239
2219 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2240 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2220 using properties, but forgot to make the main InteractiveShell
2241 using properties, but forgot to make the main InteractiveShell
2221 class a new-style class. Properties fail silently, and
2242 class a new-style class. Properties fail silently, and
2222 mysteriously, with old-style class (getters work, but
2243 mysteriously, with old-style class (getters work, but
2223 setters don't do anything).
2244 setters don't do anything).
2224
2245
2225 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2246 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2226
2247
2227 * IPython/Magic.py (magic_history): fix history reporting bug (I
2248 * IPython/Magic.py (magic_history): fix history reporting bug (I
2228 know some nasties are still there, I just can't seem to find a
2249 know some nasties are still there, I just can't seem to find a
2229 reproducible test case to track them down; the input history is
2250 reproducible test case to track them down; the input history is
2230 falling out of sync...)
2251 falling out of sync...)
2231
2252
2232 * IPython/iplib.py (handle_shell_escape): fix bug where both
2253 * IPython/iplib.py (handle_shell_escape): fix bug where both
2233 aliases and system accesses where broken for indented code (such
2254 aliases and system accesses where broken for indented code (such
2234 as loops).
2255 as loops).
2235
2256
2236 * IPython/genutils.py (shell): fix small but critical bug for
2257 * IPython/genutils.py (shell): fix small but critical bug for
2237 win32 system access.
2258 win32 system access.
2238
2259
2239 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2260 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2240
2261
2241 * IPython/iplib.py (showtraceback): remove use of the
2262 * IPython/iplib.py (showtraceback): remove use of the
2242 sys.last_{type/value/traceback} structures, which are non
2263 sys.last_{type/value/traceback} structures, which are non
2243 thread-safe.
2264 thread-safe.
2244 (_prefilter): change control flow to ensure that we NEVER
2265 (_prefilter): change control flow to ensure that we NEVER
2245 introspect objects when autocall is off. This will guarantee that
2266 introspect objects when autocall is off. This will guarantee that
2246 having an input line of the form 'x.y', where access to attribute
2267 having an input line of the form 'x.y', where access to attribute
2247 'y' has side effects, doesn't trigger the side effect TWICE. It
2268 'y' has side effects, doesn't trigger the side effect TWICE. It
2248 is important to note that, with autocall on, these side effects
2269 is important to note that, with autocall on, these side effects
2249 can still happen.
2270 can still happen.
2250 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2271 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2251 trio. IPython offers these three kinds of special calls which are
2272 trio. IPython offers these three kinds of special calls which are
2252 not python code, and it's a good thing to have their call method
2273 not python code, and it's a good thing to have their call method
2253 be accessible as pure python functions (not just special syntax at
2274 be accessible as pure python functions (not just special syntax at
2254 the command line). It gives us a better internal implementation
2275 the command line). It gives us a better internal implementation
2255 structure, as well as exposing these for user scripting more
2276 structure, as well as exposing these for user scripting more
2256 cleanly.
2277 cleanly.
2257
2278
2258 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2279 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2259 file. Now that they'll be more likely to be used with the
2280 file. Now that they'll be more likely to be used with the
2260 persistance system (%store), I want to make sure their module path
2281 persistance system (%store), I want to make sure their module path
2261 doesn't change in the future, so that we don't break things for
2282 doesn't change in the future, so that we don't break things for
2262 users' persisted data.
2283 users' persisted data.
2263
2284
2264 * IPython/iplib.py (autoindent_update): move indentation
2285 * IPython/iplib.py (autoindent_update): move indentation
2265 management into the _text_ processing loop, not the keyboard
2286 management into the _text_ processing loop, not the keyboard
2266 interactive one. This is necessary to correctly process non-typed
2287 interactive one. This is necessary to correctly process non-typed
2267 multiline input (such as macros).
2288 multiline input (such as macros).
2268
2289
2269 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2290 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2270 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2291 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2271 which was producing problems in the resulting manual.
2292 which was producing problems in the resulting manual.
2272 (magic_whos): improve reporting of instances (show their class,
2293 (magic_whos): improve reporting of instances (show their class,
2273 instead of simply printing 'instance' which isn't terribly
2294 instead of simply printing 'instance' which isn't terribly
2274 informative).
2295 informative).
2275
2296
2276 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2297 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2277 (minor mods) to support network shares under win32.
2298 (minor mods) to support network shares under win32.
2278
2299
2279 * IPython/winconsole.py (get_console_size): add new winconsole
2300 * IPython/winconsole.py (get_console_size): add new winconsole
2280 module and fixes to page_dumb() to improve its behavior under
2301 module and fixes to page_dumb() to improve its behavior under
2281 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2302 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2282
2303
2283 * IPython/Magic.py (Macro): simplified Macro class to just
2304 * IPython/Magic.py (Macro): simplified Macro class to just
2284 subclass list. We've had only 2.2 compatibility for a very long
2305 subclass list. We've had only 2.2 compatibility for a very long
2285 time, yet I was still avoiding subclassing the builtin types. No
2306 time, yet I was still avoiding subclassing the builtin types. No
2286 more (I'm also starting to use properties, though I won't shift to
2307 more (I'm also starting to use properties, though I won't shift to
2287 2.3-specific features quite yet).
2308 2.3-specific features quite yet).
2288 (magic_store): added Ville's patch for lightweight variable
2309 (magic_store): added Ville's patch for lightweight variable
2289 persistence, after a request on the user list by Matt Wilkie
2310 persistence, after a request on the user list by Matt Wilkie
2290 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2311 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2291 details.
2312 details.
2292
2313
2293 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2314 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2294 changed the default logfile name from 'ipython.log' to
2315 changed the default logfile name from 'ipython.log' to
2295 'ipython_log.py'. These logs are real python files, and now that
2316 'ipython_log.py'. These logs are real python files, and now that
2296 we have much better multiline support, people are more likely to
2317 we have much better multiline support, people are more likely to
2297 want to use them as such. Might as well name them correctly.
2318 want to use them as such. Might as well name them correctly.
2298
2319
2299 * IPython/Magic.py: substantial cleanup. While we can't stop
2320 * IPython/Magic.py: substantial cleanup. While we can't stop
2300 using magics as mixins, due to the existing customizations 'out
2321 using magics as mixins, due to the existing customizations 'out
2301 there' which rely on the mixin naming conventions, at least I
2322 there' which rely on the mixin naming conventions, at least I
2302 cleaned out all cross-class name usage. So once we are OK with
2323 cleaned out all cross-class name usage. So once we are OK with
2303 breaking compatibility, the two systems can be separated.
2324 breaking compatibility, the two systems can be separated.
2304
2325
2305 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2326 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2306 anymore, and the class is a fair bit less hideous as well. New
2327 anymore, and the class is a fair bit less hideous as well. New
2307 features were also introduced: timestamping of input, and logging
2328 features were also introduced: timestamping of input, and logging
2308 of output results. These are user-visible with the -t and -o
2329 of output results. These are user-visible with the -t and -o
2309 options to %logstart. Closes
2330 options to %logstart. Closes
2310 http://www.scipy.net/roundup/ipython/issue11 and a request by
2331 http://www.scipy.net/roundup/ipython/issue11 and a request by
2311 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2332 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2312
2333
2313 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2334 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2314
2335
2315 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2336 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2316 better handle backslashes in paths. See the thread 'More Windows
2337 better handle backslashes in paths. See the thread 'More Windows
2317 questions part 2 - \/ characters revisited' on the iypthon user
2338 questions part 2 - \/ characters revisited' on the iypthon user
2318 list:
2339 list:
2319 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2340 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2320
2341
2321 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2342 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2322
2343
2323 (InteractiveShell.__init__): change threaded shells to not use the
2344 (InteractiveShell.__init__): change threaded shells to not use the
2324 ipython crash handler. This was causing more problems than not,
2345 ipython crash handler. This was causing more problems than not,
2325 as exceptions in the main thread (GUI code, typically) would
2346 as exceptions in the main thread (GUI code, typically) would
2326 always show up as a 'crash', when they really weren't.
2347 always show up as a 'crash', when they really weren't.
2327
2348
2328 The colors and exception mode commands (%colors/%xmode) have been
2349 The colors and exception mode commands (%colors/%xmode) have been
2329 synchronized to also take this into account, so users can get
2350 synchronized to also take this into account, so users can get
2330 verbose exceptions for their threaded code as well. I also added
2351 verbose exceptions for their threaded code as well. I also added
2331 support for activating pdb inside this exception handler as well,
2352 support for activating pdb inside this exception handler as well,
2332 so now GUI authors can use IPython's enhanced pdb at runtime.
2353 so now GUI authors can use IPython's enhanced pdb at runtime.
2333
2354
2334 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2355 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2335 true by default, and add it to the shipped ipythonrc file. Since
2356 true by default, and add it to the shipped ipythonrc file. Since
2336 this asks the user before proceeding, I think it's OK to make it
2357 this asks the user before proceeding, I think it's OK to make it
2337 true by default.
2358 true by default.
2338
2359
2339 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2360 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2340 of the previous special-casing of input in the eval loop. I think
2361 of the previous special-casing of input in the eval loop. I think
2341 this is cleaner, as they really are commands and shouldn't have
2362 this is cleaner, as they really are commands and shouldn't have
2342 a special role in the middle of the core code.
2363 a special role in the middle of the core code.
2343
2364
2344 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2365 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2345
2366
2346 * IPython/iplib.py (edit_syntax_error): added support for
2367 * IPython/iplib.py (edit_syntax_error): added support for
2347 automatically reopening the editor if the file had a syntax error
2368 automatically reopening the editor if the file had a syntax error
2348 in it. Thanks to scottt who provided the patch at:
2369 in it. Thanks to scottt who provided the patch at:
2349 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2370 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2350 version committed).
2371 version committed).
2351
2372
2352 * IPython/iplib.py (handle_normal): add suport for multi-line
2373 * IPython/iplib.py (handle_normal): add suport for multi-line
2353 input with emtpy lines. This fixes
2374 input with emtpy lines. This fixes
2354 http://www.scipy.net/roundup/ipython/issue43 and a similar
2375 http://www.scipy.net/roundup/ipython/issue43 and a similar
2355 discussion on the user list.
2376 discussion on the user list.
2356
2377
2357 WARNING: a behavior change is necessarily introduced to support
2378 WARNING: a behavior change is necessarily introduced to support
2358 blank lines: now a single blank line with whitespace does NOT
2379 blank lines: now a single blank line with whitespace does NOT
2359 break the input loop, which means that when autoindent is on, by
2380 break the input loop, which means that when autoindent is on, by
2360 default hitting return on the next (indented) line does NOT exit.
2381 default hitting return on the next (indented) line does NOT exit.
2361
2382
2362 Instead, to exit a multiline input you can either have:
2383 Instead, to exit a multiline input you can either have:
2363
2384
2364 - TWO whitespace lines (just hit return again), or
2385 - TWO whitespace lines (just hit return again), or
2365 - a single whitespace line of a different length than provided
2386 - a single whitespace line of a different length than provided
2366 by the autoindent (add or remove a space).
2387 by the autoindent (add or remove a space).
2367
2388
2368 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2389 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2369 module to better organize all readline-related functionality.
2390 module to better organize all readline-related functionality.
2370 I've deleted FlexCompleter and put all completion clases here.
2391 I've deleted FlexCompleter and put all completion clases here.
2371
2392
2372 * IPython/iplib.py (raw_input): improve indentation management.
2393 * IPython/iplib.py (raw_input): improve indentation management.
2373 It is now possible to paste indented code with autoindent on, and
2394 It is now possible to paste indented code with autoindent on, and
2374 the code is interpreted correctly (though it still looks bad on
2395 the code is interpreted correctly (though it still looks bad on
2375 screen, due to the line-oriented nature of ipython).
2396 screen, due to the line-oriented nature of ipython).
2376 (MagicCompleter.complete): change behavior so that a TAB key on an
2397 (MagicCompleter.complete): change behavior so that a TAB key on an
2377 otherwise empty line actually inserts a tab, instead of completing
2398 otherwise empty line actually inserts a tab, instead of completing
2378 on the entire global namespace. This makes it easier to use the
2399 on the entire global namespace. This makes it easier to use the
2379 TAB key for indentation. After a request by Hans Meine
2400 TAB key for indentation. After a request by Hans Meine
2380 <hans_meine-AT-gmx.net>
2401 <hans_meine-AT-gmx.net>
2381 (_prefilter): add support so that typing plain 'exit' or 'quit'
2402 (_prefilter): add support so that typing plain 'exit' or 'quit'
2382 does a sensible thing. Originally I tried to deviate as little as
2403 does a sensible thing. Originally I tried to deviate as little as
2383 possible from the default python behavior, but even that one may
2404 possible from the default python behavior, but even that one may
2384 change in this direction (thread on python-dev to that effect).
2405 change in this direction (thread on python-dev to that effect).
2385 Regardless, ipython should do the right thing even if CPython's
2406 Regardless, ipython should do the right thing even if CPython's
2386 '>>>' prompt doesn't.
2407 '>>>' prompt doesn't.
2387 (InteractiveShell): removed subclassing code.InteractiveConsole
2408 (InteractiveShell): removed subclassing code.InteractiveConsole
2388 class. By now we'd overridden just about all of its methods: I've
2409 class. By now we'd overridden just about all of its methods: I've
2389 copied the remaining two over, and now ipython is a standalone
2410 copied the remaining two over, and now ipython is a standalone
2390 class. This will provide a clearer picture for the chainsaw
2411 class. This will provide a clearer picture for the chainsaw
2391 branch refactoring.
2412 branch refactoring.
2392
2413
2393 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2414 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2394
2415
2395 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2416 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2396 failures for objects which break when dir() is called on them.
2417 failures for objects which break when dir() is called on them.
2397
2418
2398 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2419 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2399 distinct local and global namespaces in the completer API. This
2420 distinct local and global namespaces in the completer API. This
2400 change allows us to properly handle completion with distinct
2421 change allows us to properly handle completion with distinct
2401 scopes, including in embedded instances (this had never really
2422 scopes, including in embedded instances (this had never really
2402 worked correctly).
2423 worked correctly).
2403
2424
2404 Note: this introduces a change in the constructor for
2425 Note: this introduces a change in the constructor for
2405 MagicCompleter, as a new global_namespace parameter is now the
2426 MagicCompleter, as a new global_namespace parameter is now the
2406 second argument (the others were bumped one position).
2427 second argument (the others were bumped one position).
2407
2428
2408 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2429 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2409
2430
2410 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2431 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2411 embedded instances (which can be done now thanks to Vivian's
2432 embedded instances (which can be done now thanks to Vivian's
2412 frame-handling fixes for pdb).
2433 frame-handling fixes for pdb).
2413 (InteractiveShell.__init__): Fix namespace handling problem in
2434 (InteractiveShell.__init__): Fix namespace handling problem in
2414 embedded instances. We were overwriting __main__ unconditionally,
2435 embedded instances. We were overwriting __main__ unconditionally,
2415 and this should only be done for 'full' (non-embedded) IPython;
2436 and this should only be done for 'full' (non-embedded) IPython;
2416 embedded instances must respect the caller's __main__. Thanks to
2437 embedded instances must respect the caller's __main__. Thanks to
2417 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2438 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2418
2439
2419 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2440 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2420
2441
2421 * setup.py: added download_url to setup(). This registers the
2442 * setup.py: added download_url to setup(). This registers the
2422 download address at PyPI, which is not only useful to humans
2443 download address at PyPI, which is not only useful to humans
2423 browsing the site, but is also picked up by setuptools (the Eggs
2444 browsing the site, but is also picked up by setuptools (the Eggs
2424 machinery). Thanks to Ville and R. Kern for the info/discussion
2445 machinery). Thanks to Ville and R. Kern for the info/discussion
2425 on this.
2446 on this.
2426
2447
2427 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2448 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2428
2449
2429 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2450 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2430 This brings a lot of nice functionality to the pdb mode, which now
2451 This brings a lot of nice functionality to the pdb mode, which now
2431 has tab-completion, syntax highlighting, and better stack handling
2452 has tab-completion, syntax highlighting, and better stack handling
2432 than before. Many thanks to Vivian De Smedt
2453 than before. Many thanks to Vivian De Smedt
2433 <vivian-AT-vdesmedt.com> for the original patches.
2454 <vivian-AT-vdesmedt.com> for the original patches.
2434
2455
2435 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2456 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2436
2457
2437 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2458 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2438 sequence to consistently accept the banner argument. The
2459 sequence to consistently accept the banner argument. The
2439 inconsistency was tripping SAGE, thanks to Gary Zablackis
2460 inconsistency was tripping SAGE, thanks to Gary Zablackis
2440 <gzabl-AT-yahoo.com> for the report.
2461 <gzabl-AT-yahoo.com> for the report.
2441
2462
2442 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2463 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2443
2464
2444 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2465 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2445 Fix bug where a naked 'alias' call in the ipythonrc file would
2466 Fix bug where a naked 'alias' call in the ipythonrc file would
2446 cause a crash. Bug reported by Jorgen Stenarson.
2467 cause a crash. Bug reported by Jorgen Stenarson.
2447
2468
2448 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2469 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2449
2470
2450 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2471 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2451 startup time.
2472 startup time.
2452
2473
2453 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2474 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2454 instances had introduced a bug with globals in normal code. Now
2475 instances had introduced a bug with globals in normal code. Now
2455 it's working in all cases.
2476 it's working in all cases.
2456
2477
2457 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2478 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2458 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2479 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2459 has been introduced to set the default case sensitivity of the
2480 has been introduced to set the default case sensitivity of the
2460 searches. Users can still select either mode at runtime on a
2481 searches. Users can still select either mode at runtime on a
2461 per-search basis.
2482 per-search basis.
2462
2483
2463 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2484 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2464
2485
2465 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2486 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2466 attributes in wildcard searches for subclasses. Modified version
2487 attributes in wildcard searches for subclasses. Modified version
2467 of a patch by Jorgen.
2488 of a patch by Jorgen.
2468
2489
2469 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2490 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2470
2491
2471 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2492 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2472 embedded instances. I added a user_global_ns attribute to the
2493 embedded instances. I added a user_global_ns attribute to the
2473 InteractiveShell class to handle this.
2494 InteractiveShell class to handle this.
2474
2495
2475 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2496 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2476
2497
2477 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2498 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2478 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2499 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2479 (reported under win32, but may happen also in other platforms).
2500 (reported under win32, but may happen also in other platforms).
2480 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2501 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2481
2502
2482 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2503 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2483
2504
2484 * IPython/Magic.py (magic_psearch): new support for wildcard
2505 * IPython/Magic.py (magic_psearch): new support for wildcard
2485 patterns. Now, typing ?a*b will list all names which begin with a
2506 patterns. Now, typing ?a*b will list all names which begin with a
2486 and end in b, for example. The %psearch magic has full
2507 and end in b, for example. The %psearch magic has full
2487 docstrings. Many thanks to JΓΆrgen Stenarson
2508 docstrings. Many thanks to JΓΆrgen Stenarson
2488 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2509 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2489 implementing this functionality.
2510 implementing this functionality.
2490
2511
2491 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2512 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2492
2513
2493 * Manual: fixed long-standing annoyance of double-dashes (as in
2514 * Manual: fixed long-standing annoyance of double-dashes (as in
2494 --prefix=~, for example) being stripped in the HTML version. This
2515 --prefix=~, for example) being stripped in the HTML version. This
2495 is a latex2html bug, but a workaround was provided. Many thanks
2516 is a latex2html bug, but a workaround was provided. Many thanks
2496 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2517 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2497 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2518 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2498 rolling. This seemingly small issue had tripped a number of users
2519 rolling. This seemingly small issue had tripped a number of users
2499 when first installing, so I'm glad to see it gone.
2520 when first installing, so I'm glad to see it gone.
2500
2521
2501 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2522 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2502
2523
2503 * IPython/Extensions/numeric_formats.py: fix missing import,
2524 * IPython/Extensions/numeric_formats.py: fix missing import,
2504 reported by Stephen Walton.
2525 reported by Stephen Walton.
2505
2526
2506 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2527 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2507
2528
2508 * IPython/demo.py: finish demo module, fully documented now.
2529 * IPython/demo.py: finish demo module, fully documented now.
2509
2530
2510 * IPython/genutils.py (file_read): simple little utility to read a
2531 * IPython/genutils.py (file_read): simple little utility to read a
2511 file and ensure it's closed afterwards.
2532 file and ensure it's closed afterwards.
2512
2533
2513 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2534 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2514
2535
2515 * IPython/demo.py (Demo.__init__): added support for individually
2536 * IPython/demo.py (Demo.__init__): added support for individually
2516 tagging blocks for automatic execution.
2537 tagging blocks for automatic execution.
2517
2538
2518 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2539 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2519 syntax-highlighted python sources, requested by John.
2540 syntax-highlighted python sources, requested by John.
2520
2541
2521 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2542 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2522
2543
2523 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2544 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2524 finishing.
2545 finishing.
2525
2546
2526 * IPython/genutils.py (shlex_split): moved from Magic to here,
2547 * IPython/genutils.py (shlex_split): moved from Magic to here,
2527 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2548 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2528
2549
2529 * IPython/demo.py (Demo.__init__): added support for silent
2550 * IPython/demo.py (Demo.__init__): added support for silent
2530 blocks, improved marks as regexps, docstrings written.
2551 blocks, improved marks as regexps, docstrings written.
2531 (Demo.__init__): better docstring, added support for sys.argv.
2552 (Demo.__init__): better docstring, added support for sys.argv.
2532
2553
2533 * IPython/genutils.py (marquee): little utility used by the demo
2554 * IPython/genutils.py (marquee): little utility used by the demo
2534 code, handy in general.
2555 code, handy in general.
2535
2556
2536 * IPython/demo.py (Demo.__init__): new class for interactive
2557 * IPython/demo.py (Demo.__init__): new class for interactive
2537 demos. Not documented yet, I just wrote it in a hurry for
2558 demos. Not documented yet, I just wrote it in a hurry for
2538 scipy'05. Will docstring later.
2559 scipy'05. Will docstring later.
2539
2560
2540 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2561 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2541
2562
2542 * IPython/Shell.py (sigint_handler): Drastic simplification which
2563 * IPython/Shell.py (sigint_handler): Drastic simplification which
2543 also seems to make Ctrl-C work correctly across threads! This is
2564 also seems to make Ctrl-C work correctly across threads! This is
2544 so simple, that I can't beleive I'd missed it before. Needs more
2565 so simple, that I can't beleive I'd missed it before. Needs more
2545 testing, though.
2566 testing, though.
2546 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2567 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2547 like this before...
2568 like this before...
2548
2569
2549 * IPython/genutils.py (get_home_dir): add protection against
2570 * IPython/genutils.py (get_home_dir): add protection against
2550 non-dirs in win32 registry.
2571 non-dirs in win32 registry.
2551
2572
2552 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2573 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2553 bug where dict was mutated while iterating (pysh crash).
2574 bug where dict was mutated while iterating (pysh crash).
2554
2575
2555 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2576 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2556
2577
2557 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2578 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2558 spurious newlines added by this routine. After a report by
2579 spurious newlines added by this routine. After a report by
2559 F. Mantegazza.
2580 F. Mantegazza.
2560
2581
2561 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2582 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2562
2583
2563 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2584 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2564 calls. These were a leftover from the GTK 1.x days, and can cause
2585 calls. These were a leftover from the GTK 1.x days, and can cause
2565 problems in certain cases (after a report by John Hunter).
2586 problems in certain cases (after a report by John Hunter).
2566
2587
2567 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2588 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2568 os.getcwd() fails at init time. Thanks to patch from David Remahl
2589 os.getcwd() fails at init time. Thanks to patch from David Remahl
2569 <chmod007-AT-mac.com>.
2590 <chmod007-AT-mac.com>.
2570 (InteractiveShell.__init__): prevent certain special magics from
2591 (InteractiveShell.__init__): prevent certain special magics from
2571 being shadowed by aliases. Closes
2592 being shadowed by aliases. Closes
2572 http://www.scipy.net/roundup/ipython/issue41.
2593 http://www.scipy.net/roundup/ipython/issue41.
2573
2594
2574 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2595 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2575
2596
2576 * IPython/iplib.py (InteractiveShell.complete): Added new
2597 * IPython/iplib.py (InteractiveShell.complete): Added new
2577 top-level completion method to expose the completion mechanism
2598 top-level completion method to expose the completion mechanism
2578 beyond readline-based environments.
2599 beyond readline-based environments.
2579
2600
2580 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2601 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2581
2602
2582 * tools/ipsvnc (svnversion): fix svnversion capture.
2603 * tools/ipsvnc (svnversion): fix svnversion capture.
2583
2604
2584 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2605 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2585 attribute to self, which was missing. Before, it was set by a
2606 attribute to self, which was missing. Before, it was set by a
2586 routine which in certain cases wasn't being called, so the
2607 routine which in certain cases wasn't being called, so the
2587 instance could end up missing the attribute. This caused a crash.
2608 instance could end up missing the attribute. This caused a crash.
2588 Closes http://www.scipy.net/roundup/ipython/issue40.
2609 Closes http://www.scipy.net/roundup/ipython/issue40.
2589
2610
2590 2005-08-16 Fernando Perez <fperez@colorado.edu>
2611 2005-08-16 Fernando Perez <fperez@colorado.edu>
2591
2612
2592 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2613 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2593 contains non-string attribute. Closes
2614 contains non-string attribute. Closes
2594 http://www.scipy.net/roundup/ipython/issue38.
2615 http://www.scipy.net/roundup/ipython/issue38.
2595
2616
2596 2005-08-14 Fernando Perez <fperez@colorado.edu>
2617 2005-08-14 Fernando Perez <fperez@colorado.edu>
2597
2618
2598 * tools/ipsvnc: Minor improvements, to add changeset info.
2619 * tools/ipsvnc: Minor improvements, to add changeset info.
2599
2620
2600 2005-08-12 Fernando Perez <fperez@colorado.edu>
2621 2005-08-12 Fernando Perez <fperez@colorado.edu>
2601
2622
2602 * IPython/iplib.py (runsource): remove self.code_to_run_src
2623 * IPython/iplib.py (runsource): remove self.code_to_run_src
2603 attribute. I realized this is nothing more than
2624 attribute. I realized this is nothing more than
2604 '\n'.join(self.buffer), and having the same data in two different
2625 '\n'.join(self.buffer), and having the same data in two different
2605 places is just asking for synchronization bugs. This may impact
2626 places is just asking for synchronization bugs. This may impact
2606 people who have custom exception handlers, so I need to warn
2627 people who have custom exception handlers, so I need to warn
2607 ipython-dev about it (F. Mantegazza may use them).
2628 ipython-dev about it (F. Mantegazza may use them).
2608
2629
2609 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2630 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2610
2631
2611 * IPython/genutils.py: fix 2.2 compatibility (generators)
2632 * IPython/genutils.py: fix 2.2 compatibility (generators)
2612
2633
2613 2005-07-18 Fernando Perez <fperez@colorado.edu>
2634 2005-07-18 Fernando Perez <fperez@colorado.edu>
2614
2635
2615 * IPython/genutils.py (get_home_dir): fix to help users with
2636 * IPython/genutils.py (get_home_dir): fix to help users with
2616 invalid $HOME under win32.
2637 invalid $HOME under win32.
2617
2638
2618 2005-07-17 Fernando Perez <fperez@colorado.edu>
2639 2005-07-17 Fernando Perez <fperez@colorado.edu>
2619
2640
2620 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2641 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2621 some old hacks and clean up a bit other routines; code should be
2642 some old hacks and clean up a bit other routines; code should be
2622 simpler and a bit faster.
2643 simpler and a bit faster.
2623
2644
2624 * IPython/iplib.py (interact): removed some last-resort attempts
2645 * IPython/iplib.py (interact): removed some last-resort attempts
2625 to survive broken stdout/stderr. That code was only making it
2646 to survive broken stdout/stderr. That code was only making it
2626 harder to abstract out the i/o (necessary for gui integration),
2647 harder to abstract out the i/o (necessary for gui integration),
2627 and the crashes it could prevent were extremely rare in practice
2648 and the crashes it could prevent were extremely rare in practice
2628 (besides being fully user-induced in a pretty violent manner).
2649 (besides being fully user-induced in a pretty violent manner).
2629
2650
2630 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2651 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2631 Nothing major yet, but the code is simpler to read; this should
2652 Nothing major yet, but the code is simpler to read; this should
2632 make it easier to do more serious modifications in the future.
2653 make it easier to do more serious modifications in the future.
2633
2654
2634 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2655 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2635 which broke in .15 (thanks to a report by Ville).
2656 which broke in .15 (thanks to a report by Ville).
2636
2657
2637 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2658 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2638 be quite correct, I know next to nothing about unicode). This
2659 be quite correct, I know next to nothing about unicode). This
2639 will allow unicode strings to be used in prompts, amongst other
2660 will allow unicode strings to be used in prompts, amongst other
2640 cases. It also will prevent ipython from crashing when unicode
2661 cases. It also will prevent ipython from crashing when unicode
2641 shows up unexpectedly in many places. If ascii encoding fails, we
2662 shows up unexpectedly in many places. If ascii encoding fails, we
2642 assume utf_8. Currently the encoding is not a user-visible
2663 assume utf_8. Currently the encoding is not a user-visible
2643 setting, though it could be made so if there is demand for it.
2664 setting, though it could be made so if there is demand for it.
2644
2665
2645 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2666 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2646
2667
2647 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2668 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2648
2669
2649 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2670 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2650
2671
2651 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2672 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2652 code can work transparently for 2.2/2.3.
2673 code can work transparently for 2.2/2.3.
2653
2674
2654 2005-07-16 Fernando Perez <fperez@colorado.edu>
2675 2005-07-16 Fernando Perez <fperez@colorado.edu>
2655
2676
2656 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2677 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2657 out of the color scheme table used for coloring exception
2678 out of the color scheme table used for coloring exception
2658 tracebacks. This allows user code to add new schemes at runtime.
2679 tracebacks. This allows user code to add new schemes at runtime.
2659 This is a minimally modified version of the patch at
2680 This is a minimally modified version of the patch at
2660 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2681 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2661 for the contribution.
2682 for the contribution.
2662
2683
2663 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2684 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2664 slightly modified version of the patch in
2685 slightly modified version of the patch in
2665 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2686 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2666 to remove the previous try/except solution (which was costlier).
2687 to remove the previous try/except solution (which was costlier).
2667 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2688 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2668
2689
2669 2005-06-08 Fernando Perez <fperez@colorado.edu>
2690 2005-06-08 Fernando Perez <fperez@colorado.edu>
2670
2691
2671 * IPython/iplib.py (write/write_err): Add methods to abstract all
2692 * IPython/iplib.py (write/write_err): Add methods to abstract all
2672 I/O a bit more.
2693 I/O a bit more.
2673
2694
2674 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2695 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2675 warning, reported by Aric Hagberg, fix by JD Hunter.
2696 warning, reported by Aric Hagberg, fix by JD Hunter.
2676
2697
2677 2005-06-02 *** Released version 0.6.15
2698 2005-06-02 *** Released version 0.6.15
2678
2699
2679 2005-06-01 Fernando Perez <fperez@colorado.edu>
2700 2005-06-01 Fernando Perez <fperez@colorado.edu>
2680
2701
2681 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2702 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2682 tab-completion of filenames within open-quoted strings. Note that
2703 tab-completion of filenames within open-quoted strings. Note that
2683 this requires that in ~/.ipython/ipythonrc, users change the
2704 this requires that in ~/.ipython/ipythonrc, users change the
2684 readline delimiters configuration to read:
2705 readline delimiters configuration to read:
2685
2706
2686 readline_remove_delims -/~
2707 readline_remove_delims -/~
2687
2708
2688
2709
2689 2005-05-31 *** Released version 0.6.14
2710 2005-05-31 *** Released version 0.6.14
2690
2711
2691 2005-05-29 Fernando Perez <fperez@colorado.edu>
2712 2005-05-29 Fernando Perez <fperez@colorado.edu>
2692
2713
2693 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2714 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2694 with files not on the filesystem. Reported by Eliyahu Sandler
2715 with files not on the filesystem. Reported by Eliyahu Sandler
2695 <eli@gondolin.net>
2716 <eli@gondolin.net>
2696
2717
2697 2005-05-22 Fernando Perez <fperez@colorado.edu>
2718 2005-05-22 Fernando Perez <fperez@colorado.edu>
2698
2719
2699 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2720 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2700 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2721 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2701
2722
2702 2005-05-19 Fernando Perez <fperez@colorado.edu>
2723 2005-05-19 Fernando Perez <fperez@colorado.edu>
2703
2724
2704 * IPython/iplib.py (safe_execfile): close a file which could be
2725 * IPython/iplib.py (safe_execfile): close a file which could be
2705 left open (causing problems in win32, which locks open files).
2726 left open (causing problems in win32, which locks open files).
2706 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2727 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2707
2728
2708 2005-05-18 Fernando Perez <fperez@colorado.edu>
2729 2005-05-18 Fernando Perez <fperez@colorado.edu>
2709
2730
2710 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2731 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2711 keyword arguments correctly to safe_execfile().
2732 keyword arguments correctly to safe_execfile().
2712
2733
2713 2005-05-13 Fernando Perez <fperez@colorado.edu>
2734 2005-05-13 Fernando Perez <fperez@colorado.edu>
2714
2735
2715 * ipython.1: Added info about Qt to manpage, and threads warning
2736 * ipython.1: Added info about Qt to manpage, and threads warning
2716 to usage page (invoked with --help).
2737 to usage page (invoked with --help).
2717
2738
2718 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2739 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2719 new matcher (it goes at the end of the priority list) to do
2740 new matcher (it goes at the end of the priority list) to do
2720 tab-completion on named function arguments. Submitted by George
2741 tab-completion on named function arguments. Submitted by George
2721 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2742 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2722 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2743 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2723 for more details.
2744 for more details.
2724
2745
2725 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2746 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2726 SystemExit exceptions in the script being run. Thanks to a report
2747 SystemExit exceptions in the script being run. Thanks to a report
2727 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2748 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2728 producing very annoying behavior when running unit tests.
2749 producing very annoying behavior when running unit tests.
2729
2750
2730 2005-05-12 Fernando Perez <fperez@colorado.edu>
2751 2005-05-12 Fernando Perez <fperez@colorado.edu>
2731
2752
2732 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2753 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2733 which I'd broken (again) due to a changed regexp. In the process,
2754 which I'd broken (again) due to a changed regexp. In the process,
2734 added ';' as an escape to auto-quote the whole line without
2755 added ';' as an escape to auto-quote the whole line without
2735 splitting its arguments. Thanks to a report by Jerry McRae
2756 splitting its arguments. Thanks to a report by Jerry McRae
2736 <qrs0xyc02-AT-sneakemail.com>.
2757 <qrs0xyc02-AT-sneakemail.com>.
2737
2758
2738 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2759 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2739 possible crashes caused by a TokenError. Reported by Ed Schofield
2760 possible crashes caused by a TokenError. Reported by Ed Schofield
2740 <schofield-AT-ftw.at>.
2761 <schofield-AT-ftw.at>.
2741
2762
2742 2005-05-06 Fernando Perez <fperez@colorado.edu>
2763 2005-05-06 Fernando Perez <fperez@colorado.edu>
2743
2764
2744 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2765 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2745
2766
2746 2005-04-29 Fernando Perez <fperez@colorado.edu>
2767 2005-04-29 Fernando Perez <fperez@colorado.edu>
2747
2768
2748 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2769 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2749 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2770 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2750 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2771 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2751 which provides support for Qt interactive usage (similar to the
2772 which provides support for Qt interactive usage (similar to the
2752 existing one for WX and GTK). This had been often requested.
2773 existing one for WX and GTK). This had been often requested.
2753
2774
2754 2005-04-14 *** Released version 0.6.13
2775 2005-04-14 *** Released version 0.6.13
2755
2776
2756 2005-04-08 Fernando Perez <fperez@colorado.edu>
2777 2005-04-08 Fernando Perez <fperez@colorado.edu>
2757
2778
2758 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2779 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2759 from _ofind, which gets called on almost every input line. Now,
2780 from _ofind, which gets called on almost every input line. Now,
2760 we only try to get docstrings if they are actually going to be
2781 we only try to get docstrings if they are actually going to be
2761 used (the overhead of fetching unnecessary docstrings can be
2782 used (the overhead of fetching unnecessary docstrings can be
2762 noticeable for certain objects, such as Pyro proxies).
2783 noticeable for certain objects, such as Pyro proxies).
2763
2784
2764 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2785 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2765 for completers. For some reason I had been passing them the state
2786 for completers. For some reason I had been passing them the state
2766 variable, which completers never actually need, and was in
2787 variable, which completers never actually need, and was in
2767 conflict with the rlcompleter API. Custom completers ONLY need to
2788 conflict with the rlcompleter API. Custom completers ONLY need to
2768 take the text parameter.
2789 take the text parameter.
2769
2790
2770 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2791 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2771 work correctly in pysh. I've also moved all the logic which used
2792 work correctly in pysh. I've also moved all the logic which used
2772 to be in pysh.py here, which will prevent problems with future
2793 to be in pysh.py here, which will prevent problems with future
2773 upgrades. However, this time I must warn users to update their
2794 upgrades. However, this time I must warn users to update their
2774 pysh profile to include the line
2795 pysh profile to include the line
2775
2796
2776 import_all IPython.Extensions.InterpreterExec
2797 import_all IPython.Extensions.InterpreterExec
2777
2798
2778 because otherwise things won't work for them. They MUST also
2799 because otherwise things won't work for them. They MUST also
2779 delete pysh.py and the line
2800 delete pysh.py and the line
2780
2801
2781 execfile pysh.py
2802 execfile pysh.py
2782
2803
2783 from their ipythonrc-pysh.
2804 from their ipythonrc-pysh.
2784
2805
2785 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2806 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2786 robust in the face of objects whose dir() returns non-strings
2807 robust in the face of objects whose dir() returns non-strings
2787 (which it shouldn't, but some broken libs like ITK do). Thanks to
2808 (which it shouldn't, but some broken libs like ITK do). Thanks to
2788 a patch by John Hunter (implemented differently, though). Also
2809 a patch by John Hunter (implemented differently, though). Also
2789 minor improvements by using .extend instead of + on lists.
2810 minor improvements by using .extend instead of + on lists.
2790
2811
2791 * pysh.py:
2812 * pysh.py:
2792
2813
2793 2005-04-06 Fernando Perez <fperez@colorado.edu>
2814 2005-04-06 Fernando Perez <fperez@colorado.edu>
2794
2815
2795 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2816 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2796 by default, so that all users benefit from it. Those who don't
2817 by default, so that all users benefit from it. Those who don't
2797 want it can still turn it off.
2818 want it can still turn it off.
2798
2819
2799 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2820 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2800 config file, I'd forgotten about this, so users were getting it
2821 config file, I'd forgotten about this, so users were getting it
2801 off by default.
2822 off by default.
2802
2823
2803 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2824 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2804 consistency. Now magics can be called in multiline statements,
2825 consistency. Now magics can be called in multiline statements,
2805 and python variables can be expanded in magic calls via $var.
2826 and python variables can be expanded in magic calls via $var.
2806 This makes the magic system behave just like aliases or !system
2827 This makes the magic system behave just like aliases or !system
2807 calls.
2828 calls.
2808
2829
2809 2005-03-28 Fernando Perez <fperez@colorado.edu>
2830 2005-03-28 Fernando Perez <fperez@colorado.edu>
2810
2831
2811 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2832 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2812 expensive string additions for building command. Add support for
2833 expensive string additions for building command. Add support for
2813 trailing ';' when autocall is used.
2834 trailing ';' when autocall is used.
2814
2835
2815 2005-03-26 Fernando Perez <fperez@colorado.edu>
2836 2005-03-26 Fernando Perez <fperez@colorado.edu>
2816
2837
2817 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2838 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2818 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2839 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2819 ipython.el robust against prompts with any number of spaces
2840 ipython.el robust against prompts with any number of spaces
2820 (including 0) after the ':' character.
2841 (including 0) after the ':' character.
2821
2842
2822 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2843 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2823 continuation prompt, which misled users to think the line was
2844 continuation prompt, which misled users to think the line was
2824 already indented. Closes debian Bug#300847, reported to me by
2845 already indented. Closes debian Bug#300847, reported to me by
2825 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2846 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2826
2847
2827 2005-03-23 Fernando Perez <fperez@colorado.edu>
2848 2005-03-23 Fernando Perez <fperez@colorado.edu>
2828
2849
2829 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2850 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2830 properly aligned if they have embedded newlines.
2851 properly aligned if they have embedded newlines.
2831
2852
2832 * IPython/iplib.py (runlines): Add a public method to expose
2853 * IPython/iplib.py (runlines): Add a public method to expose
2833 IPython's code execution machinery, so that users can run strings
2854 IPython's code execution machinery, so that users can run strings
2834 as if they had been typed at the prompt interactively.
2855 as if they had been typed at the prompt interactively.
2835 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2856 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2836 methods which can call the system shell, but with python variable
2857 methods which can call the system shell, but with python variable
2837 expansion. The three such methods are: __IPYTHON__.system,
2858 expansion. The three such methods are: __IPYTHON__.system,
2838 .getoutput and .getoutputerror. These need to be documented in a
2859 .getoutput and .getoutputerror. These need to be documented in a
2839 'public API' section (to be written) of the manual.
2860 'public API' section (to be written) of the manual.
2840
2861
2841 2005-03-20 Fernando Perez <fperez@colorado.edu>
2862 2005-03-20 Fernando Perez <fperez@colorado.edu>
2842
2863
2843 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2864 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2844 for custom exception handling. This is quite powerful, and it
2865 for custom exception handling. This is quite powerful, and it
2845 allows for user-installable exception handlers which can trap
2866 allows for user-installable exception handlers which can trap
2846 custom exceptions at runtime and treat them separately from
2867 custom exceptions at runtime and treat them separately from
2847 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2868 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2848 Mantegazza <mantegazza-AT-ill.fr>.
2869 Mantegazza <mantegazza-AT-ill.fr>.
2849 (InteractiveShell.set_custom_completer): public API function to
2870 (InteractiveShell.set_custom_completer): public API function to
2850 add new completers at runtime.
2871 add new completers at runtime.
2851
2872
2852 2005-03-19 Fernando Perez <fperez@colorado.edu>
2873 2005-03-19 Fernando Perez <fperez@colorado.edu>
2853
2874
2854 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2875 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2855 allow objects which provide their docstrings via non-standard
2876 allow objects which provide their docstrings via non-standard
2856 mechanisms (like Pyro proxies) to still be inspected by ipython's
2877 mechanisms (like Pyro proxies) to still be inspected by ipython's
2857 ? system.
2878 ? system.
2858
2879
2859 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2880 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2860 automatic capture system. I tried quite hard to make it work
2881 automatic capture system. I tried quite hard to make it work
2861 reliably, and simply failed. I tried many combinations with the
2882 reliably, and simply failed. I tried many combinations with the
2862 subprocess module, but eventually nothing worked in all needed
2883 subprocess module, but eventually nothing worked in all needed
2863 cases (not blocking stdin for the child, duplicating stdout
2884 cases (not blocking stdin for the child, duplicating stdout
2864 without blocking, etc). The new %sc/%sx still do capture to these
2885 without blocking, etc). The new %sc/%sx still do capture to these
2865 magical list/string objects which make shell use much more
2886 magical list/string objects which make shell use much more
2866 conveninent, so not all is lost.
2887 conveninent, so not all is lost.
2867
2888
2868 XXX - FIX MANUAL for the change above!
2889 XXX - FIX MANUAL for the change above!
2869
2890
2870 (runsource): I copied code.py's runsource() into ipython to modify
2891 (runsource): I copied code.py's runsource() into ipython to modify
2871 it a bit. Now the code object and source to be executed are
2892 it a bit. Now the code object and source to be executed are
2872 stored in ipython. This makes this info accessible to third-party
2893 stored in ipython. This makes this info accessible to third-party
2873 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2894 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2874 Mantegazza <mantegazza-AT-ill.fr>.
2895 Mantegazza <mantegazza-AT-ill.fr>.
2875
2896
2876 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2897 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2877 history-search via readline (like C-p/C-n). I'd wanted this for a
2898 history-search via readline (like C-p/C-n). I'd wanted this for a
2878 long time, but only recently found out how to do it. For users
2899 long time, but only recently found out how to do it. For users
2879 who already have their ipythonrc files made and want this, just
2900 who already have their ipythonrc files made and want this, just
2880 add:
2901 add:
2881
2902
2882 readline_parse_and_bind "\e[A": history-search-backward
2903 readline_parse_and_bind "\e[A": history-search-backward
2883 readline_parse_and_bind "\e[B": history-search-forward
2904 readline_parse_and_bind "\e[B": history-search-forward
2884
2905
2885 2005-03-18 Fernando Perez <fperez@colorado.edu>
2906 2005-03-18 Fernando Perez <fperez@colorado.edu>
2886
2907
2887 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2908 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2888 LSString and SList classes which allow transparent conversions
2909 LSString and SList classes which allow transparent conversions
2889 between list mode and whitespace-separated string.
2910 between list mode and whitespace-separated string.
2890 (magic_r): Fix recursion problem in %r.
2911 (magic_r): Fix recursion problem in %r.
2891
2912
2892 * IPython/genutils.py (LSString): New class to be used for
2913 * IPython/genutils.py (LSString): New class to be used for
2893 automatic storage of the results of all alias/system calls in _o
2914 automatic storage of the results of all alias/system calls in _o
2894 and _e (stdout/err). These provide a .l/.list attribute which
2915 and _e (stdout/err). These provide a .l/.list attribute which
2895 does automatic splitting on newlines. This means that for most
2916 does automatic splitting on newlines. This means that for most
2896 uses, you'll never need to do capturing of output with %sc/%sx
2917 uses, you'll never need to do capturing of output with %sc/%sx
2897 anymore, since ipython keeps this always done for you. Note that
2918 anymore, since ipython keeps this always done for you. Note that
2898 only the LAST results are stored, the _o/e variables are
2919 only the LAST results are stored, the _o/e variables are
2899 overwritten on each call. If you need to save their contents
2920 overwritten on each call. If you need to save their contents
2900 further, simply bind them to any other name.
2921 further, simply bind them to any other name.
2901
2922
2902 2005-03-17 Fernando Perez <fperez@colorado.edu>
2923 2005-03-17 Fernando Perez <fperez@colorado.edu>
2903
2924
2904 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2925 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2905 prompt namespace handling.
2926 prompt namespace handling.
2906
2927
2907 2005-03-16 Fernando Perez <fperez@colorado.edu>
2928 2005-03-16 Fernando Perez <fperez@colorado.edu>
2908
2929
2909 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2930 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2910 classic prompts to be '>>> ' (final space was missing, and it
2931 classic prompts to be '>>> ' (final space was missing, and it
2911 trips the emacs python mode).
2932 trips the emacs python mode).
2912 (BasePrompt.__str__): Added safe support for dynamic prompt
2933 (BasePrompt.__str__): Added safe support for dynamic prompt
2913 strings. Now you can set your prompt string to be '$x', and the
2934 strings. Now you can set your prompt string to be '$x', and the
2914 value of x will be printed from your interactive namespace. The
2935 value of x will be printed from your interactive namespace. The
2915 interpolation syntax includes the full Itpl support, so
2936 interpolation syntax includes the full Itpl support, so
2916 ${foo()+x+bar()} is a valid prompt string now, and the function
2937 ${foo()+x+bar()} is a valid prompt string now, and the function
2917 calls will be made at runtime.
2938 calls will be made at runtime.
2918
2939
2919 2005-03-15 Fernando Perez <fperez@colorado.edu>
2940 2005-03-15 Fernando Perez <fperez@colorado.edu>
2920
2941
2921 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2942 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2922 avoid name clashes in pylab. %hist still works, it just forwards
2943 avoid name clashes in pylab. %hist still works, it just forwards
2923 the call to %history.
2944 the call to %history.
2924
2945
2925 2005-03-02 *** Released version 0.6.12
2946 2005-03-02 *** Released version 0.6.12
2926
2947
2927 2005-03-02 Fernando Perez <fperez@colorado.edu>
2948 2005-03-02 Fernando Perez <fperez@colorado.edu>
2928
2949
2929 * IPython/iplib.py (handle_magic): log magic calls properly as
2950 * IPython/iplib.py (handle_magic): log magic calls properly as
2930 ipmagic() function calls.
2951 ipmagic() function calls.
2931
2952
2932 * IPython/Magic.py (magic_time): Improved %time to support
2953 * IPython/Magic.py (magic_time): Improved %time to support
2933 statements and provide wall-clock as well as CPU time.
2954 statements and provide wall-clock as well as CPU time.
2934
2955
2935 2005-02-27 Fernando Perez <fperez@colorado.edu>
2956 2005-02-27 Fernando Perez <fperez@colorado.edu>
2936
2957
2937 * IPython/hooks.py: New hooks module, to expose user-modifiable
2958 * IPython/hooks.py: New hooks module, to expose user-modifiable
2938 IPython functionality in a clean manner. For now only the editor
2959 IPython functionality in a clean manner. For now only the editor
2939 hook is actually written, and other thigns which I intend to turn
2960 hook is actually written, and other thigns which I intend to turn
2940 into proper hooks aren't yet there. The display and prefilter
2961 into proper hooks aren't yet there. The display and prefilter
2941 stuff, for example, should be hooks. But at least now the
2962 stuff, for example, should be hooks. But at least now the
2942 framework is in place, and the rest can be moved here with more
2963 framework is in place, and the rest can be moved here with more
2943 time later. IPython had had a .hooks variable for a long time for
2964 time later. IPython had had a .hooks variable for a long time for
2944 this purpose, but I'd never actually used it for anything.
2965 this purpose, but I'd never actually used it for anything.
2945
2966
2946 2005-02-26 Fernando Perez <fperez@colorado.edu>
2967 2005-02-26 Fernando Perez <fperez@colorado.edu>
2947
2968
2948 * IPython/ipmaker.py (make_IPython): make the default ipython
2969 * IPython/ipmaker.py (make_IPython): make the default ipython
2949 directory be called _ipython under win32, to follow more the
2970 directory be called _ipython under win32, to follow more the
2950 naming peculiarities of that platform (where buggy software like
2971 naming peculiarities of that platform (where buggy software like
2951 Visual Sourcesafe breaks with .named directories). Reported by
2972 Visual Sourcesafe breaks with .named directories). Reported by
2952 Ville Vainio.
2973 Ville Vainio.
2953
2974
2954 2005-02-23 Fernando Perez <fperez@colorado.edu>
2975 2005-02-23 Fernando Perez <fperez@colorado.edu>
2955
2976
2956 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2977 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2957 auto_aliases for win32 which were causing problems. Users can
2978 auto_aliases for win32 which were causing problems. Users can
2958 define the ones they personally like.
2979 define the ones they personally like.
2959
2980
2960 2005-02-21 Fernando Perez <fperez@colorado.edu>
2981 2005-02-21 Fernando Perez <fperez@colorado.edu>
2961
2982
2962 * IPython/Magic.py (magic_time): new magic to time execution of
2983 * IPython/Magic.py (magic_time): new magic to time execution of
2963 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2984 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2964
2985
2965 2005-02-19 Fernando Perez <fperez@colorado.edu>
2986 2005-02-19 Fernando Perez <fperez@colorado.edu>
2966
2987
2967 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2988 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2968 into keys (for prompts, for example).
2989 into keys (for prompts, for example).
2969
2990
2970 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2991 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2971 prompts in case users want them. This introduces a small behavior
2992 prompts in case users want them. This introduces a small behavior
2972 change: ipython does not automatically add a space to all prompts
2993 change: ipython does not automatically add a space to all prompts
2973 anymore. To get the old prompts with a space, users should add it
2994 anymore. To get the old prompts with a space, users should add it
2974 manually to their ipythonrc file, so for example prompt_in1 should
2995 manually to their ipythonrc file, so for example prompt_in1 should
2975 now read 'In [\#]: ' instead of 'In [\#]:'.
2996 now read 'In [\#]: ' instead of 'In [\#]:'.
2976 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2997 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2977 file) to control left-padding of secondary prompts.
2998 file) to control left-padding of secondary prompts.
2978
2999
2979 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3000 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2980 the profiler can't be imported. Fix for Debian, which removed
3001 the profiler can't be imported. Fix for Debian, which removed
2981 profile.py because of License issues. I applied a slightly
3002 profile.py because of License issues. I applied a slightly
2982 modified version of the original Debian patch at
3003 modified version of the original Debian patch at
2983 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3004 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2984
3005
2985 2005-02-17 Fernando Perez <fperez@colorado.edu>
3006 2005-02-17 Fernando Perez <fperez@colorado.edu>
2986
3007
2987 * IPython/genutils.py (native_line_ends): Fix bug which would
3008 * IPython/genutils.py (native_line_ends): Fix bug which would
2988 cause improper line-ends under win32 b/c I was not opening files
3009 cause improper line-ends under win32 b/c I was not opening files
2989 in binary mode. Bug report and fix thanks to Ville.
3010 in binary mode. Bug report and fix thanks to Ville.
2990
3011
2991 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3012 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2992 trying to catch spurious foo[1] autocalls. My fix actually broke
3013 trying to catch spurious foo[1] autocalls. My fix actually broke
2993 ',/' autoquote/call with explicit escape (bad regexp).
3014 ',/' autoquote/call with explicit escape (bad regexp).
2994
3015
2995 2005-02-15 *** Released version 0.6.11
3016 2005-02-15 *** Released version 0.6.11
2996
3017
2997 2005-02-14 Fernando Perez <fperez@colorado.edu>
3018 2005-02-14 Fernando Perez <fperez@colorado.edu>
2998
3019
2999 * IPython/background_jobs.py: New background job management
3020 * IPython/background_jobs.py: New background job management
3000 subsystem. This is implemented via a new set of classes, and
3021 subsystem. This is implemented via a new set of classes, and
3001 IPython now provides a builtin 'jobs' object for background job
3022 IPython now provides a builtin 'jobs' object for background job
3002 execution. A convenience %bg magic serves as a lightweight
3023 execution. A convenience %bg magic serves as a lightweight
3003 frontend for starting the more common type of calls. This was
3024 frontend for starting the more common type of calls. This was
3004 inspired by discussions with B. Granger and the BackgroundCommand
3025 inspired by discussions with B. Granger and the BackgroundCommand
3005 class described in the book Python Scripting for Computational
3026 class described in the book Python Scripting for Computational
3006 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3027 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3007 (although ultimately no code from this text was used, as IPython's
3028 (although ultimately no code from this text was used, as IPython's
3008 system is a separate implementation).
3029 system is a separate implementation).
3009
3030
3010 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3031 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3011 to control the completion of single/double underscore names
3032 to control the completion of single/double underscore names
3012 separately. As documented in the example ipytonrc file, the
3033 separately. As documented in the example ipytonrc file, the
3013 readline_omit__names variable can now be set to 2, to omit even
3034 readline_omit__names variable can now be set to 2, to omit even
3014 single underscore names. Thanks to a patch by Brian Wong
3035 single underscore names. Thanks to a patch by Brian Wong
3015 <BrianWong-AT-AirgoNetworks.Com>.
3036 <BrianWong-AT-AirgoNetworks.Com>.
3016 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3037 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3017 be autocalled as foo([1]) if foo were callable. A problem for
3038 be autocalled as foo([1]) if foo were callable. A problem for
3018 things which are both callable and implement __getitem__.
3039 things which are both callable and implement __getitem__.
3019 (init_readline): Fix autoindentation for win32. Thanks to a patch
3040 (init_readline): Fix autoindentation for win32. Thanks to a patch
3020 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3041 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3021
3042
3022 2005-02-12 Fernando Perez <fperez@colorado.edu>
3043 2005-02-12 Fernando Perez <fperez@colorado.edu>
3023
3044
3024 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3045 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3025 which I had written long ago to sort out user error messages which
3046 which I had written long ago to sort out user error messages which
3026 may occur during startup. This seemed like a good idea initially,
3047 may occur during startup. This seemed like a good idea initially,
3027 but it has proven a disaster in retrospect. I don't want to
3048 but it has proven a disaster in retrospect. I don't want to
3028 change much code for now, so my fix is to set the internal 'debug'
3049 change much code for now, so my fix is to set the internal 'debug'
3029 flag to true everywhere, whose only job was precisely to control
3050 flag to true everywhere, whose only job was precisely to control
3030 this subsystem. This closes issue 28 (as well as avoiding all
3051 this subsystem. This closes issue 28 (as well as avoiding all
3031 sorts of strange hangups which occur from time to time).
3052 sorts of strange hangups which occur from time to time).
3032
3053
3033 2005-02-07 Fernando Perez <fperez@colorado.edu>
3054 2005-02-07 Fernando Perez <fperez@colorado.edu>
3034
3055
3035 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3056 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3036 previous call produced a syntax error.
3057 previous call produced a syntax error.
3037
3058
3038 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3059 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3039 classes without constructor.
3060 classes without constructor.
3040
3061
3041 2005-02-06 Fernando Perez <fperez@colorado.edu>
3062 2005-02-06 Fernando Perez <fperez@colorado.edu>
3042
3063
3043 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3064 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3044 completions with the results of each matcher, so we return results
3065 completions with the results of each matcher, so we return results
3045 to the user from all namespaces. This breaks with ipython
3066 to the user from all namespaces. This breaks with ipython
3046 tradition, but I think it's a nicer behavior. Now you get all
3067 tradition, but I think it's a nicer behavior. Now you get all
3047 possible completions listed, from all possible namespaces (python,
3068 possible completions listed, from all possible namespaces (python,
3048 filesystem, magics...) After a request by John Hunter
3069 filesystem, magics...) After a request by John Hunter
3049 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3070 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3050
3071
3051 2005-02-05 Fernando Perez <fperez@colorado.edu>
3072 2005-02-05 Fernando Perez <fperez@colorado.edu>
3052
3073
3053 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3074 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3054 the call had quote characters in it (the quotes were stripped).
3075 the call had quote characters in it (the quotes were stripped).
3055
3076
3056 2005-01-31 Fernando Perez <fperez@colorado.edu>
3077 2005-01-31 Fernando Perez <fperez@colorado.edu>
3057
3078
3058 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3079 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3059 Itpl.itpl() to make the code more robust against psyco
3080 Itpl.itpl() to make the code more robust against psyco
3060 optimizations.
3081 optimizations.
3061
3082
3062 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3083 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3063 of causing an exception. Quicker, cleaner.
3084 of causing an exception. Quicker, cleaner.
3064
3085
3065 2005-01-28 Fernando Perez <fperez@colorado.edu>
3086 2005-01-28 Fernando Perez <fperez@colorado.edu>
3066
3087
3067 * scripts/ipython_win_post_install.py (install): hardcode
3088 * scripts/ipython_win_post_install.py (install): hardcode
3068 sys.prefix+'python.exe' as the executable path. It turns out that
3089 sys.prefix+'python.exe' as the executable path. It turns out that
3069 during the post-installation run, sys.executable resolves to the
3090 during the post-installation run, sys.executable resolves to the
3070 name of the binary installer! I should report this as a distutils
3091 name of the binary installer! I should report this as a distutils
3071 bug, I think. I updated the .10 release with this tiny fix, to
3092 bug, I think. I updated the .10 release with this tiny fix, to
3072 avoid annoying the lists further.
3093 avoid annoying the lists further.
3073
3094
3074 2005-01-27 *** Released version 0.6.10
3095 2005-01-27 *** Released version 0.6.10
3075
3096
3076 2005-01-27 Fernando Perez <fperez@colorado.edu>
3097 2005-01-27 Fernando Perez <fperez@colorado.edu>
3077
3098
3078 * IPython/numutils.py (norm): Added 'inf' as optional name for
3099 * IPython/numutils.py (norm): Added 'inf' as optional name for
3079 L-infinity norm, included references to mathworld.com for vector
3100 L-infinity norm, included references to mathworld.com for vector
3080 norm definitions.
3101 norm definitions.
3081 (amin/amax): added amin/amax for array min/max. Similar to what
3102 (amin/amax): added amin/amax for array min/max. Similar to what
3082 pylab ships with after the recent reorganization of names.
3103 pylab ships with after the recent reorganization of names.
3083 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3104 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3084
3105
3085 * ipython.el: committed Alex's recent fixes and improvements.
3106 * ipython.el: committed Alex's recent fixes and improvements.
3086 Tested with python-mode from CVS, and it looks excellent. Since
3107 Tested with python-mode from CVS, and it looks excellent. Since
3087 python-mode hasn't released anything in a while, I'm temporarily
3108 python-mode hasn't released anything in a while, I'm temporarily
3088 putting a copy of today's CVS (v 4.70) of python-mode in:
3109 putting a copy of today's CVS (v 4.70) of python-mode in:
3089 http://ipython.scipy.org/tmp/python-mode.el
3110 http://ipython.scipy.org/tmp/python-mode.el
3090
3111
3091 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3112 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3092 sys.executable for the executable name, instead of assuming it's
3113 sys.executable for the executable name, instead of assuming it's
3093 called 'python.exe' (the post-installer would have produced broken
3114 called 'python.exe' (the post-installer would have produced broken
3094 setups on systems with a differently named python binary).
3115 setups on systems with a differently named python binary).
3095
3116
3096 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3117 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3097 references to os.linesep, to make the code more
3118 references to os.linesep, to make the code more
3098 platform-independent. This is also part of the win32 coloring
3119 platform-independent. This is also part of the win32 coloring
3099 fixes.
3120 fixes.
3100
3121
3101 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3122 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3102 lines, which actually cause coloring bugs because the length of
3123 lines, which actually cause coloring bugs because the length of
3103 the line is very difficult to correctly compute with embedded
3124 the line is very difficult to correctly compute with embedded
3104 escapes. This was the source of all the coloring problems under
3125 escapes. This was the source of all the coloring problems under
3105 Win32. I think that _finally_, Win32 users have a properly
3126 Win32. I think that _finally_, Win32 users have a properly
3106 working ipython in all respects. This would never have happened
3127 working ipython in all respects. This would never have happened
3107 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3128 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3108
3129
3109 2005-01-26 *** Released version 0.6.9
3130 2005-01-26 *** Released version 0.6.9
3110
3131
3111 2005-01-25 Fernando Perez <fperez@colorado.edu>
3132 2005-01-25 Fernando Perez <fperez@colorado.edu>
3112
3133
3113 * setup.py: finally, we have a true Windows installer, thanks to
3134 * setup.py: finally, we have a true Windows installer, thanks to
3114 the excellent work of Viktor Ransmayr
3135 the excellent work of Viktor Ransmayr
3115 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3136 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3116 Windows users. The setup routine is quite a bit cleaner thanks to
3137 Windows users. The setup routine is quite a bit cleaner thanks to
3117 this, and the post-install script uses the proper functions to
3138 this, and the post-install script uses the proper functions to
3118 allow a clean de-installation using the standard Windows Control
3139 allow a clean de-installation using the standard Windows Control
3119 Panel.
3140 Panel.
3120
3141
3121 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3142 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3122 environment variable under all OSes (including win32) if
3143 environment variable under all OSes (including win32) if
3123 available. This will give consistency to win32 users who have set
3144 available. This will give consistency to win32 users who have set
3124 this variable for any reason. If os.environ['HOME'] fails, the
3145 this variable for any reason. If os.environ['HOME'] fails, the
3125 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3146 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3126
3147
3127 2005-01-24 Fernando Perez <fperez@colorado.edu>
3148 2005-01-24 Fernando Perez <fperez@colorado.edu>
3128
3149
3129 * IPython/numutils.py (empty_like): add empty_like(), similar to
3150 * IPython/numutils.py (empty_like): add empty_like(), similar to
3130 zeros_like() but taking advantage of the new empty() Numeric routine.
3151 zeros_like() but taking advantage of the new empty() Numeric routine.
3131
3152
3132 2005-01-23 *** Released version 0.6.8
3153 2005-01-23 *** Released version 0.6.8
3133
3154
3134 2005-01-22 Fernando Perez <fperez@colorado.edu>
3155 2005-01-22 Fernando Perez <fperez@colorado.edu>
3135
3156
3136 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3157 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3137 automatic show() calls. After discussing things with JDH, it
3158 automatic show() calls. After discussing things with JDH, it
3138 turns out there are too many corner cases where this can go wrong.
3159 turns out there are too many corner cases where this can go wrong.
3139 It's best not to try to be 'too smart', and simply have ipython
3160 It's best not to try to be 'too smart', and simply have ipython
3140 reproduce as much as possible the default behavior of a normal
3161 reproduce as much as possible the default behavior of a normal
3141 python shell.
3162 python shell.
3142
3163
3143 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3164 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3144 line-splitting regexp and _prefilter() to avoid calling getattr()
3165 line-splitting regexp and _prefilter() to avoid calling getattr()
3145 on assignments. This closes
3166 on assignments. This closes
3146 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3167 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3147 readline uses getattr(), so a simple <TAB> keypress is still
3168 readline uses getattr(), so a simple <TAB> keypress is still
3148 enough to trigger getattr() calls on an object.
3169 enough to trigger getattr() calls on an object.
3149
3170
3150 2005-01-21 Fernando Perez <fperez@colorado.edu>
3171 2005-01-21 Fernando Perez <fperez@colorado.edu>
3151
3172
3152 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3173 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3153 docstring under pylab so it doesn't mask the original.
3174 docstring under pylab so it doesn't mask the original.
3154
3175
3155 2005-01-21 *** Released version 0.6.7
3176 2005-01-21 *** Released version 0.6.7
3156
3177
3157 2005-01-21 Fernando Perez <fperez@colorado.edu>
3178 2005-01-21 Fernando Perez <fperez@colorado.edu>
3158
3179
3159 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3180 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3160 signal handling for win32 users in multithreaded mode.
3181 signal handling for win32 users in multithreaded mode.
3161
3182
3162 2005-01-17 Fernando Perez <fperez@colorado.edu>
3183 2005-01-17 Fernando Perez <fperez@colorado.edu>
3163
3184
3164 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3185 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3165 instances with no __init__. After a crash report by Norbert Nemec
3186 instances with no __init__. After a crash report by Norbert Nemec
3166 <Norbert-AT-nemec-online.de>.
3187 <Norbert-AT-nemec-online.de>.
3167
3188
3168 2005-01-14 Fernando Perez <fperez@colorado.edu>
3189 2005-01-14 Fernando Perez <fperez@colorado.edu>
3169
3190
3170 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3191 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3171 names for verbose exceptions, when multiple dotted names and the
3192 names for verbose exceptions, when multiple dotted names and the
3172 'parent' object were present on the same line.
3193 'parent' object were present on the same line.
3173
3194
3174 2005-01-11 Fernando Perez <fperez@colorado.edu>
3195 2005-01-11 Fernando Perez <fperez@colorado.edu>
3175
3196
3176 * IPython/genutils.py (flag_calls): new utility to trap and flag
3197 * IPython/genutils.py (flag_calls): new utility to trap and flag
3177 calls in functions. I need it to clean up matplotlib support.
3198 calls in functions. I need it to clean up matplotlib support.
3178 Also removed some deprecated code in genutils.
3199 Also removed some deprecated code in genutils.
3179
3200
3180 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3201 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3181 that matplotlib scripts called with %run, which don't call show()
3202 that matplotlib scripts called with %run, which don't call show()
3182 themselves, still have their plotting windows open.
3203 themselves, still have their plotting windows open.
3183
3204
3184 2005-01-05 Fernando Perez <fperez@colorado.edu>
3205 2005-01-05 Fernando Perez <fperez@colorado.edu>
3185
3206
3186 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3207 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3187 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3208 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3188
3209
3189 2004-12-19 Fernando Perez <fperez@colorado.edu>
3210 2004-12-19 Fernando Perez <fperez@colorado.edu>
3190
3211
3191 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3212 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3192 parent_runcode, which was an eyesore. The same result can be
3213 parent_runcode, which was an eyesore. The same result can be
3193 obtained with Python's regular superclass mechanisms.
3214 obtained with Python's regular superclass mechanisms.
3194
3215
3195 2004-12-17 Fernando Perez <fperez@colorado.edu>
3216 2004-12-17 Fernando Perez <fperez@colorado.edu>
3196
3217
3197 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3218 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3198 reported by Prabhu.
3219 reported by Prabhu.
3199 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3220 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3200 sys.stderr) instead of explicitly calling sys.stderr. This helps
3221 sys.stderr) instead of explicitly calling sys.stderr. This helps
3201 maintain our I/O abstractions clean, for future GUI embeddings.
3222 maintain our I/O abstractions clean, for future GUI embeddings.
3202
3223
3203 * IPython/genutils.py (info): added new utility for sys.stderr
3224 * IPython/genutils.py (info): added new utility for sys.stderr
3204 unified info message handling (thin wrapper around warn()).
3225 unified info message handling (thin wrapper around warn()).
3205
3226
3206 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3227 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3207 composite (dotted) names on verbose exceptions.
3228 composite (dotted) names on verbose exceptions.
3208 (VerboseTB.nullrepr): harden against another kind of errors which
3229 (VerboseTB.nullrepr): harden against another kind of errors which
3209 Python's inspect module can trigger, and which were crashing
3230 Python's inspect module can trigger, and which were crashing
3210 IPython. Thanks to a report by Marco Lombardi
3231 IPython. Thanks to a report by Marco Lombardi
3211 <mlombard-AT-ma010192.hq.eso.org>.
3232 <mlombard-AT-ma010192.hq.eso.org>.
3212
3233
3213 2004-12-13 *** Released version 0.6.6
3234 2004-12-13 *** Released version 0.6.6
3214
3235
3215 2004-12-12 Fernando Perez <fperez@colorado.edu>
3236 2004-12-12 Fernando Perez <fperez@colorado.edu>
3216
3237
3217 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3238 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3218 generated by pygtk upon initialization if it was built without
3239 generated by pygtk upon initialization if it was built without
3219 threads (for matplotlib users). After a crash reported by
3240 threads (for matplotlib users). After a crash reported by
3220 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3241 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3221
3242
3222 * IPython/ipmaker.py (make_IPython): fix small bug in the
3243 * IPython/ipmaker.py (make_IPython): fix small bug in the
3223 import_some parameter for multiple imports.
3244 import_some parameter for multiple imports.
3224
3245
3225 * IPython/iplib.py (ipmagic): simplified the interface of
3246 * IPython/iplib.py (ipmagic): simplified the interface of
3226 ipmagic() to take a single string argument, just as it would be
3247 ipmagic() to take a single string argument, just as it would be
3227 typed at the IPython cmd line.
3248 typed at the IPython cmd line.
3228 (ipalias): Added new ipalias() with an interface identical to
3249 (ipalias): Added new ipalias() with an interface identical to
3229 ipmagic(). This completes exposing a pure python interface to the
3250 ipmagic(). This completes exposing a pure python interface to the
3230 alias and magic system, which can be used in loops or more complex
3251 alias and magic system, which can be used in loops or more complex
3231 code where IPython's automatic line mangling is not active.
3252 code where IPython's automatic line mangling is not active.
3232
3253
3233 * IPython/genutils.py (timing): changed interface of timing to
3254 * IPython/genutils.py (timing): changed interface of timing to
3234 simply run code once, which is the most common case. timings()
3255 simply run code once, which is the most common case. timings()
3235 remains unchanged, for the cases where you want multiple runs.
3256 remains unchanged, for the cases where you want multiple runs.
3236
3257
3237 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3258 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3238 bug where Python2.2 crashes with exec'ing code which does not end
3259 bug where Python2.2 crashes with exec'ing code which does not end
3239 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3260 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3240 before.
3261 before.
3241
3262
3242 2004-12-10 Fernando Perez <fperez@colorado.edu>
3263 2004-12-10 Fernando Perez <fperez@colorado.edu>
3243
3264
3244 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3265 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3245 -t to -T, to accomodate the new -t flag in %run (the %run and
3266 -t to -T, to accomodate the new -t flag in %run (the %run and
3246 %prun options are kind of intermixed, and it's not easy to change
3267 %prun options are kind of intermixed, and it's not easy to change
3247 this with the limitations of python's getopt).
3268 this with the limitations of python's getopt).
3248
3269
3249 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3270 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3250 the execution of scripts. It's not as fine-tuned as timeit.py,
3271 the execution of scripts. It's not as fine-tuned as timeit.py,
3251 but it works from inside ipython (and under 2.2, which lacks
3272 but it works from inside ipython (and under 2.2, which lacks
3252 timeit.py). Optionally a number of runs > 1 can be given for
3273 timeit.py). Optionally a number of runs > 1 can be given for
3253 timing very short-running code.
3274 timing very short-running code.
3254
3275
3255 * IPython/genutils.py (uniq_stable): new routine which returns a
3276 * IPython/genutils.py (uniq_stable): new routine which returns a
3256 list of unique elements in any iterable, but in stable order of
3277 list of unique elements in any iterable, but in stable order of
3257 appearance. I needed this for the ultraTB fixes, and it's a handy
3278 appearance. I needed this for the ultraTB fixes, and it's a handy
3258 utility.
3279 utility.
3259
3280
3260 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3281 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3261 dotted names in Verbose exceptions. This had been broken since
3282 dotted names in Verbose exceptions. This had been broken since
3262 the very start, now x.y will properly be printed in a Verbose
3283 the very start, now x.y will properly be printed in a Verbose
3263 traceback, instead of x being shown and y appearing always as an
3284 traceback, instead of x being shown and y appearing always as an
3264 'undefined global'. Getting this to work was a bit tricky,
3285 'undefined global'. Getting this to work was a bit tricky,
3265 because by default python tokenizers are stateless. Saved by
3286 because by default python tokenizers are stateless. Saved by
3266 python's ability to easily add a bit of state to an arbitrary
3287 python's ability to easily add a bit of state to an arbitrary
3267 function (without needing to build a full-blown callable object).
3288 function (without needing to build a full-blown callable object).
3268
3289
3269 Also big cleanup of this code, which had horrendous runtime
3290 Also big cleanup of this code, which had horrendous runtime
3270 lookups of zillions of attributes for colorization. Moved all
3291 lookups of zillions of attributes for colorization. Moved all
3271 this code into a few templates, which make it cleaner and quicker.
3292 this code into a few templates, which make it cleaner and quicker.
3272
3293
3273 Printout quality was also improved for Verbose exceptions: one
3294 Printout quality was also improved for Verbose exceptions: one
3274 variable per line, and memory addresses are printed (this can be
3295 variable per line, and memory addresses are printed (this can be
3275 quite handy in nasty debugging situations, which is what Verbose
3296 quite handy in nasty debugging situations, which is what Verbose
3276 is for).
3297 is for).
3277
3298
3278 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3299 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3279 the command line as scripts to be loaded by embedded instances.
3300 the command line as scripts to be loaded by embedded instances.
3280 Doing so has the potential for an infinite recursion if there are
3301 Doing so has the potential for an infinite recursion if there are
3281 exceptions thrown in the process. This fixes a strange crash
3302 exceptions thrown in the process. This fixes a strange crash
3282 reported by Philippe MULLER <muller-AT-irit.fr>.
3303 reported by Philippe MULLER <muller-AT-irit.fr>.
3283
3304
3284 2004-12-09 Fernando Perez <fperez@colorado.edu>
3305 2004-12-09 Fernando Perez <fperez@colorado.edu>
3285
3306
3286 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3307 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3287 to reflect new names in matplotlib, which now expose the
3308 to reflect new names in matplotlib, which now expose the
3288 matlab-compatible interface via a pylab module instead of the
3309 matlab-compatible interface via a pylab module instead of the
3289 'matlab' name. The new code is backwards compatible, so users of
3310 'matlab' name. The new code is backwards compatible, so users of
3290 all matplotlib versions are OK. Patch by J. Hunter.
3311 all matplotlib versions are OK. Patch by J. Hunter.
3291
3312
3292 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3313 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3293 of __init__ docstrings for instances (class docstrings are already
3314 of __init__ docstrings for instances (class docstrings are already
3294 automatically printed). Instances with customized docstrings
3315 automatically printed). Instances with customized docstrings
3295 (indep. of the class) are also recognized and all 3 separate
3316 (indep. of the class) are also recognized and all 3 separate
3296 docstrings are printed (instance, class, constructor). After some
3317 docstrings are printed (instance, class, constructor). After some
3297 comments/suggestions by J. Hunter.
3318 comments/suggestions by J. Hunter.
3298
3319
3299 2004-12-05 Fernando Perez <fperez@colorado.edu>
3320 2004-12-05 Fernando Perez <fperez@colorado.edu>
3300
3321
3301 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3322 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3302 warnings when tab-completion fails and triggers an exception.
3323 warnings when tab-completion fails and triggers an exception.
3303
3324
3304 2004-12-03 Fernando Perez <fperez@colorado.edu>
3325 2004-12-03 Fernando Perez <fperez@colorado.edu>
3305
3326
3306 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3327 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3307 be triggered when using 'run -p'. An incorrect option flag was
3328 be triggered when using 'run -p'. An incorrect option flag was
3308 being set ('d' instead of 'D').
3329 being set ('d' instead of 'D').
3309 (manpage): fix missing escaped \- sign.
3330 (manpage): fix missing escaped \- sign.
3310
3331
3311 2004-11-30 *** Released version 0.6.5
3332 2004-11-30 *** Released version 0.6.5
3312
3333
3313 2004-11-30 Fernando Perez <fperez@colorado.edu>
3334 2004-11-30 Fernando Perez <fperez@colorado.edu>
3314
3335
3315 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3336 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3316 setting with -d option.
3337 setting with -d option.
3317
3338
3318 * setup.py (docfiles): Fix problem where the doc glob I was using
3339 * setup.py (docfiles): Fix problem where the doc glob I was using
3319 was COMPLETELY BROKEN. It was giving the right files by pure
3340 was COMPLETELY BROKEN. It was giving the right files by pure
3320 accident, but failed once I tried to include ipython.el. Note:
3341 accident, but failed once I tried to include ipython.el. Note:
3321 glob() does NOT allow you to do exclusion on multiple endings!
3342 glob() does NOT allow you to do exclusion on multiple endings!
3322
3343
3323 2004-11-29 Fernando Perez <fperez@colorado.edu>
3344 2004-11-29 Fernando Perez <fperez@colorado.edu>
3324
3345
3325 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3346 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3326 the manpage as the source. Better formatting & consistency.
3347 the manpage as the source. Better formatting & consistency.
3327
3348
3328 * IPython/Magic.py (magic_run): Added new -d option, to run
3349 * IPython/Magic.py (magic_run): Added new -d option, to run
3329 scripts under the control of the python pdb debugger. Note that
3350 scripts under the control of the python pdb debugger. Note that
3330 this required changing the %prun option -d to -D, to avoid a clash
3351 this required changing the %prun option -d to -D, to avoid a clash
3331 (since %run must pass options to %prun, and getopt is too dumb to
3352 (since %run must pass options to %prun, and getopt is too dumb to
3332 handle options with string values with embedded spaces). Thanks
3353 handle options with string values with embedded spaces). Thanks
3333 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3354 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3334 (magic_who_ls): added type matching to %who and %whos, so that one
3355 (magic_who_ls): added type matching to %who and %whos, so that one
3335 can filter their output to only include variables of certain
3356 can filter their output to only include variables of certain
3336 types. Another suggestion by Matthew.
3357 types. Another suggestion by Matthew.
3337 (magic_whos): Added memory summaries in kb and Mb for arrays.
3358 (magic_whos): Added memory summaries in kb and Mb for arrays.
3338 (magic_who): Improve formatting (break lines every 9 vars).
3359 (magic_who): Improve formatting (break lines every 9 vars).
3339
3360
3340 2004-11-28 Fernando Perez <fperez@colorado.edu>
3361 2004-11-28 Fernando Perez <fperez@colorado.edu>
3341
3362
3342 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3363 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3343 cache when empty lines were present.
3364 cache when empty lines were present.
3344
3365
3345 2004-11-24 Fernando Perez <fperez@colorado.edu>
3366 2004-11-24 Fernando Perez <fperez@colorado.edu>
3346
3367
3347 * IPython/usage.py (__doc__): document the re-activated threading
3368 * IPython/usage.py (__doc__): document the re-activated threading
3348 options for WX and GTK.
3369 options for WX and GTK.
3349
3370
3350 2004-11-23 Fernando Perez <fperez@colorado.edu>
3371 2004-11-23 Fernando Perez <fperez@colorado.edu>
3351
3372
3352 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3373 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3353 the -wthread and -gthread options, along with a new -tk one to try
3374 the -wthread and -gthread options, along with a new -tk one to try
3354 and coordinate Tk threading with wx/gtk. The tk support is very
3375 and coordinate Tk threading with wx/gtk. The tk support is very
3355 platform dependent, since it seems to require Tcl and Tk to be
3376 platform dependent, since it seems to require Tcl and Tk to be
3356 built with threads (Fedora1/2 appears NOT to have it, but in
3377 built with threads (Fedora1/2 appears NOT to have it, but in
3357 Prabhu's Debian boxes it works OK). But even with some Tk
3378 Prabhu's Debian boxes it works OK). But even with some Tk
3358 limitations, this is a great improvement.
3379 limitations, this is a great improvement.
3359
3380
3360 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3381 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3361 info in user prompts. Patch by Prabhu.
3382 info in user prompts. Patch by Prabhu.
3362
3383
3363 2004-11-18 Fernando Perez <fperez@colorado.edu>
3384 2004-11-18 Fernando Perez <fperez@colorado.edu>
3364
3385
3365 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3386 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3366 EOFErrors and bail, to avoid infinite loops if a non-terminating
3387 EOFErrors and bail, to avoid infinite loops if a non-terminating
3367 file is fed into ipython. Patch submitted in issue 19 by user,
3388 file is fed into ipython. Patch submitted in issue 19 by user,
3368 many thanks.
3389 many thanks.
3369
3390
3370 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3391 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3371 autoquote/parens in continuation prompts, which can cause lots of
3392 autoquote/parens in continuation prompts, which can cause lots of
3372 problems. Closes roundup issue 20.
3393 problems. Closes roundup issue 20.
3373
3394
3374 2004-11-17 Fernando Perez <fperez@colorado.edu>
3395 2004-11-17 Fernando Perez <fperez@colorado.edu>
3375
3396
3376 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3397 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3377 reported as debian bug #280505. I'm not sure my local changelog
3398 reported as debian bug #280505. I'm not sure my local changelog
3378 entry has the proper debian format (Jack?).
3399 entry has the proper debian format (Jack?).
3379
3400
3380 2004-11-08 *** Released version 0.6.4
3401 2004-11-08 *** Released version 0.6.4
3381
3402
3382 2004-11-08 Fernando Perez <fperez@colorado.edu>
3403 2004-11-08 Fernando Perez <fperez@colorado.edu>
3383
3404
3384 * IPython/iplib.py (init_readline): Fix exit message for Windows
3405 * IPython/iplib.py (init_readline): Fix exit message for Windows
3385 when readline is active. Thanks to a report by Eric Jones
3406 when readline is active. Thanks to a report by Eric Jones
3386 <eric-AT-enthought.com>.
3407 <eric-AT-enthought.com>.
3387
3408
3388 2004-11-07 Fernando Perez <fperez@colorado.edu>
3409 2004-11-07 Fernando Perez <fperez@colorado.edu>
3389
3410
3390 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3411 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3391 sometimes seen by win2k/cygwin users.
3412 sometimes seen by win2k/cygwin users.
3392
3413
3393 2004-11-06 Fernando Perez <fperez@colorado.edu>
3414 2004-11-06 Fernando Perez <fperez@colorado.edu>
3394
3415
3395 * IPython/iplib.py (interact): Change the handling of %Exit from
3416 * IPython/iplib.py (interact): Change the handling of %Exit from
3396 trying to propagate a SystemExit to an internal ipython flag.
3417 trying to propagate a SystemExit to an internal ipython flag.
3397 This is less elegant than using Python's exception mechanism, but
3418 This is less elegant than using Python's exception mechanism, but
3398 I can't get that to work reliably with threads, so under -pylab
3419 I can't get that to work reliably with threads, so under -pylab
3399 %Exit was hanging IPython. Cross-thread exception handling is
3420 %Exit was hanging IPython. Cross-thread exception handling is
3400 really a bitch. Thaks to a bug report by Stephen Walton
3421 really a bitch. Thaks to a bug report by Stephen Walton
3401 <stephen.walton-AT-csun.edu>.
3422 <stephen.walton-AT-csun.edu>.
3402
3423
3403 2004-11-04 Fernando Perez <fperez@colorado.edu>
3424 2004-11-04 Fernando Perez <fperez@colorado.edu>
3404
3425
3405 * IPython/iplib.py (raw_input_original): store a pointer to the
3426 * IPython/iplib.py (raw_input_original): store a pointer to the
3406 true raw_input to harden against code which can modify it
3427 true raw_input to harden against code which can modify it
3407 (wx.py.PyShell does this and would otherwise crash ipython).
3428 (wx.py.PyShell does this and would otherwise crash ipython).
3408 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3429 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3409
3430
3410 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3431 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3411 Ctrl-C problem, which does not mess up the input line.
3432 Ctrl-C problem, which does not mess up the input line.
3412
3433
3413 2004-11-03 Fernando Perez <fperez@colorado.edu>
3434 2004-11-03 Fernando Perez <fperez@colorado.edu>
3414
3435
3415 * IPython/Release.py: Changed licensing to BSD, in all files.
3436 * IPython/Release.py: Changed licensing to BSD, in all files.
3416 (name): lowercase name for tarball/RPM release.
3437 (name): lowercase name for tarball/RPM release.
3417
3438
3418 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3439 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3419 use throughout ipython.
3440 use throughout ipython.
3420
3441
3421 * IPython/Magic.py (Magic._ofind): Switch to using the new
3442 * IPython/Magic.py (Magic._ofind): Switch to using the new
3422 OInspect.getdoc() function.
3443 OInspect.getdoc() function.
3423
3444
3424 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3445 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3425 of the line currently being canceled via Ctrl-C. It's extremely
3446 of the line currently being canceled via Ctrl-C. It's extremely
3426 ugly, but I don't know how to do it better (the problem is one of
3447 ugly, but I don't know how to do it better (the problem is one of
3427 handling cross-thread exceptions).
3448 handling cross-thread exceptions).
3428
3449
3429 2004-10-28 Fernando Perez <fperez@colorado.edu>
3450 2004-10-28 Fernando Perez <fperez@colorado.edu>
3430
3451
3431 * IPython/Shell.py (signal_handler): add signal handlers to trap
3452 * IPython/Shell.py (signal_handler): add signal handlers to trap
3432 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3453 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3433 report by Francesc Alted.
3454 report by Francesc Alted.
3434
3455
3435 2004-10-21 Fernando Perez <fperez@colorado.edu>
3456 2004-10-21 Fernando Perez <fperez@colorado.edu>
3436
3457
3437 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3458 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3438 to % for pysh syntax extensions.
3459 to % for pysh syntax extensions.
3439
3460
3440 2004-10-09 Fernando Perez <fperez@colorado.edu>
3461 2004-10-09 Fernando Perez <fperez@colorado.edu>
3441
3462
3442 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3463 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3443 arrays to print a more useful summary, without calling str(arr).
3464 arrays to print a more useful summary, without calling str(arr).
3444 This avoids the problem of extremely lengthy computations which
3465 This avoids the problem of extremely lengthy computations which
3445 occur if arr is large, and appear to the user as a system lockup
3466 occur if arr is large, and appear to the user as a system lockup
3446 with 100% cpu activity. After a suggestion by Kristian Sandberg
3467 with 100% cpu activity. After a suggestion by Kristian Sandberg
3447 <Kristian.Sandberg@colorado.edu>.
3468 <Kristian.Sandberg@colorado.edu>.
3448 (Magic.__init__): fix bug in global magic escapes not being
3469 (Magic.__init__): fix bug in global magic escapes not being
3449 correctly set.
3470 correctly set.
3450
3471
3451 2004-10-08 Fernando Perez <fperez@colorado.edu>
3472 2004-10-08 Fernando Perez <fperez@colorado.edu>
3452
3473
3453 * IPython/Magic.py (__license__): change to absolute imports of
3474 * IPython/Magic.py (__license__): change to absolute imports of
3454 ipython's own internal packages, to start adapting to the absolute
3475 ipython's own internal packages, to start adapting to the absolute
3455 import requirement of PEP-328.
3476 import requirement of PEP-328.
3456
3477
3457 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3478 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3458 files, and standardize author/license marks through the Release
3479 files, and standardize author/license marks through the Release
3459 module instead of having per/file stuff (except for files with
3480 module instead of having per/file stuff (except for files with
3460 particular licenses, like the MIT/PSF-licensed codes).
3481 particular licenses, like the MIT/PSF-licensed codes).
3461
3482
3462 * IPython/Debugger.py: remove dead code for python 2.1
3483 * IPython/Debugger.py: remove dead code for python 2.1
3463
3484
3464 2004-10-04 Fernando Perez <fperez@colorado.edu>
3485 2004-10-04 Fernando Perez <fperez@colorado.edu>
3465
3486
3466 * IPython/iplib.py (ipmagic): New function for accessing magics
3487 * IPython/iplib.py (ipmagic): New function for accessing magics
3467 via a normal python function call.
3488 via a normal python function call.
3468
3489
3469 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3490 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3470 from '@' to '%', to accomodate the new @decorator syntax of python
3491 from '@' to '%', to accomodate the new @decorator syntax of python
3471 2.4.
3492 2.4.
3472
3493
3473 2004-09-29 Fernando Perez <fperez@colorado.edu>
3494 2004-09-29 Fernando Perez <fperez@colorado.edu>
3474
3495
3475 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3496 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3476 matplotlib.use to prevent running scripts which try to switch
3497 matplotlib.use to prevent running scripts which try to switch
3477 interactive backends from within ipython. This will just crash
3498 interactive backends from within ipython. This will just crash
3478 the python interpreter, so we can't allow it (but a detailed error
3499 the python interpreter, so we can't allow it (but a detailed error
3479 is given to the user).
3500 is given to the user).
3480
3501
3481 2004-09-28 Fernando Perez <fperez@colorado.edu>
3502 2004-09-28 Fernando Perez <fperez@colorado.edu>
3482
3503
3483 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3504 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3484 matplotlib-related fixes so that using @run with non-matplotlib
3505 matplotlib-related fixes so that using @run with non-matplotlib
3485 scripts doesn't pop up spurious plot windows. This requires
3506 scripts doesn't pop up spurious plot windows. This requires
3486 matplotlib >= 0.63, where I had to make some changes as well.
3507 matplotlib >= 0.63, where I had to make some changes as well.
3487
3508
3488 * IPython/ipmaker.py (make_IPython): update version requirement to
3509 * IPython/ipmaker.py (make_IPython): update version requirement to
3489 python 2.2.
3510 python 2.2.
3490
3511
3491 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3512 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3492 banner arg for embedded customization.
3513 banner arg for embedded customization.
3493
3514
3494 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3515 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3495 explicit uses of __IP as the IPython's instance name. Now things
3516 explicit uses of __IP as the IPython's instance name. Now things
3496 are properly handled via the shell.name value. The actual code
3517 are properly handled via the shell.name value. The actual code
3497 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3518 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3498 is much better than before. I'll clean things completely when the
3519 is much better than before. I'll clean things completely when the
3499 magic stuff gets a real overhaul.
3520 magic stuff gets a real overhaul.
3500
3521
3501 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3522 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3502 minor changes to debian dir.
3523 minor changes to debian dir.
3503
3524
3504 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3525 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3505 pointer to the shell itself in the interactive namespace even when
3526 pointer to the shell itself in the interactive namespace even when
3506 a user-supplied dict is provided. This is needed for embedding
3527 a user-supplied dict is provided. This is needed for embedding
3507 purposes (found by tests with Michel Sanner).
3528 purposes (found by tests with Michel Sanner).
3508
3529
3509 2004-09-27 Fernando Perez <fperez@colorado.edu>
3530 2004-09-27 Fernando Perez <fperez@colorado.edu>
3510
3531
3511 * IPython/UserConfig/ipythonrc: remove []{} from
3532 * IPython/UserConfig/ipythonrc: remove []{} from
3512 readline_remove_delims, so that things like [modname.<TAB> do
3533 readline_remove_delims, so that things like [modname.<TAB> do
3513 proper completion. This disables [].TAB, but that's a less common
3534 proper completion. This disables [].TAB, but that's a less common
3514 case than module names in list comprehensions, for example.
3535 case than module names in list comprehensions, for example.
3515 Thanks to a report by Andrea Riciputi.
3536 Thanks to a report by Andrea Riciputi.
3516
3537
3517 2004-09-09 Fernando Perez <fperez@colorado.edu>
3538 2004-09-09 Fernando Perez <fperez@colorado.edu>
3518
3539
3519 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3540 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3520 blocking problems in win32 and osx. Fix by John.
3541 blocking problems in win32 and osx. Fix by John.
3521
3542
3522 2004-09-08 Fernando Perez <fperez@colorado.edu>
3543 2004-09-08 Fernando Perez <fperez@colorado.edu>
3523
3544
3524 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3545 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3525 for Win32 and OSX. Fix by John Hunter.
3546 for Win32 and OSX. Fix by John Hunter.
3526
3547
3527 2004-08-30 *** Released version 0.6.3
3548 2004-08-30 *** Released version 0.6.3
3528
3549
3529 2004-08-30 Fernando Perez <fperez@colorado.edu>
3550 2004-08-30 Fernando Perez <fperez@colorado.edu>
3530
3551
3531 * setup.py (isfile): Add manpages to list of dependent files to be
3552 * setup.py (isfile): Add manpages to list of dependent files to be
3532 updated.
3553 updated.
3533
3554
3534 2004-08-27 Fernando Perez <fperez@colorado.edu>
3555 2004-08-27 Fernando Perez <fperez@colorado.edu>
3535
3556
3536 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3557 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3537 for now. They don't really work with standalone WX/GTK code
3558 for now. They don't really work with standalone WX/GTK code
3538 (though matplotlib IS working fine with both of those backends).
3559 (though matplotlib IS working fine with both of those backends).
3539 This will neeed much more testing. I disabled most things with
3560 This will neeed much more testing. I disabled most things with
3540 comments, so turning it back on later should be pretty easy.
3561 comments, so turning it back on later should be pretty easy.
3541
3562
3542 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3563 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3543 autocalling of expressions like r'foo', by modifying the line
3564 autocalling of expressions like r'foo', by modifying the line
3544 split regexp. Closes
3565 split regexp. Closes
3545 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3566 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3546 Riley <ipythonbugs-AT-sabi.net>.
3567 Riley <ipythonbugs-AT-sabi.net>.
3547 (InteractiveShell.mainloop): honor --nobanner with banner
3568 (InteractiveShell.mainloop): honor --nobanner with banner
3548 extensions.
3569 extensions.
3549
3570
3550 * IPython/Shell.py: Significant refactoring of all classes, so
3571 * IPython/Shell.py: Significant refactoring of all classes, so
3551 that we can really support ALL matplotlib backends and threading
3572 that we can really support ALL matplotlib backends and threading
3552 models (John spotted a bug with Tk which required this). Now we
3573 models (John spotted a bug with Tk which required this). Now we
3553 should support single-threaded, WX-threads and GTK-threads, both
3574 should support single-threaded, WX-threads and GTK-threads, both
3554 for generic code and for matplotlib.
3575 for generic code and for matplotlib.
3555
3576
3556 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3577 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3557 -pylab, to simplify things for users. Will also remove the pylab
3578 -pylab, to simplify things for users. Will also remove the pylab
3558 profile, since now all of matplotlib configuration is directly
3579 profile, since now all of matplotlib configuration is directly
3559 handled here. This also reduces startup time.
3580 handled here. This also reduces startup time.
3560
3581
3561 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3582 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3562 shell wasn't being correctly called. Also in IPShellWX.
3583 shell wasn't being correctly called. Also in IPShellWX.
3563
3584
3564 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3585 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3565 fine-tune banner.
3586 fine-tune banner.
3566
3587
3567 * IPython/numutils.py (spike): Deprecate these spike functions,
3588 * IPython/numutils.py (spike): Deprecate these spike functions,
3568 delete (long deprecated) gnuplot_exec handler.
3589 delete (long deprecated) gnuplot_exec handler.
3569
3590
3570 2004-08-26 Fernando Perez <fperez@colorado.edu>
3591 2004-08-26 Fernando Perez <fperez@colorado.edu>
3571
3592
3572 * ipython.1: Update for threading options, plus some others which
3593 * ipython.1: Update for threading options, plus some others which
3573 were missing.
3594 were missing.
3574
3595
3575 * IPython/ipmaker.py (__call__): Added -wthread option for
3596 * IPython/ipmaker.py (__call__): Added -wthread option for
3576 wxpython thread handling. Make sure threading options are only
3597 wxpython thread handling. Make sure threading options are only
3577 valid at the command line.
3598 valid at the command line.
3578
3599
3579 * scripts/ipython: moved shell selection into a factory function
3600 * scripts/ipython: moved shell selection into a factory function
3580 in Shell.py, to keep the starter script to a minimum.
3601 in Shell.py, to keep the starter script to a minimum.
3581
3602
3582 2004-08-25 Fernando Perez <fperez@colorado.edu>
3603 2004-08-25 Fernando Perez <fperez@colorado.edu>
3583
3604
3584 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3605 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3585 John. Along with some recent changes he made to matplotlib, the
3606 John. Along with some recent changes he made to matplotlib, the
3586 next versions of both systems should work very well together.
3607 next versions of both systems should work very well together.
3587
3608
3588 2004-08-24 Fernando Perez <fperez@colorado.edu>
3609 2004-08-24 Fernando Perez <fperez@colorado.edu>
3589
3610
3590 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3611 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3591 tried to switch the profiling to using hotshot, but I'm getting
3612 tried to switch the profiling to using hotshot, but I'm getting
3592 strange errors from prof.runctx() there. I may be misreading the
3613 strange errors from prof.runctx() there. I may be misreading the
3593 docs, but it looks weird. For now the profiling code will
3614 docs, but it looks weird. For now the profiling code will
3594 continue to use the standard profiler.
3615 continue to use the standard profiler.
3595
3616
3596 2004-08-23 Fernando Perez <fperez@colorado.edu>
3617 2004-08-23 Fernando Perez <fperez@colorado.edu>
3597
3618
3598 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3619 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3599 threaded shell, by John Hunter. It's not quite ready yet, but
3620 threaded shell, by John Hunter. It's not quite ready yet, but
3600 close.
3621 close.
3601
3622
3602 2004-08-22 Fernando Perez <fperez@colorado.edu>
3623 2004-08-22 Fernando Perez <fperez@colorado.edu>
3603
3624
3604 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3625 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3605 in Magic and ultraTB.
3626 in Magic and ultraTB.
3606
3627
3607 * ipython.1: document threading options in manpage.
3628 * ipython.1: document threading options in manpage.
3608
3629
3609 * scripts/ipython: Changed name of -thread option to -gthread,
3630 * scripts/ipython: Changed name of -thread option to -gthread,
3610 since this is GTK specific. I want to leave the door open for a
3631 since this is GTK specific. I want to leave the door open for a
3611 -wthread option for WX, which will most likely be necessary. This
3632 -wthread option for WX, which will most likely be necessary. This
3612 change affects usage and ipmaker as well.
3633 change affects usage and ipmaker as well.
3613
3634
3614 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3635 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3615 handle the matplotlib shell issues. Code by John Hunter
3636 handle the matplotlib shell issues. Code by John Hunter
3616 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3637 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3617 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3638 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3618 broken (and disabled for end users) for now, but it puts the
3639 broken (and disabled for end users) for now, but it puts the
3619 infrastructure in place.
3640 infrastructure in place.
3620
3641
3621 2004-08-21 Fernando Perez <fperez@colorado.edu>
3642 2004-08-21 Fernando Perez <fperez@colorado.edu>
3622
3643
3623 * ipythonrc-pylab: Add matplotlib support.
3644 * ipythonrc-pylab: Add matplotlib support.
3624
3645
3625 * matplotlib_config.py: new files for matplotlib support, part of
3646 * matplotlib_config.py: new files for matplotlib support, part of
3626 the pylab profile.
3647 the pylab profile.
3627
3648
3628 * IPython/usage.py (__doc__): documented the threading options.
3649 * IPython/usage.py (__doc__): documented the threading options.
3629
3650
3630 2004-08-20 Fernando Perez <fperez@colorado.edu>
3651 2004-08-20 Fernando Perez <fperez@colorado.edu>
3631
3652
3632 * ipython: Modified the main calling routine to handle the -thread
3653 * ipython: Modified the main calling routine to handle the -thread
3633 and -mpthread options. This needs to be done as a top-level hack,
3654 and -mpthread options. This needs to be done as a top-level hack,
3634 because it determines which class to instantiate for IPython
3655 because it determines which class to instantiate for IPython
3635 itself.
3656 itself.
3636
3657
3637 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3658 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3638 classes to support multithreaded GTK operation without blocking,
3659 classes to support multithreaded GTK operation without blocking,
3639 and matplotlib with all backends. This is a lot of still very
3660 and matplotlib with all backends. This is a lot of still very
3640 experimental code, and threads are tricky. So it may still have a
3661 experimental code, and threads are tricky. So it may still have a
3641 few rough edges... This code owes a lot to
3662 few rough edges... This code owes a lot to
3642 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3663 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3643 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3664 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3644 to John Hunter for all the matplotlib work.
3665 to John Hunter for all the matplotlib work.
3645
3666
3646 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3667 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3647 options for gtk thread and matplotlib support.
3668 options for gtk thread and matplotlib support.
3648
3669
3649 2004-08-16 Fernando Perez <fperez@colorado.edu>
3670 2004-08-16 Fernando Perez <fperez@colorado.edu>
3650
3671
3651 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3672 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3652 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3673 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3653 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3674 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3654
3675
3655 2004-08-11 Fernando Perez <fperez@colorado.edu>
3676 2004-08-11 Fernando Perez <fperez@colorado.edu>
3656
3677
3657 * setup.py (isfile): Fix build so documentation gets updated for
3678 * setup.py (isfile): Fix build so documentation gets updated for
3658 rpms (it was only done for .tgz builds).
3679 rpms (it was only done for .tgz builds).
3659
3680
3660 2004-08-10 Fernando Perez <fperez@colorado.edu>
3681 2004-08-10 Fernando Perez <fperez@colorado.edu>
3661
3682
3662 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3683 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3663
3684
3664 * iplib.py : Silence syntax error exceptions in tab-completion.
3685 * iplib.py : Silence syntax error exceptions in tab-completion.
3665
3686
3666 2004-08-05 Fernando Perez <fperez@colorado.edu>
3687 2004-08-05 Fernando Perez <fperez@colorado.edu>
3667
3688
3668 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3689 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3669 'color off' mark for continuation prompts. This was causing long
3690 'color off' mark for continuation prompts. This was causing long
3670 continuation lines to mis-wrap.
3691 continuation lines to mis-wrap.
3671
3692
3672 2004-08-01 Fernando Perez <fperez@colorado.edu>
3693 2004-08-01 Fernando Perez <fperez@colorado.edu>
3673
3694
3674 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3695 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3675 for building ipython to be a parameter. All this is necessary
3696 for building ipython to be a parameter. All this is necessary
3676 right now to have a multithreaded version, but this insane
3697 right now to have a multithreaded version, but this insane
3677 non-design will be cleaned up soon. For now, it's a hack that
3698 non-design will be cleaned up soon. For now, it's a hack that
3678 works.
3699 works.
3679
3700
3680 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3701 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3681 args in various places. No bugs so far, but it's a dangerous
3702 args in various places. No bugs so far, but it's a dangerous
3682 practice.
3703 practice.
3683
3704
3684 2004-07-31 Fernando Perez <fperez@colorado.edu>
3705 2004-07-31 Fernando Perez <fperez@colorado.edu>
3685
3706
3686 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3707 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3687 fix completion of files with dots in their names under most
3708 fix completion of files with dots in their names under most
3688 profiles (pysh was OK because the completion order is different).
3709 profiles (pysh was OK because the completion order is different).
3689
3710
3690 2004-07-27 Fernando Perez <fperez@colorado.edu>
3711 2004-07-27 Fernando Perez <fperez@colorado.edu>
3691
3712
3692 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3713 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3693 keywords manually, b/c the one in keyword.py was removed in python
3714 keywords manually, b/c the one in keyword.py was removed in python
3694 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3715 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3695 This is NOT a bug under python 2.3 and earlier.
3716 This is NOT a bug under python 2.3 and earlier.
3696
3717
3697 2004-07-26 Fernando Perez <fperez@colorado.edu>
3718 2004-07-26 Fernando Perez <fperez@colorado.edu>
3698
3719
3699 * IPython/ultraTB.py (VerboseTB.text): Add another
3720 * IPython/ultraTB.py (VerboseTB.text): Add another
3700 linecache.checkcache() call to try to prevent inspect.py from
3721 linecache.checkcache() call to try to prevent inspect.py from
3701 crashing under python 2.3. I think this fixes
3722 crashing under python 2.3. I think this fixes
3702 http://www.scipy.net/roundup/ipython/issue17.
3723 http://www.scipy.net/roundup/ipython/issue17.
3703
3724
3704 2004-07-26 *** Released version 0.6.2
3725 2004-07-26 *** Released version 0.6.2
3705
3726
3706 2004-07-26 Fernando Perez <fperez@colorado.edu>
3727 2004-07-26 Fernando Perez <fperez@colorado.edu>
3707
3728
3708 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3729 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3709 fail for any number.
3730 fail for any number.
3710 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3731 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3711 empty bookmarks.
3732 empty bookmarks.
3712
3733
3713 2004-07-26 *** Released version 0.6.1
3734 2004-07-26 *** Released version 0.6.1
3714
3735
3715 2004-07-26 Fernando Perez <fperez@colorado.edu>
3736 2004-07-26 Fernando Perez <fperez@colorado.edu>
3716
3737
3717 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3738 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3718
3739
3719 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3740 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3720 escaping '()[]{}' in filenames.
3741 escaping '()[]{}' in filenames.
3721
3742
3722 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3743 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3723 Python 2.2 users who lack a proper shlex.split.
3744 Python 2.2 users who lack a proper shlex.split.
3724
3745
3725 2004-07-19 Fernando Perez <fperez@colorado.edu>
3746 2004-07-19 Fernando Perez <fperez@colorado.edu>
3726
3747
3727 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3748 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3728 for reading readline's init file. I follow the normal chain:
3749 for reading readline's init file. I follow the normal chain:
3729 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3750 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3730 report by Mike Heeter. This closes
3751 report by Mike Heeter. This closes
3731 http://www.scipy.net/roundup/ipython/issue16.
3752 http://www.scipy.net/roundup/ipython/issue16.
3732
3753
3733 2004-07-18 Fernando Perez <fperez@colorado.edu>
3754 2004-07-18 Fernando Perez <fperez@colorado.edu>
3734
3755
3735 * IPython/iplib.py (__init__): Add better handling of '\' under
3756 * IPython/iplib.py (__init__): Add better handling of '\' under
3736 Win32 for filenames. After a patch by Ville.
3757 Win32 for filenames. After a patch by Ville.
3737
3758
3738 2004-07-17 Fernando Perez <fperez@colorado.edu>
3759 2004-07-17 Fernando Perez <fperez@colorado.edu>
3739
3760
3740 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3761 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3741 autocalling would be triggered for 'foo is bar' if foo is
3762 autocalling would be triggered for 'foo is bar' if foo is
3742 callable. I also cleaned up the autocall detection code to use a
3763 callable. I also cleaned up the autocall detection code to use a
3743 regexp, which is faster. Bug reported by Alexander Schmolck.
3764 regexp, which is faster. Bug reported by Alexander Schmolck.
3744
3765
3745 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3766 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3746 '?' in them would confuse the help system. Reported by Alex
3767 '?' in them would confuse the help system. Reported by Alex
3747 Schmolck.
3768 Schmolck.
3748
3769
3749 2004-07-16 Fernando Perez <fperez@colorado.edu>
3770 2004-07-16 Fernando Perez <fperez@colorado.edu>
3750
3771
3751 * IPython/GnuplotInteractive.py (__all__): added plot2.
3772 * IPython/GnuplotInteractive.py (__all__): added plot2.
3752
3773
3753 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3774 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3754 plotting dictionaries, lists or tuples of 1d arrays.
3775 plotting dictionaries, lists or tuples of 1d arrays.
3755
3776
3756 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3777 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3757 optimizations.
3778 optimizations.
3758
3779
3759 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3780 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3760 the information which was there from Janko's original IPP code:
3781 the information which was there from Janko's original IPP code:
3761
3782
3762 03.05.99 20:53 porto.ifm.uni-kiel.de
3783 03.05.99 20:53 porto.ifm.uni-kiel.de
3763 --Started changelog.
3784 --Started changelog.
3764 --make clear do what it say it does
3785 --make clear do what it say it does
3765 --added pretty output of lines from inputcache
3786 --added pretty output of lines from inputcache
3766 --Made Logger a mixin class, simplifies handling of switches
3787 --Made Logger a mixin class, simplifies handling of switches
3767 --Added own completer class. .string<TAB> expands to last history
3788 --Added own completer class. .string<TAB> expands to last history
3768 line which starts with string. The new expansion is also present
3789 line which starts with string. The new expansion is also present
3769 with Ctrl-r from the readline library. But this shows, who this
3790 with Ctrl-r from the readline library. But this shows, who this
3770 can be done for other cases.
3791 can be done for other cases.
3771 --Added convention that all shell functions should accept a
3792 --Added convention that all shell functions should accept a
3772 parameter_string This opens the door for different behaviour for
3793 parameter_string This opens the door for different behaviour for
3773 each function. @cd is a good example of this.
3794 each function. @cd is a good example of this.
3774
3795
3775 04.05.99 12:12 porto.ifm.uni-kiel.de
3796 04.05.99 12:12 porto.ifm.uni-kiel.de
3776 --added logfile rotation
3797 --added logfile rotation
3777 --added new mainloop method which freezes first the namespace
3798 --added new mainloop method which freezes first the namespace
3778
3799
3779 07.05.99 21:24 porto.ifm.uni-kiel.de
3800 07.05.99 21:24 porto.ifm.uni-kiel.de
3780 --added the docreader classes. Now there is a help system.
3801 --added the docreader classes. Now there is a help system.
3781 -This is only a first try. Currently it's not easy to put new
3802 -This is only a first try. Currently it's not easy to put new
3782 stuff in the indices. But this is the way to go. Info would be
3803 stuff in the indices. But this is the way to go. Info would be
3783 better, but HTML is every where and not everybody has an info
3804 better, but HTML is every where and not everybody has an info
3784 system installed and it's not so easy to change html-docs to info.
3805 system installed and it's not so easy to change html-docs to info.
3785 --added global logfile option
3806 --added global logfile option
3786 --there is now a hook for object inspection method pinfo needs to
3807 --there is now a hook for object inspection method pinfo needs to
3787 be provided for this. Can be reached by two '??'.
3808 be provided for this. Can be reached by two '??'.
3788
3809
3789 08.05.99 20:51 porto.ifm.uni-kiel.de
3810 08.05.99 20:51 porto.ifm.uni-kiel.de
3790 --added a README
3811 --added a README
3791 --bug in rc file. Something has changed so functions in the rc
3812 --bug in rc file. Something has changed so functions in the rc
3792 file need to reference the shell and not self. Not clear if it's a
3813 file need to reference the shell and not self. Not clear if it's a
3793 bug or feature.
3814 bug or feature.
3794 --changed rc file for new behavior
3815 --changed rc file for new behavior
3795
3816
3796 2004-07-15 Fernando Perez <fperez@colorado.edu>
3817 2004-07-15 Fernando Perez <fperez@colorado.edu>
3797
3818
3798 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3819 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3799 cache was falling out of sync in bizarre manners when multi-line
3820 cache was falling out of sync in bizarre manners when multi-line
3800 input was present. Minor optimizations and cleanup.
3821 input was present. Minor optimizations and cleanup.
3801
3822
3802 (Logger): Remove old Changelog info for cleanup. This is the
3823 (Logger): Remove old Changelog info for cleanup. This is the
3803 information which was there from Janko's original code:
3824 information which was there from Janko's original code:
3804
3825
3805 Changes to Logger: - made the default log filename a parameter
3826 Changes to Logger: - made the default log filename a parameter
3806
3827
3807 - put a check for lines beginning with !@? in log(). Needed
3828 - put a check for lines beginning with !@? in log(). Needed
3808 (even if the handlers properly log their lines) for mid-session
3829 (even if the handlers properly log their lines) for mid-session
3809 logging activation to work properly. Without this, lines logged
3830 logging activation to work properly. Without this, lines logged
3810 in mid session, which get read from the cache, would end up
3831 in mid session, which get read from the cache, would end up
3811 'bare' (with !@? in the open) in the log. Now they are caught
3832 'bare' (with !@? in the open) in the log. Now they are caught
3812 and prepended with a #.
3833 and prepended with a #.
3813
3834
3814 * IPython/iplib.py (InteractiveShell.init_readline): added check
3835 * IPython/iplib.py (InteractiveShell.init_readline): added check
3815 in case MagicCompleter fails to be defined, so we don't crash.
3836 in case MagicCompleter fails to be defined, so we don't crash.
3816
3837
3817 2004-07-13 Fernando Perez <fperez@colorado.edu>
3838 2004-07-13 Fernando Perez <fperez@colorado.edu>
3818
3839
3819 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3840 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3820 of EPS if the requested filename ends in '.eps'.
3841 of EPS if the requested filename ends in '.eps'.
3821
3842
3822 2004-07-04 Fernando Perez <fperez@colorado.edu>
3843 2004-07-04 Fernando Perez <fperez@colorado.edu>
3823
3844
3824 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3845 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3825 escaping of quotes when calling the shell.
3846 escaping of quotes when calling the shell.
3826
3847
3827 2004-07-02 Fernando Perez <fperez@colorado.edu>
3848 2004-07-02 Fernando Perez <fperez@colorado.edu>
3828
3849
3829 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3850 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3830 gettext not working because we were clobbering '_'. Fixes
3851 gettext not working because we were clobbering '_'. Fixes
3831 http://www.scipy.net/roundup/ipython/issue6.
3852 http://www.scipy.net/roundup/ipython/issue6.
3832
3853
3833 2004-07-01 Fernando Perez <fperez@colorado.edu>
3854 2004-07-01 Fernando Perez <fperez@colorado.edu>
3834
3855
3835 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3856 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3836 into @cd. Patch by Ville.
3857 into @cd. Patch by Ville.
3837
3858
3838 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3859 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3839 new function to store things after ipmaker runs. Patch by Ville.
3860 new function to store things after ipmaker runs. Patch by Ville.
3840 Eventually this will go away once ipmaker is removed and the class
3861 Eventually this will go away once ipmaker is removed and the class
3841 gets cleaned up, but for now it's ok. Key functionality here is
3862 gets cleaned up, but for now it's ok. Key functionality here is
3842 the addition of the persistent storage mechanism, a dict for
3863 the addition of the persistent storage mechanism, a dict for
3843 keeping data across sessions (for now just bookmarks, but more can
3864 keeping data across sessions (for now just bookmarks, but more can
3844 be implemented later).
3865 be implemented later).
3845
3866
3846 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3867 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3847 persistent across sections. Patch by Ville, I modified it
3868 persistent across sections. Patch by Ville, I modified it
3848 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3869 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3849 added a '-l' option to list all bookmarks.
3870 added a '-l' option to list all bookmarks.
3850
3871
3851 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3872 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3852 center for cleanup. Registered with atexit.register(). I moved
3873 center for cleanup. Registered with atexit.register(). I moved
3853 here the old exit_cleanup(). After a patch by Ville.
3874 here the old exit_cleanup(). After a patch by Ville.
3854
3875
3855 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3876 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3856 characters in the hacked shlex_split for python 2.2.
3877 characters in the hacked shlex_split for python 2.2.
3857
3878
3858 * IPython/iplib.py (file_matches): more fixes to filenames with
3879 * IPython/iplib.py (file_matches): more fixes to filenames with
3859 whitespace in them. It's not perfect, but limitations in python's
3880 whitespace in them. It's not perfect, but limitations in python's
3860 readline make it impossible to go further.
3881 readline make it impossible to go further.
3861
3882
3862 2004-06-29 Fernando Perez <fperez@colorado.edu>
3883 2004-06-29 Fernando Perez <fperez@colorado.edu>
3863
3884
3864 * IPython/iplib.py (file_matches): escape whitespace correctly in
3885 * IPython/iplib.py (file_matches): escape whitespace correctly in
3865 filename completions. Bug reported by Ville.
3886 filename completions. Bug reported by Ville.
3866
3887
3867 2004-06-28 Fernando Perez <fperez@colorado.edu>
3888 2004-06-28 Fernando Perez <fperez@colorado.edu>
3868
3889
3869 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3890 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3870 the history file will be called 'history-PROFNAME' (or just
3891 the history file will be called 'history-PROFNAME' (or just
3871 'history' if no profile is loaded). I was getting annoyed at
3892 'history' if no profile is loaded). I was getting annoyed at
3872 getting my Numerical work history clobbered by pysh sessions.
3893 getting my Numerical work history clobbered by pysh sessions.
3873
3894
3874 * IPython/iplib.py (InteractiveShell.__init__): Internal
3895 * IPython/iplib.py (InteractiveShell.__init__): Internal
3875 getoutputerror() function so that we can honor the system_verbose
3896 getoutputerror() function so that we can honor the system_verbose
3876 flag for _all_ system calls. I also added escaping of #
3897 flag for _all_ system calls. I also added escaping of #
3877 characters here to avoid confusing Itpl.
3898 characters here to avoid confusing Itpl.
3878
3899
3879 * IPython/Magic.py (shlex_split): removed call to shell in
3900 * IPython/Magic.py (shlex_split): removed call to shell in
3880 parse_options and replaced it with shlex.split(). The annoying
3901 parse_options and replaced it with shlex.split(). The annoying
3881 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3902 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3882 to backport it from 2.3, with several frail hacks (the shlex
3903 to backport it from 2.3, with several frail hacks (the shlex
3883 module is rather limited in 2.2). Thanks to a suggestion by Ville
3904 module is rather limited in 2.2). Thanks to a suggestion by Ville
3884 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3905 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3885 problem.
3906 problem.
3886
3907
3887 (Magic.magic_system_verbose): new toggle to print the actual
3908 (Magic.magic_system_verbose): new toggle to print the actual
3888 system calls made by ipython. Mainly for debugging purposes.
3909 system calls made by ipython. Mainly for debugging purposes.
3889
3910
3890 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3911 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3891 doesn't support persistence. Reported (and fix suggested) by
3912 doesn't support persistence. Reported (and fix suggested) by
3892 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3913 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3893
3914
3894 2004-06-26 Fernando Perez <fperez@colorado.edu>
3915 2004-06-26 Fernando Perez <fperez@colorado.edu>
3895
3916
3896 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3917 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3897 continue prompts.
3918 continue prompts.
3898
3919
3899 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3920 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3900 function (basically a big docstring) and a few more things here to
3921 function (basically a big docstring) and a few more things here to
3901 speedup startup. pysh.py is now very lightweight. We want because
3922 speedup startup. pysh.py is now very lightweight. We want because
3902 it gets execfile'd, while InterpreterExec gets imported, so
3923 it gets execfile'd, while InterpreterExec gets imported, so
3903 byte-compilation saves time.
3924 byte-compilation saves time.
3904
3925
3905 2004-06-25 Fernando Perez <fperez@colorado.edu>
3926 2004-06-25 Fernando Perez <fperez@colorado.edu>
3906
3927
3907 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3928 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3908 -NUM', which was recently broken.
3929 -NUM', which was recently broken.
3909
3930
3910 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3931 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3911 in multi-line input (but not !!, which doesn't make sense there).
3932 in multi-line input (but not !!, which doesn't make sense there).
3912
3933
3913 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3934 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3914 It's just too useful, and people can turn it off in the less
3935 It's just too useful, and people can turn it off in the less
3915 common cases where it's a problem.
3936 common cases where it's a problem.
3916
3937
3917 2004-06-24 Fernando Perez <fperez@colorado.edu>
3938 2004-06-24 Fernando Perez <fperez@colorado.edu>
3918
3939
3919 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3940 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3920 special syntaxes (like alias calling) is now allied in multi-line
3941 special syntaxes (like alias calling) is now allied in multi-line
3921 input. This is still _very_ experimental, but it's necessary for
3942 input. This is still _very_ experimental, but it's necessary for
3922 efficient shell usage combining python looping syntax with system
3943 efficient shell usage combining python looping syntax with system
3923 calls. For now it's restricted to aliases, I don't think it
3944 calls. For now it's restricted to aliases, I don't think it
3924 really even makes sense to have this for magics.
3945 really even makes sense to have this for magics.
3925
3946
3926 2004-06-23 Fernando Perez <fperez@colorado.edu>
3947 2004-06-23 Fernando Perez <fperez@colorado.edu>
3927
3948
3928 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3949 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3929 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3950 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3930
3951
3931 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3952 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3932 extensions under Windows (after code sent by Gary Bishop). The
3953 extensions under Windows (after code sent by Gary Bishop). The
3933 extensions considered 'executable' are stored in IPython's rc
3954 extensions considered 'executable' are stored in IPython's rc
3934 structure as win_exec_ext.
3955 structure as win_exec_ext.
3935
3956
3936 * IPython/genutils.py (shell): new function, like system() but
3957 * IPython/genutils.py (shell): new function, like system() but
3937 without return value. Very useful for interactive shell work.
3958 without return value. Very useful for interactive shell work.
3938
3959
3939 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3960 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3940 delete aliases.
3961 delete aliases.
3941
3962
3942 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3963 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3943 sure that the alias table doesn't contain python keywords.
3964 sure that the alias table doesn't contain python keywords.
3944
3965
3945 2004-06-21 Fernando Perez <fperez@colorado.edu>
3966 2004-06-21 Fernando Perez <fperez@colorado.edu>
3946
3967
3947 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3968 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3948 non-existent items are found in $PATH. Reported by Thorsten.
3969 non-existent items are found in $PATH. Reported by Thorsten.
3949
3970
3950 2004-06-20 Fernando Perez <fperez@colorado.edu>
3971 2004-06-20 Fernando Perez <fperez@colorado.edu>
3951
3972
3952 * IPython/iplib.py (complete): modified the completer so that the
3973 * IPython/iplib.py (complete): modified the completer so that the
3953 order of priorities can be easily changed at runtime.
3974 order of priorities can be easily changed at runtime.
3954
3975
3955 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3976 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3956 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3977 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3957
3978
3958 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3979 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3959 expand Python variables prepended with $ in all system calls. The
3980 expand Python variables prepended with $ in all system calls. The
3960 same was done to InteractiveShell.handle_shell_escape. Now all
3981 same was done to InteractiveShell.handle_shell_escape. Now all
3961 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3982 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3962 expansion of python variables and expressions according to the
3983 expansion of python variables and expressions according to the
3963 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3984 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3964
3985
3965 Though PEP-215 has been rejected, a similar (but simpler) one
3986 Though PEP-215 has been rejected, a similar (but simpler) one
3966 seems like it will go into Python 2.4, PEP-292 -
3987 seems like it will go into Python 2.4, PEP-292 -
3967 http://www.python.org/peps/pep-0292.html.
3988 http://www.python.org/peps/pep-0292.html.
3968
3989
3969 I'll keep the full syntax of PEP-215, since IPython has since the
3990 I'll keep the full syntax of PEP-215, since IPython has since the
3970 start used Ka-Ping Yee's reference implementation discussed there
3991 start used Ka-Ping Yee's reference implementation discussed there
3971 (Itpl), and I actually like the powerful semantics it offers.
3992 (Itpl), and I actually like the powerful semantics it offers.
3972
3993
3973 In order to access normal shell variables, the $ has to be escaped
3994 In order to access normal shell variables, the $ has to be escaped
3974 via an extra $. For example:
3995 via an extra $. For example:
3975
3996
3976 In [7]: PATH='a python variable'
3997 In [7]: PATH='a python variable'
3977
3998
3978 In [8]: !echo $PATH
3999 In [8]: !echo $PATH
3979 a python variable
4000 a python variable
3980
4001
3981 In [9]: !echo $$PATH
4002 In [9]: !echo $$PATH
3982 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4003 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3983
4004
3984 (Magic.parse_options): escape $ so the shell doesn't evaluate
4005 (Magic.parse_options): escape $ so the shell doesn't evaluate
3985 things prematurely.
4006 things prematurely.
3986
4007
3987 * IPython/iplib.py (InteractiveShell.call_alias): added the
4008 * IPython/iplib.py (InteractiveShell.call_alias): added the
3988 ability for aliases to expand python variables via $.
4009 ability for aliases to expand python variables via $.
3989
4010
3990 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4011 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3991 system, now there's a @rehash/@rehashx pair of magics. These work
4012 system, now there's a @rehash/@rehashx pair of magics. These work
3992 like the csh rehash command, and can be invoked at any time. They
4013 like the csh rehash command, and can be invoked at any time. They
3993 build a table of aliases to everything in the user's $PATH
4014 build a table of aliases to everything in the user's $PATH
3994 (@rehash uses everything, @rehashx is slower but only adds
4015 (@rehash uses everything, @rehashx is slower but only adds
3995 executable files). With this, the pysh.py-based shell profile can
4016 executable files). With this, the pysh.py-based shell profile can
3996 now simply call rehash upon startup, and full access to all
4017 now simply call rehash upon startup, and full access to all
3997 programs in the user's path is obtained.
4018 programs in the user's path is obtained.
3998
4019
3999 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4020 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4000 functionality is now fully in place. I removed the old dynamic
4021 functionality is now fully in place. I removed the old dynamic
4001 code generation based approach, in favor of a much lighter one
4022 code generation based approach, in favor of a much lighter one
4002 based on a simple dict. The advantage is that this allows me to
4023 based on a simple dict. The advantage is that this allows me to
4003 now have thousands of aliases with negligible cost (unthinkable
4024 now have thousands of aliases with negligible cost (unthinkable
4004 with the old system).
4025 with the old system).
4005
4026
4006 2004-06-19 Fernando Perez <fperez@colorado.edu>
4027 2004-06-19 Fernando Perez <fperez@colorado.edu>
4007
4028
4008 * IPython/iplib.py (__init__): extended MagicCompleter class to
4029 * IPython/iplib.py (__init__): extended MagicCompleter class to
4009 also complete (last in priority) on user aliases.
4030 also complete (last in priority) on user aliases.
4010
4031
4011 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4032 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4012 call to eval.
4033 call to eval.
4013 (ItplNS.__init__): Added a new class which functions like Itpl,
4034 (ItplNS.__init__): Added a new class which functions like Itpl,
4014 but allows configuring the namespace for the evaluation to occur
4035 but allows configuring the namespace for the evaluation to occur
4015 in.
4036 in.
4016
4037
4017 2004-06-18 Fernando Perez <fperez@colorado.edu>
4038 2004-06-18 Fernando Perez <fperez@colorado.edu>
4018
4039
4019 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4040 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4020 better message when 'exit' or 'quit' are typed (a common newbie
4041 better message when 'exit' or 'quit' are typed (a common newbie
4021 confusion).
4042 confusion).
4022
4043
4023 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4044 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4024 check for Windows users.
4045 check for Windows users.
4025
4046
4026 * IPython/iplib.py (InteractiveShell.user_setup): removed
4047 * IPython/iplib.py (InteractiveShell.user_setup): removed
4027 disabling of colors for Windows. I'll test at runtime and issue a
4048 disabling of colors for Windows. I'll test at runtime and issue a
4028 warning if Gary's readline isn't found, as to nudge users to
4049 warning if Gary's readline isn't found, as to nudge users to
4029 download it.
4050 download it.
4030
4051
4031 2004-06-16 Fernando Perez <fperez@colorado.edu>
4052 2004-06-16 Fernando Perez <fperez@colorado.edu>
4032
4053
4033 * IPython/genutils.py (Stream.__init__): changed to print errors
4054 * IPython/genutils.py (Stream.__init__): changed to print errors
4034 to sys.stderr. I had a circular dependency here. Now it's
4055 to sys.stderr. I had a circular dependency here. Now it's
4035 possible to run ipython as IDLE's shell (consider this pre-alpha,
4056 possible to run ipython as IDLE's shell (consider this pre-alpha,
4036 since true stdout things end up in the starting terminal instead
4057 since true stdout things end up in the starting terminal instead
4037 of IDLE's out).
4058 of IDLE's out).
4038
4059
4039 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4060 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4040 users who haven't # updated their prompt_in2 definitions. Remove
4061 users who haven't # updated their prompt_in2 definitions. Remove
4041 eventually.
4062 eventually.
4042 (multiple_replace): added credit to original ASPN recipe.
4063 (multiple_replace): added credit to original ASPN recipe.
4043
4064
4044 2004-06-15 Fernando Perez <fperez@colorado.edu>
4065 2004-06-15 Fernando Perez <fperez@colorado.edu>
4045
4066
4046 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4067 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4047 list of auto-defined aliases.
4068 list of auto-defined aliases.
4048
4069
4049 2004-06-13 Fernando Perez <fperez@colorado.edu>
4070 2004-06-13 Fernando Perez <fperez@colorado.edu>
4050
4071
4051 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4072 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4052 install was really requested (so setup.py can be used for other
4073 install was really requested (so setup.py can be used for other
4053 things under Windows).
4074 things under Windows).
4054
4075
4055 2004-06-10 Fernando Perez <fperez@colorado.edu>
4076 2004-06-10 Fernando Perez <fperez@colorado.edu>
4056
4077
4057 * IPython/Logger.py (Logger.create_log): Manually remove any old
4078 * IPython/Logger.py (Logger.create_log): Manually remove any old
4058 backup, since os.remove may fail under Windows. Fixes bug
4079 backup, since os.remove may fail under Windows. Fixes bug
4059 reported by Thorsten.
4080 reported by Thorsten.
4060
4081
4061 2004-06-09 Fernando Perez <fperez@colorado.edu>
4082 2004-06-09 Fernando Perez <fperez@colorado.edu>
4062
4083
4063 * examples/example-embed.py: fixed all references to %n (replaced
4084 * examples/example-embed.py: fixed all references to %n (replaced
4064 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4085 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4065 for all examples and the manual as well.
4086 for all examples and the manual as well.
4066
4087
4067 2004-06-08 Fernando Perez <fperez@colorado.edu>
4088 2004-06-08 Fernando Perez <fperez@colorado.edu>
4068
4089
4069 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4090 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4070 alignment and color management. All 3 prompt subsystems now
4091 alignment and color management. All 3 prompt subsystems now
4071 inherit from BasePrompt.
4092 inherit from BasePrompt.
4072
4093
4073 * tools/release: updates for windows installer build and tag rpms
4094 * tools/release: updates for windows installer build and tag rpms
4074 with python version (since paths are fixed).
4095 with python version (since paths are fixed).
4075
4096
4076 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4097 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4077 which will become eventually obsolete. Also fixed the default
4098 which will become eventually obsolete. Also fixed the default
4078 prompt_in2 to use \D, so at least new users start with the correct
4099 prompt_in2 to use \D, so at least new users start with the correct
4079 defaults.
4100 defaults.
4080 WARNING: Users with existing ipythonrc files will need to apply
4101 WARNING: Users with existing ipythonrc files will need to apply
4081 this fix manually!
4102 this fix manually!
4082
4103
4083 * setup.py: make windows installer (.exe). This is finally the
4104 * setup.py: make windows installer (.exe). This is finally the
4084 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4105 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4085 which I hadn't included because it required Python 2.3 (or recent
4106 which I hadn't included because it required Python 2.3 (or recent
4086 distutils).
4107 distutils).
4087
4108
4088 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4109 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4089 usage of new '\D' escape.
4110 usage of new '\D' escape.
4090
4111
4091 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4112 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4092 lacks os.getuid())
4113 lacks os.getuid())
4093 (CachedOutput.set_colors): Added the ability to turn coloring
4114 (CachedOutput.set_colors): Added the ability to turn coloring
4094 on/off with @colors even for manually defined prompt colors. It
4115 on/off with @colors even for manually defined prompt colors. It
4095 uses a nasty global, but it works safely and via the generic color
4116 uses a nasty global, but it works safely and via the generic color
4096 handling mechanism.
4117 handling mechanism.
4097 (Prompt2.__init__): Introduced new escape '\D' for continuation
4118 (Prompt2.__init__): Introduced new escape '\D' for continuation
4098 prompts. It represents the counter ('\#') as dots.
4119 prompts. It represents the counter ('\#') as dots.
4099 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4120 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4100 need to update their ipythonrc files and replace '%n' with '\D' in
4121 need to update their ipythonrc files and replace '%n' with '\D' in
4101 their prompt_in2 settings everywhere. Sorry, but there's
4122 their prompt_in2 settings everywhere. Sorry, but there's
4102 otherwise no clean way to get all prompts to properly align. The
4123 otherwise no clean way to get all prompts to properly align. The
4103 ipythonrc shipped with IPython has been updated.
4124 ipythonrc shipped with IPython has been updated.
4104
4125
4105 2004-06-07 Fernando Perez <fperez@colorado.edu>
4126 2004-06-07 Fernando Perez <fperez@colorado.edu>
4106
4127
4107 * setup.py (isfile): Pass local_icons option to latex2html, so the
4128 * setup.py (isfile): Pass local_icons option to latex2html, so the
4108 resulting HTML file is self-contained. Thanks to
4129 resulting HTML file is self-contained. Thanks to
4109 dryice-AT-liu.com.cn for the tip.
4130 dryice-AT-liu.com.cn for the tip.
4110
4131
4111 * pysh.py: I created a new profile 'shell', which implements a
4132 * pysh.py: I created a new profile 'shell', which implements a
4112 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4133 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4113 system shell, nor will it become one anytime soon. It's mainly
4134 system shell, nor will it become one anytime soon. It's mainly
4114 meant to illustrate the use of the new flexible bash-like prompts.
4135 meant to illustrate the use of the new flexible bash-like prompts.
4115 I guess it could be used by hardy souls for true shell management,
4136 I guess it could be used by hardy souls for true shell management,
4116 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4137 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4117 profile. This uses the InterpreterExec extension provided by
4138 profile. This uses the InterpreterExec extension provided by
4118 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4139 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4119
4140
4120 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4141 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4121 auto-align itself with the length of the previous input prompt
4142 auto-align itself with the length of the previous input prompt
4122 (taking into account the invisible color escapes).
4143 (taking into account the invisible color escapes).
4123 (CachedOutput.__init__): Large restructuring of this class. Now
4144 (CachedOutput.__init__): Large restructuring of this class. Now
4124 all three prompts (primary1, primary2, output) are proper objects,
4145 all three prompts (primary1, primary2, output) are proper objects,
4125 managed by the 'parent' CachedOutput class. The code is still a
4146 managed by the 'parent' CachedOutput class. The code is still a
4126 bit hackish (all prompts share state via a pointer to the cache),
4147 bit hackish (all prompts share state via a pointer to the cache),
4127 but it's overall far cleaner than before.
4148 but it's overall far cleaner than before.
4128
4149
4129 * IPython/genutils.py (getoutputerror): modified to add verbose,
4150 * IPython/genutils.py (getoutputerror): modified to add verbose,
4130 debug and header options. This makes the interface of all getout*
4151 debug and header options. This makes the interface of all getout*
4131 functions uniform.
4152 functions uniform.
4132 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4153 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4133
4154
4134 * IPython/Magic.py (Magic.default_option): added a function to
4155 * IPython/Magic.py (Magic.default_option): added a function to
4135 allow registering default options for any magic command. This
4156 allow registering default options for any magic command. This
4136 makes it easy to have profiles which customize the magics globally
4157 makes it easy to have profiles which customize the magics globally
4137 for a certain use. The values set through this function are
4158 for a certain use. The values set through this function are
4138 picked up by the parse_options() method, which all magics should
4159 picked up by the parse_options() method, which all magics should
4139 use to parse their options.
4160 use to parse their options.
4140
4161
4141 * IPython/genutils.py (warn): modified the warnings framework to
4162 * IPython/genutils.py (warn): modified the warnings framework to
4142 use the Term I/O class. I'm trying to slowly unify all of
4163 use the Term I/O class. I'm trying to slowly unify all of
4143 IPython's I/O operations to pass through Term.
4164 IPython's I/O operations to pass through Term.
4144
4165
4145 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4166 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4146 the secondary prompt to correctly match the length of the primary
4167 the secondary prompt to correctly match the length of the primary
4147 one for any prompt. Now multi-line code will properly line up
4168 one for any prompt. Now multi-line code will properly line up
4148 even for path dependent prompts, such as the new ones available
4169 even for path dependent prompts, such as the new ones available
4149 via the prompt_specials.
4170 via the prompt_specials.
4150
4171
4151 2004-06-06 Fernando Perez <fperez@colorado.edu>
4172 2004-06-06 Fernando Perez <fperez@colorado.edu>
4152
4173
4153 * IPython/Prompts.py (prompt_specials): Added the ability to have
4174 * IPython/Prompts.py (prompt_specials): Added the ability to have
4154 bash-like special sequences in the prompts, which get
4175 bash-like special sequences in the prompts, which get
4155 automatically expanded. Things like hostname, current working
4176 automatically expanded. Things like hostname, current working
4156 directory and username are implemented already, but it's easy to
4177 directory and username are implemented already, but it's easy to
4157 add more in the future. Thanks to a patch by W.J. van der Laan
4178 add more in the future. Thanks to a patch by W.J. van der Laan
4158 <gnufnork-AT-hetdigitalegat.nl>
4179 <gnufnork-AT-hetdigitalegat.nl>
4159 (prompt_specials): Added color support for prompt strings, so
4180 (prompt_specials): Added color support for prompt strings, so
4160 users can define arbitrary color setups for their prompts.
4181 users can define arbitrary color setups for their prompts.
4161
4182
4162 2004-06-05 Fernando Perez <fperez@colorado.edu>
4183 2004-06-05 Fernando Perez <fperez@colorado.edu>
4163
4184
4164 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4185 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4165 code to load Gary Bishop's readline and configure it
4186 code to load Gary Bishop's readline and configure it
4166 automatically. Thanks to Gary for help on this.
4187 automatically. Thanks to Gary for help on this.
4167
4188
4168 2004-06-01 Fernando Perez <fperez@colorado.edu>
4189 2004-06-01 Fernando Perez <fperez@colorado.edu>
4169
4190
4170 * IPython/Logger.py (Logger.create_log): fix bug for logging
4191 * IPython/Logger.py (Logger.create_log): fix bug for logging
4171 with no filename (previous fix was incomplete).
4192 with no filename (previous fix was incomplete).
4172
4193
4173 2004-05-25 Fernando Perez <fperez@colorado.edu>
4194 2004-05-25 Fernando Perez <fperez@colorado.edu>
4174
4195
4175 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4196 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4176 parens would get passed to the shell.
4197 parens would get passed to the shell.
4177
4198
4178 2004-05-20 Fernando Perez <fperez@colorado.edu>
4199 2004-05-20 Fernando Perez <fperez@colorado.edu>
4179
4200
4180 * IPython/Magic.py (Magic.magic_prun): changed default profile
4201 * IPython/Magic.py (Magic.magic_prun): changed default profile
4181 sort order to 'time' (the more common profiling need).
4202 sort order to 'time' (the more common profiling need).
4182
4203
4183 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4204 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4184 so that source code shown is guaranteed in sync with the file on
4205 so that source code shown is guaranteed in sync with the file on
4185 disk (also changed in psource). Similar fix to the one for
4206 disk (also changed in psource). Similar fix to the one for
4186 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4207 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4187 <yann.ledu-AT-noos.fr>.
4208 <yann.ledu-AT-noos.fr>.
4188
4209
4189 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4210 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4190 with a single option would not be correctly parsed. Closes
4211 with a single option would not be correctly parsed. Closes
4191 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4212 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4192 introduced in 0.6.0 (on 2004-05-06).
4213 introduced in 0.6.0 (on 2004-05-06).
4193
4214
4194 2004-05-13 *** Released version 0.6.0
4215 2004-05-13 *** Released version 0.6.0
4195
4216
4196 2004-05-13 Fernando Perez <fperez@colorado.edu>
4217 2004-05-13 Fernando Perez <fperez@colorado.edu>
4197
4218
4198 * debian/: Added debian/ directory to CVS, so that debian support
4219 * debian/: Added debian/ directory to CVS, so that debian support
4199 is publicly accessible. The debian package is maintained by Jack
4220 is publicly accessible. The debian package is maintained by Jack
4200 Moffit <jack-AT-xiph.org>.
4221 Moffit <jack-AT-xiph.org>.
4201
4222
4202 * Documentation: included the notes about an ipython-based system
4223 * Documentation: included the notes about an ipython-based system
4203 shell (the hypothetical 'pysh') into the new_design.pdf document,
4224 shell (the hypothetical 'pysh') into the new_design.pdf document,
4204 so that these ideas get distributed to users along with the
4225 so that these ideas get distributed to users along with the
4205 official documentation.
4226 official documentation.
4206
4227
4207 2004-05-10 Fernando Perez <fperez@colorado.edu>
4228 2004-05-10 Fernando Perez <fperez@colorado.edu>
4208
4229
4209 * IPython/Logger.py (Logger.create_log): fix recently introduced
4230 * IPython/Logger.py (Logger.create_log): fix recently introduced
4210 bug (misindented line) where logstart would fail when not given an
4231 bug (misindented line) where logstart would fail when not given an
4211 explicit filename.
4232 explicit filename.
4212
4233
4213 2004-05-09 Fernando Perez <fperez@colorado.edu>
4234 2004-05-09 Fernando Perez <fperez@colorado.edu>
4214
4235
4215 * IPython/Magic.py (Magic.parse_options): skip system call when
4236 * IPython/Magic.py (Magic.parse_options): skip system call when
4216 there are no options to look for. Faster, cleaner for the common
4237 there are no options to look for. Faster, cleaner for the common
4217 case.
4238 case.
4218
4239
4219 * Documentation: many updates to the manual: describing Windows
4240 * Documentation: many updates to the manual: describing Windows
4220 support better, Gnuplot updates, credits, misc small stuff. Also
4241 support better, Gnuplot updates, credits, misc small stuff. Also
4221 updated the new_design doc a bit.
4242 updated the new_design doc a bit.
4222
4243
4223 2004-05-06 *** Released version 0.6.0.rc1
4244 2004-05-06 *** Released version 0.6.0.rc1
4224
4245
4225 2004-05-06 Fernando Perez <fperez@colorado.edu>
4246 2004-05-06 Fernando Perez <fperez@colorado.edu>
4226
4247
4227 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4248 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4228 operations to use the vastly more efficient list/''.join() method.
4249 operations to use the vastly more efficient list/''.join() method.
4229 (FormattedTB.text): Fix
4250 (FormattedTB.text): Fix
4230 http://www.scipy.net/roundup/ipython/issue12 - exception source
4251 http://www.scipy.net/roundup/ipython/issue12 - exception source
4231 extract not updated after reload. Thanks to Mike Salib
4252 extract not updated after reload. Thanks to Mike Salib
4232 <msalib-AT-mit.edu> for pinning the source of the problem.
4253 <msalib-AT-mit.edu> for pinning the source of the problem.
4233 Fortunately, the solution works inside ipython and doesn't require
4254 Fortunately, the solution works inside ipython and doesn't require
4234 any changes to python proper.
4255 any changes to python proper.
4235
4256
4236 * IPython/Magic.py (Magic.parse_options): Improved to process the
4257 * IPython/Magic.py (Magic.parse_options): Improved to process the
4237 argument list as a true shell would (by actually using the
4258 argument list as a true shell would (by actually using the
4238 underlying system shell). This way, all @magics automatically get
4259 underlying system shell). This way, all @magics automatically get
4239 shell expansion for variables. Thanks to a comment by Alex
4260 shell expansion for variables. Thanks to a comment by Alex
4240 Schmolck.
4261 Schmolck.
4241
4262
4242 2004-04-04 Fernando Perez <fperez@colorado.edu>
4263 2004-04-04 Fernando Perez <fperez@colorado.edu>
4243
4264
4244 * IPython/iplib.py (InteractiveShell.interact): Added a special
4265 * IPython/iplib.py (InteractiveShell.interact): Added a special
4245 trap for a debugger quit exception, which is basically impossible
4266 trap for a debugger quit exception, which is basically impossible
4246 to handle by normal mechanisms, given what pdb does to the stack.
4267 to handle by normal mechanisms, given what pdb does to the stack.
4247 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4268 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4248
4269
4249 2004-04-03 Fernando Perez <fperez@colorado.edu>
4270 2004-04-03 Fernando Perez <fperez@colorado.edu>
4250
4271
4251 * IPython/genutils.py (Term): Standardized the names of the Term
4272 * IPython/genutils.py (Term): Standardized the names of the Term
4252 class streams to cin/cout/cerr, following C++ naming conventions
4273 class streams to cin/cout/cerr, following C++ naming conventions
4253 (I can't use in/out/err because 'in' is not a valid attribute
4274 (I can't use in/out/err because 'in' is not a valid attribute
4254 name).
4275 name).
4255
4276
4256 * IPython/iplib.py (InteractiveShell.interact): don't increment
4277 * IPython/iplib.py (InteractiveShell.interact): don't increment
4257 the prompt if there's no user input. By Daniel 'Dang' Griffith
4278 the prompt if there's no user input. By Daniel 'Dang' Griffith
4258 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4279 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4259 Francois Pinard.
4280 Francois Pinard.
4260
4281
4261 2004-04-02 Fernando Perez <fperez@colorado.edu>
4282 2004-04-02 Fernando Perez <fperez@colorado.edu>
4262
4283
4263 * IPython/genutils.py (Stream.__init__): Modified to survive at
4284 * IPython/genutils.py (Stream.__init__): Modified to survive at
4264 least importing in contexts where stdin/out/err aren't true file
4285 least importing in contexts where stdin/out/err aren't true file
4265 objects, such as PyCrust (they lack fileno() and mode). However,
4286 objects, such as PyCrust (they lack fileno() and mode). However,
4266 the recovery facilities which rely on these things existing will
4287 the recovery facilities which rely on these things existing will
4267 not work.
4288 not work.
4268
4289
4269 2004-04-01 Fernando Perez <fperez@colorado.edu>
4290 2004-04-01 Fernando Perez <fperez@colorado.edu>
4270
4291
4271 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4292 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4272 use the new getoutputerror() function, so it properly
4293 use the new getoutputerror() function, so it properly
4273 distinguishes stdout/err.
4294 distinguishes stdout/err.
4274
4295
4275 * IPython/genutils.py (getoutputerror): added a function to
4296 * IPython/genutils.py (getoutputerror): added a function to
4276 capture separately the standard output and error of a command.
4297 capture separately the standard output and error of a command.
4277 After a comment from dang on the mailing lists. This code is
4298 After a comment from dang on the mailing lists. This code is
4278 basically a modified version of commands.getstatusoutput(), from
4299 basically a modified version of commands.getstatusoutput(), from
4279 the standard library.
4300 the standard library.
4280
4301
4281 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4302 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4282 '!!' as a special syntax (shorthand) to access @sx.
4303 '!!' as a special syntax (shorthand) to access @sx.
4283
4304
4284 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4305 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4285 command and return its output as a list split on '\n'.
4306 command and return its output as a list split on '\n'.
4286
4307
4287 2004-03-31 Fernando Perez <fperez@colorado.edu>
4308 2004-03-31 Fernando Perez <fperez@colorado.edu>
4288
4309
4289 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4310 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4290 method to dictionaries used as FakeModule instances if they lack
4311 method to dictionaries used as FakeModule instances if they lack
4291 it. At least pydoc in python2.3 breaks for runtime-defined
4312 it. At least pydoc in python2.3 breaks for runtime-defined
4292 functions without this hack. At some point I need to _really_
4313 functions without this hack. At some point I need to _really_
4293 understand what FakeModule is doing, because it's a gross hack.
4314 understand what FakeModule is doing, because it's a gross hack.
4294 But it solves Arnd's problem for now...
4315 But it solves Arnd's problem for now...
4295
4316
4296 2004-02-27 Fernando Perez <fperez@colorado.edu>
4317 2004-02-27 Fernando Perez <fperez@colorado.edu>
4297
4318
4298 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4319 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4299 mode would behave erratically. Also increased the number of
4320 mode would behave erratically. Also increased the number of
4300 possible logs in rotate mod to 999. Thanks to Rod Holland
4321 possible logs in rotate mod to 999. Thanks to Rod Holland
4301 <rhh@StructureLABS.com> for the report and fixes.
4322 <rhh@StructureLABS.com> for the report and fixes.
4302
4323
4303 2004-02-26 Fernando Perez <fperez@colorado.edu>
4324 2004-02-26 Fernando Perez <fperez@colorado.edu>
4304
4325
4305 * IPython/genutils.py (page): Check that the curses module really
4326 * IPython/genutils.py (page): Check that the curses module really
4306 has the initscr attribute before trying to use it. For some
4327 has the initscr attribute before trying to use it. For some
4307 reason, the Solaris curses module is missing this. I think this
4328 reason, the Solaris curses module is missing this. I think this
4308 should be considered a Solaris python bug, but I'm not sure.
4329 should be considered a Solaris python bug, but I'm not sure.
4309
4330
4310 2004-01-17 Fernando Perez <fperez@colorado.edu>
4331 2004-01-17 Fernando Perez <fperez@colorado.edu>
4311
4332
4312 * IPython/genutils.py (Stream.__init__): Changes to try to make
4333 * IPython/genutils.py (Stream.__init__): Changes to try to make
4313 ipython robust against stdin/out/err being closed by the user.
4334 ipython robust against stdin/out/err being closed by the user.
4314 This is 'user error' (and blocks a normal python session, at least
4335 This is 'user error' (and blocks a normal python session, at least
4315 the stdout case). However, Ipython should be able to survive such
4336 the stdout case). However, Ipython should be able to survive such
4316 instances of abuse as gracefully as possible. To simplify the
4337 instances of abuse as gracefully as possible. To simplify the
4317 coding and maintain compatibility with Gary Bishop's Term
4338 coding and maintain compatibility with Gary Bishop's Term
4318 contributions, I've made use of classmethods for this. I think
4339 contributions, I've made use of classmethods for this. I think
4319 this introduces a dependency on python 2.2.
4340 this introduces a dependency on python 2.2.
4320
4341
4321 2004-01-13 Fernando Perez <fperez@colorado.edu>
4342 2004-01-13 Fernando Perez <fperez@colorado.edu>
4322
4343
4323 * IPython/numutils.py (exp_safe): simplified the code a bit and
4344 * IPython/numutils.py (exp_safe): simplified the code a bit and
4324 removed the need for importing the kinds module altogether.
4345 removed the need for importing the kinds module altogether.
4325
4346
4326 2004-01-06 Fernando Perez <fperez@colorado.edu>
4347 2004-01-06 Fernando Perez <fperez@colorado.edu>
4327
4348
4328 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4349 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4329 a magic function instead, after some community feedback. No
4350 a magic function instead, after some community feedback. No
4330 special syntax will exist for it, but its name is deliberately
4351 special syntax will exist for it, but its name is deliberately
4331 very short.
4352 very short.
4332
4353
4333 2003-12-20 Fernando Perez <fperez@colorado.edu>
4354 2003-12-20 Fernando Perez <fperez@colorado.edu>
4334
4355
4335 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4356 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4336 new functionality, to automagically assign the result of a shell
4357 new functionality, to automagically assign the result of a shell
4337 command to a variable. I'll solicit some community feedback on
4358 command to a variable. I'll solicit some community feedback on
4338 this before making it permanent.
4359 this before making it permanent.
4339
4360
4340 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4361 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4341 requested about callables for which inspect couldn't obtain a
4362 requested about callables for which inspect couldn't obtain a
4342 proper argspec. Thanks to a crash report sent by Etienne
4363 proper argspec. Thanks to a crash report sent by Etienne
4343 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4364 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4344
4365
4345 2003-12-09 Fernando Perez <fperez@colorado.edu>
4366 2003-12-09 Fernando Perez <fperez@colorado.edu>
4346
4367
4347 * IPython/genutils.py (page): patch for the pager to work across
4368 * IPython/genutils.py (page): patch for the pager to work across
4348 various versions of Windows. By Gary Bishop.
4369 various versions of Windows. By Gary Bishop.
4349
4370
4350 2003-12-04 Fernando Perez <fperez@colorado.edu>
4371 2003-12-04 Fernando Perez <fperez@colorado.edu>
4351
4372
4352 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4373 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4353 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4374 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4354 While I tested this and it looks ok, there may still be corner
4375 While I tested this and it looks ok, there may still be corner
4355 cases I've missed.
4376 cases I've missed.
4356
4377
4357 2003-12-01 Fernando Perez <fperez@colorado.edu>
4378 2003-12-01 Fernando Perez <fperez@colorado.edu>
4358
4379
4359 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4380 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4360 where a line like 'p,q=1,2' would fail because the automagic
4381 where a line like 'p,q=1,2' would fail because the automagic
4361 system would be triggered for @p.
4382 system would be triggered for @p.
4362
4383
4363 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4384 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4364 cleanups, code unmodified.
4385 cleanups, code unmodified.
4365
4386
4366 * IPython/genutils.py (Term): added a class for IPython to handle
4387 * IPython/genutils.py (Term): added a class for IPython to handle
4367 output. In most cases it will just be a proxy for stdout/err, but
4388 output. In most cases it will just be a proxy for stdout/err, but
4368 having this allows modifications to be made for some platforms,
4389 having this allows modifications to be made for some platforms,
4369 such as handling color escapes under Windows. All of this code
4390 such as handling color escapes under Windows. All of this code
4370 was contributed by Gary Bishop, with minor modifications by me.
4391 was contributed by Gary Bishop, with minor modifications by me.
4371 The actual changes affect many files.
4392 The actual changes affect many files.
4372
4393
4373 2003-11-30 Fernando Perez <fperez@colorado.edu>
4394 2003-11-30 Fernando Perez <fperez@colorado.edu>
4374
4395
4375 * IPython/iplib.py (file_matches): new completion code, courtesy
4396 * IPython/iplib.py (file_matches): new completion code, courtesy
4376 of Jeff Collins. This enables filename completion again under
4397 of Jeff Collins. This enables filename completion again under
4377 python 2.3, which disabled it at the C level.
4398 python 2.3, which disabled it at the C level.
4378
4399
4379 2003-11-11 Fernando Perez <fperez@colorado.edu>
4400 2003-11-11 Fernando Perez <fperez@colorado.edu>
4380
4401
4381 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4402 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4382 for Numeric.array(map(...)), but often convenient.
4403 for Numeric.array(map(...)), but often convenient.
4383
4404
4384 2003-11-05 Fernando Perez <fperez@colorado.edu>
4405 2003-11-05 Fernando Perez <fperez@colorado.edu>
4385
4406
4386 * IPython/numutils.py (frange): Changed a call from int() to
4407 * IPython/numutils.py (frange): Changed a call from int() to
4387 int(round()) to prevent a problem reported with arange() in the
4408 int(round()) to prevent a problem reported with arange() in the
4388 numpy list.
4409 numpy list.
4389
4410
4390 2003-10-06 Fernando Perez <fperez@colorado.edu>
4411 2003-10-06 Fernando Perez <fperez@colorado.edu>
4391
4412
4392 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4413 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4393 prevent crashes if sys lacks an argv attribute (it happens with
4414 prevent crashes if sys lacks an argv attribute (it happens with
4394 embedded interpreters which build a bare-bones sys module).
4415 embedded interpreters which build a bare-bones sys module).
4395 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4416 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4396
4417
4397 2003-09-24 Fernando Perez <fperez@colorado.edu>
4418 2003-09-24 Fernando Perez <fperez@colorado.edu>
4398
4419
4399 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4420 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4400 to protect against poorly written user objects where __getattr__
4421 to protect against poorly written user objects where __getattr__
4401 raises exceptions other than AttributeError. Thanks to a bug
4422 raises exceptions other than AttributeError. Thanks to a bug
4402 report by Oliver Sander <osander-AT-gmx.de>.
4423 report by Oliver Sander <osander-AT-gmx.de>.
4403
4424
4404 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4425 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4405 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4426 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4406
4427
4407 2003-09-09 Fernando Perez <fperez@colorado.edu>
4428 2003-09-09 Fernando Perez <fperez@colorado.edu>
4408
4429
4409 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4430 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4410 unpacking a list whith a callable as first element would
4431 unpacking a list whith a callable as first element would
4411 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4432 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4412 Collins.
4433 Collins.
4413
4434
4414 2003-08-25 *** Released version 0.5.0
4435 2003-08-25 *** Released version 0.5.0
4415
4436
4416 2003-08-22 Fernando Perez <fperez@colorado.edu>
4437 2003-08-22 Fernando Perez <fperez@colorado.edu>
4417
4438
4418 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4439 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4419 improperly defined user exceptions. Thanks to feedback from Mark
4440 improperly defined user exceptions. Thanks to feedback from Mark
4420 Russell <mrussell-AT-verio.net>.
4441 Russell <mrussell-AT-verio.net>.
4421
4442
4422 2003-08-20 Fernando Perez <fperez@colorado.edu>
4443 2003-08-20 Fernando Perez <fperez@colorado.edu>
4423
4444
4424 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4445 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4425 printing so that it would print multi-line string forms starting
4446 printing so that it would print multi-line string forms starting
4426 with a new line. This way the formatting is better respected for
4447 with a new line. This way the formatting is better respected for
4427 objects which work hard to make nice string forms.
4448 objects which work hard to make nice string forms.
4428
4449
4429 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4450 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4430 autocall would overtake data access for objects with both
4451 autocall would overtake data access for objects with both
4431 __getitem__ and __call__.
4452 __getitem__ and __call__.
4432
4453
4433 2003-08-19 *** Released version 0.5.0-rc1
4454 2003-08-19 *** Released version 0.5.0-rc1
4434
4455
4435 2003-08-19 Fernando Perez <fperez@colorado.edu>
4456 2003-08-19 Fernando Perez <fperez@colorado.edu>
4436
4457
4437 * IPython/deep_reload.py (load_tail): single tiny change here
4458 * IPython/deep_reload.py (load_tail): single tiny change here
4438 seems to fix the long-standing bug of dreload() failing to work
4459 seems to fix the long-standing bug of dreload() failing to work
4439 for dotted names. But this module is pretty tricky, so I may have
4460 for dotted names. But this module is pretty tricky, so I may have
4440 missed some subtlety. Needs more testing!.
4461 missed some subtlety. Needs more testing!.
4441
4462
4442 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4463 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4443 exceptions which have badly implemented __str__ methods.
4464 exceptions which have badly implemented __str__ methods.
4444 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4465 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4445 which I've been getting reports about from Python 2.3 users. I
4466 which I've been getting reports about from Python 2.3 users. I
4446 wish I had a simple test case to reproduce the problem, so I could
4467 wish I had a simple test case to reproduce the problem, so I could
4447 either write a cleaner workaround or file a bug report if
4468 either write a cleaner workaround or file a bug report if
4448 necessary.
4469 necessary.
4449
4470
4450 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4471 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4451 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4472 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4452 a bug report by Tjabo Kloppenburg.
4473 a bug report by Tjabo Kloppenburg.
4453
4474
4454 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4475 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4455 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4476 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4456 seems rather unstable. Thanks to a bug report by Tjabo
4477 seems rather unstable. Thanks to a bug report by Tjabo
4457 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4478 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4458
4479
4459 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4480 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4460 this out soon because of the critical fixes in the inner loop for
4481 this out soon because of the critical fixes in the inner loop for
4461 generators.
4482 generators.
4462
4483
4463 * IPython/Magic.py (Magic.getargspec): removed. This (and
4484 * IPython/Magic.py (Magic.getargspec): removed. This (and
4464 _get_def) have been obsoleted by OInspect for a long time, I
4485 _get_def) have been obsoleted by OInspect for a long time, I
4465 hadn't noticed that they were dead code.
4486 hadn't noticed that they were dead code.
4466 (Magic._ofind): restored _ofind functionality for a few literals
4487 (Magic._ofind): restored _ofind functionality for a few literals
4467 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4488 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4468 for things like "hello".capitalize?, since that would require a
4489 for things like "hello".capitalize?, since that would require a
4469 potentially dangerous eval() again.
4490 potentially dangerous eval() again.
4470
4491
4471 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4492 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4472 logic a bit more to clean up the escapes handling and minimize the
4493 logic a bit more to clean up the escapes handling and minimize the
4473 use of _ofind to only necessary cases. The interactive 'feel' of
4494 use of _ofind to only necessary cases. The interactive 'feel' of
4474 IPython should have improved quite a bit with the changes in
4495 IPython should have improved quite a bit with the changes in
4475 _prefilter and _ofind (besides being far safer than before).
4496 _prefilter and _ofind (besides being far safer than before).
4476
4497
4477 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4498 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4478 obscure, never reported). Edit would fail to find the object to
4499 obscure, never reported). Edit would fail to find the object to
4479 edit under some circumstances.
4500 edit under some circumstances.
4480 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4501 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4481 which were causing double-calling of generators. Those eval calls
4502 which were causing double-calling of generators. Those eval calls
4482 were _very_ dangerous, since code with side effects could be
4503 were _very_ dangerous, since code with side effects could be
4483 triggered. As they say, 'eval is evil'... These were the
4504 triggered. As they say, 'eval is evil'... These were the
4484 nastiest evals in IPython. Besides, _ofind is now far simpler,
4505 nastiest evals in IPython. Besides, _ofind is now far simpler,
4485 and it should also be quite a bit faster. Its use of inspect is
4506 and it should also be quite a bit faster. Its use of inspect is
4486 also safer, so perhaps some of the inspect-related crashes I've
4507 also safer, so perhaps some of the inspect-related crashes I've
4487 seen lately with Python 2.3 might be taken care of. That will
4508 seen lately with Python 2.3 might be taken care of. That will
4488 need more testing.
4509 need more testing.
4489
4510
4490 2003-08-17 Fernando Perez <fperez@colorado.edu>
4511 2003-08-17 Fernando Perez <fperez@colorado.edu>
4491
4512
4492 * IPython/iplib.py (InteractiveShell._prefilter): significant
4513 * IPython/iplib.py (InteractiveShell._prefilter): significant
4493 simplifications to the logic for handling user escapes. Faster
4514 simplifications to the logic for handling user escapes. Faster
4494 and simpler code.
4515 and simpler code.
4495
4516
4496 2003-08-14 Fernando Perez <fperez@colorado.edu>
4517 2003-08-14 Fernando Perez <fperez@colorado.edu>
4497
4518
4498 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4519 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4499 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4520 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4500 but it should be quite a bit faster. And the recursive version
4521 but it should be quite a bit faster. And the recursive version
4501 generated O(log N) intermediate storage for all rank>1 arrays,
4522 generated O(log N) intermediate storage for all rank>1 arrays,
4502 even if they were contiguous.
4523 even if they were contiguous.
4503 (l1norm): Added this function.
4524 (l1norm): Added this function.
4504 (norm): Added this function for arbitrary norms (including
4525 (norm): Added this function for arbitrary norms (including
4505 l-infinity). l1 and l2 are still special cases for convenience
4526 l-infinity). l1 and l2 are still special cases for convenience
4506 and speed.
4527 and speed.
4507
4528
4508 2003-08-03 Fernando Perez <fperez@colorado.edu>
4529 2003-08-03 Fernando Perez <fperez@colorado.edu>
4509
4530
4510 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4531 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4511 exceptions, which now raise PendingDeprecationWarnings in Python
4532 exceptions, which now raise PendingDeprecationWarnings in Python
4512 2.3. There were some in Magic and some in Gnuplot2.
4533 2.3. There were some in Magic and some in Gnuplot2.
4513
4534
4514 2003-06-30 Fernando Perez <fperez@colorado.edu>
4535 2003-06-30 Fernando Perez <fperez@colorado.edu>
4515
4536
4516 * IPython/genutils.py (page): modified to call curses only for
4537 * IPython/genutils.py (page): modified to call curses only for
4517 terminals where TERM=='xterm'. After problems under many other
4538 terminals where TERM=='xterm'. After problems under many other
4518 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4539 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4519
4540
4520 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4541 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4521 would be triggered when readline was absent. This was just an old
4542 would be triggered when readline was absent. This was just an old
4522 debugging statement I'd forgotten to take out.
4543 debugging statement I'd forgotten to take out.
4523
4544
4524 2003-06-20 Fernando Perez <fperez@colorado.edu>
4545 2003-06-20 Fernando Perez <fperez@colorado.edu>
4525
4546
4526 * IPython/genutils.py (clock): modified to return only user time
4547 * IPython/genutils.py (clock): modified to return only user time
4527 (not counting system time), after a discussion on scipy. While
4548 (not counting system time), after a discussion on scipy. While
4528 system time may be a useful quantity occasionally, it may much
4549 system time may be a useful quantity occasionally, it may much
4529 more easily be skewed by occasional swapping or other similar
4550 more easily be skewed by occasional swapping or other similar
4530 activity.
4551 activity.
4531
4552
4532 2003-06-05 Fernando Perez <fperez@colorado.edu>
4553 2003-06-05 Fernando Perez <fperez@colorado.edu>
4533
4554
4534 * IPython/numutils.py (identity): new function, for building
4555 * IPython/numutils.py (identity): new function, for building
4535 arbitrary rank Kronecker deltas (mostly backwards compatible with
4556 arbitrary rank Kronecker deltas (mostly backwards compatible with
4536 Numeric.identity)
4557 Numeric.identity)
4537
4558
4538 2003-06-03 Fernando Perez <fperez@colorado.edu>
4559 2003-06-03 Fernando Perez <fperez@colorado.edu>
4539
4560
4540 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4561 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4541 arguments passed to magics with spaces, to allow trailing '\' to
4562 arguments passed to magics with spaces, to allow trailing '\' to
4542 work normally (mainly for Windows users).
4563 work normally (mainly for Windows users).
4543
4564
4544 2003-05-29 Fernando Perez <fperez@colorado.edu>
4565 2003-05-29 Fernando Perez <fperez@colorado.edu>
4545
4566
4546 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4567 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4547 instead of pydoc.help. This fixes a bizarre behavior where
4568 instead of pydoc.help. This fixes a bizarre behavior where
4548 printing '%s' % locals() would trigger the help system. Now
4569 printing '%s' % locals() would trigger the help system. Now
4549 ipython behaves like normal python does.
4570 ipython behaves like normal python does.
4550
4571
4551 Note that if one does 'from pydoc import help', the bizarre
4572 Note that if one does 'from pydoc import help', the bizarre
4552 behavior returns, but this will also happen in normal python, so
4573 behavior returns, but this will also happen in normal python, so
4553 it's not an ipython bug anymore (it has to do with how pydoc.help
4574 it's not an ipython bug anymore (it has to do with how pydoc.help
4554 is implemented).
4575 is implemented).
4555
4576
4556 2003-05-22 Fernando Perez <fperez@colorado.edu>
4577 2003-05-22 Fernando Perez <fperez@colorado.edu>
4557
4578
4558 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4579 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4559 return [] instead of None when nothing matches, also match to end
4580 return [] instead of None when nothing matches, also match to end
4560 of line. Patch by Gary Bishop.
4581 of line. Patch by Gary Bishop.
4561
4582
4562 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4583 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4563 protection as before, for files passed on the command line. This
4584 protection as before, for files passed on the command line. This
4564 prevents the CrashHandler from kicking in if user files call into
4585 prevents the CrashHandler from kicking in if user files call into
4565 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4586 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4566 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4587 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4567
4588
4568 2003-05-20 *** Released version 0.4.0
4589 2003-05-20 *** Released version 0.4.0
4569
4590
4570 2003-05-20 Fernando Perez <fperez@colorado.edu>
4591 2003-05-20 Fernando Perez <fperez@colorado.edu>
4571
4592
4572 * setup.py: added support for manpages. It's a bit hackish b/c of
4593 * setup.py: added support for manpages. It's a bit hackish b/c of
4573 a bug in the way the bdist_rpm distutils target handles gzipped
4594 a bug in the way the bdist_rpm distutils target handles gzipped
4574 manpages, but it works. After a patch by Jack.
4595 manpages, but it works. After a patch by Jack.
4575
4596
4576 2003-05-19 Fernando Perez <fperez@colorado.edu>
4597 2003-05-19 Fernando Perez <fperez@colorado.edu>
4577
4598
4578 * IPython/numutils.py: added a mockup of the kinds module, since
4599 * IPython/numutils.py: added a mockup of the kinds module, since
4579 it was recently removed from Numeric. This way, numutils will
4600 it was recently removed from Numeric. This way, numutils will
4580 work for all users even if they are missing kinds.
4601 work for all users even if they are missing kinds.
4581
4602
4582 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4603 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4583 failure, which can occur with SWIG-wrapped extensions. After a
4604 failure, which can occur with SWIG-wrapped extensions. After a
4584 crash report from Prabhu.
4605 crash report from Prabhu.
4585
4606
4586 2003-05-16 Fernando Perez <fperez@colorado.edu>
4607 2003-05-16 Fernando Perez <fperez@colorado.edu>
4587
4608
4588 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4609 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4589 protect ipython from user code which may call directly
4610 protect ipython from user code which may call directly
4590 sys.excepthook (this looks like an ipython crash to the user, even
4611 sys.excepthook (this looks like an ipython crash to the user, even
4591 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4612 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4592 This is especially important to help users of WxWindows, but may
4613 This is especially important to help users of WxWindows, but may
4593 also be useful in other cases.
4614 also be useful in other cases.
4594
4615
4595 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4616 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4596 an optional tb_offset to be specified, and to preserve exception
4617 an optional tb_offset to be specified, and to preserve exception
4597 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4618 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4598
4619
4599 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4620 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4600
4621
4601 2003-05-15 Fernando Perez <fperez@colorado.edu>
4622 2003-05-15 Fernando Perez <fperez@colorado.edu>
4602
4623
4603 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4624 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4604 installing for a new user under Windows.
4625 installing for a new user under Windows.
4605
4626
4606 2003-05-12 Fernando Perez <fperez@colorado.edu>
4627 2003-05-12 Fernando Perez <fperez@colorado.edu>
4607
4628
4608 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4629 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4609 handler for Emacs comint-based lines. Currently it doesn't do
4630 handler for Emacs comint-based lines. Currently it doesn't do
4610 much (but importantly, it doesn't update the history cache). In
4631 much (but importantly, it doesn't update the history cache). In
4611 the future it may be expanded if Alex needs more functionality
4632 the future it may be expanded if Alex needs more functionality
4612 there.
4633 there.
4613
4634
4614 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4635 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4615 info to crash reports.
4636 info to crash reports.
4616
4637
4617 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4638 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4618 just like Python's -c. Also fixed crash with invalid -color
4639 just like Python's -c. Also fixed crash with invalid -color
4619 option value at startup. Thanks to Will French
4640 option value at startup. Thanks to Will French
4620 <wfrench-AT-bestweb.net> for the bug report.
4641 <wfrench-AT-bestweb.net> for the bug report.
4621
4642
4622 2003-05-09 Fernando Perez <fperez@colorado.edu>
4643 2003-05-09 Fernando Perez <fperez@colorado.edu>
4623
4644
4624 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4645 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4625 to EvalDict (it's a mapping, after all) and simplified its code
4646 to EvalDict (it's a mapping, after all) and simplified its code
4626 quite a bit, after a nice discussion on c.l.py where Gustavo
4647 quite a bit, after a nice discussion on c.l.py where Gustavo
4627 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4648 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4628
4649
4629 2003-04-30 Fernando Perez <fperez@colorado.edu>
4650 2003-04-30 Fernando Perez <fperez@colorado.edu>
4630
4651
4631 * IPython/genutils.py (timings_out): modified it to reduce its
4652 * IPython/genutils.py (timings_out): modified it to reduce its
4632 overhead in the common reps==1 case.
4653 overhead in the common reps==1 case.
4633
4654
4634 2003-04-29 Fernando Perez <fperez@colorado.edu>
4655 2003-04-29 Fernando Perez <fperez@colorado.edu>
4635
4656
4636 * IPython/genutils.py (timings_out): Modified to use the resource
4657 * IPython/genutils.py (timings_out): Modified to use the resource
4637 module, which avoids the wraparound problems of time.clock().
4658 module, which avoids the wraparound problems of time.clock().
4638
4659
4639 2003-04-17 *** Released version 0.2.15pre4
4660 2003-04-17 *** Released version 0.2.15pre4
4640
4661
4641 2003-04-17 Fernando Perez <fperez@colorado.edu>
4662 2003-04-17 Fernando Perez <fperez@colorado.edu>
4642
4663
4643 * setup.py (scriptfiles): Split windows-specific stuff over to a
4664 * setup.py (scriptfiles): Split windows-specific stuff over to a
4644 separate file, in an attempt to have a Windows GUI installer.
4665 separate file, in an attempt to have a Windows GUI installer.
4645 That didn't work, but part of the groundwork is done.
4666 That didn't work, but part of the groundwork is done.
4646
4667
4647 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4668 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4648 indent/unindent with 4 spaces. Particularly useful in combination
4669 indent/unindent with 4 spaces. Particularly useful in combination
4649 with the new auto-indent option.
4670 with the new auto-indent option.
4650
4671
4651 2003-04-16 Fernando Perez <fperez@colorado.edu>
4672 2003-04-16 Fernando Perez <fperez@colorado.edu>
4652
4673
4653 * IPython/Magic.py: various replacements of self.rc for
4674 * IPython/Magic.py: various replacements of self.rc for
4654 self.shell.rc. A lot more remains to be done to fully disentangle
4675 self.shell.rc. A lot more remains to be done to fully disentangle
4655 this class from the main Shell class.
4676 this class from the main Shell class.
4656
4677
4657 * IPython/GnuplotRuntime.py: added checks for mouse support so
4678 * IPython/GnuplotRuntime.py: added checks for mouse support so
4658 that we don't try to enable it if the current gnuplot doesn't
4679 that we don't try to enable it if the current gnuplot doesn't
4659 really support it. Also added checks so that we don't try to
4680 really support it. Also added checks so that we don't try to
4660 enable persist under Windows (where Gnuplot doesn't recognize the
4681 enable persist under Windows (where Gnuplot doesn't recognize the
4661 option).
4682 option).
4662
4683
4663 * IPython/iplib.py (InteractiveShell.interact): Added optional
4684 * IPython/iplib.py (InteractiveShell.interact): Added optional
4664 auto-indenting code, after a patch by King C. Shu
4685 auto-indenting code, after a patch by King C. Shu
4665 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4686 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4666 get along well with pasting indented code. If I ever figure out
4687 get along well with pasting indented code. If I ever figure out
4667 how to make that part go well, it will become on by default.
4688 how to make that part go well, it will become on by default.
4668
4689
4669 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4690 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4670 crash ipython if there was an unmatched '%' in the user's prompt
4691 crash ipython if there was an unmatched '%' in the user's prompt
4671 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4692 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4672
4693
4673 * IPython/iplib.py (InteractiveShell.interact): removed the
4694 * IPython/iplib.py (InteractiveShell.interact): removed the
4674 ability to ask the user whether he wants to crash or not at the
4695 ability to ask the user whether he wants to crash or not at the
4675 'last line' exception handler. Calling functions at that point
4696 'last line' exception handler. Calling functions at that point
4676 changes the stack, and the error reports would have incorrect
4697 changes the stack, and the error reports would have incorrect
4677 tracebacks.
4698 tracebacks.
4678
4699
4679 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4700 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4680 pass through a peger a pretty-printed form of any object. After a
4701 pass through a peger a pretty-printed form of any object. After a
4681 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4702 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4682
4703
4683 2003-04-14 Fernando Perez <fperez@colorado.edu>
4704 2003-04-14 Fernando Perez <fperez@colorado.edu>
4684
4705
4685 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4706 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4686 all files in ~ would be modified at first install (instead of
4707 all files in ~ would be modified at first install (instead of
4687 ~/.ipython). This could be potentially disastrous, as the
4708 ~/.ipython). This could be potentially disastrous, as the
4688 modification (make line-endings native) could damage binary files.
4709 modification (make line-endings native) could damage binary files.
4689
4710
4690 2003-04-10 Fernando Perez <fperez@colorado.edu>
4711 2003-04-10 Fernando Perez <fperez@colorado.edu>
4691
4712
4692 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4713 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4693 handle only lines which are invalid python. This now means that
4714 handle only lines which are invalid python. This now means that
4694 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4715 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4695 for the bug report.
4716 for the bug report.
4696
4717
4697 2003-04-01 Fernando Perez <fperez@colorado.edu>
4718 2003-04-01 Fernando Perez <fperez@colorado.edu>
4698
4719
4699 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4720 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4700 where failing to set sys.last_traceback would crash pdb.pm().
4721 where failing to set sys.last_traceback would crash pdb.pm().
4701 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4722 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4702 report.
4723 report.
4703
4724
4704 2003-03-25 Fernando Perez <fperez@colorado.edu>
4725 2003-03-25 Fernando Perez <fperez@colorado.edu>
4705
4726
4706 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4727 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4707 before printing it (it had a lot of spurious blank lines at the
4728 before printing it (it had a lot of spurious blank lines at the
4708 end).
4729 end).
4709
4730
4710 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4731 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4711 output would be sent 21 times! Obviously people don't use this
4732 output would be sent 21 times! Obviously people don't use this
4712 too often, or I would have heard about it.
4733 too often, or I would have heard about it.
4713
4734
4714 2003-03-24 Fernando Perez <fperez@colorado.edu>
4735 2003-03-24 Fernando Perez <fperez@colorado.edu>
4715
4736
4716 * setup.py (scriptfiles): renamed the data_files parameter from
4737 * setup.py (scriptfiles): renamed the data_files parameter from
4717 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4738 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4718 for the patch.
4739 for the patch.
4719
4740
4720 2003-03-20 Fernando Perez <fperez@colorado.edu>
4741 2003-03-20 Fernando Perez <fperez@colorado.edu>
4721
4742
4722 * IPython/genutils.py (error): added error() and fatal()
4743 * IPython/genutils.py (error): added error() and fatal()
4723 functions.
4744 functions.
4724
4745
4725 2003-03-18 *** Released version 0.2.15pre3
4746 2003-03-18 *** Released version 0.2.15pre3
4726
4747
4727 2003-03-18 Fernando Perez <fperez@colorado.edu>
4748 2003-03-18 Fernando Perez <fperez@colorado.edu>
4728
4749
4729 * setupext/install_data_ext.py
4750 * setupext/install_data_ext.py
4730 (install_data_ext.initialize_options): Class contributed by Jack
4751 (install_data_ext.initialize_options): Class contributed by Jack
4731 Moffit for fixing the old distutils hack. He is sending this to
4752 Moffit for fixing the old distutils hack. He is sending this to
4732 the distutils folks so in the future we may not need it as a
4753 the distutils folks so in the future we may not need it as a
4733 private fix.
4754 private fix.
4734
4755
4735 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4756 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4736 changes for Debian packaging. See his patch for full details.
4757 changes for Debian packaging. See his patch for full details.
4737 The old distutils hack of making the ipythonrc* files carry a
4758 The old distutils hack of making the ipythonrc* files carry a
4738 bogus .py extension is gone, at last. Examples were moved to a
4759 bogus .py extension is gone, at last. Examples were moved to a
4739 separate subdir under doc/, and the separate executable scripts
4760 separate subdir under doc/, and the separate executable scripts
4740 now live in their own directory. Overall a great cleanup. The
4761 now live in their own directory. Overall a great cleanup. The
4741 manual was updated to use the new files, and setup.py has been
4762 manual was updated to use the new files, and setup.py has been
4742 fixed for this setup.
4763 fixed for this setup.
4743
4764
4744 * IPython/PyColorize.py (Parser.usage): made non-executable and
4765 * IPython/PyColorize.py (Parser.usage): made non-executable and
4745 created a pycolor wrapper around it to be included as a script.
4766 created a pycolor wrapper around it to be included as a script.
4746
4767
4747 2003-03-12 *** Released version 0.2.15pre2
4768 2003-03-12 *** Released version 0.2.15pre2
4748
4769
4749 2003-03-12 Fernando Perez <fperez@colorado.edu>
4770 2003-03-12 Fernando Perez <fperez@colorado.edu>
4750
4771
4751 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4772 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4752 long-standing problem with garbage characters in some terminals.
4773 long-standing problem with garbage characters in some terminals.
4753 The issue was really that the \001 and \002 escapes must _only_ be
4774 The issue was really that the \001 and \002 escapes must _only_ be
4754 passed to input prompts (which call readline), but _never_ to
4775 passed to input prompts (which call readline), but _never_ to
4755 normal text to be printed on screen. I changed ColorANSI to have
4776 normal text to be printed on screen. I changed ColorANSI to have
4756 two classes: TermColors and InputTermColors, each with the
4777 two classes: TermColors and InputTermColors, each with the
4757 appropriate escapes for input prompts or normal text. The code in
4778 appropriate escapes for input prompts or normal text. The code in
4758 Prompts.py got slightly more complicated, but this very old and
4779 Prompts.py got slightly more complicated, but this very old and
4759 annoying bug is finally fixed.
4780 annoying bug is finally fixed.
4760
4781
4761 All the credit for nailing down the real origin of this problem
4782 All the credit for nailing down the real origin of this problem
4762 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4783 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4763 *Many* thanks to him for spending quite a bit of effort on this.
4784 *Many* thanks to him for spending quite a bit of effort on this.
4764
4785
4765 2003-03-05 *** Released version 0.2.15pre1
4786 2003-03-05 *** Released version 0.2.15pre1
4766
4787
4767 2003-03-03 Fernando Perez <fperez@colorado.edu>
4788 2003-03-03 Fernando Perez <fperez@colorado.edu>
4768
4789
4769 * IPython/FakeModule.py: Moved the former _FakeModule to a
4790 * IPython/FakeModule.py: Moved the former _FakeModule to a
4770 separate file, because it's also needed by Magic (to fix a similar
4791 separate file, because it's also needed by Magic (to fix a similar
4771 pickle-related issue in @run).
4792 pickle-related issue in @run).
4772
4793
4773 2003-03-02 Fernando Perez <fperez@colorado.edu>
4794 2003-03-02 Fernando Perez <fperez@colorado.edu>
4774
4795
4775 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4796 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4776 the autocall option at runtime.
4797 the autocall option at runtime.
4777 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4798 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4778 across Magic.py to start separating Magic from InteractiveShell.
4799 across Magic.py to start separating Magic from InteractiveShell.
4779 (Magic._ofind): Fixed to return proper namespace for dotted
4800 (Magic._ofind): Fixed to return proper namespace for dotted
4780 names. Before, a dotted name would always return 'not currently
4801 names. Before, a dotted name would always return 'not currently
4781 defined', because it would find the 'parent'. s.x would be found,
4802 defined', because it would find the 'parent'. s.x would be found,
4782 but since 'x' isn't defined by itself, it would get confused.
4803 but since 'x' isn't defined by itself, it would get confused.
4783 (Magic.magic_run): Fixed pickling problems reported by Ralf
4804 (Magic.magic_run): Fixed pickling problems reported by Ralf
4784 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4805 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4785 that I'd used when Mike Heeter reported similar issues at the
4806 that I'd used when Mike Heeter reported similar issues at the
4786 top-level, but now for @run. It boils down to injecting the
4807 top-level, but now for @run. It boils down to injecting the
4787 namespace where code is being executed with something that looks
4808 namespace where code is being executed with something that looks
4788 enough like a module to fool pickle.dump(). Since a pickle stores
4809 enough like a module to fool pickle.dump(). Since a pickle stores
4789 a named reference to the importing module, we need this for
4810 a named reference to the importing module, we need this for
4790 pickles to save something sensible.
4811 pickles to save something sensible.
4791
4812
4792 * IPython/ipmaker.py (make_IPython): added an autocall option.
4813 * IPython/ipmaker.py (make_IPython): added an autocall option.
4793
4814
4794 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4815 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4795 the auto-eval code. Now autocalling is an option, and the code is
4816 the auto-eval code. Now autocalling is an option, and the code is
4796 also vastly safer. There is no more eval() involved at all.
4817 also vastly safer. There is no more eval() involved at all.
4797
4818
4798 2003-03-01 Fernando Perez <fperez@colorado.edu>
4819 2003-03-01 Fernando Perez <fperez@colorado.edu>
4799
4820
4800 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4821 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4801 dict with named keys instead of a tuple.
4822 dict with named keys instead of a tuple.
4802
4823
4803 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4824 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4804
4825
4805 * setup.py (make_shortcut): Fixed message about directories
4826 * setup.py (make_shortcut): Fixed message about directories
4806 created during Windows installation (the directories were ok, just
4827 created during Windows installation (the directories were ok, just
4807 the printed message was misleading). Thanks to Chris Liechti
4828 the printed message was misleading). Thanks to Chris Liechti
4808 <cliechti-AT-gmx.net> for the heads up.
4829 <cliechti-AT-gmx.net> for the heads up.
4809
4830
4810 2003-02-21 Fernando Perez <fperez@colorado.edu>
4831 2003-02-21 Fernando Perez <fperez@colorado.edu>
4811
4832
4812 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4833 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4813 of ValueError exception when checking for auto-execution. This
4834 of ValueError exception when checking for auto-execution. This
4814 one is raised by things like Numeric arrays arr.flat when the
4835 one is raised by things like Numeric arrays arr.flat when the
4815 array is non-contiguous.
4836 array is non-contiguous.
4816
4837
4817 2003-01-31 Fernando Perez <fperez@colorado.edu>
4838 2003-01-31 Fernando Perez <fperez@colorado.edu>
4818
4839
4819 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4840 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4820 not return any value at all (even though the command would get
4841 not return any value at all (even though the command would get
4821 executed).
4842 executed).
4822 (xsys): Flush stdout right after printing the command to ensure
4843 (xsys): Flush stdout right after printing the command to ensure
4823 proper ordering of commands and command output in the total
4844 proper ordering of commands and command output in the total
4824 output.
4845 output.
4825 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4846 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4826 system/getoutput as defaults. The old ones are kept for
4847 system/getoutput as defaults. The old ones are kept for
4827 compatibility reasons, so no code which uses this library needs
4848 compatibility reasons, so no code which uses this library needs
4828 changing.
4849 changing.
4829
4850
4830 2003-01-27 *** Released version 0.2.14
4851 2003-01-27 *** Released version 0.2.14
4831
4852
4832 2003-01-25 Fernando Perez <fperez@colorado.edu>
4853 2003-01-25 Fernando Perez <fperez@colorado.edu>
4833
4854
4834 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4855 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4835 functions defined in previous edit sessions could not be re-edited
4856 functions defined in previous edit sessions could not be re-edited
4836 (because the temp files were immediately removed). Now temp files
4857 (because the temp files were immediately removed). Now temp files
4837 are removed only at IPython's exit.
4858 are removed only at IPython's exit.
4838 (Magic.magic_run): Improved @run to perform shell-like expansions
4859 (Magic.magic_run): Improved @run to perform shell-like expansions
4839 on its arguments (~users and $VARS). With this, @run becomes more
4860 on its arguments (~users and $VARS). With this, @run becomes more
4840 like a normal command-line.
4861 like a normal command-line.
4841
4862
4842 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4863 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4843 bugs related to embedding and cleaned up that code. A fairly
4864 bugs related to embedding and cleaned up that code. A fairly
4844 important one was the impossibility to access the global namespace
4865 important one was the impossibility to access the global namespace
4845 through the embedded IPython (only local variables were visible).
4866 through the embedded IPython (only local variables were visible).
4846
4867
4847 2003-01-14 Fernando Perez <fperez@colorado.edu>
4868 2003-01-14 Fernando Perez <fperez@colorado.edu>
4848
4869
4849 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4870 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4850 auto-calling to be a bit more conservative. Now it doesn't get
4871 auto-calling to be a bit more conservative. Now it doesn't get
4851 triggered if any of '!=()<>' are in the rest of the input line, to
4872 triggered if any of '!=()<>' are in the rest of the input line, to
4852 allow comparing callables. Thanks to Alex for the heads up.
4873 allow comparing callables. Thanks to Alex for the heads up.
4853
4874
4854 2003-01-07 Fernando Perez <fperez@colorado.edu>
4875 2003-01-07 Fernando Perez <fperez@colorado.edu>
4855
4876
4856 * IPython/genutils.py (page): fixed estimation of the number of
4877 * IPython/genutils.py (page): fixed estimation of the number of
4857 lines in a string to be paged to simply count newlines. This
4878 lines in a string to be paged to simply count newlines. This
4858 prevents over-guessing due to embedded escape sequences. A better
4879 prevents over-guessing due to embedded escape sequences. A better
4859 long-term solution would involve stripping out the control chars
4880 long-term solution would involve stripping out the control chars
4860 for the count, but it's potentially so expensive I just don't
4881 for the count, but it's potentially so expensive I just don't
4861 think it's worth doing.
4882 think it's worth doing.
4862
4883
4863 2002-12-19 *** Released version 0.2.14pre50
4884 2002-12-19 *** Released version 0.2.14pre50
4864
4885
4865 2002-12-19 Fernando Perez <fperez@colorado.edu>
4886 2002-12-19 Fernando Perez <fperez@colorado.edu>
4866
4887
4867 * tools/release (version): Changed release scripts to inform
4888 * tools/release (version): Changed release scripts to inform
4868 Andrea and build a NEWS file with a list of recent changes.
4889 Andrea and build a NEWS file with a list of recent changes.
4869
4890
4870 * IPython/ColorANSI.py (__all__): changed terminal detection
4891 * IPython/ColorANSI.py (__all__): changed terminal detection
4871 code. Seems to work better for xterms without breaking
4892 code. Seems to work better for xterms without breaking
4872 konsole. Will need more testing to determine if WinXP and Mac OSX
4893 konsole. Will need more testing to determine if WinXP and Mac OSX
4873 also work ok.
4894 also work ok.
4874
4895
4875 2002-12-18 *** Released version 0.2.14pre49
4896 2002-12-18 *** Released version 0.2.14pre49
4876
4897
4877 2002-12-18 Fernando Perez <fperez@colorado.edu>
4898 2002-12-18 Fernando Perez <fperez@colorado.edu>
4878
4899
4879 * Docs: added new info about Mac OSX, from Andrea.
4900 * Docs: added new info about Mac OSX, from Andrea.
4880
4901
4881 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4902 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4882 allow direct plotting of python strings whose format is the same
4903 allow direct plotting of python strings whose format is the same
4883 of gnuplot data files.
4904 of gnuplot data files.
4884
4905
4885 2002-12-16 Fernando Perez <fperez@colorado.edu>
4906 2002-12-16 Fernando Perez <fperez@colorado.edu>
4886
4907
4887 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4908 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4888 value of exit question to be acknowledged.
4909 value of exit question to be acknowledged.
4889
4910
4890 2002-12-03 Fernando Perez <fperez@colorado.edu>
4911 2002-12-03 Fernando Perez <fperez@colorado.edu>
4891
4912
4892 * IPython/ipmaker.py: removed generators, which had been added
4913 * IPython/ipmaker.py: removed generators, which had been added
4893 by mistake in an earlier debugging run. This was causing trouble
4914 by mistake in an earlier debugging run. This was causing trouble
4894 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4915 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4895 for pointing this out.
4916 for pointing this out.
4896
4917
4897 2002-11-17 Fernando Perez <fperez@colorado.edu>
4918 2002-11-17 Fernando Perez <fperez@colorado.edu>
4898
4919
4899 * Manual: updated the Gnuplot section.
4920 * Manual: updated the Gnuplot section.
4900
4921
4901 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4922 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4902 a much better split of what goes in Runtime and what goes in
4923 a much better split of what goes in Runtime and what goes in
4903 Interactive.
4924 Interactive.
4904
4925
4905 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4926 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4906 being imported from iplib.
4927 being imported from iplib.
4907
4928
4908 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4929 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4909 for command-passing. Now the global Gnuplot instance is called
4930 for command-passing. Now the global Gnuplot instance is called
4910 'gp' instead of 'g', which was really a far too fragile and
4931 'gp' instead of 'g', which was really a far too fragile and
4911 common name.
4932 common name.
4912
4933
4913 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4934 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4914 bounding boxes generated by Gnuplot for square plots.
4935 bounding boxes generated by Gnuplot for square plots.
4915
4936
4916 * IPython/genutils.py (popkey): new function added. I should
4937 * IPython/genutils.py (popkey): new function added. I should
4917 suggest this on c.l.py as a dict method, it seems useful.
4938 suggest this on c.l.py as a dict method, it seems useful.
4918
4939
4919 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4940 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4920 to transparently handle PostScript generation. MUCH better than
4941 to transparently handle PostScript generation. MUCH better than
4921 the previous plot_eps/replot_eps (which I removed now). The code
4942 the previous plot_eps/replot_eps (which I removed now). The code
4922 is also fairly clean and well documented now (including
4943 is also fairly clean and well documented now (including
4923 docstrings).
4944 docstrings).
4924
4945
4925 2002-11-13 Fernando Perez <fperez@colorado.edu>
4946 2002-11-13 Fernando Perez <fperez@colorado.edu>
4926
4947
4927 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4948 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4928 (inconsistent with options).
4949 (inconsistent with options).
4929
4950
4930 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4951 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4931 manually disabled, I don't know why. Fixed it.
4952 manually disabled, I don't know why. Fixed it.
4932 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4953 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4933 eps output.
4954 eps output.
4934
4955
4935 2002-11-12 Fernando Perez <fperez@colorado.edu>
4956 2002-11-12 Fernando Perez <fperez@colorado.edu>
4936
4957
4937 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4958 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4938 don't propagate up to caller. Fixes crash reported by François
4959 don't propagate up to caller. Fixes crash reported by François
4939 Pinard.
4960 Pinard.
4940
4961
4941 2002-11-09 Fernando Perez <fperez@colorado.edu>
4962 2002-11-09 Fernando Perez <fperez@colorado.edu>
4942
4963
4943 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4964 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4944 history file for new users.
4965 history file for new users.
4945 (make_IPython): fixed bug where initial install would leave the
4966 (make_IPython): fixed bug where initial install would leave the
4946 user running in the .ipython dir.
4967 user running in the .ipython dir.
4947 (make_IPython): fixed bug where config dir .ipython would be
4968 (make_IPython): fixed bug where config dir .ipython would be
4948 created regardless of the given -ipythondir option. Thanks to Cory
4969 created regardless of the given -ipythondir option. Thanks to Cory
4949 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4970 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4950
4971
4951 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4972 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4952 type confirmations. Will need to use it in all of IPython's code
4973 type confirmations. Will need to use it in all of IPython's code
4953 consistently.
4974 consistently.
4954
4975
4955 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4976 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4956 context to print 31 lines instead of the default 5. This will make
4977 context to print 31 lines instead of the default 5. This will make
4957 the crash reports extremely detailed in case the problem is in
4978 the crash reports extremely detailed in case the problem is in
4958 libraries I don't have access to.
4979 libraries I don't have access to.
4959
4980
4960 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4981 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4961 line of defense' code to still crash, but giving users fair
4982 line of defense' code to still crash, but giving users fair
4962 warning. I don't want internal errors to go unreported: if there's
4983 warning. I don't want internal errors to go unreported: if there's
4963 an internal problem, IPython should crash and generate a full
4984 an internal problem, IPython should crash and generate a full
4964 report.
4985 report.
4965
4986
4966 2002-11-08 Fernando Perez <fperez@colorado.edu>
4987 2002-11-08 Fernando Perez <fperez@colorado.edu>
4967
4988
4968 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4989 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4969 otherwise uncaught exceptions which can appear if people set
4990 otherwise uncaught exceptions which can appear if people set
4970 sys.stdout to something badly broken. Thanks to a crash report
4991 sys.stdout to something badly broken. Thanks to a crash report
4971 from henni-AT-mail.brainbot.com.
4992 from henni-AT-mail.brainbot.com.
4972
4993
4973 2002-11-04 Fernando Perez <fperez@colorado.edu>
4994 2002-11-04 Fernando Perez <fperez@colorado.edu>
4974
4995
4975 * IPython/iplib.py (InteractiveShell.interact): added
4996 * IPython/iplib.py (InteractiveShell.interact): added
4976 __IPYTHON__active to the builtins. It's a flag which goes on when
4997 __IPYTHON__active to the builtins. It's a flag which goes on when
4977 the interaction starts and goes off again when it stops. This
4998 the interaction starts and goes off again when it stops. This
4978 allows embedding code to detect being inside IPython. Before this
4999 allows embedding code to detect being inside IPython. Before this
4979 was done via __IPYTHON__, but that only shows that an IPython
5000 was done via __IPYTHON__, but that only shows that an IPython
4980 instance has been created.
5001 instance has been created.
4981
5002
4982 * IPython/Magic.py (Magic.magic_env): I realized that in a
5003 * IPython/Magic.py (Magic.magic_env): I realized that in a
4983 UserDict, instance.data holds the data as a normal dict. So I
5004 UserDict, instance.data holds the data as a normal dict. So I
4984 modified @env to return os.environ.data instead of rebuilding a
5005 modified @env to return os.environ.data instead of rebuilding a
4985 dict by hand.
5006 dict by hand.
4986
5007
4987 2002-11-02 Fernando Perez <fperez@colorado.edu>
5008 2002-11-02 Fernando Perez <fperez@colorado.edu>
4988
5009
4989 * IPython/genutils.py (warn): changed so that level 1 prints no
5010 * IPython/genutils.py (warn): changed so that level 1 prints no
4990 header. Level 2 is now the default (with 'WARNING' header, as
5011 header. Level 2 is now the default (with 'WARNING' header, as
4991 before). I think I tracked all places where changes were needed in
5012 before). I think I tracked all places where changes were needed in
4992 IPython, but outside code using the old level numbering may have
5013 IPython, but outside code using the old level numbering may have
4993 broken.
5014 broken.
4994
5015
4995 * IPython/iplib.py (InteractiveShell.runcode): added this to
5016 * IPython/iplib.py (InteractiveShell.runcode): added this to
4996 handle the tracebacks in SystemExit traps correctly. The previous
5017 handle the tracebacks in SystemExit traps correctly. The previous
4997 code (through interact) was printing more of the stack than
5018 code (through interact) was printing more of the stack than
4998 necessary, showing IPython internal code to the user.
5019 necessary, showing IPython internal code to the user.
4999
5020
5000 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5021 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5001 default. Now that the default at the confirmation prompt is yes,
5022 default. Now that the default at the confirmation prompt is yes,
5002 it's not so intrusive. François' argument that ipython sessions
5023 it's not so intrusive. François' argument that ipython sessions
5003 tend to be complex enough not to lose them from an accidental C-d,
5024 tend to be complex enough not to lose them from an accidental C-d,
5004 is a valid one.
5025 is a valid one.
5005
5026
5006 * IPython/iplib.py (InteractiveShell.interact): added a
5027 * IPython/iplib.py (InteractiveShell.interact): added a
5007 showtraceback() call to the SystemExit trap, and modified the exit
5028 showtraceback() call to the SystemExit trap, and modified the exit
5008 confirmation to have yes as the default.
5029 confirmation to have yes as the default.
5009
5030
5010 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5031 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5011 this file. It's been gone from the code for a long time, this was
5032 this file. It's been gone from the code for a long time, this was
5012 simply leftover junk.
5033 simply leftover junk.
5013
5034
5014 2002-11-01 Fernando Perez <fperez@colorado.edu>
5035 2002-11-01 Fernando Perez <fperez@colorado.edu>
5015
5036
5016 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5037 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5017 added. If set, IPython now traps EOF and asks for
5038 added. If set, IPython now traps EOF and asks for
5018 confirmation. After a request by François Pinard.
5039 confirmation. After a request by François Pinard.
5019
5040
5020 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5041 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5021 of @abort, and with a new (better) mechanism for handling the
5042 of @abort, and with a new (better) mechanism for handling the
5022 exceptions.
5043 exceptions.
5023
5044
5024 2002-10-27 Fernando Perez <fperez@colorado.edu>
5045 2002-10-27 Fernando Perez <fperez@colorado.edu>
5025
5046
5026 * IPython/usage.py (__doc__): updated the --help information and
5047 * IPython/usage.py (__doc__): updated the --help information and
5027 the ipythonrc file to indicate that -log generates
5048 the ipythonrc file to indicate that -log generates
5028 ./ipython.log. Also fixed the corresponding info in @logstart.
5049 ./ipython.log. Also fixed the corresponding info in @logstart.
5029 This and several other fixes in the manuals thanks to reports by
5050 This and several other fixes in the manuals thanks to reports by
5030 François Pinard <pinard-AT-iro.umontreal.ca>.
5051 François Pinard <pinard-AT-iro.umontreal.ca>.
5031
5052
5032 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5053 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5033 refer to @logstart (instead of @log, which doesn't exist).
5054 refer to @logstart (instead of @log, which doesn't exist).
5034
5055
5035 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5056 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5036 AttributeError crash. Thanks to Christopher Armstrong
5057 AttributeError crash. Thanks to Christopher Armstrong
5037 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5058 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5038 introduced recently (in 0.2.14pre37) with the fix to the eval
5059 introduced recently (in 0.2.14pre37) with the fix to the eval
5039 problem mentioned below.
5060 problem mentioned below.
5040
5061
5041 2002-10-17 Fernando Perez <fperez@colorado.edu>
5062 2002-10-17 Fernando Perez <fperez@colorado.edu>
5042
5063
5043 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5064 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5044 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5065 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5045
5066
5046 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5067 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5047 this function to fix a problem reported by Alex Schmolck. He saw
5068 this function to fix a problem reported by Alex Schmolck. He saw
5048 it with list comprehensions and generators, which were getting
5069 it with list comprehensions and generators, which were getting
5049 called twice. The real problem was an 'eval' call in testing for
5070 called twice. The real problem was an 'eval' call in testing for
5050 automagic which was evaluating the input line silently.
5071 automagic which was evaluating the input line silently.
5051
5072
5052 This is a potentially very nasty bug, if the input has side
5073 This is a potentially very nasty bug, if the input has side
5053 effects which must not be repeated. The code is much cleaner now,
5074 effects which must not be repeated. The code is much cleaner now,
5054 without any blanket 'except' left and with a regexp test for
5075 without any blanket 'except' left and with a regexp test for
5055 actual function names.
5076 actual function names.
5056
5077
5057 But an eval remains, which I'm not fully comfortable with. I just
5078 But an eval remains, which I'm not fully comfortable with. I just
5058 don't know how to find out if an expression could be a callable in
5079 don't know how to find out if an expression could be a callable in
5059 the user's namespace without doing an eval on the string. However
5080 the user's namespace without doing an eval on the string. However
5060 that string is now much more strictly checked so that no code
5081 that string is now much more strictly checked so that no code
5061 slips by, so the eval should only happen for things that can
5082 slips by, so the eval should only happen for things that can
5062 really be only function/method names.
5083 really be only function/method names.
5063
5084
5064 2002-10-15 Fernando Perez <fperez@colorado.edu>
5085 2002-10-15 Fernando Perez <fperez@colorado.edu>
5065
5086
5066 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5087 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5067 OSX information to main manual, removed README_Mac_OSX file from
5088 OSX information to main manual, removed README_Mac_OSX file from
5068 distribution. Also updated credits for recent additions.
5089 distribution. Also updated credits for recent additions.
5069
5090
5070 2002-10-10 Fernando Perez <fperez@colorado.edu>
5091 2002-10-10 Fernando Perez <fperez@colorado.edu>
5071
5092
5072 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5093 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5073 terminal-related issues. Many thanks to Andrea Riciputi
5094 terminal-related issues. Many thanks to Andrea Riciputi
5074 <andrea.riciputi-AT-libero.it> for writing it.
5095 <andrea.riciputi-AT-libero.it> for writing it.
5075
5096
5076 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5097 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5077 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5098 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5078
5099
5079 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5100 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5080 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5101 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5081 <syver-en-AT-online.no> who both submitted patches for this problem.
5102 <syver-en-AT-online.no> who both submitted patches for this problem.
5082
5103
5083 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5104 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5084 global embedding to make sure that things don't overwrite user
5105 global embedding to make sure that things don't overwrite user
5085 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5106 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5086
5107
5087 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5108 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5088 compatibility. Thanks to Hayden Callow
5109 compatibility. Thanks to Hayden Callow
5089 <h.callow-AT-elec.canterbury.ac.nz>
5110 <h.callow-AT-elec.canterbury.ac.nz>
5090
5111
5091 2002-10-04 Fernando Perez <fperez@colorado.edu>
5112 2002-10-04 Fernando Perez <fperez@colorado.edu>
5092
5113
5093 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5114 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5094 Gnuplot.File objects.
5115 Gnuplot.File objects.
5095
5116
5096 2002-07-23 Fernando Perez <fperez@colorado.edu>
5117 2002-07-23 Fernando Perez <fperez@colorado.edu>
5097
5118
5098 * IPython/genutils.py (timing): Added timings() and timing() for
5119 * IPython/genutils.py (timing): Added timings() and timing() for
5099 quick access to the most commonly needed data, the execution
5120 quick access to the most commonly needed data, the execution
5100 times. Old timing() renamed to timings_out().
5121 times. Old timing() renamed to timings_out().
5101
5122
5102 2002-07-18 Fernando Perez <fperez@colorado.edu>
5123 2002-07-18 Fernando Perez <fperez@colorado.edu>
5103
5124
5104 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5125 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5105 bug with nested instances disrupting the parent's tab completion.
5126 bug with nested instances disrupting the parent's tab completion.
5106
5127
5107 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5128 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5108 all_completions code to begin the emacs integration.
5129 all_completions code to begin the emacs integration.
5109
5130
5110 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5131 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5111 argument to allow titling individual arrays when plotting.
5132 argument to allow titling individual arrays when plotting.
5112
5133
5113 2002-07-15 Fernando Perez <fperez@colorado.edu>
5134 2002-07-15 Fernando Perez <fperez@colorado.edu>
5114
5135
5115 * setup.py (make_shortcut): changed to retrieve the value of
5136 * setup.py (make_shortcut): changed to retrieve the value of
5116 'Program Files' directory from the registry (this value changes in
5137 'Program Files' directory from the registry (this value changes in
5117 non-english versions of Windows). Thanks to Thomas Fanslau
5138 non-english versions of Windows). Thanks to Thomas Fanslau
5118 <tfanslau-AT-gmx.de> for the report.
5139 <tfanslau-AT-gmx.de> for the report.
5119
5140
5120 2002-07-10 Fernando Perez <fperez@colorado.edu>
5141 2002-07-10 Fernando Perez <fperez@colorado.edu>
5121
5142
5122 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5143 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5123 a bug in pdb, which crashes if a line with only whitespace is
5144 a bug in pdb, which crashes if a line with only whitespace is
5124 entered. Bug report submitted to sourceforge.
5145 entered. Bug report submitted to sourceforge.
5125
5146
5126 2002-07-09 Fernando Perez <fperez@colorado.edu>
5147 2002-07-09 Fernando Perez <fperez@colorado.edu>
5127
5148
5128 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5149 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5129 reporting exceptions (it's a bug in inspect.py, I just set a
5150 reporting exceptions (it's a bug in inspect.py, I just set a
5130 workaround).
5151 workaround).
5131
5152
5132 2002-07-08 Fernando Perez <fperez@colorado.edu>
5153 2002-07-08 Fernando Perez <fperez@colorado.edu>
5133
5154
5134 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5155 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5135 __IPYTHON__ in __builtins__ to show up in user_ns.
5156 __IPYTHON__ in __builtins__ to show up in user_ns.
5136
5157
5137 2002-07-03 Fernando Perez <fperez@colorado.edu>
5158 2002-07-03 Fernando Perez <fperez@colorado.edu>
5138
5159
5139 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5160 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5140 name from @gp_set_instance to @gp_set_default.
5161 name from @gp_set_instance to @gp_set_default.
5141
5162
5142 * IPython/ipmaker.py (make_IPython): default editor value set to
5163 * IPython/ipmaker.py (make_IPython): default editor value set to
5143 '0' (a string), to match the rc file. Otherwise will crash when
5164 '0' (a string), to match the rc file. Otherwise will crash when
5144 .strip() is called on it.
5165 .strip() is called on it.
5145
5166
5146
5167
5147 2002-06-28 Fernando Perez <fperez@colorado.edu>
5168 2002-06-28 Fernando Perez <fperez@colorado.edu>
5148
5169
5149 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5170 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5150 of files in current directory when a file is executed via
5171 of files in current directory when a file is executed via
5151 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5172 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5152
5173
5153 * setup.py (manfiles): fix for rpm builds, submitted by RA
5174 * setup.py (manfiles): fix for rpm builds, submitted by RA
5154 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5175 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5155
5176
5156 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5177 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5157 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5178 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5158 string!). A. Schmolck caught this one.
5179 string!). A. Schmolck caught this one.
5159
5180
5160 2002-06-27 Fernando Perez <fperez@colorado.edu>
5181 2002-06-27 Fernando Perez <fperez@colorado.edu>
5161
5182
5162 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5183 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5163 defined files at the cmd line. __name__ wasn't being set to
5184 defined files at the cmd line. __name__ wasn't being set to
5164 __main__.
5185 __main__.
5165
5186
5166 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5187 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5167 regular lists and tuples besides Numeric arrays.
5188 regular lists and tuples besides Numeric arrays.
5168
5189
5169 * IPython/Prompts.py (CachedOutput.__call__): Added output
5190 * IPython/Prompts.py (CachedOutput.__call__): Added output
5170 supression for input ending with ';'. Similar to Mathematica and
5191 supression for input ending with ';'. Similar to Mathematica and
5171 Matlab. The _* vars and Out[] list are still updated, just like
5192 Matlab. The _* vars and Out[] list are still updated, just like
5172 Mathematica behaves.
5193 Mathematica behaves.
5173
5194
5174 2002-06-25 Fernando Perez <fperez@colorado.edu>
5195 2002-06-25 Fernando Perez <fperez@colorado.edu>
5175
5196
5176 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5197 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5177 .ini extensions for profiels under Windows.
5198 .ini extensions for profiels under Windows.
5178
5199
5179 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5200 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5180 string form. Fix contributed by Alexander Schmolck
5201 string form. Fix contributed by Alexander Schmolck
5181 <a.schmolck-AT-gmx.net>
5202 <a.schmolck-AT-gmx.net>
5182
5203
5183 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5204 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5184 pre-configured Gnuplot instance.
5205 pre-configured Gnuplot instance.
5185
5206
5186 2002-06-21 Fernando Perez <fperez@colorado.edu>
5207 2002-06-21 Fernando Perez <fperez@colorado.edu>
5187
5208
5188 * IPython/numutils.py (exp_safe): new function, works around the
5209 * IPython/numutils.py (exp_safe): new function, works around the
5189 underflow problems in Numeric.
5210 underflow problems in Numeric.
5190 (log2): New fn. Safe log in base 2: returns exact integer answer
5211 (log2): New fn. Safe log in base 2: returns exact integer answer
5191 for exact integer powers of 2.
5212 for exact integer powers of 2.
5192
5213
5193 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5214 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5194 properly.
5215 properly.
5195
5216
5196 2002-06-20 Fernando Perez <fperez@colorado.edu>
5217 2002-06-20 Fernando Perez <fperez@colorado.edu>
5197
5218
5198 * IPython/genutils.py (timing): new function like
5219 * IPython/genutils.py (timing): new function like
5199 Mathematica's. Similar to time_test, but returns more info.
5220 Mathematica's. Similar to time_test, but returns more info.
5200
5221
5201 2002-06-18 Fernando Perez <fperez@colorado.edu>
5222 2002-06-18 Fernando Perez <fperez@colorado.edu>
5202
5223
5203 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5224 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5204 according to Mike Heeter's suggestions.
5225 according to Mike Heeter's suggestions.
5205
5226
5206 2002-06-16 Fernando Perez <fperez@colorado.edu>
5227 2002-06-16 Fernando Perez <fperez@colorado.edu>
5207
5228
5208 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5229 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5209 system. GnuplotMagic is gone as a user-directory option. New files
5230 system. GnuplotMagic is gone as a user-directory option. New files
5210 make it easier to use all the gnuplot stuff both from external
5231 make it easier to use all the gnuplot stuff both from external
5211 programs as well as from IPython. Had to rewrite part of
5232 programs as well as from IPython. Had to rewrite part of
5212 hardcopy() b/c of a strange bug: often the ps files simply don't
5233 hardcopy() b/c of a strange bug: often the ps files simply don't
5213 get created, and require a repeat of the command (often several
5234 get created, and require a repeat of the command (often several
5214 times).
5235 times).
5215
5236
5216 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5237 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5217 resolve output channel at call time, so that if sys.stderr has
5238 resolve output channel at call time, so that if sys.stderr has
5218 been redirected by user this gets honored.
5239 been redirected by user this gets honored.
5219
5240
5220 2002-06-13 Fernando Perez <fperez@colorado.edu>
5241 2002-06-13 Fernando Perez <fperez@colorado.edu>
5221
5242
5222 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5243 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5223 IPShell. Kept a copy with the old names to avoid breaking people's
5244 IPShell. Kept a copy with the old names to avoid breaking people's
5224 embedded code.
5245 embedded code.
5225
5246
5226 * IPython/ipython: simplified it to the bare minimum after
5247 * IPython/ipython: simplified it to the bare minimum after
5227 Holger's suggestions. Added info about how to use it in
5248 Holger's suggestions. Added info about how to use it in
5228 PYTHONSTARTUP.
5249 PYTHONSTARTUP.
5229
5250
5230 * IPython/Shell.py (IPythonShell): changed the options passing
5251 * IPython/Shell.py (IPythonShell): changed the options passing
5231 from a string with funky %s replacements to a straight list. Maybe
5252 from a string with funky %s replacements to a straight list. Maybe
5232 a bit more typing, but it follows sys.argv conventions, so there's
5253 a bit more typing, but it follows sys.argv conventions, so there's
5233 less special-casing to remember.
5254 less special-casing to remember.
5234
5255
5235 2002-06-12 Fernando Perez <fperez@colorado.edu>
5256 2002-06-12 Fernando Perez <fperez@colorado.edu>
5236
5257
5237 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5258 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5238 command. Thanks to a suggestion by Mike Heeter.
5259 command. Thanks to a suggestion by Mike Heeter.
5239 (Magic.magic_pfile): added behavior to look at filenames if given
5260 (Magic.magic_pfile): added behavior to look at filenames if given
5240 arg is not a defined object.
5261 arg is not a defined object.
5241 (Magic.magic_save): New @save function to save code snippets. Also
5262 (Magic.magic_save): New @save function to save code snippets. Also
5242 a Mike Heeter idea.
5263 a Mike Heeter idea.
5243
5264
5244 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5265 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5245 plot() and replot(). Much more convenient now, especially for
5266 plot() and replot(). Much more convenient now, especially for
5246 interactive use.
5267 interactive use.
5247
5268
5248 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5269 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5249 filenames.
5270 filenames.
5250
5271
5251 2002-06-02 Fernando Perez <fperez@colorado.edu>
5272 2002-06-02 Fernando Perez <fperez@colorado.edu>
5252
5273
5253 * IPython/Struct.py (Struct.__init__): modified to admit
5274 * IPython/Struct.py (Struct.__init__): modified to admit
5254 initialization via another struct.
5275 initialization via another struct.
5255
5276
5256 * IPython/genutils.py (SystemExec.__init__): New stateful
5277 * IPython/genutils.py (SystemExec.__init__): New stateful
5257 interface to xsys and bq. Useful for writing system scripts.
5278 interface to xsys and bq. Useful for writing system scripts.
5258
5279
5259 2002-05-30 Fernando Perez <fperez@colorado.edu>
5280 2002-05-30 Fernando Perez <fperez@colorado.edu>
5260
5281
5261 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5282 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5262 documents. This will make the user download smaller (it's getting
5283 documents. This will make the user download smaller (it's getting
5263 too big).
5284 too big).
5264
5285
5265 2002-05-29 Fernando Perez <fperez@colorado.edu>
5286 2002-05-29 Fernando Perez <fperez@colorado.edu>
5266
5287
5267 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5288 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5268 fix problems with shelve and pickle. Seems to work, but I don't
5289 fix problems with shelve and pickle. Seems to work, but I don't
5269 know if corner cases break it. Thanks to Mike Heeter
5290 know if corner cases break it. Thanks to Mike Heeter
5270 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5291 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5271
5292
5272 2002-05-24 Fernando Perez <fperez@colorado.edu>
5293 2002-05-24 Fernando Perez <fperez@colorado.edu>
5273
5294
5274 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5295 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5275 macros having broken.
5296 macros having broken.
5276
5297
5277 2002-05-21 Fernando Perez <fperez@colorado.edu>
5298 2002-05-21 Fernando Perez <fperez@colorado.edu>
5278
5299
5279 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5300 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5280 introduced logging bug: all history before logging started was
5301 introduced logging bug: all history before logging started was
5281 being written one character per line! This came from the redesign
5302 being written one character per line! This came from the redesign
5282 of the input history as a special list which slices to strings,
5303 of the input history as a special list which slices to strings,
5283 not to lists.
5304 not to lists.
5284
5305
5285 2002-05-20 Fernando Perez <fperez@colorado.edu>
5306 2002-05-20 Fernando Perez <fperez@colorado.edu>
5286
5307
5287 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5308 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5288 be an attribute of all classes in this module. The design of these
5309 be an attribute of all classes in this module. The design of these
5289 classes needs some serious overhauling.
5310 classes needs some serious overhauling.
5290
5311
5291 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5312 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5292 which was ignoring '_' in option names.
5313 which was ignoring '_' in option names.
5293
5314
5294 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5315 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5295 'Verbose_novars' to 'Context' and made it the new default. It's a
5316 'Verbose_novars' to 'Context' and made it the new default. It's a
5296 bit more readable and also safer than verbose.
5317 bit more readable and also safer than verbose.
5297
5318
5298 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5319 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5299 triple-quoted strings.
5320 triple-quoted strings.
5300
5321
5301 * IPython/OInspect.py (__all__): new module exposing the object
5322 * IPython/OInspect.py (__all__): new module exposing the object
5302 introspection facilities. Now the corresponding magics are dummy
5323 introspection facilities. Now the corresponding magics are dummy
5303 wrappers around this. Having this module will make it much easier
5324 wrappers around this. Having this module will make it much easier
5304 to put these functions into our modified pdb.
5325 to put these functions into our modified pdb.
5305 This new object inspector system uses the new colorizing module,
5326 This new object inspector system uses the new colorizing module,
5306 so source code and other things are nicely syntax highlighted.
5327 so source code and other things are nicely syntax highlighted.
5307
5328
5308 2002-05-18 Fernando Perez <fperez@colorado.edu>
5329 2002-05-18 Fernando Perez <fperez@colorado.edu>
5309
5330
5310 * IPython/ColorANSI.py: Split the coloring tools into a separate
5331 * IPython/ColorANSI.py: Split the coloring tools into a separate
5311 module so I can use them in other code easier (they were part of
5332 module so I can use them in other code easier (they were part of
5312 ultraTB).
5333 ultraTB).
5313
5334
5314 2002-05-17 Fernando Perez <fperez@colorado.edu>
5335 2002-05-17 Fernando Perez <fperez@colorado.edu>
5315
5336
5316 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5337 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5317 fixed it to set the global 'g' also to the called instance, as
5338 fixed it to set the global 'g' also to the called instance, as
5318 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5339 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5319 user's 'g' variables).
5340 user's 'g' variables).
5320
5341
5321 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5342 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5322 global variables (aliases to _ih,_oh) so that users which expect
5343 global variables (aliases to _ih,_oh) so that users which expect
5323 In[5] or Out[7] to work aren't unpleasantly surprised.
5344 In[5] or Out[7] to work aren't unpleasantly surprised.
5324 (InputList.__getslice__): new class to allow executing slices of
5345 (InputList.__getslice__): new class to allow executing slices of
5325 input history directly. Very simple class, complements the use of
5346 input history directly. Very simple class, complements the use of
5326 macros.
5347 macros.
5327
5348
5328 2002-05-16 Fernando Perez <fperez@colorado.edu>
5349 2002-05-16 Fernando Perez <fperez@colorado.edu>
5329
5350
5330 * setup.py (docdirbase): make doc directory be just doc/IPython
5351 * setup.py (docdirbase): make doc directory be just doc/IPython
5331 without version numbers, it will reduce clutter for users.
5352 without version numbers, it will reduce clutter for users.
5332
5353
5333 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5354 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5334 execfile call to prevent possible memory leak. See for details:
5355 execfile call to prevent possible memory leak. See for details:
5335 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5356 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5336
5357
5337 2002-05-15 Fernando Perez <fperez@colorado.edu>
5358 2002-05-15 Fernando Perez <fperez@colorado.edu>
5338
5359
5339 * IPython/Magic.py (Magic.magic_psource): made the object
5360 * IPython/Magic.py (Magic.magic_psource): made the object
5340 introspection names be more standard: pdoc, pdef, pfile and
5361 introspection names be more standard: pdoc, pdef, pfile and
5341 psource. They all print/page their output, and it makes
5362 psource. They all print/page their output, and it makes
5342 remembering them easier. Kept old names for compatibility as
5363 remembering them easier. Kept old names for compatibility as
5343 aliases.
5364 aliases.
5344
5365
5345 2002-05-14 Fernando Perez <fperez@colorado.edu>
5366 2002-05-14 Fernando Perez <fperez@colorado.edu>
5346
5367
5347 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5368 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5348 what the mouse problem was. The trick is to use gnuplot with temp
5369 what the mouse problem was. The trick is to use gnuplot with temp
5349 files and NOT with pipes (for data communication), because having
5370 files and NOT with pipes (for data communication), because having
5350 both pipes and the mouse on is bad news.
5371 both pipes and the mouse on is bad news.
5351
5372
5352 2002-05-13 Fernando Perez <fperez@colorado.edu>
5373 2002-05-13 Fernando Perez <fperez@colorado.edu>
5353
5374
5354 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5375 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5355 bug. Information would be reported about builtins even when
5376 bug. Information would be reported about builtins even when
5356 user-defined functions overrode them.
5377 user-defined functions overrode them.
5357
5378
5358 2002-05-11 Fernando Perez <fperez@colorado.edu>
5379 2002-05-11 Fernando Perez <fperez@colorado.edu>
5359
5380
5360 * IPython/__init__.py (__all__): removed FlexCompleter from
5381 * IPython/__init__.py (__all__): removed FlexCompleter from
5361 __all__ so that things don't fail in platforms without readline.
5382 __all__ so that things don't fail in platforms without readline.
5362
5383
5363 2002-05-10 Fernando Perez <fperez@colorado.edu>
5384 2002-05-10 Fernando Perez <fperez@colorado.edu>
5364
5385
5365 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5386 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5366 it requires Numeric, effectively making Numeric a dependency for
5387 it requires Numeric, effectively making Numeric a dependency for
5367 IPython.
5388 IPython.
5368
5389
5369 * Released 0.2.13
5390 * Released 0.2.13
5370
5391
5371 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5392 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5372 profiler interface. Now all the major options from the profiler
5393 profiler interface. Now all the major options from the profiler
5373 module are directly supported in IPython, both for single
5394 module are directly supported in IPython, both for single
5374 expressions (@prun) and for full programs (@run -p).
5395 expressions (@prun) and for full programs (@run -p).
5375
5396
5376 2002-05-09 Fernando Perez <fperez@colorado.edu>
5397 2002-05-09 Fernando Perez <fperez@colorado.edu>
5377
5398
5378 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5399 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5379 magic properly formatted for screen.
5400 magic properly formatted for screen.
5380
5401
5381 * setup.py (make_shortcut): Changed things to put pdf version in
5402 * setup.py (make_shortcut): Changed things to put pdf version in
5382 doc/ instead of doc/manual (had to change lyxport a bit).
5403 doc/ instead of doc/manual (had to change lyxport a bit).
5383
5404
5384 * IPython/Magic.py (Profile.string_stats): made profile runs go
5405 * IPython/Magic.py (Profile.string_stats): made profile runs go
5385 through pager (they are long and a pager allows searching, saving,
5406 through pager (they are long and a pager allows searching, saving,
5386 etc.)
5407 etc.)
5387
5408
5388 2002-05-08 Fernando Perez <fperez@colorado.edu>
5409 2002-05-08 Fernando Perez <fperez@colorado.edu>
5389
5410
5390 * Released 0.2.12
5411 * Released 0.2.12
5391
5412
5392 2002-05-06 Fernando Perez <fperez@colorado.edu>
5413 2002-05-06 Fernando Perez <fperez@colorado.edu>
5393
5414
5394 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5415 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5395 introduced); 'hist n1 n2' was broken.
5416 introduced); 'hist n1 n2' was broken.
5396 (Magic.magic_pdb): added optional on/off arguments to @pdb
5417 (Magic.magic_pdb): added optional on/off arguments to @pdb
5397 (Magic.magic_run): added option -i to @run, which executes code in
5418 (Magic.magic_run): added option -i to @run, which executes code in
5398 the IPython namespace instead of a clean one. Also added @irun as
5419 the IPython namespace instead of a clean one. Also added @irun as
5399 an alias to @run -i.
5420 an alias to @run -i.
5400
5421
5401 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5422 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5402 fixed (it didn't really do anything, the namespaces were wrong).
5423 fixed (it didn't really do anything, the namespaces were wrong).
5403
5424
5404 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5425 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5405
5426
5406 * IPython/__init__.py (__all__): Fixed package namespace, now
5427 * IPython/__init__.py (__all__): Fixed package namespace, now
5407 'import IPython' does give access to IPython.<all> as
5428 'import IPython' does give access to IPython.<all> as
5408 expected. Also renamed __release__ to Release.
5429 expected. Also renamed __release__ to Release.
5409
5430
5410 * IPython/Debugger.py (__license__): created new Pdb class which
5431 * IPython/Debugger.py (__license__): created new Pdb class which
5411 functions like a drop-in for the normal pdb.Pdb but does NOT
5432 functions like a drop-in for the normal pdb.Pdb but does NOT
5412 import readline by default. This way it doesn't muck up IPython's
5433 import readline by default. This way it doesn't muck up IPython's
5413 readline handling, and now tab-completion finally works in the
5434 readline handling, and now tab-completion finally works in the
5414 debugger -- sort of. It completes things globally visible, but the
5435 debugger -- sort of. It completes things globally visible, but the
5415 completer doesn't track the stack as pdb walks it. That's a bit
5436 completer doesn't track the stack as pdb walks it. That's a bit
5416 tricky, and I'll have to implement it later.
5437 tricky, and I'll have to implement it later.
5417
5438
5418 2002-05-05 Fernando Perez <fperez@colorado.edu>
5439 2002-05-05 Fernando Perez <fperez@colorado.edu>
5419
5440
5420 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5441 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5421 magic docstrings when printed via ? (explicit \'s were being
5442 magic docstrings when printed via ? (explicit \'s were being
5422 printed).
5443 printed).
5423
5444
5424 * IPython/ipmaker.py (make_IPython): fixed namespace
5445 * IPython/ipmaker.py (make_IPython): fixed namespace
5425 identification bug. Now variables loaded via logs or command-line
5446 identification bug. Now variables loaded via logs or command-line
5426 files are recognized in the interactive namespace by @who.
5447 files are recognized in the interactive namespace by @who.
5427
5448
5428 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5449 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5429 log replay system stemming from the string form of Structs.
5450 log replay system stemming from the string form of Structs.
5430
5451
5431 * IPython/Magic.py (Macro.__init__): improved macros to properly
5452 * IPython/Magic.py (Macro.__init__): improved macros to properly
5432 handle magic commands in them.
5453 handle magic commands in them.
5433 (Magic.magic_logstart): usernames are now expanded so 'logstart
5454 (Magic.magic_logstart): usernames are now expanded so 'logstart
5434 ~/mylog' now works.
5455 ~/mylog' now works.
5435
5456
5436 * IPython/iplib.py (complete): fixed bug where paths starting with
5457 * IPython/iplib.py (complete): fixed bug where paths starting with
5437 '/' would be completed as magic names.
5458 '/' would be completed as magic names.
5438
5459
5439 2002-05-04 Fernando Perez <fperez@colorado.edu>
5460 2002-05-04 Fernando Perez <fperez@colorado.edu>
5440
5461
5441 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5462 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5442 allow running full programs under the profiler's control.
5463 allow running full programs under the profiler's control.
5443
5464
5444 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5465 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5445 mode to report exceptions verbosely but without formatting
5466 mode to report exceptions verbosely but without formatting
5446 variables. This addresses the issue of ipython 'freezing' (it's
5467 variables. This addresses the issue of ipython 'freezing' (it's
5447 not frozen, but caught in an expensive formatting loop) when huge
5468 not frozen, but caught in an expensive formatting loop) when huge
5448 variables are in the context of an exception.
5469 variables are in the context of an exception.
5449 (VerboseTB.text): Added '--->' markers at line where exception was
5470 (VerboseTB.text): Added '--->' markers at line where exception was
5450 triggered. Much clearer to read, especially in NoColor modes.
5471 triggered. Much clearer to read, especially in NoColor modes.
5451
5472
5452 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5473 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5453 implemented in reverse when changing to the new parse_options().
5474 implemented in reverse when changing to the new parse_options().
5454
5475
5455 2002-05-03 Fernando Perez <fperez@colorado.edu>
5476 2002-05-03 Fernando Perez <fperez@colorado.edu>
5456
5477
5457 * IPython/Magic.py (Magic.parse_options): new function so that
5478 * IPython/Magic.py (Magic.parse_options): new function so that
5458 magics can parse options easier.
5479 magics can parse options easier.
5459 (Magic.magic_prun): new function similar to profile.run(),
5480 (Magic.magic_prun): new function similar to profile.run(),
5460 suggested by Chris Hart.
5481 suggested by Chris Hart.
5461 (Magic.magic_cd): fixed behavior so that it only changes if
5482 (Magic.magic_cd): fixed behavior so that it only changes if
5462 directory actually is in history.
5483 directory actually is in history.
5463
5484
5464 * IPython/usage.py (__doc__): added information about potential
5485 * IPython/usage.py (__doc__): added information about potential
5465 slowness of Verbose exception mode when there are huge data
5486 slowness of Verbose exception mode when there are huge data
5466 structures to be formatted (thanks to Archie Paulson).
5487 structures to be formatted (thanks to Archie Paulson).
5467
5488
5468 * IPython/ipmaker.py (make_IPython): Changed default logging
5489 * IPython/ipmaker.py (make_IPython): Changed default logging
5469 (when simply called with -log) to use curr_dir/ipython.log in
5490 (when simply called with -log) to use curr_dir/ipython.log in
5470 rotate mode. Fixed crash which was occuring with -log before
5491 rotate mode. Fixed crash which was occuring with -log before
5471 (thanks to Jim Boyle).
5492 (thanks to Jim Boyle).
5472
5493
5473 2002-05-01 Fernando Perez <fperez@colorado.edu>
5494 2002-05-01 Fernando Perez <fperez@colorado.edu>
5474
5495
5475 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5496 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5476 was nasty -- though somewhat of a corner case).
5497 was nasty -- though somewhat of a corner case).
5477
5498
5478 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5499 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5479 text (was a bug).
5500 text (was a bug).
5480
5501
5481 2002-04-30 Fernando Perez <fperez@colorado.edu>
5502 2002-04-30 Fernando Perez <fperez@colorado.edu>
5482
5503
5483 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5504 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5484 a print after ^D or ^C from the user so that the In[] prompt
5505 a print after ^D or ^C from the user so that the In[] prompt
5485 doesn't over-run the gnuplot one.
5506 doesn't over-run the gnuplot one.
5486
5507
5487 2002-04-29 Fernando Perez <fperez@colorado.edu>
5508 2002-04-29 Fernando Perez <fperez@colorado.edu>
5488
5509
5489 * Released 0.2.10
5510 * Released 0.2.10
5490
5511
5491 * IPython/__release__.py (version): get date dynamically.
5512 * IPython/__release__.py (version): get date dynamically.
5492
5513
5493 * Misc. documentation updates thanks to Arnd's comments. Also ran
5514 * Misc. documentation updates thanks to Arnd's comments. Also ran
5494 a full spellcheck on the manual (hadn't been done in a while).
5515 a full spellcheck on the manual (hadn't been done in a while).
5495
5516
5496 2002-04-27 Fernando Perez <fperez@colorado.edu>
5517 2002-04-27 Fernando Perez <fperez@colorado.edu>
5497
5518
5498 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5519 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5499 starting a log in mid-session would reset the input history list.
5520 starting a log in mid-session would reset the input history list.
5500
5521
5501 2002-04-26 Fernando Perez <fperez@colorado.edu>
5522 2002-04-26 Fernando Perez <fperez@colorado.edu>
5502
5523
5503 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5524 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5504 all files were being included in an update. Now anything in
5525 all files were being included in an update. Now anything in
5505 UserConfig that matches [A-Za-z]*.py will go (this excludes
5526 UserConfig that matches [A-Za-z]*.py will go (this excludes
5506 __init__.py)
5527 __init__.py)
5507
5528
5508 2002-04-25 Fernando Perez <fperez@colorado.edu>
5529 2002-04-25 Fernando Perez <fperez@colorado.edu>
5509
5530
5510 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5531 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5511 to __builtins__ so that any form of embedded or imported code can
5532 to __builtins__ so that any form of embedded or imported code can
5512 test for being inside IPython.
5533 test for being inside IPython.
5513
5534
5514 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5535 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5515 changed to GnuplotMagic because it's now an importable module,
5536 changed to GnuplotMagic because it's now an importable module,
5516 this makes the name follow that of the standard Gnuplot module.
5537 this makes the name follow that of the standard Gnuplot module.
5517 GnuplotMagic can now be loaded at any time in mid-session.
5538 GnuplotMagic can now be loaded at any time in mid-session.
5518
5539
5519 2002-04-24 Fernando Perez <fperez@colorado.edu>
5540 2002-04-24 Fernando Perez <fperez@colorado.edu>
5520
5541
5521 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5542 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5522 the globals (IPython has its own namespace) and the
5543 the globals (IPython has its own namespace) and the
5523 PhysicalQuantity stuff is much better anyway.
5544 PhysicalQuantity stuff is much better anyway.
5524
5545
5525 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5546 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5526 embedding example to standard user directory for
5547 embedding example to standard user directory for
5527 distribution. Also put it in the manual.
5548 distribution. Also put it in the manual.
5528
5549
5529 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5550 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5530 instance as first argument (so it doesn't rely on some obscure
5551 instance as first argument (so it doesn't rely on some obscure
5531 hidden global).
5552 hidden global).
5532
5553
5533 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5554 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5534 delimiters. While it prevents ().TAB from working, it allows
5555 delimiters. While it prevents ().TAB from working, it allows
5535 completions in open (... expressions. This is by far a more common
5556 completions in open (... expressions. This is by far a more common
5536 case.
5557 case.
5537
5558
5538 2002-04-23 Fernando Perez <fperez@colorado.edu>
5559 2002-04-23 Fernando Perez <fperez@colorado.edu>
5539
5560
5540 * IPython/Extensions/InterpreterPasteInput.py: new
5561 * IPython/Extensions/InterpreterPasteInput.py: new
5541 syntax-processing module for pasting lines with >>> or ... at the
5562 syntax-processing module for pasting lines with >>> or ... at the
5542 start.
5563 start.
5543
5564
5544 * IPython/Extensions/PhysicalQ_Interactive.py
5565 * IPython/Extensions/PhysicalQ_Interactive.py
5545 (PhysicalQuantityInteractive.__int__): fixed to work with either
5566 (PhysicalQuantityInteractive.__int__): fixed to work with either
5546 Numeric or math.
5567 Numeric or math.
5547
5568
5548 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5569 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5549 provided profiles. Now we have:
5570 provided profiles. Now we have:
5550 -math -> math module as * and cmath with its own namespace.
5571 -math -> math module as * and cmath with its own namespace.
5551 -numeric -> Numeric as *, plus gnuplot & grace
5572 -numeric -> Numeric as *, plus gnuplot & grace
5552 -physics -> same as before
5573 -physics -> same as before
5553
5574
5554 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5575 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5555 user-defined magics wouldn't be found by @magic if they were
5576 user-defined magics wouldn't be found by @magic if they were
5556 defined as class methods. Also cleaned up the namespace search
5577 defined as class methods. Also cleaned up the namespace search
5557 logic and the string building (to use %s instead of many repeated
5578 logic and the string building (to use %s instead of many repeated
5558 string adds).
5579 string adds).
5559
5580
5560 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5581 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5561 of user-defined magics to operate with class methods (cleaner, in
5582 of user-defined magics to operate with class methods (cleaner, in
5562 line with the gnuplot code).
5583 line with the gnuplot code).
5563
5584
5564 2002-04-22 Fernando Perez <fperez@colorado.edu>
5585 2002-04-22 Fernando Perez <fperez@colorado.edu>
5565
5586
5566 * setup.py: updated dependency list so that manual is updated when
5587 * setup.py: updated dependency list so that manual is updated when
5567 all included files change.
5588 all included files change.
5568
5589
5569 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5590 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5570 the delimiter removal option (the fix is ugly right now).
5591 the delimiter removal option (the fix is ugly right now).
5571
5592
5572 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5593 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5573 all of the math profile (quicker loading, no conflict between
5594 all of the math profile (quicker loading, no conflict between
5574 g-9.8 and g-gnuplot).
5595 g-9.8 and g-gnuplot).
5575
5596
5576 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5597 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5577 name of post-mortem files to IPython_crash_report.txt.
5598 name of post-mortem files to IPython_crash_report.txt.
5578
5599
5579 * Cleanup/update of the docs. Added all the new readline info and
5600 * Cleanup/update of the docs. Added all the new readline info and
5580 formatted all lists as 'real lists'.
5601 formatted all lists as 'real lists'.
5581
5602
5582 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5603 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5583 tab-completion options, since the full readline parse_and_bind is
5604 tab-completion options, since the full readline parse_and_bind is
5584 now accessible.
5605 now accessible.
5585
5606
5586 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5607 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5587 handling of readline options. Now users can specify any string to
5608 handling of readline options. Now users can specify any string to
5588 be passed to parse_and_bind(), as well as the delimiters to be
5609 be passed to parse_and_bind(), as well as the delimiters to be
5589 removed.
5610 removed.
5590 (InteractiveShell.__init__): Added __name__ to the global
5611 (InteractiveShell.__init__): Added __name__ to the global
5591 namespace so that things like Itpl which rely on its existence
5612 namespace so that things like Itpl which rely on its existence
5592 don't crash.
5613 don't crash.
5593 (InteractiveShell._prefilter): Defined the default with a _ so
5614 (InteractiveShell._prefilter): Defined the default with a _ so
5594 that prefilter() is easier to override, while the default one
5615 that prefilter() is easier to override, while the default one
5595 remains available.
5616 remains available.
5596
5617
5597 2002-04-18 Fernando Perez <fperez@colorado.edu>
5618 2002-04-18 Fernando Perez <fperez@colorado.edu>
5598
5619
5599 * Added information about pdb in the docs.
5620 * Added information about pdb in the docs.
5600
5621
5601 2002-04-17 Fernando Perez <fperez@colorado.edu>
5622 2002-04-17 Fernando Perez <fperez@colorado.edu>
5602
5623
5603 * IPython/ipmaker.py (make_IPython): added rc_override option to
5624 * IPython/ipmaker.py (make_IPython): added rc_override option to
5604 allow passing config options at creation time which may override
5625 allow passing config options at creation time which may override
5605 anything set in the config files or command line. This is
5626 anything set in the config files or command line. This is
5606 particularly useful for configuring embedded instances.
5627 particularly useful for configuring embedded instances.
5607
5628
5608 2002-04-15 Fernando Perez <fperez@colorado.edu>
5629 2002-04-15 Fernando Perez <fperez@colorado.edu>
5609
5630
5610 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5631 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5611 crash embedded instances because of the input cache falling out of
5632 crash embedded instances because of the input cache falling out of
5612 sync with the output counter.
5633 sync with the output counter.
5613
5634
5614 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5635 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5615 mode which calls pdb after an uncaught exception in IPython itself.
5636 mode which calls pdb after an uncaught exception in IPython itself.
5616
5637
5617 2002-04-14 Fernando Perez <fperez@colorado.edu>
5638 2002-04-14 Fernando Perez <fperez@colorado.edu>
5618
5639
5619 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5640 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5620 readline, fix it back after each call.
5641 readline, fix it back after each call.
5621
5642
5622 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5643 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5623 method to force all access via __call__(), which guarantees that
5644 method to force all access via __call__(), which guarantees that
5624 traceback references are properly deleted.
5645 traceback references are properly deleted.
5625
5646
5626 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5647 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5627 improve printing when pprint is in use.
5648 improve printing when pprint is in use.
5628
5649
5629 2002-04-13 Fernando Perez <fperez@colorado.edu>
5650 2002-04-13 Fernando Perez <fperez@colorado.edu>
5630
5651
5631 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5652 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5632 exceptions aren't caught anymore. If the user triggers one, he
5653 exceptions aren't caught anymore. If the user triggers one, he
5633 should know why he's doing it and it should go all the way up,
5654 should know why he's doing it and it should go all the way up,
5634 just like any other exception. So now @abort will fully kill the
5655 just like any other exception. So now @abort will fully kill the
5635 embedded interpreter and the embedding code (unless that happens
5656 embedded interpreter and the embedding code (unless that happens
5636 to catch SystemExit).
5657 to catch SystemExit).
5637
5658
5638 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5659 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5639 and a debugger() method to invoke the interactive pdb debugger
5660 and a debugger() method to invoke the interactive pdb debugger
5640 after printing exception information. Also added the corresponding
5661 after printing exception information. Also added the corresponding
5641 -pdb option and @pdb magic to control this feature, and updated
5662 -pdb option and @pdb magic to control this feature, and updated
5642 the docs. After a suggestion from Christopher Hart
5663 the docs. After a suggestion from Christopher Hart
5643 (hart-AT-caltech.edu).
5664 (hart-AT-caltech.edu).
5644
5665
5645 2002-04-12 Fernando Perez <fperez@colorado.edu>
5666 2002-04-12 Fernando Perez <fperez@colorado.edu>
5646
5667
5647 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5668 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5648 the exception handlers defined by the user (not the CrashHandler)
5669 the exception handlers defined by the user (not the CrashHandler)
5649 so that user exceptions don't trigger an ipython bug report.
5670 so that user exceptions don't trigger an ipython bug report.
5650
5671
5651 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5672 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5652 configurable (it should have always been so).
5673 configurable (it should have always been so).
5653
5674
5654 2002-03-26 Fernando Perez <fperez@colorado.edu>
5675 2002-03-26 Fernando Perez <fperez@colorado.edu>
5655
5676
5656 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5677 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5657 and there to fix embedding namespace issues. This should all be
5678 and there to fix embedding namespace issues. This should all be
5658 done in a more elegant way.
5679 done in a more elegant way.
5659
5680
5660 2002-03-25 Fernando Perez <fperez@colorado.edu>
5681 2002-03-25 Fernando Perez <fperez@colorado.edu>
5661
5682
5662 * IPython/genutils.py (get_home_dir): Try to make it work under
5683 * IPython/genutils.py (get_home_dir): Try to make it work under
5663 win9x also.
5684 win9x also.
5664
5685
5665 2002-03-20 Fernando Perez <fperez@colorado.edu>
5686 2002-03-20 Fernando Perez <fperez@colorado.edu>
5666
5687
5667 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5688 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5668 sys.displayhook untouched upon __init__.
5689 sys.displayhook untouched upon __init__.
5669
5690
5670 2002-03-19 Fernando Perez <fperez@colorado.edu>
5691 2002-03-19 Fernando Perez <fperez@colorado.edu>
5671
5692
5672 * Released 0.2.9 (for embedding bug, basically).
5693 * Released 0.2.9 (for embedding bug, basically).
5673
5694
5674 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5695 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5675 exceptions so that enclosing shell's state can be restored.
5696 exceptions so that enclosing shell's state can be restored.
5676
5697
5677 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5698 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5678 naming conventions in the .ipython/ dir.
5699 naming conventions in the .ipython/ dir.
5679
5700
5680 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5701 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5681 from delimiters list so filenames with - in them get expanded.
5702 from delimiters list so filenames with - in them get expanded.
5682
5703
5683 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5704 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5684 sys.displayhook not being properly restored after an embedded call.
5705 sys.displayhook not being properly restored after an embedded call.
5685
5706
5686 2002-03-18 Fernando Perez <fperez@colorado.edu>
5707 2002-03-18 Fernando Perez <fperez@colorado.edu>
5687
5708
5688 * Released 0.2.8
5709 * Released 0.2.8
5689
5710
5690 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5711 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5691 some files weren't being included in a -upgrade.
5712 some files weren't being included in a -upgrade.
5692 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5713 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5693 on' so that the first tab completes.
5714 on' so that the first tab completes.
5694 (InteractiveShell.handle_magic): fixed bug with spaces around
5715 (InteractiveShell.handle_magic): fixed bug with spaces around
5695 quotes breaking many magic commands.
5716 quotes breaking many magic commands.
5696
5717
5697 * setup.py: added note about ignoring the syntax error messages at
5718 * setup.py: added note about ignoring the syntax error messages at
5698 installation.
5719 installation.
5699
5720
5700 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5721 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5701 streamlining the gnuplot interface, now there's only one magic @gp.
5722 streamlining the gnuplot interface, now there's only one magic @gp.
5702
5723
5703 2002-03-17 Fernando Perez <fperez@colorado.edu>
5724 2002-03-17 Fernando Perez <fperez@colorado.edu>
5704
5725
5705 * IPython/UserConfig/magic_gnuplot.py: new name for the
5726 * IPython/UserConfig/magic_gnuplot.py: new name for the
5706 example-magic_pm.py file. Much enhanced system, now with a shell
5727 example-magic_pm.py file. Much enhanced system, now with a shell
5707 for communicating directly with gnuplot, one command at a time.
5728 for communicating directly with gnuplot, one command at a time.
5708
5729
5709 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5730 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5710 setting __name__=='__main__'.
5731 setting __name__=='__main__'.
5711
5732
5712 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5733 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5713 mini-shell for accessing gnuplot from inside ipython. Should
5734 mini-shell for accessing gnuplot from inside ipython. Should
5714 extend it later for grace access too. Inspired by Arnd's
5735 extend it later for grace access too. Inspired by Arnd's
5715 suggestion.
5736 suggestion.
5716
5737
5717 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5738 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5718 calling magic functions with () in their arguments. Thanks to Arnd
5739 calling magic functions with () in their arguments. Thanks to Arnd
5719 Baecker for pointing this to me.
5740 Baecker for pointing this to me.
5720
5741
5721 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5742 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5722 infinitely for integer or complex arrays (only worked with floats).
5743 infinitely for integer or complex arrays (only worked with floats).
5723
5744
5724 2002-03-16 Fernando Perez <fperez@colorado.edu>
5745 2002-03-16 Fernando Perez <fperez@colorado.edu>
5725
5746
5726 * setup.py: Merged setup and setup_windows into a single script
5747 * setup.py: Merged setup and setup_windows into a single script
5727 which properly handles things for windows users.
5748 which properly handles things for windows users.
5728
5749
5729 2002-03-15 Fernando Perez <fperez@colorado.edu>
5750 2002-03-15 Fernando Perez <fperez@colorado.edu>
5730
5751
5731 * Big change to the manual: now the magics are all automatically
5752 * Big change to the manual: now the magics are all automatically
5732 documented. This information is generated from their docstrings
5753 documented. This information is generated from their docstrings
5733 and put in a latex file included by the manual lyx file. This way
5754 and put in a latex file included by the manual lyx file. This way
5734 we get always up to date information for the magics. The manual
5755 we get always up to date information for the magics. The manual
5735 now also has proper version information, also auto-synced.
5756 now also has proper version information, also auto-synced.
5736
5757
5737 For this to work, an undocumented --magic_docstrings option was added.
5758 For this to work, an undocumented --magic_docstrings option was added.
5738
5759
5739 2002-03-13 Fernando Perez <fperez@colorado.edu>
5760 2002-03-13 Fernando Perez <fperez@colorado.edu>
5740
5761
5741 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5762 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5742 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5763 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5743
5764
5744 2002-03-12 Fernando Perez <fperez@colorado.edu>
5765 2002-03-12 Fernando Perez <fperez@colorado.edu>
5745
5766
5746 * IPython/ultraTB.py (TermColors): changed color escapes again to
5767 * IPython/ultraTB.py (TermColors): changed color escapes again to
5747 fix the (old, reintroduced) line-wrapping bug. Basically, if
5768 fix the (old, reintroduced) line-wrapping bug. Basically, if
5748 \001..\002 aren't given in the color escapes, lines get wrapped
5769 \001..\002 aren't given in the color escapes, lines get wrapped
5749 weirdly. But giving those screws up old xterms and emacs terms. So
5770 weirdly. But giving those screws up old xterms and emacs terms. So
5750 I added some logic for emacs terms to be ok, but I can't identify old
5771 I added some logic for emacs terms to be ok, but I can't identify old
5751 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5772 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5752
5773
5753 2002-03-10 Fernando Perez <fperez@colorado.edu>
5774 2002-03-10 Fernando Perez <fperez@colorado.edu>
5754
5775
5755 * IPython/usage.py (__doc__): Various documentation cleanups and
5776 * IPython/usage.py (__doc__): Various documentation cleanups and
5756 updates, both in usage docstrings and in the manual.
5777 updates, both in usage docstrings and in the manual.
5757
5778
5758 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5779 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5759 handling of caching. Set minimum acceptabe value for having a
5780 handling of caching. Set minimum acceptabe value for having a
5760 cache at 20 values.
5781 cache at 20 values.
5761
5782
5762 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5783 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5763 install_first_time function to a method, renamed it and added an
5784 install_first_time function to a method, renamed it and added an
5764 'upgrade' mode. Now people can update their config directory with
5785 'upgrade' mode. Now people can update their config directory with
5765 a simple command line switch (-upgrade, also new).
5786 a simple command line switch (-upgrade, also new).
5766
5787
5767 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5788 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5768 @file (convenient for automagic users under Python >= 2.2).
5789 @file (convenient for automagic users under Python >= 2.2).
5769 Removed @files (it seemed more like a plural than an abbrev. of
5790 Removed @files (it seemed more like a plural than an abbrev. of
5770 'file show').
5791 'file show').
5771
5792
5772 * IPython/iplib.py (install_first_time): Fixed crash if there were
5793 * IPython/iplib.py (install_first_time): Fixed crash if there were
5773 backup files ('~') in .ipython/ install directory.
5794 backup files ('~') in .ipython/ install directory.
5774
5795
5775 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5796 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5776 system. Things look fine, but these changes are fairly
5797 system. Things look fine, but these changes are fairly
5777 intrusive. Test them for a few days.
5798 intrusive. Test them for a few days.
5778
5799
5779 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5800 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5780 the prompts system. Now all in/out prompt strings are user
5801 the prompts system. Now all in/out prompt strings are user
5781 controllable. This is particularly useful for embedding, as one
5802 controllable. This is particularly useful for embedding, as one
5782 can tag embedded instances with particular prompts.
5803 can tag embedded instances with particular prompts.
5783
5804
5784 Also removed global use of sys.ps1/2, which now allows nested
5805 Also removed global use of sys.ps1/2, which now allows nested
5785 embeddings without any problems. Added command-line options for
5806 embeddings without any problems. Added command-line options for
5786 the prompt strings.
5807 the prompt strings.
5787
5808
5788 2002-03-08 Fernando Perez <fperez@colorado.edu>
5809 2002-03-08 Fernando Perez <fperez@colorado.edu>
5789
5810
5790 * IPython/UserConfig/example-embed-short.py (ipshell): added
5811 * IPython/UserConfig/example-embed-short.py (ipshell): added
5791 example file with the bare minimum code for embedding.
5812 example file with the bare minimum code for embedding.
5792
5813
5793 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5814 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5794 functionality for the embeddable shell to be activated/deactivated
5815 functionality for the embeddable shell to be activated/deactivated
5795 either globally or at each call.
5816 either globally or at each call.
5796
5817
5797 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5818 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5798 rewriting the prompt with '--->' for auto-inputs with proper
5819 rewriting the prompt with '--->' for auto-inputs with proper
5799 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5820 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5800 this is handled by the prompts class itself, as it should.
5821 this is handled by the prompts class itself, as it should.
5801
5822
5802 2002-03-05 Fernando Perez <fperez@colorado.edu>
5823 2002-03-05 Fernando Perez <fperez@colorado.edu>
5803
5824
5804 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5825 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5805 @logstart to avoid name clashes with the math log function.
5826 @logstart to avoid name clashes with the math log function.
5806
5827
5807 * Big updates to X/Emacs section of the manual.
5828 * Big updates to X/Emacs section of the manual.
5808
5829
5809 * Removed ipython_emacs. Milan explained to me how to pass
5830 * Removed ipython_emacs. Milan explained to me how to pass
5810 arguments to ipython through Emacs. Some day I'm going to end up
5831 arguments to ipython through Emacs. Some day I'm going to end up
5811 learning some lisp...
5832 learning some lisp...
5812
5833
5813 2002-03-04 Fernando Perez <fperez@colorado.edu>
5834 2002-03-04 Fernando Perez <fperez@colorado.edu>
5814
5835
5815 * IPython/ipython_emacs: Created script to be used as the
5836 * IPython/ipython_emacs: Created script to be used as the
5816 py-python-command Emacs variable so we can pass IPython
5837 py-python-command Emacs variable so we can pass IPython
5817 parameters. I can't figure out how to tell Emacs directly to pass
5838 parameters. I can't figure out how to tell Emacs directly to pass
5818 parameters to IPython, so a dummy shell script will do it.
5839 parameters to IPython, so a dummy shell script will do it.
5819
5840
5820 Other enhancements made for things to work better under Emacs'
5841 Other enhancements made for things to work better under Emacs'
5821 various types of terminals. Many thanks to Milan Zamazal
5842 various types of terminals. Many thanks to Milan Zamazal
5822 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5843 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5823
5844
5824 2002-03-01 Fernando Perez <fperez@colorado.edu>
5845 2002-03-01 Fernando Perez <fperez@colorado.edu>
5825
5846
5826 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5847 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5827 that loading of readline is now optional. This gives better
5848 that loading of readline is now optional. This gives better
5828 control to emacs users.
5849 control to emacs users.
5829
5850
5830 * IPython/ultraTB.py (__date__): Modified color escape sequences
5851 * IPython/ultraTB.py (__date__): Modified color escape sequences
5831 and now things work fine under xterm and in Emacs' term buffers
5852 and now things work fine under xterm and in Emacs' term buffers
5832 (though not shell ones). Well, in emacs you get colors, but all
5853 (though not shell ones). Well, in emacs you get colors, but all
5833 seem to be 'light' colors (no difference between dark and light
5854 seem to be 'light' colors (no difference between dark and light
5834 ones). But the garbage chars are gone, and also in xterms. It
5855 ones). But the garbage chars are gone, and also in xterms. It
5835 seems that now I'm using 'cleaner' ansi sequences.
5856 seems that now I'm using 'cleaner' ansi sequences.
5836
5857
5837 2002-02-21 Fernando Perez <fperez@colorado.edu>
5858 2002-02-21 Fernando Perez <fperez@colorado.edu>
5838
5859
5839 * Released 0.2.7 (mainly to publish the scoping fix).
5860 * Released 0.2.7 (mainly to publish the scoping fix).
5840
5861
5841 * IPython/Logger.py (Logger.logstate): added. A corresponding
5862 * IPython/Logger.py (Logger.logstate): added. A corresponding
5842 @logstate magic was created.
5863 @logstate magic was created.
5843
5864
5844 * IPython/Magic.py: fixed nested scoping problem under Python
5865 * IPython/Magic.py: fixed nested scoping problem under Python
5845 2.1.x (automagic wasn't working).
5866 2.1.x (automagic wasn't working).
5846
5867
5847 2002-02-20 Fernando Perez <fperez@colorado.edu>
5868 2002-02-20 Fernando Perez <fperez@colorado.edu>
5848
5869
5849 * Released 0.2.6.
5870 * Released 0.2.6.
5850
5871
5851 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5872 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5852 option so that logs can come out without any headers at all.
5873 option so that logs can come out without any headers at all.
5853
5874
5854 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5875 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5855 SciPy.
5876 SciPy.
5856
5877
5857 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5878 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5858 that embedded IPython calls don't require vars() to be explicitly
5879 that embedded IPython calls don't require vars() to be explicitly
5859 passed. Now they are extracted from the caller's frame (code
5880 passed. Now they are extracted from the caller's frame (code
5860 snatched from Eric Jones' weave). Added better documentation to
5881 snatched from Eric Jones' weave). Added better documentation to
5861 the section on embedding and the example file.
5882 the section on embedding and the example file.
5862
5883
5863 * IPython/genutils.py (page): Changed so that under emacs, it just
5884 * IPython/genutils.py (page): Changed so that under emacs, it just
5864 prints the string. You can then page up and down in the emacs
5885 prints the string. You can then page up and down in the emacs
5865 buffer itself. This is how the builtin help() works.
5886 buffer itself. This is how the builtin help() works.
5866
5887
5867 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5888 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5868 macro scoping: macros need to be executed in the user's namespace
5889 macro scoping: macros need to be executed in the user's namespace
5869 to work as if they had been typed by the user.
5890 to work as if they had been typed by the user.
5870
5891
5871 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5892 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5872 execute automatically (no need to type 'exec...'). They then
5893 execute automatically (no need to type 'exec...'). They then
5873 behave like 'true macros'. The printing system was also modified
5894 behave like 'true macros'. The printing system was also modified
5874 for this to work.
5895 for this to work.
5875
5896
5876 2002-02-19 Fernando Perez <fperez@colorado.edu>
5897 2002-02-19 Fernando Perez <fperez@colorado.edu>
5877
5898
5878 * IPython/genutils.py (page_file): new function for paging files
5899 * IPython/genutils.py (page_file): new function for paging files
5879 in an OS-independent way. Also necessary for file viewing to work
5900 in an OS-independent way. Also necessary for file viewing to work
5880 well inside Emacs buffers.
5901 well inside Emacs buffers.
5881 (page): Added checks for being in an emacs buffer.
5902 (page): Added checks for being in an emacs buffer.
5882 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5903 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5883 same bug in iplib.
5904 same bug in iplib.
5884
5905
5885 2002-02-18 Fernando Perez <fperez@colorado.edu>
5906 2002-02-18 Fernando Perez <fperez@colorado.edu>
5886
5907
5887 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5908 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5888 of readline so that IPython can work inside an Emacs buffer.
5909 of readline so that IPython can work inside an Emacs buffer.
5889
5910
5890 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5911 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5891 method signatures (they weren't really bugs, but it looks cleaner
5912 method signatures (they weren't really bugs, but it looks cleaner
5892 and keeps PyChecker happy).
5913 and keeps PyChecker happy).
5893
5914
5894 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5915 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5895 for implementing various user-defined hooks. Currently only
5916 for implementing various user-defined hooks. Currently only
5896 display is done.
5917 display is done.
5897
5918
5898 * IPython/Prompts.py (CachedOutput._display): changed display
5919 * IPython/Prompts.py (CachedOutput._display): changed display
5899 functions so that they can be dynamically changed by users easily.
5920 functions so that they can be dynamically changed by users easily.
5900
5921
5901 * IPython/Extensions/numeric_formats.py (num_display): added an
5922 * IPython/Extensions/numeric_formats.py (num_display): added an
5902 extension for printing NumPy arrays in flexible manners. It
5923 extension for printing NumPy arrays in flexible manners. It
5903 doesn't do anything yet, but all the structure is in
5924 doesn't do anything yet, but all the structure is in
5904 place. Ultimately the plan is to implement output format control
5925 place. Ultimately the plan is to implement output format control
5905 like in Octave.
5926 like in Octave.
5906
5927
5907 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5928 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5908 methods are found at run-time by all the automatic machinery.
5929 methods are found at run-time by all the automatic machinery.
5909
5930
5910 2002-02-17 Fernando Perez <fperez@colorado.edu>
5931 2002-02-17 Fernando Perez <fperez@colorado.edu>
5911
5932
5912 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5933 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5913 whole file a little.
5934 whole file a little.
5914
5935
5915 * ToDo: closed this document. Now there's a new_design.lyx
5936 * ToDo: closed this document. Now there's a new_design.lyx
5916 document for all new ideas. Added making a pdf of it for the
5937 document for all new ideas. Added making a pdf of it for the
5917 end-user distro.
5938 end-user distro.
5918
5939
5919 * IPython/Logger.py (Logger.switch_log): Created this to replace
5940 * IPython/Logger.py (Logger.switch_log): Created this to replace
5920 logon() and logoff(). It also fixes a nasty crash reported by
5941 logon() and logoff(). It also fixes a nasty crash reported by
5921 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5942 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5922
5943
5923 * IPython/iplib.py (complete): got auto-completion to work with
5944 * IPython/iplib.py (complete): got auto-completion to work with
5924 automagic (I had wanted this for a long time).
5945 automagic (I had wanted this for a long time).
5925
5946
5926 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5947 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5927 to @file, since file() is now a builtin and clashes with automagic
5948 to @file, since file() is now a builtin and clashes with automagic
5928 for @file.
5949 for @file.
5929
5950
5930 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5951 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5931 of this was previously in iplib, which had grown to more than 2000
5952 of this was previously in iplib, which had grown to more than 2000
5932 lines, way too long. No new functionality, but it makes managing
5953 lines, way too long. No new functionality, but it makes managing
5933 the code a bit easier.
5954 the code a bit easier.
5934
5955
5935 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5956 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5936 information to crash reports.
5957 information to crash reports.
5937
5958
5938 2002-02-12 Fernando Perez <fperez@colorado.edu>
5959 2002-02-12 Fernando Perez <fperez@colorado.edu>
5939
5960
5940 * Released 0.2.5.
5961 * Released 0.2.5.
5941
5962
5942 2002-02-11 Fernando Perez <fperez@colorado.edu>
5963 2002-02-11 Fernando Perez <fperez@colorado.edu>
5943
5964
5944 * Wrote a relatively complete Windows installer. It puts
5965 * Wrote a relatively complete Windows installer. It puts
5945 everything in place, creates Start Menu entries and fixes the
5966 everything in place, creates Start Menu entries and fixes the
5946 color issues. Nothing fancy, but it works.
5967 color issues. Nothing fancy, but it works.
5947
5968
5948 2002-02-10 Fernando Perez <fperez@colorado.edu>
5969 2002-02-10 Fernando Perez <fperez@colorado.edu>
5949
5970
5950 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5971 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5951 os.path.expanduser() call so that we can type @run ~/myfile.py and
5972 os.path.expanduser() call so that we can type @run ~/myfile.py and
5952 have thigs work as expected.
5973 have thigs work as expected.
5953
5974
5954 * IPython/genutils.py (page): fixed exception handling so things
5975 * IPython/genutils.py (page): fixed exception handling so things
5955 work both in Unix and Windows correctly. Quitting a pager triggers
5976 work both in Unix and Windows correctly. Quitting a pager triggers
5956 an IOError/broken pipe in Unix, and in windows not finding a pager
5977 an IOError/broken pipe in Unix, and in windows not finding a pager
5957 is also an IOError, so I had to actually look at the return value
5978 is also an IOError, so I had to actually look at the return value
5958 of the exception, not just the exception itself. Should be ok now.
5979 of the exception, not just the exception itself. Should be ok now.
5959
5980
5960 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5981 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5961 modified to allow case-insensitive color scheme changes.
5982 modified to allow case-insensitive color scheme changes.
5962
5983
5963 2002-02-09 Fernando Perez <fperez@colorado.edu>
5984 2002-02-09 Fernando Perez <fperez@colorado.edu>
5964
5985
5965 * IPython/genutils.py (native_line_ends): new function to leave
5986 * IPython/genutils.py (native_line_ends): new function to leave
5966 user config files with os-native line-endings.
5987 user config files with os-native line-endings.
5967
5988
5968 * README and manual updates.
5989 * README and manual updates.
5969
5990
5970 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5991 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5971 instead of StringType to catch Unicode strings.
5992 instead of StringType to catch Unicode strings.
5972
5993
5973 * IPython/genutils.py (filefind): fixed bug for paths with
5994 * IPython/genutils.py (filefind): fixed bug for paths with
5974 embedded spaces (very common in Windows).
5995 embedded spaces (very common in Windows).
5975
5996
5976 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5997 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5977 files under Windows, so that they get automatically associated
5998 files under Windows, so that they get automatically associated
5978 with a text editor. Windows makes it a pain to handle
5999 with a text editor. Windows makes it a pain to handle
5979 extension-less files.
6000 extension-less files.
5980
6001
5981 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6002 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5982 warning about readline only occur for Posix. In Windows there's no
6003 warning about readline only occur for Posix. In Windows there's no
5983 way to get readline, so why bother with the warning.
6004 way to get readline, so why bother with the warning.
5984
6005
5985 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6006 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5986 for __str__ instead of dir(self), since dir() changed in 2.2.
6007 for __str__ instead of dir(self), since dir() changed in 2.2.
5987
6008
5988 * Ported to Windows! Tested on XP, I suspect it should work fine
6009 * Ported to Windows! Tested on XP, I suspect it should work fine
5989 on NT/2000, but I don't think it will work on 98 et al. That
6010 on NT/2000, but I don't think it will work on 98 et al. That
5990 series of Windows is such a piece of junk anyway that I won't try
6011 series of Windows is such a piece of junk anyway that I won't try
5991 porting it there. The XP port was straightforward, showed a few
6012 porting it there. The XP port was straightforward, showed a few
5992 bugs here and there (fixed all), in particular some string
6013 bugs here and there (fixed all), in particular some string
5993 handling stuff which required considering Unicode strings (which
6014 handling stuff which required considering Unicode strings (which
5994 Windows uses). This is good, but hasn't been too tested :) No
6015 Windows uses). This is good, but hasn't been too tested :) No
5995 fancy installer yet, I'll put a note in the manual so people at
6016 fancy installer yet, I'll put a note in the manual so people at
5996 least make manually a shortcut.
6017 least make manually a shortcut.
5997
6018
5998 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6019 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5999 into a single one, "colors". This now controls both prompt and
6020 into a single one, "colors". This now controls both prompt and
6000 exception color schemes, and can be changed both at startup
6021 exception color schemes, and can be changed both at startup
6001 (either via command-line switches or via ipythonrc files) and at
6022 (either via command-line switches or via ipythonrc files) and at
6002 runtime, with @colors.
6023 runtime, with @colors.
6003 (Magic.magic_run): renamed @prun to @run and removed the old
6024 (Magic.magic_run): renamed @prun to @run and removed the old
6004 @run. The two were too similar to warrant keeping both.
6025 @run. The two were too similar to warrant keeping both.
6005
6026
6006 2002-02-03 Fernando Perez <fperez@colorado.edu>
6027 2002-02-03 Fernando Perez <fperez@colorado.edu>
6007
6028
6008 * IPython/iplib.py (install_first_time): Added comment on how to
6029 * IPython/iplib.py (install_first_time): Added comment on how to
6009 configure the color options for first-time users. Put a <return>
6030 configure the color options for first-time users. Put a <return>
6010 request at the end so that small-terminal users get a chance to
6031 request at the end so that small-terminal users get a chance to
6011 read the startup info.
6032 read the startup info.
6012
6033
6013 2002-01-23 Fernando Perez <fperez@colorado.edu>
6034 2002-01-23 Fernando Perez <fperez@colorado.edu>
6014
6035
6015 * IPython/iplib.py (CachedOutput.update): Changed output memory
6036 * IPython/iplib.py (CachedOutput.update): Changed output memory
6016 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6037 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6017 input history we still use _i. Did this b/c these variable are
6038 input history we still use _i. Did this b/c these variable are
6018 very commonly used in interactive work, so the less we need to
6039 very commonly used in interactive work, so the less we need to
6019 type the better off we are.
6040 type the better off we are.
6020 (Magic.magic_prun): updated @prun to better handle the namespaces
6041 (Magic.magic_prun): updated @prun to better handle the namespaces
6021 the file will run in, including a fix for __name__ not being set
6042 the file will run in, including a fix for __name__ not being set
6022 before.
6043 before.
6023
6044
6024 2002-01-20 Fernando Perez <fperez@colorado.edu>
6045 2002-01-20 Fernando Perez <fperez@colorado.edu>
6025
6046
6026 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6047 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6027 extra garbage for Python 2.2. Need to look more carefully into
6048 extra garbage for Python 2.2. Need to look more carefully into
6028 this later.
6049 this later.
6029
6050
6030 2002-01-19 Fernando Perez <fperez@colorado.edu>
6051 2002-01-19 Fernando Perez <fperez@colorado.edu>
6031
6052
6032 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6053 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6033 display SyntaxError exceptions properly formatted when they occur
6054 display SyntaxError exceptions properly formatted when they occur
6034 (they can be triggered by imported code).
6055 (they can be triggered by imported code).
6035
6056
6036 2002-01-18 Fernando Perez <fperez@colorado.edu>
6057 2002-01-18 Fernando Perez <fperez@colorado.edu>
6037
6058
6038 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6059 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6039 SyntaxError exceptions are reported nicely formatted, instead of
6060 SyntaxError exceptions are reported nicely formatted, instead of
6040 spitting out only offset information as before.
6061 spitting out only offset information as before.
6041 (Magic.magic_prun): Added the @prun function for executing
6062 (Magic.magic_prun): Added the @prun function for executing
6042 programs with command line args inside IPython.
6063 programs with command line args inside IPython.
6043
6064
6044 2002-01-16 Fernando Perez <fperez@colorado.edu>
6065 2002-01-16 Fernando Perez <fperez@colorado.edu>
6045
6066
6046 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6067 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6047 to *not* include the last item given in a range. This brings their
6068 to *not* include the last item given in a range. This brings their
6048 behavior in line with Python's slicing:
6069 behavior in line with Python's slicing:
6049 a[n1:n2] -> a[n1]...a[n2-1]
6070 a[n1:n2] -> a[n1]...a[n2-1]
6050 It may be a bit less convenient, but I prefer to stick to Python's
6071 It may be a bit less convenient, but I prefer to stick to Python's
6051 conventions *everywhere*, so users never have to wonder.
6072 conventions *everywhere*, so users never have to wonder.
6052 (Magic.magic_macro): Added @macro function to ease the creation of
6073 (Magic.magic_macro): Added @macro function to ease the creation of
6053 macros.
6074 macros.
6054
6075
6055 2002-01-05 Fernando Perez <fperez@colorado.edu>
6076 2002-01-05 Fernando Perez <fperez@colorado.edu>
6056
6077
6057 * Released 0.2.4.
6078 * Released 0.2.4.
6058
6079
6059 * IPython/iplib.py (Magic.magic_pdef):
6080 * IPython/iplib.py (Magic.magic_pdef):
6060 (InteractiveShell.safe_execfile): report magic lines and error
6081 (InteractiveShell.safe_execfile): report magic lines and error
6061 lines without line numbers so one can easily copy/paste them for
6082 lines without line numbers so one can easily copy/paste them for
6062 re-execution.
6083 re-execution.
6063
6084
6064 * Updated manual with recent changes.
6085 * Updated manual with recent changes.
6065
6086
6066 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6087 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6067 docstring printing when class? is called. Very handy for knowing
6088 docstring printing when class? is called. Very handy for knowing
6068 how to create class instances (as long as __init__ is well
6089 how to create class instances (as long as __init__ is well
6069 documented, of course :)
6090 documented, of course :)
6070 (Magic.magic_doc): print both class and constructor docstrings.
6091 (Magic.magic_doc): print both class and constructor docstrings.
6071 (Magic.magic_pdef): give constructor info if passed a class and
6092 (Magic.magic_pdef): give constructor info if passed a class and
6072 __call__ info for callable object instances.
6093 __call__ info for callable object instances.
6073
6094
6074 2002-01-04 Fernando Perez <fperez@colorado.edu>
6095 2002-01-04 Fernando Perez <fperez@colorado.edu>
6075
6096
6076 * Made deep_reload() off by default. It doesn't always work
6097 * Made deep_reload() off by default. It doesn't always work
6077 exactly as intended, so it's probably safer to have it off. It's
6098 exactly as intended, so it's probably safer to have it off. It's
6078 still available as dreload() anyway, so nothing is lost.
6099 still available as dreload() anyway, so nothing is lost.
6079
6100
6080 2002-01-02 Fernando Perez <fperez@colorado.edu>
6101 2002-01-02 Fernando Perez <fperez@colorado.edu>
6081
6102
6082 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6103 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6083 so I wanted an updated release).
6104 so I wanted an updated release).
6084
6105
6085 2001-12-27 Fernando Perez <fperez@colorado.edu>
6106 2001-12-27 Fernando Perez <fperez@colorado.edu>
6086
6107
6087 * IPython/iplib.py (InteractiveShell.interact): Added the original
6108 * IPython/iplib.py (InteractiveShell.interact): Added the original
6088 code from 'code.py' for this module in order to change the
6109 code from 'code.py' for this module in order to change the
6089 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6110 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6090 the history cache would break when the user hit Ctrl-C, and
6111 the history cache would break when the user hit Ctrl-C, and
6091 interact() offers no way to add any hooks to it.
6112 interact() offers no way to add any hooks to it.
6092
6113
6093 2001-12-23 Fernando Perez <fperez@colorado.edu>
6114 2001-12-23 Fernando Perez <fperez@colorado.edu>
6094
6115
6095 * setup.py: added check for 'MANIFEST' before trying to remove
6116 * setup.py: added check for 'MANIFEST' before trying to remove
6096 it. Thanks to Sean Reifschneider.
6117 it. Thanks to Sean Reifschneider.
6097
6118
6098 2001-12-22 Fernando Perez <fperez@colorado.edu>
6119 2001-12-22 Fernando Perez <fperez@colorado.edu>
6099
6120
6100 * Released 0.2.2.
6121 * Released 0.2.2.
6101
6122
6102 * Finished (reasonably) writing the manual. Later will add the
6123 * Finished (reasonably) writing the manual. Later will add the
6103 python-standard navigation stylesheets, but for the time being
6124 python-standard navigation stylesheets, but for the time being
6104 it's fairly complete. Distribution will include html and pdf
6125 it's fairly complete. Distribution will include html and pdf
6105 versions.
6126 versions.
6106
6127
6107 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6128 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6108 (MayaVi author).
6129 (MayaVi author).
6109
6130
6110 2001-12-21 Fernando Perez <fperez@colorado.edu>
6131 2001-12-21 Fernando Perez <fperez@colorado.edu>
6111
6132
6112 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6133 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6113 good public release, I think (with the manual and the distutils
6134 good public release, I think (with the manual and the distutils
6114 installer). The manual can use some work, but that can go
6135 installer). The manual can use some work, but that can go
6115 slowly. Otherwise I think it's quite nice for end users. Next
6136 slowly. Otherwise I think it's quite nice for end users. Next
6116 summer, rewrite the guts of it...
6137 summer, rewrite the guts of it...
6117
6138
6118 * Changed format of ipythonrc files to use whitespace as the
6139 * Changed format of ipythonrc files to use whitespace as the
6119 separator instead of an explicit '='. Cleaner.
6140 separator instead of an explicit '='. Cleaner.
6120
6141
6121 2001-12-20 Fernando Perez <fperez@colorado.edu>
6142 2001-12-20 Fernando Perez <fperez@colorado.edu>
6122
6143
6123 * Started a manual in LyX. For now it's just a quick merge of the
6144 * Started a manual in LyX. For now it's just a quick merge of the
6124 various internal docstrings and READMEs. Later it may grow into a
6145 various internal docstrings and READMEs. Later it may grow into a
6125 nice, full-blown manual.
6146 nice, full-blown manual.
6126
6147
6127 * Set up a distutils based installer. Installation should now be
6148 * Set up a distutils based installer. Installation should now be
6128 trivially simple for end-users.
6149 trivially simple for end-users.
6129
6150
6130 2001-12-11 Fernando Perez <fperez@colorado.edu>
6151 2001-12-11 Fernando Perez <fperez@colorado.edu>
6131
6152
6132 * Released 0.2.0. First public release, announced it at
6153 * Released 0.2.0. First public release, announced it at
6133 comp.lang.python. From now on, just bugfixes...
6154 comp.lang.python. From now on, just bugfixes...
6134
6155
6135 * Went through all the files, set copyright/license notices and
6156 * Went through all the files, set copyright/license notices and
6136 cleaned up things. Ready for release.
6157 cleaned up things. Ready for release.
6137
6158
6138 2001-12-10 Fernando Perez <fperez@colorado.edu>
6159 2001-12-10 Fernando Perez <fperez@colorado.edu>
6139
6160
6140 * Changed the first-time installer not to use tarfiles. It's more
6161 * Changed the first-time installer not to use tarfiles. It's more
6141 robust now and less unix-dependent. Also makes it easier for
6162 robust now and less unix-dependent. Also makes it easier for
6142 people to later upgrade versions.
6163 people to later upgrade versions.
6143
6164
6144 * Changed @exit to @abort to reflect the fact that it's pretty
6165 * Changed @exit to @abort to reflect the fact that it's pretty
6145 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6166 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6146 becomes significant only when IPyhton is embedded: in that case,
6167 becomes significant only when IPyhton is embedded: in that case,
6147 C-D closes IPython only, but @abort kills the enclosing program
6168 C-D closes IPython only, but @abort kills the enclosing program
6148 too (unless it had called IPython inside a try catching
6169 too (unless it had called IPython inside a try catching
6149 SystemExit).
6170 SystemExit).
6150
6171
6151 * Created Shell module which exposes the actuall IPython Shell
6172 * Created Shell module which exposes the actuall IPython Shell
6152 classes, currently the normal and the embeddable one. This at
6173 classes, currently the normal and the embeddable one. This at
6153 least offers a stable interface we won't need to change when
6174 least offers a stable interface we won't need to change when
6154 (later) the internals are rewritten. That rewrite will be confined
6175 (later) the internals are rewritten. That rewrite will be confined
6155 to iplib and ipmaker, but the Shell interface should remain as is.
6176 to iplib and ipmaker, but the Shell interface should remain as is.
6156
6177
6157 * Added embed module which offers an embeddable IPShell object,
6178 * Added embed module which offers an embeddable IPShell object,
6158 useful to fire up IPython *inside* a running program. Great for
6179 useful to fire up IPython *inside* a running program. Great for
6159 debugging or dynamical data analysis.
6180 debugging or dynamical data analysis.
6160
6181
6161 2001-12-08 Fernando Perez <fperez@colorado.edu>
6182 2001-12-08 Fernando Perez <fperez@colorado.edu>
6162
6183
6163 * Fixed small bug preventing seeing info from methods of defined
6184 * Fixed small bug preventing seeing info from methods of defined
6164 objects (incorrect namespace in _ofind()).
6185 objects (incorrect namespace in _ofind()).
6165
6186
6166 * Documentation cleanup. Moved the main usage docstrings to a
6187 * Documentation cleanup. Moved the main usage docstrings to a
6167 separate file, usage.py (cleaner to maintain, and hopefully in the
6188 separate file, usage.py (cleaner to maintain, and hopefully in the
6168 future some perlpod-like way of producing interactive, man and
6189 future some perlpod-like way of producing interactive, man and
6169 html docs out of it will be found).
6190 html docs out of it will be found).
6170
6191
6171 * Added @profile to see your profile at any time.
6192 * Added @profile to see your profile at any time.
6172
6193
6173 * Added @p as an alias for 'print'. It's especially convenient if
6194 * Added @p as an alias for 'print'. It's especially convenient if
6174 using automagic ('p x' prints x).
6195 using automagic ('p x' prints x).
6175
6196
6176 * Small cleanups and fixes after a pychecker run.
6197 * Small cleanups and fixes after a pychecker run.
6177
6198
6178 * Changed the @cd command to handle @cd - and @cd -<n> for
6199 * Changed the @cd command to handle @cd - and @cd -<n> for
6179 visiting any directory in _dh.
6200 visiting any directory in _dh.
6180
6201
6181 * Introduced _dh, a history of visited directories. @dhist prints
6202 * Introduced _dh, a history of visited directories. @dhist prints
6182 it out with numbers.
6203 it out with numbers.
6183
6204
6184 2001-12-07 Fernando Perez <fperez@colorado.edu>
6205 2001-12-07 Fernando Perez <fperez@colorado.edu>
6185
6206
6186 * Released 0.1.22
6207 * Released 0.1.22
6187
6208
6188 * Made initialization a bit more robust against invalid color
6209 * Made initialization a bit more robust against invalid color
6189 options in user input (exit, not traceback-crash).
6210 options in user input (exit, not traceback-crash).
6190
6211
6191 * Changed the bug crash reporter to write the report only in the
6212 * Changed the bug crash reporter to write the report only in the
6192 user's .ipython directory. That way IPython won't litter people's
6213 user's .ipython directory. That way IPython won't litter people's
6193 hard disks with crash files all over the place. Also print on
6214 hard disks with crash files all over the place. Also print on
6194 screen the necessary mail command.
6215 screen the necessary mail command.
6195
6216
6196 * With the new ultraTB, implemented LightBG color scheme for light
6217 * With the new ultraTB, implemented LightBG color scheme for light
6197 background terminals. A lot of people like white backgrounds, so I
6218 background terminals. A lot of people like white backgrounds, so I
6198 guess we should at least give them something readable.
6219 guess we should at least give them something readable.
6199
6220
6200 2001-12-06 Fernando Perez <fperez@colorado.edu>
6221 2001-12-06 Fernando Perez <fperez@colorado.edu>
6201
6222
6202 * Modified the structure of ultraTB. Now there's a proper class
6223 * Modified the structure of ultraTB. Now there's a proper class
6203 for tables of color schemes which allow adding schemes easily and
6224 for tables of color schemes which allow adding schemes easily and
6204 switching the active scheme without creating a new instance every
6225 switching the active scheme without creating a new instance every
6205 time (which was ridiculous). The syntax for creating new schemes
6226 time (which was ridiculous). The syntax for creating new schemes
6206 is also cleaner. I think ultraTB is finally done, with a clean
6227 is also cleaner. I think ultraTB is finally done, with a clean
6207 class structure. Names are also much cleaner (now there's proper
6228 class structure. Names are also much cleaner (now there's proper
6208 color tables, no need for every variable to also have 'color' in
6229 color tables, no need for every variable to also have 'color' in
6209 its name).
6230 its name).
6210
6231
6211 * Broke down genutils into separate files. Now genutils only
6232 * Broke down genutils into separate files. Now genutils only
6212 contains utility functions, and classes have been moved to their
6233 contains utility functions, and classes have been moved to their
6213 own files (they had enough independent functionality to warrant
6234 own files (they had enough independent functionality to warrant
6214 it): ConfigLoader, OutputTrap, Struct.
6235 it): ConfigLoader, OutputTrap, Struct.
6215
6236
6216 2001-12-05 Fernando Perez <fperez@colorado.edu>
6237 2001-12-05 Fernando Perez <fperez@colorado.edu>
6217
6238
6218 * IPython turns 21! Released version 0.1.21, as a candidate for
6239 * IPython turns 21! Released version 0.1.21, as a candidate for
6219 public consumption. If all goes well, release in a few days.
6240 public consumption. If all goes well, release in a few days.
6220
6241
6221 * Fixed path bug (files in Extensions/ directory wouldn't be found
6242 * Fixed path bug (files in Extensions/ directory wouldn't be found
6222 unless IPython/ was explicitly in sys.path).
6243 unless IPython/ was explicitly in sys.path).
6223
6244
6224 * Extended the FlexCompleter class as MagicCompleter to allow
6245 * Extended the FlexCompleter class as MagicCompleter to allow
6225 completion of @-starting lines.
6246 completion of @-starting lines.
6226
6247
6227 * Created __release__.py file as a central repository for release
6248 * Created __release__.py file as a central repository for release
6228 info that other files can read from.
6249 info that other files can read from.
6229
6250
6230 * Fixed small bug in logging: when logging was turned on in
6251 * Fixed small bug in logging: when logging was turned on in
6231 mid-session, old lines with special meanings (!@?) were being
6252 mid-session, old lines with special meanings (!@?) were being
6232 logged without the prepended comment, which is necessary since
6253 logged without the prepended comment, which is necessary since
6233 they are not truly valid python syntax. This should make session
6254 they are not truly valid python syntax. This should make session
6234 restores produce less errors.
6255 restores produce less errors.
6235
6256
6236 * The namespace cleanup forced me to make a FlexCompleter class
6257 * The namespace cleanup forced me to make a FlexCompleter class
6237 which is nothing but a ripoff of rlcompleter, but with selectable
6258 which is nothing but a ripoff of rlcompleter, but with selectable
6238 namespace (rlcompleter only works in __main__.__dict__). I'll try
6259 namespace (rlcompleter only works in __main__.__dict__). I'll try
6239 to submit a note to the authors to see if this change can be
6260 to submit a note to the authors to see if this change can be
6240 incorporated in future rlcompleter releases (Dec.6: done)
6261 incorporated in future rlcompleter releases (Dec.6: done)
6241
6262
6242 * More fixes to namespace handling. It was a mess! Now all
6263 * More fixes to namespace handling. It was a mess! Now all
6243 explicit references to __main__.__dict__ are gone (except when
6264 explicit references to __main__.__dict__ are gone (except when
6244 really needed) and everything is handled through the namespace
6265 really needed) and everything is handled through the namespace
6245 dicts in the IPython instance. We seem to be getting somewhere
6266 dicts in the IPython instance. We seem to be getting somewhere
6246 with this, finally...
6267 with this, finally...
6247
6268
6248 * Small documentation updates.
6269 * Small documentation updates.
6249
6270
6250 * Created the Extensions directory under IPython (with an
6271 * Created the Extensions directory under IPython (with an
6251 __init__.py). Put the PhysicalQ stuff there. This directory should
6272 __init__.py). Put the PhysicalQ stuff there. This directory should
6252 be used for all special-purpose extensions.
6273 be used for all special-purpose extensions.
6253
6274
6254 * File renaming:
6275 * File renaming:
6255 ipythonlib --> ipmaker
6276 ipythonlib --> ipmaker
6256 ipplib --> iplib
6277 ipplib --> iplib
6257 This makes a bit more sense in terms of what these files actually do.
6278 This makes a bit more sense in terms of what these files actually do.
6258
6279
6259 * Moved all the classes and functions in ipythonlib to ipplib, so
6280 * Moved all the classes and functions in ipythonlib to ipplib, so
6260 now ipythonlib only has make_IPython(). This will ease up its
6281 now ipythonlib only has make_IPython(). This will ease up its
6261 splitting in smaller functional chunks later.
6282 splitting in smaller functional chunks later.
6262
6283
6263 * Cleaned up (done, I think) output of @whos. Better column
6284 * Cleaned up (done, I think) output of @whos. Better column
6264 formatting, and now shows str(var) for as much as it can, which is
6285 formatting, and now shows str(var) for as much as it can, which is
6265 typically what one gets with a 'print var'.
6286 typically what one gets with a 'print var'.
6266
6287
6267 2001-12-04 Fernando Perez <fperez@colorado.edu>
6288 2001-12-04 Fernando Perez <fperez@colorado.edu>
6268
6289
6269 * Fixed namespace problems. Now builtin/IPyhton/user names get
6290 * Fixed namespace problems. Now builtin/IPyhton/user names get
6270 properly reported in their namespace. Internal namespace handling
6291 properly reported in their namespace. Internal namespace handling
6271 is finally getting decent (not perfect yet, but much better than
6292 is finally getting decent (not perfect yet, but much better than
6272 the ad-hoc mess we had).
6293 the ad-hoc mess we had).
6273
6294
6274 * Removed -exit option. If people just want to run a python
6295 * Removed -exit option. If people just want to run a python
6275 script, that's what the normal interpreter is for. Less
6296 script, that's what the normal interpreter is for. Less
6276 unnecessary options, less chances for bugs.
6297 unnecessary options, less chances for bugs.
6277
6298
6278 * Added a crash handler which generates a complete post-mortem if
6299 * Added a crash handler which generates a complete post-mortem if
6279 IPython crashes. This will help a lot in tracking bugs down the
6300 IPython crashes. This will help a lot in tracking bugs down the
6280 road.
6301 road.
6281
6302
6282 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6303 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6283 which were boud to functions being reassigned would bypass the
6304 which were boud to functions being reassigned would bypass the
6284 logger, breaking the sync of _il with the prompt counter. This
6305 logger, breaking the sync of _il with the prompt counter. This
6285 would then crash IPython later when a new line was logged.
6306 would then crash IPython later when a new line was logged.
6286
6307
6287 2001-12-02 Fernando Perez <fperez@colorado.edu>
6308 2001-12-02 Fernando Perez <fperez@colorado.edu>
6288
6309
6289 * Made IPython a package. This means people don't have to clutter
6310 * Made IPython a package. This means people don't have to clutter
6290 their sys.path with yet another directory. Changed the INSTALL
6311 their sys.path with yet another directory. Changed the INSTALL
6291 file accordingly.
6312 file accordingly.
6292
6313
6293 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6314 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6294 sorts its output (so @who shows it sorted) and @whos formats the
6315 sorts its output (so @who shows it sorted) and @whos formats the
6295 table according to the width of the first column. Nicer, easier to
6316 table according to the width of the first column. Nicer, easier to
6296 read. Todo: write a generic table_format() which takes a list of
6317 read. Todo: write a generic table_format() which takes a list of
6297 lists and prints it nicely formatted, with optional row/column
6318 lists and prints it nicely formatted, with optional row/column
6298 separators and proper padding and justification.
6319 separators and proper padding and justification.
6299
6320
6300 * Released 0.1.20
6321 * Released 0.1.20
6301
6322
6302 * Fixed bug in @log which would reverse the inputcache list (a
6323 * Fixed bug in @log which would reverse the inputcache list (a
6303 copy operation was missing).
6324 copy operation was missing).
6304
6325
6305 * Code cleanup. @config was changed to use page(). Better, since
6326 * Code cleanup. @config was changed to use page(). Better, since
6306 its output is always quite long.
6327 its output is always quite long.
6307
6328
6308 * Itpl is back as a dependency. I was having too many problems
6329 * Itpl is back as a dependency. I was having too many problems
6309 getting the parametric aliases to work reliably, and it's just
6330 getting the parametric aliases to work reliably, and it's just
6310 easier to code weird string operations with it than playing %()s
6331 easier to code weird string operations with it than playing %()s
6311 games. It's only ~6k, so I don't think it's too big a deal.
6332 games. It's only ~6k, so I don't think it's too big a deal.
6312
6333
6313 * Found (and fixed) a very nasty bug with history. !lines weren't
6334 * Found (and fixed) a very nasty bug with history. !lines weren't
6314 getting cached, and the out of sync caches would crash
6335 getting cached, and the out of sync caches would crash
6315 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6336 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6316 division of labor a bit better. Bug fixed, cleaner structure.
6337 division of labor a bit better. Bug fixed, cleaner structure.
6317
6338
6318 2001-12-01 Fernando Perez <fperez@colorado.edu>
6339 2001-12-01 Fernando Perez <fperez@colorado.edu>
6319
6340
6320 * Released 0.1.19
6341 * Released 0.1.19
6321
6342
6322 * Added option -n to @hist to prevent line number printing. Much
6343 * Added option -n to @hist to prevent line number printing. Much
6323 easier to copy/paste code this way.
6344 easier to copy/paste code this way.
6324
6345
6325 * Created global _il to hold the input list. Allows easy
6346 * Created global _il to hold the input list. Allows easy
6326 re-execution of blocks of code by slicing it (inspired by Janko's
6347 re-execution of blocks of code by slicing it (inspired by Janko's
6327 comment on 'macros').
6348 comment on 'macros').
6328
6349
6329 * Small fixes and doc updates.
6350 * Small fixes and doc updates.
6330
6351
6331 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6352 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6332 much too fragile with automagic. Handles properly multi-line
6353 much too fragile with automagic. Handles properly multi-line
6333 statements and takes parameters.
6354 statements and takes parameters.
6334
6355
6335 2001-11-30 Fernando Perez <fperez@colorado.edu>
6356 2001-11-30 Fernando Perez <fperez@colorado.edu>
6336
6357
6337 * Version 0.1.18 released.
6358 * Version 0.1.18 released.
6338
6359
6339 * Fixed nasty namespace bug in initial module imports.
6360 * Fixed nasty namespace bug in initial module imports.
6340
6361
6341 * Added copyright/license notes to all code files (except
6362 * Added copyright/license notes to all code files (except
6342 DPyGetOpt). For the time being, LGPL. That could change.
6363 DPyGetOpt). For the time being, LGPL. That could change.
6343
6364
6344 * Rewrote a much nicer README, updated INSTALL, cleaned up
6365 * Rewrote a much nicer README, updated INSTALL, cleaned up
6345 ipythonrc-* samples.
6366 ipythonrc-* samples.
6346
6367
6347 * Overall code/documentation cleanup. Basically ready for
6368 * Overall code/documentation cleanup. Basically ready for
6348 release. Only remaining thing: licence decision (LGPL?).
6369 release. Only remaining thing: licence decision (LGPL?).
6349
6370
6350 * Converted load_config to a class, ConfigLoader. Now recursion
6371 * Converted load_config to a class, ConfigLoader. Now recursion
6351 control is better organized. Doesn't include the same file twice.
6372 control is better organized. Doesn't include the same file twice.
6352
6373
6353 2001-11-29 Fernando Perez <fperez@colorado.edu>
6374 2001-11-29 Fernando Perez <fperez@colorado.edu>
6354
6375
6355 * Got input history working. Changed output history variables from
6376 * Got input history working. Changed output history variables from
6356 _p to _o so that _i is for input and _o for output. Just cleaner
6377 _p to _o so that _i is for input and _o for output. Just cleaner
6357 convention.
6378 convention.
6358
6379
6359 * Implemented parametric aliases. This pretty much allows the
6380 * Implemented parametric aliases. This pretty much allows the
6360 alias system to offer full-blown shell convenience, I think.
6381 alias system to offer full-blown shell convenience, I think.
6361
6382
6362 * Version 0.1.17 released, 0.1.18 opened.
6383 * Version 0.1.17 released, 0.1.18 opened.
6363
6384
6364 * dot_ipython/ipythonrc (alias): added documentation.
6385 * dot_ipython/ipythonrc (alias): added documentation.
6365 (xcolor): Fixed small bug (xcolors -> xcolor)
6386 (xcolor): Fixed small bug (xcolors -> xcolor)
6366
6387
6367 * Changed the alias system. Now alias is a magic command to define
6388 * Changed the alias system. Now alias is a magic command to define
6368 aliases just like the shell. Rationale: the builtin magics should
6389 aliases just like the shell. Rationale: the builtin magics should
6369 be there for things deeply connected to IPython's
6390 be there for things deeply connected to IPython's
6370 architecture. And this is a much lighter system for what I think
6391 architecture. And this is a much lighter system for what I think
6371 is the really important feature: allowing users to define quickly
6392 is the really important feature: allowing users to define quickly
6372 magics that will do shell things for them, so they can customize
6393 magics that will do shell things for them, so they can customize
6373 IPython easily to match their work habits. If someone is really
6394 IPython easily to match their work habits. If someone is really
6374 desperate to have another name for a builtin alias, they can
6395 desperate to have another name for a builtin alias, they can
6375 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6396 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6376 works.
6397 works.
6377
6398
6378 2001-11-28 Fernando Perez <fperez@colorado.edu>
6399 2001-11-28 Fernando Perez <fperez@colorado.edu>
6379
6400
6380 * Changed @file so that it opens the source file at the proper
6401 * Changed @file so that it opens the source file at the proper
6381 line. Since it uses less, if your EDITOR environment is
6402 line. Since it uses less, if your EDITOR environment is
6382 configured, typing v will immediately open your editor of choice
6403 configured, typing v will immediately open your editor of choice
6383 right at the line where the object is defined. Not as quick as
6404 right at the line where the object is defined. Not as quick as
6384 having a direct @edit command, but for all intents and purposes it
6405 having a direct @edit command, but for all intents and purposes it
6385 works. And I don't have to worry about writing @edit to deal with
6406 works. And I don't have to worry about writing @edit to deal with
6386 all the editors, less does that.
6407 all the editors, less does that.
6387
6408
6388 * Version 0.1.16 released, 0.1.17 opened.
6409 * Version 0.1.16 released, 0.1.17 opened.
6389
6410
6390 * Fixed some nasty bugs in the page/page_dumb combo that could
6411 * Fixed some nasty bugs in the page/page_dumb combo that could
6391 crash IPython.
6412 crash IPython.
6392
6413
6393 2001-11-27 Fernando Perez <fperez@colorado.edu>
6414 2001-11-27 Fernando Perez <fperez@colorado.edu>
6394
6415
6395 * Version 0.1.15 released, 0.1.16 opened.
6416 * Version 0.1.15 released, 0.1.16 opened.
6396
6417
6397 * Finally got ? and ?? to work for undefined things: now it's
6418 * Finally got ? and ?? to work for undefined things: now it's
6398 possible to type {}.get? and get information about the get method
6419 possible to type {}.get? and get information about the get method
6399 of dicts, or os.path? even if only os is defined (so technically
6420 of dicts, or os.path? even if only os is defined (so technically
6400 os.path isn't). Works at any level. For example, after import os,
6421 os.path isn't). Works at any level. For example, after import os,
6401 os?, os.path?, os.path.abspath? all work. This is great, took some
6422 os?, os.path?, os.path.abspath? all work. This is great, took some
6402 work in _ofind.
6423 work in _ofind.
6403
6424
6404 * Fixed more bugs with logging. The sanest way to do it was to add
6425 * Fixed more bugs with logging. The sanest way to do it was to add
6405 to @log a 'mode' parameter. Killed two in one shot (this mode
6426 to @log a 'mode' parameter. Killed two in one shot (this mode
6406 option was a request of Janko's). I think it's finally clean
6427 option was a request of Janko's). I think it's finally clean
6407 (famous last words).
6428 (famous last words).
6408
6429
6409 * Added a page_dumb() pager which does a decent job of paging on
6430 * Added a page_dumb() pager which does a decent job of paging on
6410 screen, if better things (like less) aren't available. One less
6431 screen, if better things (like less) aren't available. One less
6411 unix dependency (someday maybe somebody will port this to
6432 unix dependency (someday maybe somebody will port this to
6412 windows).
6433 windows).
6413
6434
6414 * Fixed problem in magic_log: would lock of logging out if log
6435 * Fixed problem in magic_log: would lock of logging out if log
6415 creation failed (because it would still think it had succeeded).
6436 creation failed (because it would still think it had succeeded).
6416
6437
6417 * Improved the page() function using curses to auto-detect screen
6438 * Improved the page() function using curses to auto-detect screen
6418 size. Now it can make a much better decision on whether to print
6439 size. Now it can make a much better decision on whether to print
6419 or page a string. Option screen_length was modified: a value 0
6440 or page a string. Option screen_length was modified: a value 0
6420 means auto-detect, and that's the default now.
6441 means auto-detect, and that's the default now.
6421
6442
6422 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6443 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6423 go out. I'll test it for a few days, then talk to Janko about
6444 go out. I'll test it for a few days, then talk to Janko about
6424 licences and announce it.
6445 licences and announce it.
6425
6446
6426 * Fixed the length of the auto-generated ---> prompt which appears
6447 * Fixed the length of the auto-generated ---> prompt which appears
6427 for auto-parens and auto-quotes. Getting this right isn't trivial,
6448 for auto-parens and auto-quotes. Getting this right isn't trivial,
6428 with all the color escapes, different prompt types and optional
6449 with all the color escapes, different prompt types and optional
6429 separators. But it seems to be working in all the combinations.
6450 separators. But it seems to be working in all the combinations.
6430
6451
6431 2001-11-26 Fernando Perez <fperez@colorado.edu>
6452 2001-11-26 Fernando Perez <fperez@colorado.edu>
6432
6453
6433 * Wrote a regexp filter to get option types from the option names
6454 * Wrote a regexp filter to get option types from the option names
6434 string. This eliminates the need to manually keep two duplicate
6455 string. This eliminates the need to manually keep two duplicate
6435 lists.
6456 lists.
6436
6457
6437 * Removed the unneeded check_option_names. Now options are handled
6458 * Removed the unneeded check_option_names. Now options are handled
6438 in a much saner manner and it's easy to visually check that things
6459 in a much saner manner and it's easy to visually check that things
6439 are ok.
6460 are ok.
6440
6461
6441 * Updated version numbers on all files I modified to carry a
6462 * Updated version numbers on all files I modified to carry a
6442 notice so Janko and Nathan have clear version markers.
6463 notice so Janko and Nathan have clear version markers.
6443
6464
6444 * Updated docstring for ultraTB with my changes. I should send
6465 * Updated docstring for ultraTB with my changes. I should send
6445 this to Nathan.
6466 this to Nathan.
6446
6467
6447 * Lots of small fixes. Ran everything through pychecker again.
6468 * Lots of small fixes. Ran everything through pychecker again.
6448
6469
6449 * Made loading of deep_reload an cmd line option. If it's not too
6470 * Made loading of deep_reload an cmd line option. If it's not too
6450 kosher, now people can just disable it. With -nodeep_reload it's
6471 kosher, now people can just disable it. With -nodeep_reload it's
6451 still available as dreload(), it just won't overwrite reload().
6472 still available as dreload(), it just won't overwrite reload().
6452
6473
6453 * Moved many options to the no| form (-opt and -noopt
6474 * Moved many options to the no| form (-opt and -noopt
6454 accepted). Cleaner.
6475 accepted). Cleaner.
6455
6476
6456 * Changed magic_log so that if called with no parameters, it uses
6477 * Changed magic_log so that if called with no parameters, it uses
6457 'rotate' mode. That way auto-generated logs aren't automatically
6478 'rotate' mode. That way auto-generated logs aren't automatically
6458 over-written. For normal logs, now a backup is made if it exists
6479 over-written. For normal logs, now a backup is made if it exists
6459 (only 1 level of backups). A new 'backup' mode was added to the
6480 (only 1 level of backups). A new 'backup' mode was added to the
6460 Logger class to support this. This was a request by Janko.
6481 Logger class to support this. This was a request by Janko.
6461
6482
6462 * Added @logoff/@logon to stop/restart an active log.
6483 * Added @logoff/@logon to stop/restart an active log.
6463
6484
6464 * Fixed a lot of bugs in log saving/replay. It was pretty
6485 * Fixed a lot of bugs in log saving/replay. It was pretty
6465 broken. Now special lines (!@,/) appear properly in the command
6486 broken. Now special lines (!@,/) appear properly in the command
6466 history after a log replay.
6487 history after a log replay.
6467
6488
6468 * Tried and failed to implement full session saving via pickle. My
6489 * Tried and failed to implement full session saving via pickle. My
6469 idea was to pickle __main__.__dict__, but modules can't be
6490 idea was to pickle __main__.__dict__, but modules can't be
6470 pickled. This would be a better alternative to replaying logs, but
6491 pickled. This would be a better alternative to replaying logs, but
6471 seems quite tricky to get to work. Changed -session to be called
6492 seems quite tricky to get to work. Changed -session to be called
6472 -logplay, which more accurately reflects what it does. And if we
6493 -logplay, which more accurately reflects what it does. And if we
6473 ever get real session saving working, -session is now available.
6494 ever get real session saving working, -session is now available.
6474
6495
6475 * Implemented color schemes for prompts also. As for tracebacks,
6496 * Implemented color schemes for prompts also. As for tracebacks,
6476 currently only NoColor and Linux are supported. But now the
6497 currently only NoColor and Linux are supported. But now the
6477 infrastructure is in place, based on a generic ColorScheme
6498 infrastructure is in place, based on a generic ColorScheme
6478 class. So writing and activating new schemes both for the prompts
6499 class. So writing and activating new schemes both for the prompts
6479 and the tracebacks should be straightforward.
6500 and the tracebacks should be straightforward.
6480
6501
6481 * Version 0.1.13 released, 0.1.14 opened.
6502 * Version 0.1.13 released, 0.1.14 opened.
6482
6503
6483 * Changed handling of options for output cache. Now counter is
6504 * Changed handling of options for output cache. Now counter is
6484 hardwired starting at 1 and one specifies the maximum number of
6505 hardwired starting at 1 and one specifies the maximum number of
6485 entries *in the outcache* (not the max prompt counter). This is
6506 entries *in the outcache* (not the max prompt counter). This is
6486 much better, since many statements won't increase the cache
6507 much better, since many statements won't increase the cache
6487 count. It also eliminated some confusing options, now there's only
6508 count. It also eliminated some confusing options, now there's only
6488 one: cache_size.
6509 one: cache_size.
6489
6510
6490 * Added 'alias' magic function and magic_alias option in the
6511 * Added 'alias' magic function and magic_alias option in the
6491 ipythonrc file. Now the user can easily define whatever names he
6512 ipythonrc file. Now the user can easily define whatever names he
6492 wants for the magic functions without having to play weird
6513 wants for the magic functions without having to play weird
6493 namespace games. This gives IPython a real shell-like feel.
6514 namespace games. This gives IPython a real shell-like feel.
6494
6515
6495 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6516 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6496 @ or not).
6517 @ or not).
6497
6518
6498 This was one of the last remaining 'visible' bugs (that I know
6519 This was one of the last remaining 'visible' bugs (that I know
6499 of). I think if I can clean up the session loading so it works
6520 of). I think if I can clean up the session loading so it works
6500 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6521 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6501 about licensing).
6522 about licensing).
6502
6523
6503 2001-11-25 Fernando Perez <fperez@colorado.edu>
6524 2001-11-25 Fernando Perez <fperez@colorado.edu>
6504
6525
6505 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6526 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6506 there's a cleaner distinction between what ? and ?? show.
6527 there's a cleaner distinction between what ? and ?? show.
6507
6528
6508 * Added screen_length option. Now the user can define his own
6529 * Added screen_length option. Now the user can define his own
6509 screen size for page() operations.
6530 screen size for page() operations.
6510
6531
6511 * Implemented magic shell-like functions with automatic code
6532 * Implemented magic shell-like functions with automatic code
6512 generation. Now adding another function is just a matter of adding
6533 generation. Now adding another function is just a matter of adding
6513 an entry to a dict, and the function is dynamically generated at
6534 an entry to a dict, and the function is dynamically generated at
6514 run-time. Python has some really cool features!
6535 run-time. Python has some really cool features!
6515
6536
6516 * Renamed many options to cleanup conventions a little. Now all
6537 * Renamed many options to cleanup conventions a little. Now all
6517 are lowercase, and only underscores where needed. Also in the code
6538 are lowercase, and only underscores where needed. Also in the code
6518 option name tables are clearer.
6539 option name tables are clearer.
6519
6540
6520 * Changed prompts a little. Now input is 'In [n]:' instead of
6541 * Changed prompts a little. Now input is 'In [n]:' instead of
6521 'In[n]:='. This allows it the numbers to be aligned with the
6542 'In[n]:='. This allows it the numbers to be aligned with the
6522 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6543 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6523 Python (it was a Mathematica thing). The '...' continuation prompt
6544 Python (it was a Mathematica thing). The '...' continuation prompt
6524 was also changed a little to align better.
6545 was also changed a little to align better.
6525
6546
6526 * Fixed bug when flushing output cache. Not all _p<n> variables
6547 * Fixed bug when flushing output cache. Not all _p<n> variables
6527 exist, so their deletion needs to be wrapped in a try:
6548 exist, so their deletion needs to be wrapped in a try:
6528
6549
6529 * Figured out how to properly use inspect.formatargspec() (it
6550 * Figured out how to properly use inspect.formatargspec() (it
6530 requires the args preceded by *). So I removed all the code from
6551 requires the args preceded by *). So I removed all the code from
6531 _get_pdef in Magic, which was just replicating that.
6552 _get_pdef in Magic, which was just replicating that.
6532
6553
6533 * Added test to prefilter to allow redefining magic function names
6554 * Added test to prefilter to allow redefining magic function names
6534 as variables. This is ok, since the @ form is always available,
6555 as variables. This is ok, since the @ form is always available,
6535 but whe should allow the user to define a variable called 'ls' if
6556 but whe should allow the user to define a variable called 'ls' if
6536 he needs it.
6557 he needs it.
6537
6558
6538 * Moved the ToDo information from README into a separate ToDo.
6559 * Moved the ToDo information from README into a separate ToDo.
6539
6560
6540 * General code cleanup and small bugfixes. I think it's close to a
6561 * General code cleanup and small bugfixes. I think it's close to a
6541 state where it can be released, obviously with a big 'beta'
6562 state where it can be released, obviously with a big 'beta'
6542 warning on it.
6563 warning on it.
6543
6564
6544 * Got the magic function split to work. Now all magics are defined
6565 * Got the magic function split to work. Now all magics are defined
6545 in a separate class. It just organizes things a bit, and now
6566 in a separate class. It just organizes things a bit, and now
6546 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6567 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6547 was too long).
6568 was too long).
6548
6569
6549 * Changed @clear to @reset to avoid potential confusions with
6570 * Changed @clear to @reset to avoid potential confusions with
6550 the shell command clear. Also renamed @cl to @clear, which does
6571 the shell command clear. Also renamed @cl to @clear, which does
6551 exactly what people expect it to from their shell experience.
6572 exactly what people expect it to from their shell experience.
6552
6573
6553 Added a check to the @reset command (since it's so
6574 Added a check to the @reset command (since it's so
6554 destructive, it's probably a good idea to ask for confirmation).
6575 destructive, it's probably a good idea to ask for confirmation).
6555 But now reset only works for full namespace resetting. Since the
6576 But now reset only works for full namespace resetting. Since the
6556 del keyword is already there for deleting a few specific
6577 del keyword is already there for deleting a few specific
6557 variables, I don't see the point of having a redundant magic
6578 variables, I don't see the point of having a redundant magic
6558 function for the same task.
6579 function for the same task.
6559
6580
6560 2001-11-24 Fernando Perez <fperez@colorado.edu>
6581 2001-11-24 Fernando Perez <fperez@colorado.edu>
6561
6582
6562 * Updated the builtin docs (esp. the ? ones).
6583 * Updated the builtin docs (esp. the ? ones).
6563
6584
6564 * Ran all the code through pychecker. Not terribly impressed with
6585 * Ran all the code through pychecker. Not terribly impressed with
6565 it: lots of spurious warnings and didn't really find anything of
6586 it: lots of spurious warnings and didn't really find anything of
6566 substance (just a few modules being imported and not used).
6587 substance (just a few modules being imported and not used).
6567
6588
6568 * Implemented the new ultraTB functionality into IPython. New
6589 * Implemented the new ultraTB functionality into IPython. New
6569 option: xcolors. This chooses color scheme. xmode now only selects
6590 option: xcolors. This chooses color scheme. xmode now only selects
6570 between Plain and Verbose. Better orthogonality.
6591 between Plain and Verbose. Better orthogonality.
6571
6592
6572 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6593 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6573 mode and color scheme for the exception handlers. Now it's
6594 mode and color scheme for the exception handlers. Now it's
6574 possible to have the verbose traceback with no coloring.
6595 possible to have the verbose traceback with no coloring.
6575
6596
6576 2001-11-23 Fernando Perez <fperez@colorado.edu>
6597 2001-11-23 Fernando Perez <fperez@colorado.edu>
6577
6598
6578 * Version 0.1.12 released, 0.1.13 opened.
6599 * Version 0.1.12 released, 0.1.13 opened.
6579
6600
6580 * Removed option to set auto-quote and auto-paren escapes by
6601 * Removed option to set auto-quote and auto-paren escapes by
6581 user. The chances of breaking valid syntax are just too high. If
6602 user. The chances of breaking valid syntax are just too high. If
6582 someone *really* wants, they can always dig into the code.
6603 someone *really* wants, they can always dig into the code.
6583
6604
6584 * Made prompt separators configurable.
6605 * Made prompt separators configurable.
6585
6606
6586 2001-11-22 Fernando Perez <fperez@colorado.edu>
6607 2001-11-22 Fernando Perez <fperez@colorado.edu>
6587
6608
6588 * Small bugfixes in many places.
6609 * Small bugfixes in many places.
6589
6610
6590 * Removed the MyCompleter class from ipplib. It seemed redundant
6611 * Removed the MyCompleter class from ipplib. It seemed redundant
6591 with the C-p,C-n history search functionality. Less code to
6612 with the C-p,C-n history search functionality. Less code to
6592 maintain.
6613 maintain.
6593
6614
6594 * Moved all the original ipython.py code into ipythonlib.py. Right
6615 * Moved all the original ipython.py code into ipythonlib.py. Right
6595 now it's just one big dump into a function called make_IPython, so
6616 now it's just one big dump into a function called make_IPython, so
6596 no real modularity has been gained. But at least it makes the
6617 no real modularity has been gained. But at least it makes the
6597 wrapper script tiny, and since ipythonlib is a module, it gets
6618 wrapper script tiny, and since ipythonlib is a module, it gets
6598 compiled and startup is much faster.
6619 compiled and startup is much faster.
6599
6620
6600 This is a reasobably 'deep' change, so we should test it for a
6621 This is a reasobably 'deep' change, so we should test it for a
6601 while without messing too much more with the code.
6622 while without messing too much more with the code.
6602
6623
6603 2001-11-21 Fernando Perez <fperez@colorado.edu>
6624 2001-11-21 Fernando Perez <fperez@colorado.edu>
6604
6625
6605 * Version 0.1.11 released, 0.1.12 opened for further work.
6626 * Version 0.1.11 released, 0.1.12 opened for further work.
6606
6627
6607 * Removed dependency on Itpl. It was only needed in one place. It
6628 * Removed dependency on Itpl. It was only needed in one place. It
6608 would be nice if this became part of python, though. It makes life
6629 would be nice if this became part of python, though. It makes life
6609 *a lot* easier in some cases.
6630 *a lot* easier in some cases.
6610
6631
6611 * Simplified the prefilter code a bit. Now all handlers are
6632 * Simplified the prefilter code a bit. Now all handlers are
6612 expected to explicitly return a value (at least a blank string).
6633 expected to explicitly return a value (at least a blank string).
6613
6634
6614 * Heavy edits in ipplib. Removed the help system altogether. Now
6635 * Heavy edits in ipplib. Removed the help system altogether. Now
6615 obj?/?? is used for inspecting objects, a magic @doc prints
6636 obj?/?? is used for inspecting objects, a magic @doc prints
6616 docstrings, and full-blown Python help is accessed via the 'help'
6637 docstrings, and full-blown Python help is accessed via the 'help'
6617 keyword. This cleans up a lot of code (less to maintain) and does
6638 keyword. This cleans up a lot of code (less to maintain) and does
6618 the job. Since 'help' is now a standard Python component, might as
6639 the job. Since 'help' is now a standard Python component, might as
6619 well use it and remove duplicate functionality.
6640 well use it and remove duplicate functionality.
6620
6641
6621 Also removed the option to use ipplib as a standalone program. By
6642 Also removed the option to use ipplib as a standalone program. By
6622 now it's too dependent on other parts of IPython to function alone.
6643 now it's too dependent on other parts of IPython to function alone.
6623
6644
6624 * Fixed bug in genutils.pager. It would crash if the pager was
6645 * Fixed bug in genutils.pager. It would crash if the pager was
6625 exited immediately after opening (broken pipe).
6646 exited immediately after opening (broken pipe).
6626
6647
6627 * Trimmed down the VerboseTB reporting a little. The header is
6648 * Trimmed down the VerboseTB reporting a little. The header is
6628 much shorter now and the repeated exception arguments at the end
6649 much shorter now and the repeated exception arguments at the end
6629 have been removed. For interactive use the old header seemed a bit
6650 have been removed. For interactive use the old header seemed a bit
6630 excessive.
6651 excessive.
6631
6652
6632 * Fixed small bug in output of @whos for variables with multi-word
6653 * Fixed small bug in output of @whos for variables with multi-word
6633 types (only first word was displayed).
6654 types (only first word was displayed).
6634
6655
6635 2001-11-17 Fernando Perez <fperez@colorado.edu>
6656 2001-11-17 Fernando Perez <fperez@colorado.edu>
6636
6657
6637 * Version 0.1.10 released, 0.1.11 opened for further work.
6658 * Version 0.1.10 released, 0.1.11 opened for further work.
6638
6659
6639 * Modified dirs and friends. dirs now *returns* the stack (not
6660 * Modified dirs and friends. dirs now *returns* the stack (not
6640 prints), so one can manipulate it as a variable. Convenient to
6661 prints), so one can manipulate it as a variable. Convenient to
6641 travel along many directories.
6662 travel along many directories.
6642
6663
6643 * Fixed bug in magic_pdef: would only work with functions with
6664 * Fixed bug in magic_pdef: would only work with functions with
6644 arguments with default values.
6665 arguments with default values.
6645
6666
6646 2001-11-14 Fernando Perez <fperez@colorado.edu>
6667 2001-11-14 Fernando Perez <fperez@colorado.edu>
6647
6668
6648 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6669 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6649 example with IPython. Various other minor fixes and cleanups.
6670 example with IPython. Various other minor fixes and cleanups.
6650
6671
6651 * Version 0.1.9 released, 0.1.10 opened for further work.
6672 * Version 0.1.9 released, 0.1.10 opened for further work.
6652
6673
6653 * Added sys.path to the list of directories searched in the
6674 * Added sys.path to the list of directories searched in the
6654 execfile= option. It used to be the current directory and the
6675 execfile= option. It used to be the current directory and the
6655 user's IPYTHONDIR only.
6676 user's IPYTHONDIR only.
6656
6677
6657 2001-11-13 Fernando Perez <fperez@colorado.edu>
6678 2001-11-13 Fernando Perez <fperez@colorado.edu>
6658
6679
6659 * Reinstated the raw_input/prefilter separation that Janko had
6680 * Reinstated the raw_input/prefilter separation that Janko had
6660 initially. This gives a more convenient setup for extending the
6681 initially. This gives a more convenient setup for extending the
6661 pre-processor from the outside: raw_input always gets a string,
6682 pre-processor from the outside: raw_input always gets a string,
6662 and prefilter has to process it. We can then redefine prefilter
6683 and prefilter has to process it. We can then redefine prefilter
6663 from the outside and implement extensions for special
6684 from the outside and implement extensions for special
6664 purposes.
6685 purposes.
6665
6686
6666 Today I got one for inputting PhysicalQuantity objects
6687 Today I got one for inputting PhysicalQuantity objects
6667 (from Scientific) without needing any function calls at
6688 (from Scientific) without needing any function calls at
6668 all. Extremely convenient, and it's all done as a user-level
6689 all. Extremely convenient, and it's all done as a user-level
6669 extension (no IPython code was touched). Now instead of:
6690 extension (no IPython code was touched). Now instead of:
6670 a = PhysicalQuantity(4.2,'m/s**2')
6691 a = PhysicalQuantity(4.2,'m/s**2')
6671 one can simply say
6692 one can simply say
6672 a = 4.2 m/s**2
6693 a = 4.2 m/s**2
6673 or even
6694 or even
6674 a = 4.2 m/s^2
6695 a = 4.2 m/s^2
6675
6696
6676 I use this, but it's also a proof of concept: IPython really is
6697 I use this, but it's also a proof of concept: IPython really is
6677 fully user-extensible, even at the level of the parsing of the
6698 fully user-extensible, even at the level of the parsing of the
6678 command line. It's not trivial, but it's perfectly doable.
6699 command line. It's not trivial, but it's perfectly doable.
6679
6700
6680 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6701 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6681 the problem of modules being loaded in the inverse order in which
6702 the problem of modules being loaded in the inverse order in which
6682 they were defined in
6703 they were defined in
6683
6704
6684 * Version 0.1.8 released, 0.1.9 opened for further work.
6705 * Version 0.1.8 released, 0.1.9 opened for further work.
6685
6706
6686 * Added magics pdef, source and file. They respectively show the
6707 * Added magics pdef, source and file. They respectively show the
6687 definition line ('prototype' in C), source code and full python
6708 definition line ('prototype' in C), source code and full python
6688 file for any callable object. The object inspector oinfo uses
6709 file for any callable object. The object inspector oinfo uses
6689 these to show the same information.
6710 these to show the same information.
6690
6711
6691 * Version 0.1.7 released, 0.1.8 opened for further work.
6712 * Version 0.1.7 released, 0.1.8 opened for further work.
6692
6713
6693 * Separated all the magic functions into a class called Magic. The
6714 * Separated all the magic functions into a class called Magic. The
6694 InteractiveShell class was becoming too big for Xemacs to handle
6715 InteractiveShell class was becoming too big for Xemacs to handle
6695 (de-indenting a line would lock it up for 10 seconds while it
6716 (de-indenting a line would lock it up for 10 seconds while it
6696 backtracked on the whole class!)
6717 backtracked on the whole class!)
6697
6718
6698 FIXME: didn't work. It can be done, but right now namespaces are
6719 FIXME: didn't work. It can be done, but right now namespaces are
6699 all messed up. Do it later (reverted it for now, so at least
6720 all messed up. Do it later (reverted it for now, so at least
6700 everything works as before).
6721 everything works as before).
6701
6722
6702 * Got the object introspection system (magic_oinfo) working! I
6723 * Got the object introspection system (magic_oinfo) working! I
6703 think this is pretty much ready for release to Janko, so he can
6724 think this is pretty much ready for release to Janko, so he can
6704 test it for a while and then announce it. Pretty much 100% of what
6725 test it for a while and then announce it. Pretty much 100% of what
6705 I wanted for the 'phase 1' release is ready. Happy, tired.
6726 I wanted for the 'phase 1' release is ready. Happy, tired.
6706
6727
6707 2001-11-12 Fernando Perez <fperez@colorado.edu>
6728 2001-11-12 Fernando Perez <fperez@colorado.edu>
6708
6729
6709 * Version 0.1.6 released, 0.1.7 opened for further work.
6730 * Version 0.1.6 released, 0.1.7 opened for further work.
6710
6731
6711 * Fixed bug in printing: it used to test for truth before
6732 * Fixed bug in printing: it used to test for truth before
6712 printing, so 0 wouldn't print. Now checks for None.
6733 printing, so 0 wouldn't print. Now checks for None.
6713
6734
6714 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6735 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6715 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6736 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6716 reaches by hand into the outputcache. Think of a better way to do
6737 reaches by hand into the outputcache. Think of a better way to do
6717 this later.
6738 this later.
6718
6739
6719 * Various small fixes thanks to Nathan's comments.
6740 * Various small fixes thanks to Nathan's comments.
6720
6741
6721 * Changed magic_pprint to magic_Pprint. This way it doesn't
6742 * Changed magic_pprint to magic_Pprint. This way it doesn't
6722 collide with pprint() and the name is consistent with the command
6743 collide with pprint() and the name is consistent with the command
6723 line option.
6744 line option.
6724
6745
6725 * Changed prompt counter behavior to be fully like
6746 * Changed prompt counter behavior to be fully like
6726 Mathematica's. That is, even input that doesn't return a result
6747 Mathematica's. That is, even input that doesn't return a result
6727 raises the prompt counter. The old behavior was kind of confusing
6748 raises the prompt counter. The old behavior was kind of confusing
6728 (getting the same prompt number several times if the operation
6749 (getting the same prompt number several times if the operation
6729 didn't return a result).
6750 didn't return a result).
6730
6751
6731 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6752 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6732
6753
6733 * Fixed -Classic mode (wasn't working anymore).
6754 * Fixed -Classic mode (wasn't working anymore).
6734
6755
6735 * Added colored prompts using Nathan's new code. Colors are
6756 * Added colored prompts using Nathan's new code. Colors are
6736 currently hardwired, they can be user-configurable. For
6757 currently hardwired, they can be user-configurable. For
6737 developers, they can be chosen in file ipythonlib.py, at the
6758 developers, they can be chosen in file ipythonlib.py, at the
6738 beginning of the CachedOutput class def.
6759 beginning of the CachedOutput class def.
6739
6760
6740 2001-11-11 Fernando Perez <fperez@colorado.edu>
6761 2001-11-11 Fernando Perez <fperez@colorado.edu>
6741
6762
6742 * Version 0.1.5 released, 0.1.6 opened for further work.
6763 * Version 0.1.5 released, 0.1.6 opened for further work.
6743
6764
6744 * Changed magic_env to *return* the environment as a dict (not to
6765 * Changed magic_env to *return* the environment as a dict (not to
6745 print it). This way it prints, but it can also be processed.
6766 print it). This way it prints, but it can also be processed.
6746
6767
6747 * Added Verbose exception reporting to interactive
6768 * Added Verbose exception reporting to interactive
6748 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6769 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6749 traceback. Had to make some changes to the ultraTB file. This is
6770 traceback. Had to make some changes to the ultraTB file. This is
6750 probably the last 'big' thing in my mental todo list. This ties
6771 probably the last 'big' thing in my mental todo list. This ties
6751 in with the next entry:
6772 in with the next entry:
6752
6773
6753 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6774 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6754 has to specify is Plain, Color or Verbose for all exception
6775 has to specify is Plain, Color or Verbose for all exception
6755 handling.
6776 handling.
6756
6777
6757 * Removed ShellServices option. All this can really be done via
6778 * Removed ShellServices option. All this can really be done via
6758 the magic system. It's easier to extend, cleaner and has automatic
6779 the magic system. It's easier to extend, cleaner and has automatic
6759 namespace protection and documentation.
6780 namespace protection and documentation.
6760
6781
6761 2001-11-09 Fernando Perez <fperez@colorado.edu>
6782 2001-11-09 Fernando Perez <fperez@colorado.edu>
6762
6783
6763 * Fixed bug in output cache flushing (missing parameter to
6784 * Fixed bug in output cache flushing (missing parameter to
6764 __init__). Other small bugs fixed (found using pychecker).
6785 __init__). Other small bugs fixed (found using pychecker).
6765
6786
6766 * Version 0.1.4 opened for bugfixing.
6787 * Version 0.1.4 opened for bugfixing.
6767
6788
6768 2001-11-07 Fernando Perez <fperez@colorado.edu>
6789 2001-11-07 Fernando Perez <fperez@colorado.edu>
6769
6790
6770 * Version 0.1.3 released, mainly because of the raw_input bug.
6791 * Version 0.1.3 released, mainly because of the raw_input bug.
6771
6792
6772 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6793 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6773 and when testing for whether things were callable, a call could
6794 and when testing for whether things were callable, a call could
6774 actually be made to certain functions. They would get called again
6795 actually be made to certain functions. They would get called again
6775 once 'really' executed, with a resulting double call. A disaster
6796 once 'really' executed, with a resulting double call. A disaster
6776 in many cases (list.reverse() would never work!).
6797 in many cases (list.reverse() would never work!).
6777
6798
6778 * Removed prefilter() function, moved its code to raw_input (which
6799 * Removed prefilter() function, moved its code to raw_input (which
6779 after all was just a near-empty caller for prefilter). This saves
6800 after all was just a near-empty caller for prefilter). This saves
6780 a function call on every prompt, and simplifies the class a tiny bit.
6801 a function call on every prompt, and simplifies the class a tiny bit.
6781
6802
6782 * Fix _ip to __ip name in magic example file.
6803 * Fix _ip to __ip name in magic example file.
6783
6804
6784 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6805 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6785 work with non-gnu versions of tar.
6806 work with non-gnu versions of tar.
6786
6807
6787 2001-11-06 Fernando Perez <fperez@colorado.edu>
6808 2001-11-06 Fernando Perez <fperez@colorado.edu>
6788
6809
6789 * Version 0.1.2. Just to keep track of the recent changes.
6810 * Version 0.1.2. Just to keep track of the recent changes.
6790
6811
6791 * Fixed nasty bug in output prompt routine. It used to check 'if
6812 * Fixed nasty bug in output prompt routine. It used to check 'if
6792 arg != None...'. Problem is, this fails if arg implements a
6813 arg != None...'. Problem is, this fails if arg implements a
6793 special comparison (__cmp__) which disallows comparing to
6814 special comparison (__cmp__) which disallows comparing to
6794 None. Found it when trying to use the PhysicalQuantity module from
6815 None. Found it when trying to use the PhysicalQuantity module from
6795 ScientificPython.
6816 ScientificPython.
6796
6817
6797 2001-11-05 Fernando Perez <fperez@colorado.edu>
6818 2001-11-05 Fernando Perez <fperez@colorado.edu>
6798
6819
6799 * Also added dirs. Now the pushd/popd/dirs family functions
6820 * Also added dirs. Now the pushd/popd/dirs family functions
6800 basically like the shell, with the added convenience of going home
6821 basically like the shell, with the added convenience of going home
6801 when called with no args.
6822 when called with no args.
6802
6823
6803 * pushd/popd slightly modified to mimic shell behavior more
6824 * pushd/popd slightly modified to mimic shell behavior more
6804 closely.
6825 closely.
6805
6826
6806 * Added env,pushd,popd from ShellServices as magic functions. I
6827 * Added env,pushd,popd from ShellServices as magic functions. I
6807 think the cleanest will be to port all desired functions from
6828 think the cleanest will be to port all desired functions from
6808 ShellServices as magics and remove ShellServices altogether. This
6829 ShellServices as magics and remove ShellServices altogether. This
6809 will provide a single, clean way of adding functionality
6830 will provide a single, clean way of adding functionality
6810 (shell-type or otherwise) to IP.
6831 (shell-type or otherwise) to IP.
6811
6832
6812 2001-11-04 Fernando Perez <fperez@colorado.edu>
6833 2001-11-04 Fernando Perez <fperez@colorado.edu>
6813
6834
6814 * Added .ipython/ directory to sys.path. This way users can keep
6835 * Added .ipython/ directory to sys.path. This way users can keep
6815 customizations there and access them via import.
6836 customizations there and access them via import.
6816
6837
6817 2001-11-03 Fernando Perez <fperez@colorado.edu>
6838 2001-11-03 Fernando Perez <fperez@colorado.edu>
6818
6839
6819 * Opened version 0.1.1 for new changes.
6840 * Opened version 0.1.1 for new changes.
6820
6841
6821 * Changed version number to 0.1.0: first 'public' release, sent to
6842 * Changed version number to 0.1.0: first 'public' release, sent to
6822 Nathan and Janko.
6843 Nathan and Janko.
6823
6844
6824 * Lots of small fixes and tweaks.
6845 * Lots of small fixes and tweaks.
6825
6846
6826 * Minor changes to whos format. Now strings are shown, snipped if
6847 * Minor changes to whos format. Now strings are shown, snipped if
6827 too long.
6848 too long.
6828
6849
6829 * Changed ShellServices to work on __main__ so they show up in @who
6850 * Changed ShellServices to work on __main__ so they show up in @who
6830
6851
6831 * Help also works with ? at the end of a line:
6852 * Help also works with ? at the end of a line:
6832 ?sin and sin?
6853 ?sin and sin?
6833 both produce the same effect. This is nice, as often I use the
6854 both produce the same effect. This is nice, as often I use the
6834 tab-complete to find the name of a method, but I used to then have
6855 tab-complete to find the name of a method, but I used to then have
6835 to go to the beginning of the line to put a ? if I wanted more
6856 to go to the beginning of the line to put a ? if I wanted more
6836 info. Now I can just add the ? and hit return. Convenient.
6857 info. Now I can just add the ? and hit return. Convenient.
6837
6858
6838 2001-11-02 Fernando Perez <fperez@colorado.edu>
6859 2001-11-02 Fernando Perez <fperez@colorado.edu>
6839
6860
6840 * Python version check (>=2.1) added.
6861 * Python version check (>=2.1) added.
6841
6862
6842 * Added LazyPython documentation. At this point the docs are quite
6863 * Added LazyPython documentation. At this point the docs are quite
6843 a mess. A cleanup is in order.
6864 a mess. A cleanup is in order.
6844
6865
6845 * Auto-installer created. For some bizarre reason, the zipfiles
6866 * Auto-installer created. For some bizarre reason, the zipfiles
6846 module isn't working on my system. So I made a tar version
6867 module isn't working on my system. So I made a tar version
6847 (hopefully the command line options in various systems won't kill
6868 (hopefully the command line options in various systems won't kill
6848 me).
6869 me).
6849
6870
6850 * Fixes to Struct in genutils. Now all dictionary-like methods are
6871 * Fixes to Struct in genutils. Now all dictionary-like methods are
6851 protected (reasonably).
6872 protected (reasonably).
6852
6873
6853 * Added pager function to genutils and changed ? to print usage
6874 * Added pager function to genutils and changed ? to print usage
6854 note through it (it was too long).
6875 note through it (it was too long).
6855
6876
6856 * Added the LazyPython functionality. Works great! I changed the
6877 * Added the LazyPython functionality. Works great! I changed the
6857 auto-quote escape to ';', it's on home row and next to '. But
6878 auto-quote escape to ';', it's on home row and next to '. But
6858 both auto-quote and auto-paren (still /) escapes are command-line
6879 both auto-quote and auto-paren (still /) escapes are command-line
6859 parameters.
6880 parameters.
6860
6881
6861
6882
6862 2001-11-01 Fernando Perez <fperez@colorado.edu>
6883 2001-11-01 Fernando Perez <fperez@colorado.edu>
6863
6884
6864 * Version changed to 0.0.7. Fairly large change: configuration now
6885 * Version changed to 0.0.7. Fairly large change: configuration now
6865 is all stored in a directory, by default .ipython. There, all
6886 is all stored in a directory, by default .ipython. There, all
6866 config files have normal looking names (not .names)
6887 config files have normal looking names (not .names)
6867
6888
6868 * Version 0.0.6 Released first to Lucas and Archie as a test
6889 * Version 0.0.6 Released first to Lucas and Archie as a test
6869 run. Since it's the first 'semi-public' release, change version to
6890 run. Since it's the first 'semi-public' release, change version to
6870 > 0.0.6 for any changes now.
6891 > 0.0.6 for any changes now.
6871
6892
6872 * Stuff I had put in the ipplib.py changelog:
6893 * Stuff I had put in the ipplib.py changelog:
6873
6894
6874 Changes to InteractiveShell:
6895 Changes to InteractiveShell:
6875
6896
6876 - Made the usage message a parameter.
6897 - Made the usage message a parameter.
6877
6898
6878 - Require the name of the shell variable to be given. It's a bit
6899 - Require the name of the shell variable to be given. It's a bit
6879 of a hack, but allows the name 'shell' not to be hardwired in the
6900 of a hack, but allows the name 'shell' not to be hardwired in the
6880 magic (@) handler, which is problematic b/c it requires
6901 magic (@) handler, which is problematic b/c it requires
6881 polluting the global namespace with 'shell'. This in turn is
6902 polluting the global namespace with 'shell'. This in turn is
6882 fragile: if a user redefines a variable called shell, things
6903 fragile: if a user redefines a variable called shell, things
6883 break.
6904 break.
6884
6905
6885 - magic @: all functions available through @ need to be defined
6906 - magic @: all functions available through @ need to be defined
6886 as magic_<name>, even though they can be called simply as
6907 as magic_<name>, even though they can be called simply as
6887 @<name>. This allows the special command @magic to gather
6908 @<name>. This allows the special command @magic to gather
6888 information automatically about all existing magic functions,
6909 information automatically about all existing magic functions,
6889 even if they are run-time user extensions, by parsing the shell
6910 even if they are run-time user extensions, by parsing the shell
6890 instance __dict__ looking for special magic_ names.
6911 instance __dict__ looking for special magic_ names.
6891
6912
6892 - mainloop: added *two* local namespace parameters. This allows
6913 - mainloop: added *two* local namespace parameters. This allows
6893 the class to differentiate between parameters which were there
6914 the class to differentiate between parameters which were there
6894 before and after command line initialization was processed. This
6915 before and after command line initialization was processed. This
6895 way, later @who can show things loaded at startup by the
6916 way, later @who can show things loaded at startup by the
6896 user. This trick was necessary to make session saving/reloading
6917 user. This trick was necessary to make session saving/reloading
6897 really work: ideally after saving/exiting/reloading a session,
6918 really work: ideally after saving/exiting/reloading a session,
6898 *everything* should look the same, including the output of @who. I
6919 *everything* should look the same, including the output of @who. I
6899 was only able to make this work with this double namespace
6920 was only able to make this work with this double namespace
6900 trick.
6921 trick.
6901
6922
6902 - added a header to the logfile which allows (almost) full
6923 - added a header to the logfile which allows (almost) full
6903 session restoring.
6924 session restoring.
6904
6925
6905 - prepend lines beginning with @ or !, with a and log
6926 - prepend lines beginning with @ or !, with a and log
6906 them. Why? !lines: may be useful to know what you did @lines:
6927 them. Why? !lines: may be useful to know what you did @lines:
6907 they may affect session state. So when restoring a session, at
6928 they may affect session state. So when restoring a session, at
6908 least inform the user of their presence. I couldn't quite get
6929 least inform the user of their presence. I couldn't quite get
6909 them to properly re-execute, but at least the user is warned.
6930 them to properly re-execute, but at least the user is warned.
6910
6931
6911 * Started ChangeLog.
6932 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now