##// END OF EJS Templates
add .meta namespace for extension writers.
fperez -
Show More
@@ -1,76 +1,76 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Release data for the IPython project.
2 """Release data for the IPython project.
3
3
4 $Id: Release.py 986 2005-12-31 23:07:31Z fperez $"""
4 $Id: Release.py 987 2005-12-31 23:50:31Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
7 # Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
8 #
8 #
9 # Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and Nathaniel Gray
9 # Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and Nathaniel Gray
10 # <n8gray@caltech.edu>
10 # <n8gray@caltech.edu>
11 #
11 #
12 # Distributed under the terms of the BSD License. The full license is in
12 # Distributed under the terms of the BSD License. The full license is in
13 # the file COPYING, distributed as part of this software.
13 # the file COPYING, distributed as part of this software.
14 #*****************************************************************************
14 #*****************************************************************************
15
15
16 # Name of the package for release purposes. This is the name which labels
16 # Name of the package for release purposes. This is the name which labels
17 # the tarballs and RPMs made by distutils, so it's best to lowercase it.
17 # the tarballs and RPMs made by distutils, so it's best to lowercase it.
18 name = 'ipython'
18 name = 'ipython'
19
19
20 # For versions with substrings (like 0.6.16.svn), use an extra . to separate
20 # For versions with substrings (like 0.6.16.svn), use an extra . to separate
21 # the new substring. We have to avoid using either dashes or underscores,
21 # the new substring. We have to avoid using either dashes or underscores,
22 # because bdist_rpm does not accept dashes (an RPM) convention, and
22 # because bdist_rpm does not accept dashes (an RPM) convention, and
23 # bdist_deb does not accept underscores (a Debian convention).
23 # bdist_deb does not accept underscores (a Debian convention).
24
24
25 version = '0.7.0.rc5'
25 version = '0.7.0.rc6'
26
26
27 revision = '$Revision: 986 $'
27 revision = '$Revision: 987 $'
28
28
29 description = "An enhanced interactive Python shell."
29 description = "An enhanced interactive Python shell."
30
30
31 long_description = \
31 long_description = \
32 """
32 """
33 IPython provides a replacement for the interactive Python interpreter with
33 IPython provides a replacement for the interactive Python interpreter with
34 extra functionality.
34 extra functionality.
35
35
36 Main features:
36 Main features:
37
37
38 * Comprehensive object introspection.
38 * Comprehensive object introspection.
39
39
40 * Input history, persistent across sessions.
40 * Input history, persistent across sessions.
41
41
42 * Caching of output results during a session with automatically generated
42 * Caching of output results during a session with automatically generated
43 references.
43 references.
44
44
45 * Readline based name completion.
45 * Readline based name completion.
46
46
47 * Extensible system of 'magic' commands for controlling the environment and
47 * Extensible system of 'magic' commands for controlling the environment and
48 performing many tasks related either to IPython or the operating system.
48 performing many tasks related either to IPython or the operating system.
49
49
50 * Configuration system with easy switching between different setups (simpler
50 * Configuration system with easy switching between different setups (simpler
51 than changing $PYTHONSTARTUP environment variables every time).
51 than changing $PYTHONSTARTUP environment variables every time).
52
52
53 * Session logging and reloading.
53 * Session logging and reloading.
54
54
55 * Extensible syntax processing for special purpose situations.
55 * Extensible syntax processing for special purpose situations.
56
56
57 * Access to the system shell with user-extensible alias system.
57 * Access to the system shell with user-extensible alias system.
58
58
59 * Easily embeddable in other Python programs.
59 * Easily embeddable in other Python programs.
60
60
61 * Integrated access to the pdb debugger and the Python profiler. """
61 * Integrated access to the pdb debugger and the Python profiler. """
62
62
63 license = 'BSD'
63 license = 'BSD'
64
64
65 authors = {'Fernando' : ('Fernando Perez','fperez@colorado.edu'),
65 authors = {'Fernando' : ('Fernando Perez','fperez@colorado.edu'),
66 'Janko' : ('Janko Hauser','jhauser@zscout.de'),
66 'Janko' : ('Janko Hauser','jhauser@zscout.de'),
67 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu')
67 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu')
68 }
68 }
69
69
70 url = 'http://ipython.scipy.org'
70 url = 'http://ipython.scipy.org'
71
71
72 download_url = 'http://ipython.scipy.org/dist'
72 download_url = 'http://ipython.scipy.org/dist'
73
73
74 platforms = ['Linux','Mac OSX','Windows XP/2000/NT','Windows 95/98/ME']
74 platforms = ['Linux','Mac OSX','Windows XP/2000/NT','Windows 95/98/ME']
75
75
76 keywords = ['Interactive','Interpreter','Shell']
76 keywords = ['Interactive','Interpreter','Shell']
@@ -1,2058 +1,2065 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.1 or newer.
5 Requires Python 2.1 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 984 2005-12-31 08:40:31Z fperez $
9 $Id: iplib.py 987 2005-12-31 23:50:31Z 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-2005 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2005 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 __future__ import generators # for 2.2 backwards-compatibility
31 from __future__ import generators # for 2.2 backwards-compatibility
32
32
33 from IPython import Release
33 from IPython import Release
34 __author__ = '%s <%s>\n%s <%s>' % \
34 __author__ = '%s <%s>\n%s <%s>' % \
35 ( Release.authors['Janko'] + Release.authors['Fernando'] )
35 ( Release.authors['Janko'] + Release.authors['Fernando'] )
36 __license__ = Release.license
36 __license__ = Release.license
37 __version__ = Release.version
37 __version__ = Release.version
38
38
39 # Python standard modules
39 # Python standard modules
40 import __main__
40 import __main__
41 import __builtin__
41 import __builtin__
42 import StringIO
42 import StringIO
43 import bdb
43 import bdb
44 import cPickle as pickle
44 import cPickle as pickle
45 import codeop
45 import codeop
46 import exceptions
46 import exceptions
47 import glob
47 import glob
48 import inspect
48 import inspect
49 import keyword
49 import keyword
50 import new
50 import new
51 import os
51 import os
52 import pdb
52 import pdb
53 import pydoc
53 import pydoc
54 import re
54 import re
55 import shutil
55 import shutil
56 import string
56 import string
57 import sys
57 import sys
58 import traceback
58 import traceback
59 import types
59 import types
60
60
61 from pprint import pprint, pformat
61 from pprint import pprint, pformat
62
62
63 # IPython's own modules
63 # IPython's own modules
64 import IPython
64 import IPython
65 from IPython import OInspect,PyColorize,ultraTB
65 from IPython import OInspect,PyColorize,ultraTB
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
67 from IPython.FakeModule import FakeModule
67 from IPython.FakeModule import FakeModule
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
69 from IPython.Logger import Logger
69 from IPython.Logger import Logger
70 from IPython.Magic import Magic
70 from IPython.Magic import Magic
71 from IPython.Prompts import CachedOutput
71 from IPython.Prompts import CachedOutput
72 from IPython.Struct import Struct
72 from IPython.Struct import Struct
73 from IPython.background_jobs import BackgroundJobManager
73 from IPython.background_jobs import BackgroundJobManager
74 from IPython.usage import cmd_line_usage,interactive_usage
74 from IPython.usage import cmd_line_usage,interactive_usage
75 from IPython.genutils import *
75 from IPython.genutils import *
76
76
77 # store the builtin raw_input globally, and use this always, in case user code
77 # store the builtin raw_input globally, and use this always, in case user code
78 # overwrites it (like wx.py.PyShell does)
78 # overwrites it (like wx.py.PyShell does)
79 raw_input_original = raw_input
79 raw_input_original = raw_input
80
80
81 # compiled regexps for autoindent management
81 # compiled regexps for autoindent management
82 ini_spaces_re = re.compile(r'^(\s+)')
82 ini_spaces_re = re.compile(r'^(\s+)')
83 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
83 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
84
84
85 #****************************************************************************
85 #****************************************************************************
86 # Some utility function definitions
86 # Some utility function definitions
87
87
88 def softspace(file, newvalue):
88 def softspace(file, newvalue):
89 """Copied from code.py, to remove the dependency"""
89 """Copied from code.py, to remove the dependency"""
90 oldvalue = 0
90 oldvalue = 0
91 try:
91 try:
92 oldvalue = file.softspace
92 oldvalue = file.softspace
93 except AttributeError:
93 except AttributeError:
94 pass
94 pass
95 try:
95 try:
96 file.softspace = newvalue
96 file.softspace = newvalue
97 except (AttributeError, TypeError):
97 except (AttributeError, TypeError):
98 # "attribute-less object" or "read-only attributes"
98 # "attribute-less object" or "read-only attributes"
99 pass
99 pass
100 return oldvalue
100 return oldvalue
101
101
102 #****************************************************************************
102 #****************************************************************************
103 # These special functions get installed in the builtin namespace, to provide
103 # These special functions get installed in the builtin namespace, to provide
104 # programmatic (pure python) access to magics, aliases and system calls. This
104 # programmatic (pure python) access to magics, aliases and system calls. This
105 # is important for logging, user scripting, and more.
105 # is important for logging, user scripting, and more.
106
106
107 # We are basically exposing, via normal python functions, the three mechanisms
107 # We are basically exposing, via normal python functions, the three mechanisms
108 # in which ipython offers special call modes (magics for internal control,
108 # in which ipython offers special call modes (magics for internal control,
109 # aliases for direct system access via pre-selected names, and !cmd for
109 # aliases for direct system access via pre-selected names, and !cmd for
110 # calling arbitrary system commands).
110 # calling arbitrary system commands).
111
111
112 def ipmagic(arg_s):
112 def ipmagic(arg_s):
113 """Call a magic function by name.
113 """Call a magic function by name.
114
114
115 Input: a string containing the name of the magic function to call and any
115 Input: a string containing the name of the magic function to call and any
116 additional arguments to be passed to the magic.
116 additional arguments to be passed to the magic.
117
117
118 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
118 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
119 prompt:
119 prompt:
120
120
121 In[1]: %name -opt foo bar
121 In[1]: %name -opt foo bar
122
122
123 To call a magic without arguments, simply use ipmagic('name').
123 To call a magic without arguments, simply use ipmagic('name').
124
124
125 This provides a proper Python function to call IPython's magics in any
125 This provides a proper Python function to call IPython's magics in any
126 valid Python code you can type at the interpreter, including loops and
126 valid Python code you can type at the interpreter, including loops and
127 compound statements. It is added by IPython to the Python builtin
127 compound statements. It is added by IPython to the Python builtin
128 namespace upon initialization."""
128 namespace upon initialization."""
129
129
130 args = arg_s.split(' ',1)
130 args = arg_s.split(' ',1)
131 magic_name = args[0]
131 magic_name = args[0]
132 if magic_name.startswith(__IPYTHON__.ESC_MAGIC):
132 if magic_name.startswith(__IPYTHON__.ESC_MAGIC):
133 magic_name = magic_name[1:]
133 magic_name = magic_name[1:]
134 try:
134 try:
135 magic_args = args[1]
135 magic_args = args[1]
136 except IndexError:
136 except IndexError:
137 magic_args = ''
137 magic_args = ''
138 fn = getattr(__IPYTHON__,'magic_'+magic_name,None)
138 fn = getattr(__IPYTHON__,'magic_'+magic_name,None)
139 if fn is None:
139 if fn is None:
140 error("Magic function `%s` not found." % magic_name)
140 error("Magic function `%s` not found." % magic_name)
141 else:
141 else:
142 magic_args = __IPYTHON__.var_expand(magic_args)
142 magic_args = __IPYTHON__.var_expand(magic_args)
143 return fn(magic_args)
143 return fn(magic_args)
144
144
145 def ipalias(arg_s):
145 def ipalias(arg_s):
146 """Call an alias by name.
146 """Call an alias by name.
147
147
148 Input: a string containing the name of the alias to call and any
148 Input: a string containing the name of the alias to call and any
149 additional arguments to be passed to the magic.
149 additional arguments to be passed to the magic.
150
150
151 ipalias('name -opt foo bar') is equivalent to typing at the ipython
151 ipalias('name -opt foo bar') is equivalent to typing at the ipython
152 prompt:
152 prompt:
153
153
154 In[1]: name -opt foo bar
154 In[1]: name -opt foo bar
155
155
156 To call an alias without arguments, simply use ipalias('name').
156 To call an alias without arguments, simply use ipalias('name').
157
157
158 This provides a proper Python function to call IPython's aliases in any
158 This provides a proper Python function to call IPython's aliases in any
159 valid Python code you can type at the interpreter, including loops and
159 valid Python code you can type at the interpreter, including loops and
160 compound statements. It is added by IPython to the Python builtin
160 compound statements. It is added by IPython to the Python builtin
161 namespace upon initialization."""
161 namespace upon initialization."""
162
162
163 args = arg_s.split(' ',1)
163 args = arg_s.split(' ',1)
164 alias_name = args[0]
164 alias_name = args[0]
165 try:
165 try:
166 alias_args = args[1]
166 alias_args = args[1]
167 except IndexError:
167 except IndexError:
168 alias_args = ''
168 alias_args = ''
169 if alias_name in __IPYTHON__.alias_table:
169 if alias_name in __IPYTHON__.alias_table:
170 __IPYTHON__.call_alias(alias_name,alias_args)
170 __IPYTHON__.call_alias(alias_name,alias_args)
171 else:
171 else:
172 error("Alias `%s` not found." % alias_name)
172 error("Alias `%s` not found." % alias_name)
173
173
174 def ipsystem(arg_s):
174 def ipsystem(arg_s):
175 """Make a system call, using IPython."""
175 """Make a system call, using IPython."""
176 __IPYTHON__.system(arg_s)
176 __IPYTHON__.system(arg_s)
177
177
178
178
179 #****************************************************************************
179 #****************************************************************************
180 # Local use exceptions
180 # Local use exceptions
181 class SpaceInInput(exceptions.Exception): pass
181 class SpaceInInput(exceptions.Exception): pass
182
182
183 #****************************************************************************
183 #****************************************************************************
184 # Local use classes
184 # Local use classes
185 class Bunch: pass
185 class Bunch: pass
186
186
187 class InputList(list):
187 class InputList(list):
188 """Class to store user input.
188 """Class to store user input.
189
189
190 It's basically a list, but slices return a string instead of a list, thus
190 It's basically a list, but slices return a string instead of a list, thus
191 allowing things like (assuming 'In' is an instance):
191 allowing things like (assuming 'In' is an instance):
192
192
193 exec In[4:7]
193 exec In[4:7]
194
194
195 or
195 or
196
196
197 exec In[5:9] + In[14] + In[21:25]"""
197 exec In[5:9] + In[14] + In[21:25]"""
198
198
199 def __getslice__(self,i,j):
199 def __getslice__(self,i,j):
200 return ''.join(list.__getslice__(self,i,j))
200 return ''.join(list.__getslice__(self,i,j))
201
201
202 class SyntaxTB(ultraTB.ListTB):
202 class SyntaxTB(ultraTB.ListTB):
203 """Extension which holds some state: the last exception value"""
203 """Extension which holds some state: the last exception value"""
204
204
205 def __init__(self,color_scheme = 'NoColor'):
205 def __init__(self,color_scheme = 'NoColor'):
206 ultraTB.ListTB.__init__(self,color_scheme)
206 ultraTB.ListTB.__init__(self,color_scheme)
207 self.last_syntax_error = None
207 self.last_syntax_error = None
208
208
209 def __call__(self, etype, value, elist):
209 def __call__(self, etype, value, elist):
210 self.last_syntax_error = value
210 self.last_syntax_error = value
211 ultraTB.ListTB.__call__(self,etype,value,elist)
211 ultraTB.ListTB.__call__(self,etype,value,elist)
212
212
213 def clear_err_state(self):
213 def clear_err_state(self):
214 """Return the current error state and clear it"""
214 """Return the current error state and clear it"""
215 e = self.last_syntax_error
215 e = self.last_syntax_error
216 self.last_syntax_error = None
216 self.last_syntax_error = None
217 return e
217 return e
218
218
219 #****************************************************************************
219 #****************************************************************************
220 # Main IPython class
220 # Main IPython class
221
221
222 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
222 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
223 # until a full rewrite is made. I've cleaned all cross-class uses of
223 # until a full rewrite is made. I've cleaned all cross-class uses of
224 # attributes and methods, but too much user code out there relies on the
224 # attributes and methods, but too much user code out there relies on the
225 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
225 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
226 #
226 #
227 # But at least now, all the pieces have been separated and we could, in
227 # But at least now, all the pieces have been separated and we could, in
228 # principle, stop using the mixin. This will ease the transition to the
228 # principle, stop using the mixin. This will ease the transition to the
229 # chainsaw branch.
229 # chainsaw branch.
230
230
231 # For reference, the following is the list of 'self.foo' uses in the Magic
231 # For reference, the following is the list of 'self.foo' uses in the Magic
232 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
232 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
233 # class, to prevent clashes.
233 # class, to prevent clashes.
234
234
235 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
235 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
236 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
236 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
237 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
237 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
238 # 'self.value']
238 # 'self.value']
239
239
240 class InteractiveShell(object,Magic):
240 class InteractiveShell(object,Magic):
241 """An enhanced console for Python."""
241 """An enhanced console for Python."""
242
242
243 # class attribute to indicate whether the class supports threads or not.
243 # class attribute to indicate whether the class supports threads or not.
244 # Subclasses with thread support should override this as needed.
244 # Subclasses with thread support should override this as needed.
245 isthreaded = False
245 isthreaded = False
246
246
247 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
247 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
248 user_ns = None,user_global_ns=None,banner2='',
248 user_ns = None,user_global_ns=None,banner2='',
249 custom_exceptions=((),None),embedded=False):
249 custom_exceptions=((),None),embedded=False):
250
250
251 # some minimal strict typechecks. For some core data structures, I
251 # some minimal strict typechecks. For some core data structures, I
252 # want actual basic python types, not just anything that looks like
252 # want actual basic python types, not just anything that looks like
253 # one. This is especially true for namespaces.
253 # one. This is especially true for namespaces.
254 for ns in (user_ns,user_global_ns):
254 for ns in (user_ns,user_global_ns):
255 if ns is not None and type(ns) != types.DictType:
255 if ns is not None and type(ns) != types.DictType:
256 raise TypeError,'namespace must be a dictionary'
256 raise TypeError,'namespace must be a dictionary'
257
257
258 # Put a reference to self in builtins so that any form of embedded or
258 # Put a reference to self in builtins so that any form of embedded or
259 # imported code can test for being inside IPython.
259 # imported code can test for being inside IPython.
260 __builtin__.__IPYTHON__ = self
260 __builtin__.__IPYTHON__ = self
261
261
262 # And load into builtins ipmagic/ipalias/ipsystem as well
262 # And load into builtins ipmagic/ipalias/ipsystem as well
263 __builtin__.ipmagic = ipmagic
263 __builtin__.ipmagic = ipmagic
264 __builtin__.ipalias = ipalias
264 __builtin__.ipalias = ipalias
265 __builtin__.ipsystem = ipsystem
265 __builtin__.ipsystem = ipsystem
266
266
267 # Add to __builtin__ other parts of IPython's public API
267 # Add to __builtin__ other parts of IPython's public API
268 __builtin__.ip_set_hook = self.set_hook
268 __builtin__.ip_set_hook = self.set_hook
269
269
270 # Keep in the builtins a flag for when IPython is active. We set it
270 # Keep in the builtins a flag for when IPython is active. We set it
271 # with setdefault so that multiple nested IPythons don't clobber one
271 # with setdefault so that multiple nested IPythons don't clobber one
272 # another. Each will increase its value by one upon being activated,
272 # another. Each will increase its value by one upon being activated,
273 # which also gives us a way to determine the nesting level.
273 # which also gives us a way to determine the nesting level.
274 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
274 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
275
275
276 # Do the intuitively correct thing for quit/exit: we remove the
276 # Do the intuitively correct thing for quit/exit: we remove the
277 # builtins if they exist, and our own prefilter routine will handle
277 # builtins if they exist, and our own prefilter routine will handle
278 # these special cases
278 # these special cases
279 try:
279 try:
280 del __builtin__.exit, __builtin__.quit
280 del __builtin__.exit, __builtin__.quit
281 except AttributeError:
281 except AttributeError:
282 pass
282 pass
283
283
284 # Store the actual shell's name
284 # Store the actual shell's name
285 self.name = name
285 self.name = name
286
286
287 # We need to know whether the instance is meant for embedding, since
287 # We need to know whether the instance is meant for embedding, since
288 # global/local namespaces need to be handled differently in that case
288 # global/local namespaces need to be handled differently in that case
289 self.embedded = embedded
289 self.embedded = embedded
290
290
291 # command compiler
291 # command compiler
292 self.compile = codeop.CommandCompiler()
292 self.compile = codeop.CommandCompiler()
293
293
294 # User input buffer
294 # User input buffer
295 self.buffer = []
295 self.buffer = []
296
296
297 # Default name given in compilation of code
297 # Default name given in compilation of code
298 self.filename = '<ipython console>'
298 self.filename = '<ipython console>'
299
299
300 # Make an empty namespace, which extension writers can rely on both
301 # existing and NEVER being used by ipython itself. This gives them a
302 # convenient location for storing additional information and state
303 # their extensions may require, without fear of collisions with other
304 # ipython names that may develop later.
305 self.meta = Bunch()
306
300 # Create the namespace where the user will operate. user_ns is
307 # Create the namespace where the user will operate. user_ns is
301 # normally the only one used, and it is passed to the exec calls as
308 # normally the only one used, and it is passed to the exec calls as
302 # the locals argument. But we do carry a user_global_ns namespace
309 # the locals argument. But we do carry a user_global_ns namespace
303 # given as the exec 'globals' argument, This is useful in embedding
310 # given as the exec 'globals' argument, This is useful in embedding
304 # situations where the ipython shell opens in a context where the
311 # situations where the ipython shell opens in a context where the
305 # distinction between locals and globals is meaningful.
312 # distinction between locals and globals is meaningful.
306
313
307 # FIXME. For some strange reason, __builtins__ is showing up at user
314 # FIXME. For some strange reason, __builtins__ is showing up at user
308 # level as a dict instead of a module. This is a manual fix, but I
315 # level as a dict instead of a module. This is a manual fix, but I
309 # should really track down where the problem is coming from. Alex
316 # should really track down where the problem is coming from. Alex
310 # Schmolck reported this problem first.
317 # Schmolck reported this problem first.
311
318
312 # A useful post by Alex Martelli on this topic:
319 # A useful post by Alex Martelli on this topic:
313 # Re: inconsistent value from __builtins__
320 # Re: inconsistent value from __builtins__
314 # Von: Alex Martelli <aleaxit@yahoo.com>
321 # Von: Alex Martelli <aleaxit@yahoo.com>
315 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
322 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
316 # Gruppen: comp.lang.python
323 # Gruppen: comp.lang.python
317
324
318 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
325 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
319 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
326 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
320 # > <type 'dict'>
327 # > <type 'dict'>
321 # > >>> print type(__builtins__)
328 # > >>> print type(__builtins__)
322 # > <type 'module'>
329 # > <type 'module'>
323 # > Is this difference in return value intentional?
330 # > Is this difference in return value intentional?
324
331
325 # Well, it's documented that '__builtins__' can be either a dictionary
332 # Well, it's documented that '__builtins__' can be either a dictionary
326 # or a module, and it's been that way for a long time. Whether it's
333 # or a module, and it's been that way for a long time. Whether it's
327 # intentional (or sensible), I don't know. In any case, the idea is
334 # intentional (or sensible), I don't know. In any case, the idea is
328 # that if you need to access the built-in namespace directly, you
335 # that if you need to access the built-in namespace directly, you
329 # should start with "import __builtin__" (note, no 's') which will
336 # should start with "import __builtin__" (note, no 's') which will
330 # definitely give you a module. Yeah, it's somewhatΒ confusing:-(.
337 # definitely give you a module. Yeah, it's somewhatΒ confusing:-(.
331
338
332 if user_ns is None:
339 if user_ns is None:
333 # Set __name__ to __main__ to better match the behavior of the
340 # Set __name__ to __main__ to better match the behavior of the
334 # normal interpreter.
341 # normal interpreter.
335 user_ns = {'__name__' :'__main__',
342 user_ns = {'__name__' :'__main__',
336 '__builtins__' : __builtin__,
343 '__builtins__' : __builtin__,
337 }
344 }
338
345
339 if user_global_ns is None:
346 if user_global_ns is None:
340 user_global_ns = {}
347 user_global_ns = {}
341
348
342 # Assign namespaces
349 # Assign namespaces
343 # This is the namespace where all normal user variables live
350 # This is the namespace where all normal user variables live
344 self.user_ns = user_ns
351 self.user_ns = user_ns
345 # Embedded instances require a separate namespace for globals.
352 # Embedded instances require a separate namespace for globals.
346 # Normally this one is unused by non-embedded instances.
353 # Normally this one is unused by non-embedded instances.
347 self.user_global_ns = user_global_ns
354 self.user_global_ns = user_global_ns
348 # A namespace to keep track of internal data structures to prevent
355 # A namespace to keep track of internal data structures to prevent
349 # them from cluttering user-visible stuff. Will be updated later
356 # them from cluttering user-visible stuff. Will be updated later
350 self.internal_ns = {}
357 self.internal_ns = {}
351
358
352 # Namespace of system aliases. Each entry in the alias
359 # Namespace of system aliases. Each entry in the alias
353 # table must be a 2-tuple of the form (N,name), where N is the number
360 # table must be a 2-tuple of the form (N,name), where N is the number
354 # of positional arguments of the alias.
361 # of positional arguments of the alias.
355 self.alias_table = {}
362 self.alias_table = {}
356
363
357 # A table holding all the namespaces IPython deals with, so that
364 # A table holding all the namespaces IPython deals with, so that
358 # introspection facilities can search easily.
365 # introspection facilities can search easily.
359 self.ns_table = {'user':user_ns,
366 self.ns_table = {'user':user_ns,
360 'user_global':user_global_ns,
367 'user_global':user_global_ns,
361 'alias':self.alias_table,
368 'alias':self.alias_table,
362 'internal':self.internal_ns,
369 'internal':self.internal_ns,
363 'builtin':__builtin__.__dict__
370 'builtin':__builtin__.__dict__
364 }
371 }
365
372
366 # The user namespace MUST have a pointer to the shell itself.
373 # The user namespace MUST have a pointer to the shell itself.
367 self.user_ns[name] = self
374 self.user_ns[name] = self
368
375
369 # We need to insert into sys.modules something that looks like a
376 # We need to insert into sys.modules something that looks like a
370 # module but which accesses the IPython namespace, for shelve and
377 # module but which accesses the IPython namespace, for shelve and
371 # pickle to work interactively. Normally they rely on getting
378 # pickle to work interactively. Normally they rely on getting
372 # everything out of __main__, but for embedding purposes each IPython
379 # everything out of __main__, but for embedding purposes each IPython
373 # instance has its own private namespace, so we can't go shoving
380 # instance has its own private namespace, so we can't go shoving
374 # everything into __main__.
381 # everything into __main__.
375
382
376 # note, however, that we should only do this for non-embedded
383 # note, however, that we should only do this for non-embedded
377 # ipythons, which really mimic the __main__.__dict__ with their own
384 # ipythons, which really mimic the __main__.__dict__ with their own
378 # namespace. Embedded instances, on the other hand, should not do
385 # namespace. Embedded instances, on the other hand, should not do
379 # this because they need to manage the user local/global namespaces
386 # this because they need to manage the user local/global namespaces
380 # only, but they live within a 'normal' __main__ (meaning, they
387 # only, but they live within a 'normal' __main__ (meaning, they
381 # shouldn't overtake the execution environment of the script they're
388 # shouldn't overtake the execution environment of the script they're
382 # embedded in).
389 # embedded in).
383
390
384 if not embedded:
391 if not embedded:
385 try:
392 try:
386 main_name = self.user_ns['__name__']
393 main_name = self.user_ns['__name__']
387 except KeyError:
394 except KeyError:
388 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
395 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
389 else:
396 else:
390 #print "pickle hack in place" # dbg
397 #print "pickle hack in place" # dbg
391 #print 'main_name:',main_name # dbg
398 #print 'main_name:',main_name # dbg
392 sys.modules[main_name] = FakeModule(self.user_ns)
399 sys.modules[main_name] = FakeModule(self.user_ns)
393
400
394 # List of input with multi-line handling.
401 # List of input with multi-line handling.
395 # Fill its zero entry, user counter starts at 1
402 # Fill its zero entry, user counter starts at 1
396 self.input_hist = InputList(['\n'])
403 self.input_hist = InputList(['\n'])
397
404
398 # list of visited directories
405 # list of visited directories
399 try:
406 try:
400 self.dir_hist = [os.getcwd()]
407 self.dir_hist = [os.getcwd()]
401 except IOError, e:
408 except IOError, e:
402 self.dir_hist = []
409 self.dir_hist = []
403
410
404 # dict of output history
411 # dict of output history
405 self.output_hist = {}
412 self.output_hist = {}
406
413
407 # dict of things NOT to alias (keywords, builtins and some magics)
414 # dict of things NOT to alias (keywords, builtins and some magics)
408 no_alias = {}
415 no_alias = {}
409 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
416 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
410 for key in keyword.kwlist + no_alias_magics:
417 for key in keyword.kwlist + no_alias_magics:
411 no_alias[key] = 1
418 no_alias[key] = 1
412 no_alias.update(__builtin__.__dict__)
419 no_alias.update(__builtin__.__dict__)
413 self.no_alias = no_alias
420 self.no_alias = no_alias
414
421
415 # make global variables for user access to these
422 # make global variables for user access to these
416 self.user_ns['_ih'] = self.input_hist
423 self.user_ns['_ih'] = self.input_hist
417 self.user_ns['_oh'] = self.output_hist
424 self.user_ns['_oh'] = self.output_hist
418 self.user_ns['_dh'] = self.dir_hist
425 self.user_ns['_dh'] = self.dir_hist
419
426
420 # user aliases to input and output histories
427 # user aliases to input and output histories
421 self.user_ns['In'] = self.input_hist
428 self.user_ns['In'] = self.input_hist
422 self.user_ns['Out'] = self.output_hist
429 self.user_ns['Out'] = self.output_hist
423
430
424 # Object variable to store code object waiting execution. This is
431 # Object variable to store code object waiting execution. This is
425 # used mainly by the multithreaded shells, but it can come in handy in
432 # used mainly by the multithreaded shells, but it can come in handy in
426 # other situations. No need to use a Queue here, since it's a single
433 # other situations. No need to use a Queue here, since it's a single
427 # item which gets cleared once run.
434 # item which gets cleared once run.
428 self.code_to_run = None
435 self.code_to_run = None
429
436
430 # Job manager (for jobs run as background threads)
437 # Job manager (for jobs run as background threads)
431 self.jobs = BackgroundJobManager()
438 self.jobs = BackgroundJobManager()
432 # Put the job manager into builtins so it's always there.
439 # Put the job manager into builtins so it's always there.
433 __builtin__.jobs = self.jobs
440 __builtin__.jobs = self.jobs
434
441
435 # escapes for automatic behavior on the command line
442 # escapes for automatic behavior on the command line
436 self.ESC_SHELL = '!'
443 self.ESC_SHELL = '!'
437 self.ESC_HELP = '?'
444 self.ESC_HELP = '?'
438 self.ESC_MAGIC = '%'
445 self.ESC_MAGIC = '%'
439 self.ESC_QUOTE = ','
446 self.ESC_QUOTE = ','
440 self.ESC_QUOTE2 = ';'
447 self.ESC_QUOTE2 = ';'
441 self.ESC_PAREN = '/'
448 self.ESC_PAREN = '/'
442
449
443 # And their associated handlers
450 # And their associated handlers
444 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
451 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
445 self.ESC_QUOTE : self.handle_auto,
452 self.ESC_QUOTE : self.handle_auto,
446 self.ESC_QUOTE2 : self.handle_auto,
453 self.ESC_QUOTE2 : self.handle_auto,
447 self.ESC_MAGIC : self.handle_magic,
454 self.ESC_MAGIC : self.handle_magic,
448 self.ESC_HELP : self.handle_help,
455 self.ESC_HELP : self.handle_help,
449 self.ESC_SHELL : self.handle_shell_escape,
456 self.ESC_SHELL : self.handle_shell_escape,
450 }
457 }
451
458
452 # class initializations
459 # class initializations
453 Magic.__init__(self,self)
460 Magic.__init__(self,self)
454
461
455 # Python source parser/formatter for syntax highlighting
462 # Python source parser/formatter for syntax highlighting
456 pyformat = PyColorize.Parser().format
463 pyformat = PyColorize.Parser().format
457 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
464 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
458
465
459 # hooks holds pointers used for user-side customizations
466 # hooks holds pointers used for user-side customizations
460 self.hooks = Struct()
467 self.hooks = Struct()
461
468
462 # Set all default hooks, defined in the IPython.hooks module.
469 # Set all default hooks, defined in the IPython.hooks module.
463 hooks = IPython.hooks
470 hooks = IPython.hooks
464 for hook_name in hooks.__all__:
471 for hook_name in hooks.__all__:
465 self.set_hook(hook_name,getattr(hooks,hook_name))
472 self.set_hook(hook_name,getattr(hooks,hook_name))
466
473
467 # Flag to mark unconditional exit
474 # Flag to mark unconditional exit
468 self.exit_now = False
475 self.exit_now = False
469
476
470 self.usage_min = """\
477 self.usage_min = """\
471 An enhanced console for Python.
478 An enhanced console for Python.
472 Some of its features are:
479 Some of its features are:
473 - Readline support if the readline library is present.
480 - Readline support if the readline library is present.
474 - Tab completion in the local namespace.
481 - Tab completion in the local namespace.
475 - Logging of input, see command-line options.
482 - Logging of input, see command-line options.
476 - System shell escape via ! , eg !ls.
483 - System shell escape via ! , eg !ls.
477 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
484 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
478 - Keeps track of locally defined variables via %who, %whos.
485 - Keeps track of locally defined variables via %who, %whos.
479 - Show object information with a ? eg ?x or x? (use ?? for more info).
486 - Show object information with a ? eg ?x or x? (use ?? for more info).
480 """
487 """
481 if usage: self.usage = usage
488 if usage: self.usage = usage
482 else: self.usage = self.usage_min
489 else: self.usage = self.usage_min
483
490
484 # Storage
491 # Storage
485 self.rc = rc # This will hold all configuration information
492 self.rc = rc # This will hold all configuration information
486 self.pager = 'less'
493 self.pager = 'less'
487 # temporary files used for various purposes. Deleted at exit.
494 # temporary files used for various purposes. Deleted at exit.
488 self.tempfiles = []
495 self.tempfiles = []
489
496
490 # Keep track of readline usage (later set by init_readline)
497 # Keep track of readline usage (later set by init_readline)
491 self.has_readline = False
498 self.has_readline = False
492
499
493 # template for logfile headers. It gets resolved at runtime by the
500 # template for logfile headers. It gets resolved at runtime by the
494 # logstart method.
501 # logstart method.
495 self.loghead_tpl = \
502 self.loghead_tpl = \
496 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
503 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
497 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
504 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
498 #log# opts = %s
505 #log# opts = %s
499 #log# args = %s
506 #log# args = %s
500 #log# It is safe to make manual edits below here.
507 #log# It is safe to make manual edits below here.
501 #log#-----------------------------------------------------------------------
508 #log#-----------------------------------------------------------------------
502 """
509 """
503 # for pushd/popd management
510 # for pushd/popd management
504 try:
511 try:
505 self.home_dir = get_home_dir()
512 self.home_dir = get_home_dir()
506 except HomeDirError,msg:
513 except HomeDirError,msg:
507 fatal(msg)
514 fatal(msg)
508
515
509 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
516 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
510
517
511 # Functions to call the underlying shell.
518 # Functions to call the underlying shell.
512
519
513 # utility to expand user variables via Itpl
520 # utility to expand user variables via Itpl
514 self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'),
521 self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'),
515 self.user_ns))
522 self.user_ns))
516 # The first is similar to os.system, but it doesn't return a value,
523 # The first is similar to os.system, but it doesn't return a value,
517 # and it allows interpolation of variables in the user's namespace.
524 # and it allows interpolation of variables in the user's namespace.
518 self.system = lambda cmd: shell(self.var_expand(cmd),
525 self.system = lambda cmd: shell(self.var_expand(cmd),
519 header='IPython system call: ',
526 header='IPython system call: ',
520 verbose=self.rc.system_verbose)
527 verbose=self.rc.system_verbose)
521 # These are for getoutput and getoutputerror:
528 # These are for getoutput and getoutputerror:
522 self.getoutput = lambda cmd: \
529 self.getoutput = lambda cmd: \
523 getoutput(self.var_expand(cmd),
530 getoutput(self.var_expand(cmd),
524 header='IPython system call: ',
531 header='IPython system call: ',
525 verbose=self.rc.system_verbose)
532 verbose=self.rc.system_verbose)
526 self.getoutputerror = lambda cmd: \
533 self.getoutputerror = lambda cmd: \
527 getoutputerror(str(ItplNS(cmd.replace('#','\#'),
534 getoutputerror(str(ItplNS(cmd.replace('#','\#'),
528 self.user_ns)),
535 self.user_ns)),
529 header='IPython system call: ',
536 header='IPython system call: ',
530 verbose=self.rc.system_verbose)
537 verbose=self.rc.system_verbose)
531
538
532 # RegExp for splitting line contents into pre-char//first
539 # RegExp for splitting line contents into pre-char//first
533 # word-method//rest. For clarity, each group in on one line.
540 # word-method//rest. For clarity, each group in on one line.
534
541
535 # WARNING: update the regexp if the above escapes are changed, as they
542 # WARNING: update the regexp if the above escapes are changed, as they
536 # are hardwired in.
543 # are hardwired in.
537
544
538 # Don't get carried away with trying to make the autocalling catch too
545 # Don't get carried away with trying to make the autocalling catch too
539 # much: it's better to be conservative rather than to trigger hidden
546 # much: it's better to be conservative rather than to trigger hidden
540 # evals() somewhere and end up causing side effects.
547 # evals() somewhere and end up causing side effects.
541
548
542 self.line_split = re.compile(r'^([\s*,;/])'
549 self.line_split = re.compile(r'^([\s*,;/])'
543 r'([\?\w\.]+\w*\s*)'
550 r'([\?\w\.]+\w*\s*)'
544 r'(\(?.*$)')
551 r'(\(?.*$)')
545
552
546 # Original re, keep around for a while in case changes break something
553 # Original re, keep around for a while in case changes break something
547 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
554 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
548 # r'(\s*[\?\w\.]+\w*\s*)'
555 # r'(\s*[\?\w\.]+\w*\s*)'
549 # r'(\(?.*$)')
556 # r'(\(?.*$)')
550
557
551 # RegExp to identify potential function names
558 # RegExp to identify potential function names
552 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
559 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
553 # RegExp to exclude strings with this start from autocalling
560 # RegExp to exclude strings with this start from autocalling
554 self.re_exclude_auto = re.compile('^[!=()<>,\*/\+-]|^is ')
561 self.re_exclude_auto = re.compile('^[!=()<>,\*/\+-]|^is ')
555
562
556 # try to catch also methods for stuff in lists/tuples/dicts: off
563 # try to catch also methods for stuff in lists/tuples/dicts: off
557 # (experimental). For this to work, the line_split regexp would need
564 # (experimental). For this to work, the line_split regexp would need
558 # to be modified so it wouldn't break things at '['. That line is
565 # to be modified so it wouldn't break things at '['. That line is
559 # nasty enough that I shouldn't change it until I can test it _well_.
566 # nasty enough that I shouldn't change it until I can test it _well_.
560 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
567 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
561
568
562 # keep track of where we started running (mainly for crash post-mortem)
569 # keep track of where we started running (mainly for crash post-mortem)
563 self.starting_dir = os.getcwd()
570 self.starting_dir = os.getcwd()
564
571
565 # Various switches which can be set
572 # Various switches which can be set
566 self.CACHELENGTH = 5000 # this is cheap, it's just text
573 self.CACHELENGTH = 5000 # this is cheap, it's just text
567 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
574 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
568 self.banner2 = banner2
575 self.banner2 = banner2
569
576
570 # TraceBack handlers:
577 # TraceBack handlers:
571
578
572 # Syntax error handler.
579 # Syntax error handler.
573 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
580 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
574
581
575 # The interactive one is initialized with an offset, meaning we always
582 # The interactive one is initialized with an offset, meaning we always
576 # want to remove the topmost item in the traceback, which is our own
583 # want to remove the topmost item in the traceback, which is our own
577 # internal code. Valid modes: ['Plain','Context','Verbose']
584 # internal code. Valid modes: ['Plain','Context','Verbose']
578 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
585 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
579 color_scheme='NoColor',
586 color_scheme='NoColor',
580 tb_offset = 1)
587 tb_offset = 1)
581
588
582 # IPython itself shouldn't crash. This will produce a detailed
589 # IPython itself shouldn't crash. This will produce a detailed
583 # post-mortem if it does. But we only install the crash handler for
590 # post-mortem if it does. But we only install the crash handler for
584 # non-threaded shells, the threaded ones use a normal verbose reporter
591 # non-threaded shells, the threaded ones use a normal verbose reporter
585 # and lose the crash handler. This is because exceptions in the main
592 # and lose the crash handler. This is because exceptions in the main
586 # thread (such as in GUI code) propagate directly to sys.excepthook,
593 # thread (such as in GUI code) propagate directly to sys.excepthook,
587 # and there's no point in printing crash dumps for every user exception.
594 # and there's no point in printing crash dumps for every user exception.
588 if self.isthreaded:
595 if self.isthreaded:
589 sys.excepthook = ultraTB.FormattedTB()
596 sys.excepthook = ultraTB.FormattedTB()
590 else:
597 else:
591 from IPython import CrashHandler
598 from IPython import CrashHandler
592 sys.excepthook = CrashHandler.CrashHandler(self)
599 sys.excepthook = CrashHandler.CrashHandler(self)
593
600
594 # The instance will store a pointer to this, so that runtime code
601 # The instance will store a pointer to this, so that runtime code
595 # (such as magics) can access it. This is because during the
602 # (such as magics) can access it. This is because during the
596 # read-eval loop, it gets temporarily overwritten (to deal with GUI
603 # read-eval loop, it gets temporarily overwritten (to deal with GUI
597 # frameworks).
604 # frameworks).
598 self.sys_excepthook = sys.excepthook
605 self.sys_excepthook = sys.excepthook
599
606
600 # and add any custom exception handlers the user may have specified
607 # and add any custom exception handlers the user may have specified
601 self.set_custom_exc(*custom_exceptions)
608 self.set_custom_exc(*custom_exceptions)
602
609
603 # Object inspector
610 # Object inspector
604 self.inspector = OInspect.Inspector(OInspect.InspectColors,
611 self.inspector = OInspect.Inspector(OInspect.InspectColors,
605 PyColorize.ANSICodeColors,
612 PyColorize.ANSICodeColors,
606 'NoColor')
613 'NoColor')
607 # indentation management
614 # indentation management
608 self.autoindent = False
615 self.autoindent = False
609 self.indent_current_nsp = 0
616 self.indent_current_nsp = 0
610 self.indent_current = '' # actual indent string
617 self.indent_current = '' # actual indent string
611
618
612 # Make some aliases automatically
619 # Make some aliases automatically
613 # Prepare list of shell aliases to auto-define
620 # Prepare list of shell aliases to auto-define
614 if os.name == 'posix':
621 if os.name == 'posix':
615 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
622 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
616 'mv mv -i','rm rm -i','cp cp -i',
623 'mv mv -i','rm rm -i','cp cp -i',
617 'cat cat','less less','clear clear',
624 'cat cat','less less','clear clear',
618 # a better ls
625 # a better ls
619 'ls ls -F',
626 'ls ls -F',
620 # long ls
627 # long ls
621 'll ls -lF',
628 'll ls -lF',
622 # color ls
629 # color ls
623 'lc ls -F -o --color',
630 'lc ls -F -o --color',
624 # ls normal files only
631 # ls normal files only
625 'lf ls -F -o --color %l | grep ^-',
632 'lf ls -F -o --color %l | grep ^-',
626 # ls symbolic links
633 # ls symbolic links
627 'lk ls -F -o --color %l | grep ^l',
634 'lk ls -F -o --color %l | grep ^l',
628 # directories or links to directories,
635 # directories or links to directories,
629 'ldir ls -F -o --color %l | grep /$',
636 'ldir ls -F -o --color %l | grep /$',
630 # things which are executable
637 # things which are executable
631 'lx ls -F -o --color %l | grep ^-..x',
638 'lx ls -F -o --color %l | grep ^-..x',
632 )
639 )
633 elif os.name in ['nt','dos']:
640 elif os.name in ['nt','dos']:
634 auto_alias = ('dir dir /on', 'ls dir /on',
641 auto_alias = ('dir dir /on', 'ls dir /on',
635 'ddir dir /ad /on', 'ldir dir /ad /on',
642 'ddir dir /ad /on', 'ldir dir /ad /on',
636 'mkdir mkdir','rmdir rmdir','echo echo',
643 'mkdir mkdir','rmdir rmdir','echo echo',
637 'ren ren','cls cls','copy copy')
644 'ren ren','cls cls','copy copy')
638 else:
645 else:
639 auto_alias = ()
646 auto_alias = ()
640 self.auto_alias = map(lambda s:s.split(None,1),auto_alias)
647 self.auto_alias = map(lambda s:s.split(None,1),auto_alias)
641 # Call the actual (public) initializer
648 # Call the actual (public) initializer
642 self.init_auto_alias()
649 self.init_auto_alias()
643 # end __init__
650 # end __init__
644
651
645 def post_config_initialization(self):
652 def post_config_initialization(self):
646 """Post configuration init method
653 """Post configuration init method
647
654
648 This is called after the configuration files have been processed to
655 This is called after the configuration files have been processed to
649 'finalize' the initialization."""
656 'finalize' the initialization."""
650
657
651 rc = self.rc
658 rc = self.rc
652
659
653 # Load readline proper
660 # Load readline proper
654 if rc.readline:
661 if rc.readline:
655 self.init_readline()
662 self.init_readline()
656
663
657 # log system
664 # log system
658 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
665 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
659 # local shortcut, this is used a LOT
666 # local shortcut, this is used a LOT
660 self.log = self.logger.log
667 self.log = self.logger.log
661
668
662 # Initialize cache, set in/out prompts and printing system
669 # Initialize cache, set in/out prompts and printing system
663 self.outputcache = CachedOutput(self,
670 self.outputcache = CachedOutput(self,
664 rc.cache_size,
671 rc.cache_size,
665 rc.pprint,
672 rc.pprint,
666 input_sep = rc.separate_in,
673 input_sep = rc.separate_in,
667 output_sep = rc.separate_out,
674 output_sep = rc.separate_out,
668 output_sep2 = rc.separate_out2,
675 output_sep2 = rc.separate_out2,
669 ps1 = rc.prompt_in1,
676 ps1 = rc.prompt_in1,
670 ps2 = rc.prompt_in2,
677 ps2 = rc.prompt_in2,
671 ps_out = rc.prompt_out,
678 ps_out = rc.prompt_out,
672 pad_left = rc.prompts_pad_left)
679 pad_left = rc.prompts_pad_left)
673
680
674 # user may have over-ridden the default print hook:
681 # user may have over-ridden the default print hook:
675 try:
682 try:
676 self.outputcache.__class__.display = self.hooks.display
683 self.outputcache.__class__.display = self.hooks.display
677 except AttributeError:
684 except AttributeError:
678 pass
685 pass
679
686
680 # I don't like assigning globally to sys, because it means when embedding
687 # I don't like assigning globally to sys, because it means when embedding
681 # instances, each embedded instance overrides the previous choice. But
688 # instances, each embedded instance overrides the previous choice. But
682 # sys.displayhook seems to be called internally by exec, so I don't see a
689 # sys.displayhook seems to be called internally by exec, so I don't see a
683 # way around it.
690 # way around it.
684 sys.displayhook = self.outputcache
691 sys.displayhook = self.outputcache
685
692
686 # Set user colors (don't do it in the constructor above so that it
693 # Set user colors (don't do it in the constructor above so that it
687 # doesn't crash if colors option is invalid)
694 # doesn't crash if colors option is invalid)
688 self.magic_colors(rc.colors)
695 self.magic_colors(rc.colors)
689
696
690 # Set calling of pdb on exceptions
697 # Set calling of pdb on exceptions
691 self.call_pdb = rc.pdb
698 self.call_pdb = rc.pdb
692
699
693 # Load user aliases
700 # Load user aliases
694 for alias in rc.alias:
701 for alias in rc.alias:
695 self.magic_alias(alias)
702 self.magic_alias(alias)
696
703
697 # dynamic data that survives through sessions
704 # dynamic data that survives through sessions
698 # XXX make the filename a config option?
705 # XXX make the filename a config option?
699 persist_base = 'persist'
706 persist_base = 'persist'
700 if rc.profile:
707 if rc.profile:
701 persist_base += '_%s' % rc.profile
708 persist_base += '_%s' % rc.profile
702 self.persist_fname = os.path.join(rc.ipythondir,persist_base)
709 self.persist_fname = os.path.join(rc.ipythondir,persist_base)
703
710
704 try:
711 try:
705 self.persist = pickle.load(file(self.persist_fname))
712 self.persist = pickle.load(file(self.persist_fname))
706 except:
713 except:
707 self.persist = {}
714 self.persist = {}
708
715
709
716
710 for (key, value) in [(k[2:],v) for (k,v) in self.persist.items() if k.startswith('S:')]:
717 for (key, value) in [(k[2:],v) for (k,v) in self.persist.items() if k.startswith('S:')]:
711 try:
718 try:
712 obj = pickle.loads(value)
719 obj = pickle.loads(value)
713 except:
720 except:
714
721
715 print "Unable to restore variable '%s', ignoring (use %%store -d to forget!)" % key
722 print "Unable to restore variable '%s', ignoring (use %%store -d to forget!)" % key
716 print "The error was:",sys.exc_info()[0]
723 print "The error was:",sys.exc_info()[0]
717 continue
724 continue
718
725
719
726
720 self.user_ns[key] = obj
727 self.user_ns[key] = obj
721
728
722 def set_hook(self,name,hook):
729 def set_hook(self,name,hook):
723 """set_hook(name,hook) -> sets an internal IPython hook.
730 """set_hook(name,hook) -> sets an internal IPython hook.
724
731
725 IPython exposes some of its internal API as user-modifiable hooks. By
732 IPython exposes some of its internal API as user-modifiable hooks. By
726 resetting one of these hooks, you can modify IPython's behavior to
733 resetting one of these hooks, you can modify IPython's behavior to
727 call at runtime your own routines."""
734 call at runtime your own routines."""
728
735
729 # At some point in the future, this should validate the hook before it
736 # At some point in the future, this should validate the hook before it
730 # accepts it. Probably at least check that the hook takes the number
737 # accepts it. Probably at least check that the hook takes the number
731 # of args it's supposed to.
738 # of args it's supposed to.
732 setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
739 setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
733
740
734 def set_custom_exc(self,exc_tuple,handler):
741 def set_custom_exc(self,exc_tuple,handler):
735 """set_custom_exc(exc_tuple,handler)
742 """set_custom_exc(exc_tuple,handler)
736
743
737 Set a custom exception handler, which will be called if any of the
744 Set a custom exception handler, which will be called if any of the
738 exceptions in exc_tuple occur in the mainloop (specifically, in the
745 exceptions in exc_tuple occur in the mainloop (specifically, in the
739 runcode() method.
746 runcode() method.
740
747
741 Inputs:
748 Inputs:
742
749
743 - exc_tuple: a *tuple* of valid exceptions to call the defined
750 - exc_tuple: a *tuple* of valid exceptions to call the defined
744 handler for. It is very important that you use a tuple, and NOT A
751 handler for. It is very important that you use a tuple, and NOT A
745 LIST here, because of the way Python's except statement works. If
752 LIST here, because of the way Python's except statement works. If
746 you only want to trap a single exception, use a singleton tuple:
753 you only want to trap a single exception, use a singleton tuple:
747
754
748 exc_tuple == (MyCustomException,)
755 exc_tuple == (MyCustomException,)
749
756
750 - handler: this must be defined as a function with the following
757 - handler: this must be defined as a function with the following
751 basic interface: def my_handler(self,etype,value,tb).
758 basic interface: def my_handler(self,etype,value,tb).
752
759
753 This will be made into an instance method (via new.instancemethod)
760 This will be made into an instance method (via new.instancemethod)
754 of IPython itself, and it will be called if any of the exceptions
761 of IPython itself, and it will be called if any of the exceptions
755 listed in the exc_tuple are caught. If the handler is None, an
762 listed in the exc_tuple are caught. If the handler is None, an
756 internal basic one is used, which just prints basic info.
763 internal basic one is used, which just prints basic info.
757
764
758 WARNING: by putting in your own exception handler into IPython's main
765 WARNING: by putting in your own exception handler into IPython's main
759 execution loop, you run a very good chance of nasty crashes. This
766 execution loop, you run a very good chance of nasty crashes. This
760 facility should only be used if you really know what you are doing."""
767 facility should only be used if you really know what you are doing."""
761
768
762 assert type(exc_tuple)==type(()) , \
769 assert type(exc_tuple)==type(()) , \
763 "The custom exceptions must be given AS A TUPLE."
770 "The custom exceptions must be given AS A TUPLE."
764
771
765 def dummy_handler(self,etype,value,tb):
772 def dummy_handler(self,etype,value,tb):
766 print '*** Simple custom exception handler ***'
773 print '*** Simple custom exception handler ***'
767 print 'Exception type :',etype
774 print 'Exception type :',etype
768 print 'Exception value:',value
775 print 'Exception value:',value
769 print 'Traceback :',tb
776 print 'Traceback :',tb
770 print 'Source code :','\n'.join(self.buffer)
777 print 'Source code :','\n'.join(self.buffer)
771
778
772 if handler is None: handler = dummy_handler
779 if handler is None: handler = dummy_handler
773
780
774 self.CustomTB = new.instancemethod(handler,self,self.__class__)
781 self.CustomTB = new.instancemethod(handler,self,self.__class__)
775 self.custom_exceptions = exc_tuple
782 self.custom_exceptions = exc_tuple
776
783
777 def set_custom_completer(self,completer,pos=0):
784 def set_custom_completer(self,completer,pos=0):
778 """set_custom_completer(completer,pos=0)
785 """set_custom_completer(completer,pos=0)
779
786
780 Adds a new custom completer function.
787 Adds a new custom completer function.
781
788
782 The position argument (defaults to 0) is the index in the completers
789 The position argument (defaults to 0) is the index in the completers
783 list where you want the completer to be inserted."""
790 list where you want the completer to be inserted."""
784
791
785 newcomp = new.instancemethod(completer,self.Completer,
792 newcomp = new.instancemethod(completer,self.Completer,
786 self.Completer.__class__)
793 self.Completer.__class__)
787 self.Completer.matchers.insert(pos,newcomp)
794 self.Completer.matchers.insert(pos,newcomp)
788
795
789 def _get_call_pdb(self):
796 def _get_call_pdb(self):
790 return self._call_pdb
797 return self._call_pdb
791
798
792 def _set_call_pdb(self,val):
799 def _set_call_pdb(self,val):
793
800
794 if val not in (0,1,False,True):
801 if val not in (0,1,False,True):
795 raise ValueError,'new call_pdb value must be boolean'
802 raise ValueError,'new call_pdb value must be boolean'
796
803
797 # store value in instance
804 # store value in instance
798 self._call_pdb = val
805 self._call_pdb = val
799
806
800 # notify the actual exception handlers
807 # notify the actual exception handlers
801 self.InteractiveTB.call_pdb = val
808 self.InteractiveTB.call_pdb = val
802 if self.isthreaded:
809 if self.isthreaded:
803 try:
810 try:
804 self.sys_excepthook.call_pdb = val
811 self.sys_excepthook.call_pdb = val
805 except:
812 except:
806 warn('Failed to activate pdb for threaded exception handler')
813 warn('Failed to activate pdb for threaded exception handler')
807
814
808 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
815 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
809 'Control auto-activation of pdb at exceptions')
816 'Control auto-activation of pdb at exceptions')
810
817
811 def complete(self,text):
818 def complete(self,text):
812 """Return a sorted list of all possible completions on text.
819 """Return a sorted list of all possible completions on text.
813
820
814 Inputs:
821 Inputs:
815
822
816 - text: a string of text to be completed on.
823 - text: a string of text to be completed on.
817
824
818 This is a wrapper around the completion mechanism, similar to what
825 This is a wrapper around the completion mechanism, similar to what
819 readline does at the command line when the TAB key is hit. By
826 readline does at the command line when the TAB key is hit. By
820 exposing it as a method, it can be used by other non-readline
827 exposing it as a method, it can be used by other non-readline
821 environments (such as GUIs) for text completion.
828 environments (such as GUIs) for text completion.
822
829
823 Simple usage example:
830 Simple usage example:
824
831
825 In [1]: x = 'hello'
832 In [1]: x = 'hello'
826
833
827 In [2]: __IP.complete('x.l')
834 In [2]: __IP.complete('x.l')
828 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
835 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
829
836
830 complete = self.Completer.complete
837 complete = self.Completer.complete
831 state = 0
838 state = 0
832 # use a dict so we get unique keys, since ipyhton's multiple
839 # use a dict so we get unique keys, since ipyhton's multiple
833 # completers can return duplicates.
840 # completers can return duplicates.
834 comps = {}
841 comps = {}
835 while True:
842 while True:
836 newcomp = complete(text,state)
843 newcomp = complete(text,state)
837 if newcomp is None:
844 if newcomp is None:
838 break
845 break
839 comps[newcomp] = 1
846 comps[newcomp] = 1
840 state += 1
847 state += 1
841 outcomps = comps.keys()
848 outcomps = comps.keys()
842 outcomps.sort()
849 outcomps.sort()
843 return outcomps
850 return outcomps
844
851
845 def set_completer_frame(self, frame):
852 def set_completer_frame(self, frame):
846 if frame:
853 if frame:
847 self.Completer.namespace = frame.f_locals
854 self.Completer.namespace = frame.f_locals
848 self.Completer.global_namespace = frame.f_globals
855 self.Completer.global_namespace = frame.f_globals
849 else:
856 else:
850 self.Completer.namespace = self.user_ns
857 self.Completer.namespace = self.user_ns
851 self.Completer.global_namespace = self.user_global_ns
858 self.Completer.global_namespace = self.user_global_ns
852
859
853 def init_auto_alias(self):
860 def init_auto_alias(self):
854 """Define some aliases automatically.
861 """Define some aliases automatically.
855
862
856 These are ALL parameter-less aliases"""
863 These are ALL parameter-less aliases"""
857 for alias,cmd in self.auto_alias:
864 for alias,cmd in self.auto_alias:
858 self.alias_table[alias] = (0,cmd)
865 self.alias_table[alias] = (0,cmd)
859
866
860 def alias_table_validate(self,verbose=0):
867 def alias_table_validate(self,verbose=0):
861 """Update information about the alias table.
868 """Update information about the alias table.
862
869
863 In particular, make sure no Python keywords/builtins are in it."""
870 In particular, make sure no Python keywords/builtins are in it."""
864
871
865 no_alias = self.no_alias
872 no_alias = self.no_alias
866 for k in self.alias_table.keys():
873 for k in self.alias_table.keys():
867 if k in no_alias:
874 if k in no_alias:
868 del self.alias_table[k]
875 del self.alias_table[k]
869 if verbose:
876 if verbose:
870 print ("Deleting alias <%s>, it's a Python "
877 print ("Deleting alias <%s>, it's a Python "
871 "keyword or builtin." % k)
878 "keyword or builtin." % k)
872
879
873 def set_autoindent(self,value=None):
880 def set_autoindent(self,value=None):
874 """Set the autoindent flag, checking for readline support.
881 """Set the autoindent flag, checking for readline support.
875
882
876 If called with no arguments, it acts as a toggle."""
883 If called with no arguments, it acts as a toggle."""
877
884
878 if not self.has_readline:
885 if not self.has_readline:
879 if os.name == 'posix':
886 if os.name == 'posix':
880 warn("The auto-indent feature requires the readline library")
887 warn("The auto-indent feature requires the readline library")
881 self.autoindent = 0
888 self.autoindent = 0
882 return
889 return
883 if value is None:
890 if value is None:
884 self.autoindent = not self.autoindent
891 self.autoindent = not self.autoindent
885 else:
892 else:
886 self.autoindent = value
893 self.autoindent = value
887
894
888 def rc_set_toggle(self,rc_field,value=None):
895 def rc_set_toggle(self,rc_field,value=None):
889 """Set or toggle a field in IPython's rc config. structure.
896 """Set or toggle a field in IPython's rc config. structure.
890
897
891 If called with no arguments, it acts as a toggle.
898 If called with no arguments, it acts as a toggle.
892
899
893 If called with a non-existent field, the resulting AttributeError
900 If called with a non-existent field, the resulting AttributeError
894 exception will propagate out."""
901 exception will propagate out."""
895
902
896 rc_val = getattr(self.rc,rc_field)
903 rc_val = getattr(self.rc,rc_field)
897 if value is None:
904 if value is None:
898 value = not rc_val
905 value = not rc_val
899 setattr(self.rc,rc_field,value)
906 setattr(self.rc,rc_field,value)
900
907
901 def user_setup(self,ipythondir,rc_suffix,mode='install'):
908 def user_setup(self,ipythondir,rc_suffix,mode='install'):
902 """Install the user configuration directory.
909 """Install the user configuration directory.
903
910
904 Can be called when running for the first time or to upgrade the user's
911 Can be called when running for the first time or to upgrade the user's
905 .ipython/ directory with the mode parameter. Valid modes are 'install'
912 .ipython/ directory with the mode parameter. Valid modes are 'install'
906 and 'upgrade'."""
913 and 'upgrade'."""
907
914
908 def wait():
915 def wait():
909 try:
916 try:
910 raw_input("Please press <RETURN> to start IPython.")
917 raw_input("Please press <RETURN> to start IPython.")
911 except EOFError:
918 except EOFError:
912 print >> Term.cout
919 print >> Term.cout
913 print '*'*70
920 print '*'*70
914
921
915 cwd = os.getcwd() # remember where we started
922 cwd = os.getcwd() # remember where we started
916 glb = glob.glob
923 glb = glob.glob
917 print '*'*70
924 print '*'*70
918 if mode == 'install':
925 if mode == 'install':
919 print \
926 print \
920 """Welcome to IPython. I will try to create a personal configuration directory
927 """Welcome to IPython. I will try to create a personal configuration directory
921 where you can customize many aspects of IPython's functionality in:\n"""
928 where you can customize many aspects of IPython's functionality in:\n"""
922 else:
929 else:
923 print 'I am going to upgrade your configuration in:'
930 print 'I am going to upgrade your configuration in:'
924
931
925 print ipythondir
932 print ipythondir
926
933
927 rcdirend = os.path.join('IPython','UserConfig')
934 rcdirend = os.path.join('IPython','UserConfig')
928 cfg = lambda d: os.path.join(d,rcdirend)
935 cfg = lambda d: os.path.join(d,rcdirend)
929 try:
936 try:
930 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
937 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
931 except IOError:
938 except IOError:
932 warning = """
939 warning = """
933 Installation error. IPython's directory was not found.
940 Installation error. IPython's directory was not found.
934
941
935 Check the following:
942 Check the following:
936
943
937 The ipython/IPython directory should be in a directory belonging to your
944 The ipython/IPython directory should be in a directory belonging to your
938 PYTHONPATH environment variable (that is, it should be in a directory
945 PYTHONPATH environment variable (that is, it should be in a directory
939 belonging to sys.path). You can copy it explicitly there or just link to it.
946 belonging to sys.path). You can copy it explicitly there or just link to it.
940
947
941 IPython will proceed with builtin defaults.
948 IPython will proceed with builtin defaults.
942 """
949 """
943 warn(warning)
950 warn(warning)
944 wait()
951 wait()
945 return
952 return
946
953
947 if mode == 'install':
954 if mode == 'install':
948 try:
955 try:
949 shutil.copytree(rcdir,ipythondir)
956 shutil.copytree(rcdir,ipythondir)
950 os.chdir(ipythondir)
957 os.chdir(ipythondir)
951 rc_files = glb("ipythonrc*")
958 rc_files = glb("ipythonrc*")
952 for rc_file in rc_files:
959 for rc_file in rc_files:
953 os.rename(rc_file,rc_file+rc_suffix)
960 os.rename(rc_file,rc_file+rc_suffix)
954 except:
961 except:
955 warning = """
962 warning = """
956
963
957 There was a problem with the installation:
964 There was a problem with the installation:
958 %s
965 %s
959 Try to correct it or contact the developers if you think it's a bug.
966 Try to correct it or contact the developers if you think it's a bug.
960 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
967 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
961 warn(warning)
968 warn(warning)
962 wait()
969 wait()
963 return
970 return
964
971
965 elif mode == 'upgrade':
972 elif mode == 'upgrade':
966 try:
973 try:
967 os.chdir(ipythondir)
974 os.chdir(ipythondir)
968 except:
975 except:
969 print """
976 print """
970 Can not upgrade: changing to directory %s failed. Details:
977 Can not upgrade: changing to directory %s failed. Details:
971 %s
978 %s
972 """ % (ipythondir,sys.exc_info()[1])
979 """ % (ipythondir,sys.exc_info()[1])
973 wait()
980 wait()
974 return
981 return
975 else:
982 else:
976 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
983 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
977 for new_full_path in sources:
984 for new_full_path in sources:
978 new_filename = os.path.basename(new_full_path)
985 new_filename = os.path.basename(new_full_path)
979 if new_filename.startswith('ipythonrc'):
986 if new_filename.startswith('ipythonrc'):
980 new_filename = new_filename + rc_suffix
987 new_filename = new_filename + rc_suffix
981 # The config directory should only contain files, skip any
988 # The config directory should only contain files, skip any
982 # directories which may be there (like CVS)
989 # directories which may be there (like CVS)
983 if os.path.isdir(new_full_path):
990 if os.path.isdir(new_full_path):
984 continue
991 continue
985 if os.path.exists(new_filename):
992 if os.path.exists(new_filename):
986 old_file = new_filename+'.old'
993 old_file = new_filename+'.old'
987 if os.path.exists(old_file):
994 if os.path.exists(old_file):
988 os.remove(old_file)
995 os.remove(old_file)
989 os.rename(new_filename,old_file)
996 os.rename(new_filename,old_file)
990 shutil.copy(new_full_path,new_filename)
997 shutil.copy(new_full_path,new_filename)
991 else:
998 else:
992 raise ValueError,'unrecognized mode for install:',`mode`
999 raise ValueError,'unrecognized mode for install:',`mode`
993
1000
994 # Fix line-endings to those native to each platform in the config
1001 # Fix line-endings to those native to each platform in the config
995 # directory.
1002 # directory.
996 try:
1003 try:
997 os.chdir(ipythondir)
1004 os.chdir(ipythondir)
998 except:
1005 except:
999 print """
1006 print """
1000 Problem: changing to directory %s failed.
1007 Problem: changing to directory %s failed.
1001 Details:
1008 Details:
1002 %s
1009 %s
1003
1010
1004 Some configuration files may have incorrect line endings. This should not
1011 Some configuration files may have incorrect line endings. This should not
1005 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1012 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1006 wait()
1013 wait()
1007 else:
1014 else:
1008 for fname in glb('ipythonrc*'):
1015 for fname in glb('ipythonrc*'):
1009 try:
1016 try:
1010 native_line_ends(fname,backup=0)
1017 native_line_ends(fname,backup=0)
1011 except IOError:
1018 except IOError:
1012 pass
1019 pass
1013
1020
1014 if mode == 'install':
1021 if mode == 'install':
1015 print """
1022 print """
1016 Successful installation!
1023 Successful installation!
1017
1024
1018 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1025 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1019 IPython manual (there are both HTML and PDF versions supplied with the
1026 IPython manual (there are both HTML and PDF versions supplied with the
1020 distribution) to make sure that your system environment is properly configured
1027 distribution) to make sure that your system environment is properly configured
1021 to take advantage of IPython's features."""
1028 to take advantage of IPython's features."""
1022 else:
1029 else:
1023 print """
1030 print """
1024 Successful upgrade!
1031 Successful upgrade!
1025
1032
1026 All files in your directory:
1033 All files in your directory:
1027 %(ipythondir)s
1034 %(ipythondir)s
1028 which would have been overwritten by the upgrade were backed up with a .old
1035 which would have been overwritten by the upgrade were backed up with a .old
1029 extension. If you had made particular customizations in those files you may
1036 extension. If you had made particular customizations in those files you may
1030 want to merge them back into the new files.""" % locals()
1037 want to merge them back into the new files.""" % locals()
1031 wait()
1038 wait()
1032 os.chdir(cwd)
1039 os.chdir(cwd)
1033 # end user_setup()
1040 # end user_setup()
1034
1041
1035 def atexit_operations(self):
1042 def atexit_operations(self):
1036 """This will be executed at the time of exit.
1043 """This will be executed at the time of exit.
1037
1044
1038 Saving of persistent data should be performed here. """
1045 Saving of persistent data should be performed here. """
1039
1046
1040 # input history
1047 # input history
1041 self.savehist()
1048 self.savehist()
1042
1049
1043 # Cleanup all tempfiles left around
1050 # Cleanup all tempfiles left around
1044 for tfile in self.tempfiles:
1051 for tfile in self.tempfiles:
1045 try:
1052 try:
1046 os.unlink(tfile)
1053 os.unlink(tfile)
1047 except OSError:
1054 except OSError:
1048 pass
1055 pass
1049
1056
1050 # save the "persistent data" catch-all dictionary
1057 # save the "persistent data" catch-all dictionary
1051 try:
1058 try:
1052 pickle.dump(self.persist, open(self.persist_fname,"w"))
1059 pickle.dump(self.persist, open(self.persist_fname,"w"))
1053 except:
1060 except:
1054 print "*** ERROR *** persistent data saving failed."
1061 print "*** ERROR *** persistent data saving failed."
1055
1062
1056 def savehist(self):
1063 def savehist(self):
1057 """Save input history to a file (via readline library)."""
1064 """Save input history to a file (via readline library)."""
1058 try:
1065 try:
1059 self.readline.write_history_file(self.histfile)
1066 self.readline.write_history_file(self.histfile)
1060 except:
1067 except:
1061 print 'Unable to save IPython command history to file: ' + \
1068 print 'Unable to save IPython command history to file: ' + \
1062 `self.histfile`
1069 `self.histfile`
1063
1070
1064 def pre_readline(self):
1071 def pre_readline(self):
1065 """readline hook to be used at the start of each line.
1072 """readline hook to be used at the start of each line.
1066
1073
1067 Currently it handles auto-indent only."""
1074 Currently it handles auto-indent only."""
1068
1075
1069 self.readline.insert_text(self.indent_current)
1076 self.readline.insert_text(self.indent_current)
1070
1077
1071 def init_readline(self):
1078 def init_readline(self):
1072 """Command history completion/saving/reloading."""
1079 """Command history completion/saving/reloading."""
1073 try:
1080 try:
1074 import readline
1081 import readline
1075 except ImportError:
1082 except ImportError:
1076 self.has_readline = 0
1083 self.has_readline = 0
1077 self.readline = None
1084 self.readline = None
1078 # no point in bugging windows users with this every time:
1085 # no point in bugging windows users with this every time:
1079 if os.name == 'posix':
1086 if os.name == 'posix':
1080 warn('Readline services not available on this platform.')
1087 warn('Readline services not available on this platform.')
1081 else:
1088 else:
1082 import atexit
1089 import atexit
1083 from IPython.completer import IPCompleter
1090 from IPython.completer import IPCompleter
1084 self.Completer = IPCompleter(self,
1091 self.Completer = IPCompleter(self,
1085 self.user_ns,
1092 self.user_ns,
1086 self.user_global_ns,
1093 self.user_global_ns,
1087 self.rc.readline_omit__names,
1094 self.rc.readline_omit__names,
1088 self.alias_table)
1095 self.alias_table)
1089
1096
1090 # Platform-specific configuration
1097 # Platform-specific configuration
1091 if os.name == 'nt':
1098 if os.name == 'nt':
1092 self.readline_startup_hook = readline.set_pre_input_hook
1099 self.readline_startup_hook = readline.set_pre_input_hook
1093 else:
1100 else:
1094 self.readline_startup_hook = readline.set_startup_hook
1101 self.readline_startup_hook = readline.set_startup_hook
1095
1102
1096 # Load user's initrc file (readline config)
1103 # Load user's initrc file (readline config)
1097 inputrc_name = os.environ.get('INPUTRC')
1104 inputrc_name = os.environ.get('INPUTRC')
1098 if inputrc_name is None:
1105 if inputrc_name is None:
1099 home_dir = get_home_dir()
1106 home_dir = get_home_dir()
1100 if home_dir is not None:
1107 if home_dir is not None:
1101 inputrc_name = os.path.join(home_dir,'.inputrc')
1108 inputrc_name = os.path.join(home_dir,'.inputrc')
1102 if os.path.isfile(inputrc_name):
1109 if os.path.isfile(inputrc_name):
1103 try:
1110 try:
1104 readline.read_init_file(inputrc_name)
1111 readline.read_init_file(inputrc_name)
1105 except:
1112 except:
1106 warn('Problems reading readline initialization file <%s>'
1113 warn('Problems reading readline initialization file <%s>'
1107 % inputrc_name)
1114 % inputrc_name)
1108
1115
1109 self.has_readline = 1
1116 self.has_readline = 1
1110 self.readline = readline
1117 self.readline = readline
1111 # save this in sys so embedded copies can restore it properly
1118 # save this in sys so embedded copies can restore it properly
1112 sys.ipcompleter = self.Completer.complete
1119 sys.ipcompleter = self.Completer.complete
1113 readline.set_completer(self.Completer.complete)
1120 readline.set_completer(self.Completer.complete)
1114
1121
1115 # Configure readline according to user's prefs
1122 # Configure readline according to user's prefs
1116 for rlcommand in self.rc.readline_parse_and_bind:
1123 for rlcommand in self.rc.readline_parse_and_bind:
1117 readline.parse_and_bind(rlcommand)
1124 readline.parse_and_bind(rlcommand)
1118
1125
1119 # remove some chars from the delimiters list
1126 # remove some chars from the delimiters list
1120 delims = readline.get_completer_delims()
1127 delims = readline.get_completer_delims()
1121 delims = delims.translate(string._idmap,
1128 delims = delims.translate(string._idmap,
1122 self.rc.readline_remove_delims)
1129 self.rc.readline_remove_delims)
1123 readline.set_completer_delims(delims)
1130 readline.set_completer_delims(delims)
1124 # otherwise we end up with a monster history after a while:
1131 # otherwise we end up with a monster history after a while:
1125 readline.set_history_length(1000)
1132 readline.set_history_length(1000)
1126 try:
1133 try:
1127 #print '*** Reading readline history' # dbg
1134 #print '*** Reading readline history' # dbg
1128 readline.read_history_file(self.histfile)
1135 readline.read_history_file(self.histfile)
1129 except IOError:
1136 except IOError:
1130 pass # It doesn't exist yet.
1137 pass # It doesn't exist yet.
1131
1138
1132 atexit.register(self.atexit_operations)
1139 atexit.register(self.atexit_operations)
1133 del atexit
1140 del atexit
1134
1141
1135 # Configure auto-indent for all platforms
1142 # Configure auto-indent for all platforms
1136 self.set_autoindent(self.rc.autoindent)
1143 self.set_autoindent(self.rc.autoindent)
1137
1144
1138 def _should_recompile(self,e):
1145 def _should_recompile(self,e):
1139 """Utility routine for edit_syntax_error"""
1146 """Utility routine for edit_syntax_error"""
1140
1147
1141 if e.filename in ('<ipython console>','<input>','<string>',
1148 if e.filename in ('<ipython console>','<input>','<string>',
1142 '<console>'):
1149 '<console>'):
1143 return False
1150 return False
1144 try:
1151 try:
1145 if not ask_yes_no('Return to editor to correct syntax error? '
1152 if not ask_yes_no('Return to editor to correct syntax error? '
1146 '[Y/n] ','y'):
1153 '[Y/n] ','y'):
1147 return False
1154 return False
1148 except EOFError:
1155 except EOFError:
1149 return False
1156 return False
1150 self.hooks.fix_error_editor(e.filename,e.lineno,e.offset,e.msg)
1157 self.hooks.fix_error_editor(e.filename,e.lineno,e.offset,e.msg)
1151 return True
1158 return True
1152
1159
1153 def edit_syntax_error(self):
1160 def edit_syntax_error(self):
1154 """The bottom half of the syntax error handler called in the main loop.
1161 """The bottom half of the syntax error handler called in the main loop.
1155
1162
1156 Loop until syntax error is fixed or user cancels.
1163 Loop until syntax error is fixed or user cancels.
1157 """
1164 """
1158
1165
1159 while self.SyntaxTB.last_syntax_error:
1166 while self.SyntaxTB.last_syntax_error:
1160 # copy and clear last_syntax_error
1167 # copy and clear last_syntax_error
1161 err = self.SyntaxTB.clear_err_state()
1168 err = self.SyntaxTB.clear_err_state()
1162 if not self._should_recompile(err):
1169 if not self._should_recompile(err):
1163 return
1170 return
1164 try:
1171 try:
1165 # may set last_syntax_error again if a SyntaxError is raised
1172 # may set last_syntax_error again if a SyntaxError is raised
1166 self.safe_execfile(err.filename,self.shell.user_ns)
1173 self.safe_execfile(err.filename,self.shell.user_ns)
1167 except:
1174 except:
1168 self.showtraceback()
1175 self.showtraceback()
1169 else:
1176 else:
1170 f = file(err.filename)
1177 f = file(err.filename)
1171 try:
1178 try:
1172 sys.displayhook(f.read())
1179 sys.displayhook(f.read())
1173 finally:
1180 finally:
1174 f.close()
1181 f.close()
1175
1182
1176 def showsyntaxerror(self, filename=None):
1183 def showsyntaxerror(self, filename=None):
1177 """Display the syntax error that just occurred.
1184 """Display the syntax error that just occurred.
1178
1185
1179 This doesn't display a stack trace because there isn't one.
1186 This doesn't display a stack trace because there isn't one.
1180
1187
1181 If a filename is given, it is stuffed in the exception instead
1188 If a filename is given, it is stuffed in the exception instead
1182 of what was there before (because Python's parser always uses
1189 of what was there before (because Python's parser always uses
1183 "<string>" when reading from a string).
1190 "<string>" when reading from a string).
1184 """
1191 """
1185 etype, value, last_traceback = sys.exc_info()
1192 etype, value, last_traceback = sys.exc_info()
1186 if filename and etype is SyntaxError:
1193 if filename and etype is SyntaxError:
1187 # Work hard to stuff the correct filename in the exception
1194 # Work hard to stuff the correct filename in the exception
1188 try:
1195 try:
1189 msg, (dummy_filename, lineno, offset, line) = value
1196 msg, (dummy_filename, lineno, offset, line) = value
1190 except:
1197 except:
1191 # Not the format we expect; leave it alone
1198 # Not the format we expect; leave it alone
1192 pass
1199 pass
1193 else:
1200 else:
1194 # Stuff in the right filename
1201 # Stuff in the right filename
1195 try:
1202 try:
1196 # Assume SyntaxError is a class exception
1203 # Assume SyntaxError is a class exception
1197 value = SyntaxError(msg, (filename, lineno, offset, line))
1204 value = SyntaxError(msg, (filename, lineno, offset, line))
1198 except:
1205 except:
1199 # If that failed, assume SyntaxError is a string
1206 # If that failed, assume SyntaxError is a string
1200 value = msg, (filename, lineno, offset, line)
1207 value = msg, (filename, lineno, offset, line)
1201 self.SyntaxTB(etype,value,[])
1208 self.SyntaxTB(etype,value,[])
1202
1209
1203 def debugger(self):
1210 def debugger(self):
1204 """Call the pdb debugger."""
1211 """Call the pdb debugger."""
1205
1212
1206 if not self.rc.pdb:
1213 if not self.rc.pdb:
1207 return
1214 return
1208 pdb.pm()
1215 pdb.pm()
1209
1216
1210 def showtraceback(self,exc_tuple = None,filename=None):
1217 def showtraceback(self,exc_tuple = None,filename=None):
1211 """Display the exception that just occurred."""
1218 """Display the exception that just occurred."""
1212
1219
1213 # Though this won't be called by syntax errors in the input line,
1220 # Though this won't be called by syntax errors in the input line,
1214 # there may be SyntaxError cases whith imported code.
1221 # there may be SyntaxError cases whith imported code.
1215 if exc_tuple is None:
1222 if exc_tuple is None:
1216 type, value, tb = sys.exc_info()
1223 type, value, tb = sys.exc_info()
1217 else:
1224 else:
1218 type, value, tb = exc_tuple
1225 type, value, tb = exc_tuple
1219 if type is SyntaxError:
1226 if type is SyntaxError:
1220 self.showsyntaxerror(filename)
1227 self.showsyntaxerror(filename)
1221 else:
1228 else:
1222 self.InteractiveTB()
1229 self.InteractiveTB()
1223 if self.InteractiveTB.call_pdb and self.has_readline:
1230 if self.InteractiveTB.call_pdb and self.has_readline:
1224 # pdb mucks up readline, fix it back
1231 # pdb mucks up readline, fix it back
1225 self.readline.set_completer(self.Completer.complete)
1232 self.readline.set_completer(self.Completer.complete)
1226
1233
1227 def mainloop(self,banner=None):
1234 def mainloop(self,banner=None):
1228 """Creates the local namespace and starts the mainloop.
1235 """Creates the local namespace and starts the mainloop.
1229
1236
1230 If an optional banner argument is given, it will override the
1237 If an optional banner argument is given, it will override the
1231 internally created default banner."""
1238 internally created default banner."""
1232
1239
1233 if self.rc.c: # Emulate Python's -c option
1240 if self.rc.c: # Emulate Python's -c option
1234 self.exec_init_cmd()
1241 self.exec_init_cmd()
1235 if banner is None:
1242 if banner is None:
1236 if self.rc.banner:
1243 if self.rc.banner:
1237 banner = self.BANNER+self.banner2
1244 banner = self.BANNER+self.banner2
1238 else:
1245 else:
1239 banner = ''
1246 banner = ''
1240 self.interact(banner)
1247 self.interact(banner)
1241
1248
1242 def exec_init_cmd(self):
1249 def exec_init_cmd(self):
1243 """Execute a command given at the command line.
1250 """Execute a command given at the command line.
1244
1251
1245 This emulates Python's -c option."""
1252 This emulates Python's -c option."""
1246
1253
1247 sys.argv = ['-c']
1254 sys.argv = ['-c']
1248 self.push(self.rc.c)
1255 self.push(self.rc.c)
1249
1256
1250 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1257 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1251 """Embeds IPython into a running python program.
1258 """Embeds IPython into a running python program.
1252
1259
1253 Input:
1260 Input:
1254
1261
1255 - header: An optional header message can be specified.
1262 - header: An optional header message can be specified.
1256
1263
1257 - local_ns, global_ns: working namespaces. If given as None, the
1264 - local_ns, global_ns: working namespaces. If given as None, the
1258 IPython-initialized one is updated with __main__.__dict__, so that
1265 IPython-initialized one is updated with __main__.__dict__, so that
1259 program variables become visible but user-specific configuration
1266 program variables become visible but user-specific configuration
1260 remains possible.
1267 remains possible.
1261
1268
1262 - stack_depth: specifies how many levels in the stack to go to
1269 - stack_depth: specifies how many levels in the stack to go to
1263 looking for namespaces (when local_ns and global_ns are None). This
1270 looking for namespaces (when local_ns and global_ns are None). This
1264 allows an intermediate caller to make sure that this function gets
1271 allows an intermediate caller to make sure that this function gets
1265 the namespace from the intended level in the stack. By default (0)
1272 the namespace from the intended level in the stack. By default (0)
1266 it will get its locals and globals from the immediate caller.
1273 it will get its locals and globals from the immediate caller.
1267
1274
1268 Warning: it's possible to use this in a program which is being run by
1275 Warning: it's possible to use this in a program which is being run by
1269 IPython itself (via %run), but some funny things will happen (a few
1276 IPython itself (via %run), but some funny things will happen (a few
1270 globals get overwritten). In the future this will be cleaned up, as
1277 globals get overwritten). In the future this will be cleaned up, as
1271 there is no fundamental reason why it can't work perfectly."""
1278 there is no fundamental reason why it can't work perfectly."""
1272
1279
1273 # Get locals and globals from caller
1280 # Get locals and globals from caller
1274 if local_ns is None or global_ns is None:
1281 if local_ns is None or global_ns is None:
1275 call_frame = sys._getframe(stack_depth).f_back
1282 call_frame = sys._getframe(stack_depth).f_back
1276
1283
1277 if local_ns is None:
1284 if local_ns is None:
1278 local_ns = call_frame.f_locals
1285 local_ns = call_frame.f_locals
1279 if global_ns is None:
1286 if global_ns is None:
1280 global_ns = call_frame.f_globals
1287 global_ns = call_frame.f_globals
1281
1288
1282 # Update namespaces and fire up interpreter
1289 # Update namespaces and fire up interpreter
1283 self.user_ns = local_ns
1290 self.user_ns = local_ns
1284 self.user_global_ns = global_ns
1291 self.user_global_ns = global_ns
1285
1292
1286 # Patch for global embedding to make sure that things don't overwrite
1293 # Patch for global embedding to make sure that things don't overwrite
1287 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1294 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1288 # FIXME. Test this a bit more carefully (the if.. is new)
1295 # FIXME. Test this a bit more carefully (the if.. is new)
1289 if local_ns is None and global_ns is None:
1296 if local_ns is None and global_ns is None:
1290 self.user_global_ns.update(__main__.__dict__)
1297 self.user_global_ns.update(__main__.__dict__)
1291
1298
1292 # make sure the tab-completer has the correct frame information, so it
1299 # make sure the tab-completer has the correct frame information, so it
1293 # actually completes using the frame's locals/globals
1300 # actually completes using the frame's locals/globals
1294 self.set_completer_frame(call_frame)
1301 self.set_completer_frame(call_frame)
1295
1302
1296 self.interact(header)
1303 self.interact(header)
1297
1304
1298 def interact(self, banner=None):
1305 def interact(self, banner=None):
1299 """Closely emulate the interactive Python console.
1306 """Closely emulate the interactive Python console.
1300
1307
1301 The optional banner argument specify the banner to print
1308 The optional banner argument specify the banner to print
1302 before the first interaction; by default it prints a banner
1309 before the first interaction; by default it prints a banner
1303 similar to the one printed by the real Python interpreter,
1310 similar to the one printed by the real Python interpreter,
1304 followed by the current class name in parentheses (so as not
1311 followed by the current class name in parentheses (so as not
1305 to confuse this with the real interpreter -- since it's so
1312 to confuse this with the real interpreter -- since it's so
1306 close!).
1313 close!).
1307
1314
1308 """
1315 """
1309 cprt = 'Type "copyright", "credits" or "license" for more information.'
1316 cprt = 'Type "copyright", "credits" or "license" for more information.'
1310 if banner is None:
1317 if banner is None:
1311 self.write("Python %s on %s\n%s\n(%s)\n" %
1318 self.write("Python %s on %s\n%s\n(%s)\n" %
1312 (sys.version, sys.platform, cprt,
1319 (sys.version, sys.platform, cprt,
1313 self.__class__.__name__))
1320 self.__class__.__name__))
1314 else:
1321 else:
1315 self.write(banner)
1322 self.write(banner)
1316
1323
1317 more = 0
1324 more = 0
1318
1325
1319 # Mark activity in the builtins
1326 # Mark activity in the builtins
1320 __builtin__.__dict__['__IPYTHON__active'] += 1
1327 __builtin__.__dict__['__IPYTHON__active'] += 1
1321
1328
1322 # exit_now is set by a call to %Exit or %Quit
1329 # exit_now is set by a call to %Exit or %Quit
1323 while not self.exit_now:
1330 while not self.exit_now:
1324 try:
1331 try:
1325 if more:
1332 if more:
1326 prompt = self.outputcache.prompt2
1333 prompt = self.outputcache.prompt2
1327 if self.autoindent:
1334 if self.autoindent:
1328 self.readline_startup_hook(self.pre_readline)
1335 self.readline_startup_hook(self.pre_readline)
1329 else:
1336 else:
1330 prompt = self.outputcache.prompt1
1337 prompt = self.outputcache.prompt1
1331 try:
1338 try:
1332 line = self.raw_input(prompt,more)
1339 line = self.raw_input(prompt,more)
1333 if self.autoindent:
1340 if self.autoindent:
1334 self.readline_startup_hook(None)
1341 self.readline_startup_hook(None)
1335 except EOFError:
1342 except EOFError:
1336 if self.autoindent:
1343 if self.autoindent:
1337 self.readline_startup_hook(None)
1344 self.readline_startup_hook(None)
1338 self.write("\n")
1345 self.write("\n")
1339 self.exit()
1346 self.exit()
1340 else:
1347 else:
1341 more = self.push(line)
1348 more = self.push(line)
1342
1349
1343 if (self.SyntaxTB.last_syntax_error and
1350 if (self.SyntaxTB.last_syntax_error and
1344 self.rc.autoedit_syntax):
1351 self.rc.autoedit_syntax):
1345 self.edit_syntax_error()
1352 self.edit_syntax_error()
1346
1353
1347 except KeyboardInterrupt:
1354 except KeyboardInterrupt:
1348 self.write("\nKeyboardInterrupt\n")
1355 self.write("\nKeyboardInterrupt\n")
1349 self.resetbuffer()
1356 self.resetbuffer()
1350 more = 0
1357 more = 0
1351 # keep cache in sync with the prompt counter:
1358 # keep cache in sync with the prompt counter:
1352 self.outputcache.prompt_count -= 1
1359 self.outputcache.prompt_count -= 1
1353
1360
1354 if self.autoindent:
1361 if self.autoindent:
1355 self.indent_current_nsp = 0
1362 self.indent_current_nsp = 0
1356 self.indent_current = ' '* self.indent_current_nsp
1363 self.indent_current = ' '* self.indent_current_nsp
1357
1364
1358 except bdb.BdbQuit:
1365 except bdb.BdbQuit:
1359 warn("The Python debugger has exited with a BdbQuit exception.\n"
1366 warn("The Python debugger has exited with a BdbQuit exception.\n"
1360 "Because of how pdb handles the stack, it is impossible\n"
1367 "Because of how pdb handles the stack, it is impossible\n"
1361 "for IPython to properly format this particular exception.\n"
1368 "for IPython to properly format this particular exception.\n"
1362 "IPython will resume normal operation.")
1369 "IPython will resume normal operation.")
1363
1370
1364 # We are off again...
1371 # We are off again...
1365 __builtin__.__dict__['__IPYTHON__active'] -= 1
1372 __builtin__.__dict__['__IPYTHON__active'] -= 1
1366
1373
1367 def excepthook(self, type, value, tb):
1374 def excepthook(self, type, value, tb):
1368 """One more defense for GUI apps that call sys.excepthook.
1375 """One more defense for GUI apps that call sys.excepthook.
1369
1376
1370 GUI frameworks like wxPython trap exceptions and call
1377 GUI frameworks like wxPython trap exceptions and call
1371 sys.excepthook themselves. I guess this is a feature that
1378 sys.excepthook themselves. I guess this is a feature that
1372 enables them to keep running after exceptions that would
1379 enables them to keep running after exceptions that would
1373 otherwise kill their mainloop. This is a bother for IPython
1380 otherwise kill their mainloop. This is a bother for IPython
1374 which excepts to catch all of the program exceptions with a try:
1381 which excepts to catch all of the program exceptions with a try:
1375 except: statement.
1382 except: statement.
1376
1383
1377 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1384 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1378 any app directly invokes sys.excepthook, it will look to the user like
1385 any app directly invokes sys.excepthook, it will look to the user like
1379 IPython crashed. In order to work around this, we can disable the
1386 IPython crashed. In order to work around this, we can disable the
1380 CrashHandler and replace it with this excepthook instead, which prints a
1387 CrashHandler and replace it with this excepthook instead, which prints a
1381 regular traceback using our InteractiveTB. In this fashion, apps which
1388 regular traceback using our InteractiveTB. In this fashion, apps which
1382 call sys.excepthook will generate a regular-looking exception from
1389 call sys.excepthook will generate a regular-looking exception from
1383 IPython, and the CrashHandler will only be triggered by real IPython
1390 IPython, and the CrashHandler will only be triggered by real IPython
1384 crashes.
1391 crashes.
1385
1392
1386 This hook should be used sparingly, only in places which are not likely
1393 This hook should be used sparingly, only in places which are not likely
1387 to be true IPython errors.
1394 to be true IPython errors.
1388 """
1395 """
1389
1396
1390 self.InteractiveTB(type, value, tb, tb_offset=0)
1397 self.InteractiveTB(type, value, tb, tb_offset=0)
1391 if self.InteractiveTB.call_pdb and self.has_readline:
1398 if self.InteractiveTB.call_pdb and self.has_readline:
1392 self.readline.set_completer(self.Completer.complete)
1399 self.readline.set_completer(self.Completer.complete)
1393
1400
1394 def call_alias(self,alias,rest=''):
1401 def call_alias(self,alias,rest=''):
1395 """Call an alias given its name and the rest of the line.
1402 """Call an alias given its name and the rest of the line.
1396
1403
1397 This function MUST be given a proper alias, because it doesn't make
1404 This function MUST be given a proper alias, because it doesn't make
1398 any checks when looking up into the alias table. The caller is
1405 any checks when looking up into the alias table. The caller is
1399 responsible for invoking it only with a valid alias."""
1406 responsible for invoking it only with a valid alias."""
1400
1407
1401 #print 'ALIAS: <%s>+<%s>' % (alias,rest) # dbg
1408 #print 'ALIAS: <%s>+<%s>' % (alias,rest) # dbg
1402 nargs,cmd = self.alias_table[alias]
1409 nargs,cmd = self.alias_table[alias]
1403 # Expand the %l special to be the user's input line
1410 # Expand the %l special to be the user's input line
1404 if cmd.find('%l') >= 0:
1411 if cmd.find('%l') >= 0:
1405 cmd = cmd.replace('%l',rest)
1412 cmd = cmd.replace('%l',rest)
1406 rest = ''
1413 rest = ''
1407 if nargs==0:
1414 if nargs==0:
1408 # Simple, argument-less aliases
1415 # Simple, argument-less aliases
1409 cmd = '%s %s' % (cmd,rest)
1416 cmd = '%s %s' % (cmd,rest)
1410 else:
1417 else:
1411 # Handle aliases with positional arguments
1418 # Handle aliases with positional arguments
1412 args = rest.split(None,nargs)
1419 args = rest.split(None,nargs)
1413 if len(args)< nargs:
1420 if len(args)< nargs:
1414 error('Alias <%s> requires %s arguments, %s given.' %
1421 error('Alias <%s> requires %s arguments, %s given.' %
1415 (alias,nargs,len(args)))
1422 (alias,nargs,len(args)))
1416 return
1423 return
1417 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1424 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1418 # Now call the macro, evaluating in the user's namespace
1425 # Now call the macro, evaluating in the user's namespace
1419 try:
1426 try:
1420 self.system(cmd)
1427 self.system(cmd)
1421 except:
1428 except:
1422 self.showtraceback()
1429 self.showtraceback()
1423
1430
1424 def autoindent_update(self,line):
1431 def autoindent_update(self,line):
1425 """Keep track of the indent level."""
1432 """Keep track of the indent level."""
1426 if self.autoindent:
1433 if self.autoindent:
1427 if line:
1434 if line:
1428 ini_spaces = ini_spaces_re.match(line)
1435 ini_spaces = ini_spaces_re.match(line)
1429 if ini_spaces:
1436 if ini_spaces:
1430 nspaces = ini_spaces.end()
1437 nspaces = ini_spaces.end()
1431 else:
1438 else:
1432 nspaces = 0
1439 nspaces = 0
1433 self.indent_current_nsp = nspaces
1440 self.indent_current_nsp = nspaces
1434
1441
1435 if line[-1] == ':':
1442 if line[-1] == ':':
1436 self.indent_current_nsp += 4
1443 self.indent_current_nsp += 4
1437 elif dedent_re.match(line):
1444 elif dedent_re.match(line):
1438 self.indent_current_nsp -= 4
1445 self.indent_current_nsp -= 4
1439 else:
1446 else:
1440 self.indent_current_nsp = 0
1447 self.indent_current_nsp = 0
1441
1448
1442 # indent_current is the actual string to be inserted
1449 # indent_current is the actual string to be inserted
1443 # by the readline hooks for indentation
1450 # by the readline hooks for indentation
1444 self.indent_current = ' '* self.indent_current_nsp
1451 self.indent_current = ' '* self.indent_current_nsp
1445
1452
1446 def runlines(self,lines):
1453 def runlines(self,lines):
1447 """Run a string of one or more lines of source.
1454 """Run a string of one or more lines of source.
1448
1455
1449 This method is capable of running a string containing multiple source
1456 This method is capable of running a string containing multiple source
1450 lines, as if they had been entered at the IPython prompt. Since it
1457 lines, as if they had been entered at the IPython prompt. Since it
1451 exposes IPython's processing machinery, the given strings can contain
1458 exposes IPython's processing machinery, the given strings can contain
1452 magic calls (%magic), special shell access (!cmd), etc."""
1459 magic calls (%magic), special shell access (!cmd), etc."""
1453
1460
1454 # We must start with a clean buffer, in case this is run from an
1461 # We must start with a clean buffer, in case this is run from an
1455 # interactive IPython session (via a magic, for example).
1462 # interactive IPython session (via a magic, for example).
1456 self.resetbuffer()
1463 self.resetbuffer()
1457 lines = lines.split('\n')
1464 lines = lines.split('\n')
1458 more = 0
1465 more = 0
1459 for line in lines:
1466 for line in lines:
1460 # skip blank lines so we don't mess up the prompt counter, but do
1467 # skip blank lines so we don't mess up the prompt counter, but do
1461 # NOT skip even a blank line if we are in a code block (more is
1468 # NOT skip even a blank line if we are in a code block (more is
1462 # true)
1469 # true)
1463 if line or more:
1470 if line or more:
1464 more = self.push(self.prefilter(line,more))
1471 more = self.push(self.prefilter(line,more))
1465 # IPython's runsource returns None if there was an error
1472 # IPython's runsource returns None if there was an error
1466 # compiling the code. This allows us to stop processing right
1473 # compiling the code. This allows us to stop processing right
1467 # away, so the user gets the error message at the right place.
1474 # away, so the user gets the error message at the right place.
1468 if more is None:
1475 if more is None:
1469 break
1476 break
1470 # final newline in case the input didn't have it, so that the code
1477 # final newline in case the input didn't have it, so that the code
1471 # actually does get executed
1478 # actually does get executed
1472 if more:
1479 if more:
1473 self.push('\n')
1480 self.push('\n')
1474
1481
1475 def runsource(self, source, filename='<input>', symbol='single'):
1482 def runsource(self, source, filename='<input>', symbol='single'):
1476 """Compile and run some source in the interpreter.
1483 """Compile and run some source in the interpreter.
1477
1484
1478 Arguments are as for compile_command().
1485 Arguments are as for compile_command().
1479
1486
1480 One several things can happen:
1487 One several things can happen:
1481
1488
1482 1) The input is incorrect; compile_command() raised an
1489 1) The input is incorrect; compile_command() raised an
1483 exception (SyntaxError or OverflowError). A syntax traceback
1490 exception (SyntaxError or OverflowError). A syntax traceback
1484 will be printed by calling the showsyntaxerror() method.
1491 will be printed by calling the showsyntaxerror() method.
1485
1492
1486 2) The input is incomplete, and more input is required;
1493 2) The input is incomplete, and more input is required;
1487 compile_command() returned None. Nothing happens.
1494 compile_command() returned None. Nothing happens.
1488
1495
1489 3) The input is complete; compile_command() returned a code
1496 3) The input is complete; compile_command() returned a code
1490 object. The code is executed by calling self.runcode() (which
1497 object. The code is executed by calling self.runcode() (which
1491 also handles run-time exceptions, except for SystemExit).
1498 also handles run-time exceptions, except for SystemExit).
1492
1499
1493 The return value is:
1500 The return value is:
1494
1501
1495 - True in case 2
1502 - True in case 2
1496
1503
1497 - False in the other cases, unless an exception is raised, where
1504 - False in the other cases, unless an exception is raised, where
1498 None is returned instead. This can be used by external callers to
1505 None is returned instead. This can be used by external callers to
1499 know whether to continue feeding input or not.
1506 know whether to continue feeding input or not.
1500
1507
1501 The return value can be used to decide whether to use sys.ps1 or
1508 The return value can be used to decide whether to use sys.ps1 or
1502 sys.ps2 to prompt the next line."""
1509 sys.ps2 to prompt the next line."""
1503
1510
1504 try:
1511 try:
1505 code = self.compile(source,filename,symbol)
1512 code = self.compile(source,filename,symbol)
1506 except (OverflowError, SyntaxError, ValueError):
1513 except (OverflowError, SyntaxError, ValueError):
1507 # Case 1
1514 # Case 1
1508 self.showsyntaxerror(filename)
1515 self.showsyntaxerror(filename)
1509 return None
1516 return None
1510
1517
1511 if code is None:
1518 if code is None:
1512 # Case 2
1519 # Case 2
1513 return True
1520 return True
1514
1521
1515 # Case 3
1522 # Case 3
1516 # We store the code object so that threaded shells and
1523 # We store the code object so that threaded shells and
1517 # custom exception handlers can access all this info if needed.
1524 # custom exception handlers can access all this info if needed.
1518 # The source corresponding to this can be obtained from the
1525 # The source corresponding to this can be obtained from the
1519 # buffer attribute as '\n'.join(self.buffer).
1526 # buffer attribute as '\n'.join(self.buffer).
1520 self.code_to_run = code
1527 self.code_to_run = code
1521 # now actually execute the code object
1528 # now actually execute the code object
1522 if self.runcode(code) == 0:
1529 if self.runcode(code) == 0:
1523 return False
1530 return False
1524 else:
1531 else:
1525 return None
1532 return None
1526
1533
1527 def runcode(self,code_obj):
1534 def runcode(self,code_obj):
1528 """Execute a code object.
1535 """Execute a code object.
1529
1536
1530 When an exception occurs, self.showtraceback() is called to display a
1537 When an exception occurs, self.showtraceback() is called to display a
1531 traceback.
1538 traceback.
1532
1539
1533 Return value: a flag indicating whether the code to be run completed
1540 Return value: a flag indicating whether the code to be run completed
1534 successfully:
1541 successfully:
1535
1542
1536 - 0: successful execution.
1543 - 0: successful execution.
1537 - 1: an error occurred.
1544 - 1: an error occurred.
1538 """
1545 """
1539
1546
1540 # Set our own excepthook in case the user code tries to call it
1547 # Set our own excepthook in case the user code tries to call it
1541 # directly, so that the IPython crash handler doesn't get triggered
1548 # directly, so that the IPython crash handler doesn't get triggered
1542 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1549 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1543
1550
1544 # we save the original sys.excepthook in the instance, in case config
1551 # we save the original sys.excepthook in the instance, in case config
1545 # code (such as magics) needs access to it.
1552 # code (such as magics) needs access to it.
1546 self.sys_excepthook = old_excepthook
1553 self.sys_excepthook = old_excepthook
1547 outflag = 1 # happens in more places, so it's easier as default
1554 outflag = 1 # happens in more places, so it's easier as default
1548 try:
1555 try:
1549 try:
1556 try:
1550 # Embedded instances require separate global/local namespaces
1557 # Embedded instances require separate global/local namespaces
1551 # so they can see both the surrounding (local) namespace and
1558 # so they can see both the surrounding (local) namespace and
1552 # the module-level globals when called inside another function.
1559 # the module-level globals when called inside another function.
1553 if self.embedded:
1560 if self.embedded:
1554 exec code_obj in self.user_global_ns, self.user_ns
1561 exec code_obj in self.user_global_ns, self.user_ns
1555 # Normal (non-embedded) instances should only have a single
1562 # Normal (non-embedded) instances should only have a single
1556 # namespace for user code execution, otherwise functions won't
1563 # namespace for user code execution, otherwise functions won't
1557 # see interactive top-level globals.
1564 # see interactive top-level globals.
1558 else:
1565 else:
1559 exec code_obj in self.user_ns
1566 exec code_obj in self.user_ns
1560 finally:
1567 finally:
1561 # Reset our crash handler in place
1568 # Reset our crash handler in place
1562 sys.excepthook = old_excepthook
1569 sys.excepthook = old_excepthook
1563 except SystemExit:
1570 except SystemExit:
1564 self.resetbuffer()
1571 self.resetbuffer()
1565 self.showtraceback()
1572 self.showtraceback()
1566 warn("Type exit or quit to exit IPython "
1573 warn("Type exit or quit to exit IPython "
1567 "(%Exit or %Quit do so unconditionally).",level=1)
1574 "(%Exit or %Quit do so unconditionally).",level=1)
1568 except self.custom_exceptions:
1575 except self.custom_exceptions:
1569 etype,value,tb = sys.exc_info()
1576 etype,value,tb = sys.exc_info()
1570 self.CustomTB(etype,value,tb)
1577 self.CustomTB(etype,value,tb)
1571 except:
1578 except:
1572 self.showtraceback()
1579 self.showtraceback()
1573 else:
1580 else:
1574 outflag = 0
1581 outflag = 0
1575 if softspace(sys.stdout, 0):
1582 if softspace(sys.stdout, 0):
1576 print
1583 print
1577 # Flush out code object which has been run (and source)
1584 # Flush out code object which has been run (and source)
1578 self.code_to_run = None
1585 self.code_to_run = None
1579 return outflag
1586 return outflag
1580
1587
1581 def push(self, line):
1588 def push(self, line):
1582 """Push a line to the interpreter.
1589 """Push a line to the interpreter.
1583
1590
1584 The line should not have a trailing newline; it may have
1591 The line should not have a trailing newline; it may have
1585 internal newlines. The line is appended to a buffer and the
1592 internal newlines. The line is appended to a buffer and the
1586 interpreter's runsource() method is called with the
1593 interpreter's runsource() method is called with the
1587 concatenated contents of the buffer as source. If this
1594 concatenated contents of the buffer as source. If this
1588 indicates that the command was executed or invalid, the buffer
1595 indicates that the command was executed or invalid, the buffer
1589 is reset; otherwise, the command is incomplete, and the buffer
1596 is reset; otherwise, the command is incomplete, and the buffer
1590 is left as it was after the line was appended. The return
1597 is left as it was after the line was appended. The return
1591 value is 1 if more input is required, 0 if the line was dealt
1598 value is 1 if more input is required, 0 if the line was dealt
1592 with in some way (this is the same as runsource()).
1599 with in some way (this is the same as runsource()).
1593 """
1600 """
1594
1601
1595 # autoindent management should be done here, and not in the
1602 # autoindent management should be done here, and not in the
1596 # interactive loop, since that one is only seen by keyboard input. We
1603 # interactive loop, since that one is only seen by keyboard input. We
1597 # need this done correctly even for code run via runlines (which uses
1604 # need this done correctly even for code run via runlines (which uses
1598 # push).
1605 # push).
1599
1606
1600 #print 'push line: <%s>' % line # dbg
1607 #print 'push line: <%s>' % line # dbg
1601 self.autoindent_update(line)
1608 self.autoindent_update(line)
1602
1609
1603 self.buffer.append(line)
1610 self.buffer.append(line)
1604 more = self.runsource('\n'.join(self.buffer), self.filename)
1611 more = self.runsource('\n'.join(self.buffer), self.filename)
1605 if not more:
1612 if not more:
1606 self.resetbuffer()
1613 self.resetbuffer()
1607 return more
1614 return more
1608
1615
1609 def resetbuffer(self):
1616 def resetbuffer(self):
1610 """Reset the input buffer."""
1617 """Reset the input buffer."""
1611 self.buffer[:] = []
1618 self.buffer[:] = []
1612
1619
1613 def raw_input(self,prompt='',continue_prompt=False):
1620 def raw_input(self,prompt='',continue_prompt=False):
1614 """Write a prompt and read a line.
1621 """Write a prompt and read a line.
1615
1622
1616 The returned line does not include the trailing newline.
1623 The returned line does not include the trailing newline.
1617 When the user enters the EOF key sequence, EOFError is raised.
1624 When the user enters the EOF key sequence, EOFError is raised.
1618
1625
1619 Optional inputs:
1626 Optional inputs:
1620
1627
1621 - prompt(''): a string to be printed to prompt the user.
1628 - prompt(''): a string to be printed to prompt the user.
1622
1629
1623 - continue_prompt(False): whether this line is the first one or a
1630 - continue_prompt(False): whether this line is the first one or a
1624 continuation in a sequence of inputs.
1631 continuation in a sequence of inputs.
1625 """
1632 """
1626
1633
1627 line = raw_input_original(prompt)
1634 line = raw_input_original(prompt)
1628 # Try to be reasonably smart about not re-indenting pasted input more
1635 # Try to be reasonably smart about not re-indenting pasted input more
1629 # than necessary. We do this by trimming out the auto-indent initial
1636 # than necessary. We do this by trimming out the auto-indent initial
1630 # spaces, if the user's actual input started itself with whitespace.
1637 # spaces, if the user's actual input started itself with whitespace.
1631 if self.autoindent:
1638 if self.autoindent:
1632 line2 = line[self.indent_current_nsp:]
1639 line2 = line[self.indent_current_nsp:]
1633 if line2[0:1] in (' ','\t'):
1640 if line2[0:1] in (' ','\t'):
1634 line = line2
1641 line = line2
1635 return self.prefilter(line,continue_prompt)
1642 return self.prefilter(line,continue_prompt)
1636
1643
1637 def split_user_input(self,line):
1644 def split_user_input(self,line):
1638 """Split user input into pre-char, function part and rest."""
1645 """Split user input into pre-char, function part and rest."""
1639
1646
1640 lsplit = self.line_split.match(line)
1647 lsplit = self.line_split.match(line)
1641 if lsplit is None: # no regexp match returns None
1648 if lsplit is None: # no regexp match returns None
1642 try:
1649 try:
1643 iFun,theRest = line.split(None,1)
1650 iFun,theRest = line.split(None,1)
1644 except ValueError:
1651 except ValueError:
1645 iFun,theRest = line,''
1652 iFun,theRest = line,''
1646 pre = re.match('^(\s*)(.*)',line).groups()[0]
1653 pre = re.match('^(\s*)(.*)',line).groups()[0]
1647 else:
1654 else:
1648 pre,iFun,theRest = lsplit.groups()
1655 pre,iFun,theRest = lsplit.groups()
1649
1656
1650 #print 'line:<%s>' % line # dbg
1657 #print 'line:<%s>' % line # dbg
1651 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
1658 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
1652 return pre,iFun.strip(),theRest
1659 return pre,iFun.strip(),theRest
1653
1660
1654 def _prefilter(self, line, continue_prompt):
1661 def _prefilter(self, line, continue_prompt):
1655 """Calls different preprocessors, depending on the form of line."""
1662 """Calls different preprocessors, depending on the form of line."""
1656
1663
1657 # All handlers *must* return a value, even if it's blank ('').
1664 # All handlers *must* return a value, even if it's blank ('').
1658
1665
1659 # Lines are NOT logged here. Handlers should process the line as
1666 # Lines are NOT logged here. Handlers should process the line as
1660 # needed, update the cache AND log it (so that the input cache array
1667 # needed, update the cache AND log it (so that the input cache array
1661 # stays synced).
1668 # stays synced).
1662
1669
1663 # This function is _very_ delicate, and since it's also the one which
1670 # This function is _very_ delicate, and since it's also the one which
1664 # determines IPython's response to user input, it must be as efficient
1671 # determines IPython's response to user input, it must be as efficient
1665 # as possible. For this reason it has _many_ returns in it, trying
1672 # as possible. For this reason it has _many_ returns in it, trying
1666 # always to exit as quickly as it can figure out what it needs to do.
1673 # always to exit as quickly as it can figure out what it needs to do.
1667
1674
1668 # This function is the main responsible for maintaining IPython's
1675 # This function is the main responsible for maintaining IPython's
1669 # behavior respectful of Python's semantics. So be _very_ careful if
1676 # behavior respectful of Python's semantics. So be _very_ careful if
1670 # making changes to anything here.
1677 # making changes to anything here.
1671
1678
1672 #.....................................................................
1679 #.....................................................................
1673 # Code begins
1680 # Code begins
1674
1681
1675 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
1682 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
1676
1683
1677 # save the line away in case we crash, so the post-mortem handler can
1684 # save the line away in case we crash, so the post-mortem handler can
1678 # record it
1685 # record it
1679 self._last_input_line = line
1686 self._last_input_line = line
1680
1687
1681 #print '***line: <%s>' % line # dbg
1688 #print '***line: <%s>' % line # dbg
1682
1689
1683 # the input history needs to track even empty lines
1690 # the input history needs to track even empty lines
1684 if not line.strip():
1691 if not line.strip():
1685 if not continue_prompt:
1692 if not continue_prompt:
1686 self.outputcache.prompt_count -= 1
1693 self.outputcache.prompt_count -= 1
1687 return self.handle_normal(line,continue_prompt)
1694 return self.handle_normal(line,continue_prompt)
1688 #return self.handle_normal('',continue_prompt)
1695 #return self.handle_normal('',continue_prompt)
1689
1696
1690 # print '***cont',continue_prompt # dbg
1697 # print '***cont',continue_prompt # dbg
1691 # special handlers are only allowed for single line statements
1698 # special handlers are only allowed for single line statements
1692 if continue_prompt and not self.rc.multi_line_specials:
1699 if continue_prompt and not self.rc.multi_line_specials:
1693 return self.handle_normal(line,continue_prompt)
1700 return self.handle_normal(line,continue_prompt)
1694
1701
1695 # For the rest, we need the structure of the input
1702 # For the rest, we need the structure of the input
1696 pre,iFun,theRest = self.split_user_input(line)
1703 pre,iFun,theRest = self.split_user_input(line)
1697 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1704 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1698
1705
1699 # First check for explicit escapes in the last/first character
1706 # First check for explicit escapes in the last/first character
1700 handler = None
1707 handler = None
1701 if line[-1] == self.ESC_HELP:
1708 if line[-1] == self.ESC_HELP:
1702 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
1709 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
1703 if handler is None:
1710 if handler is None:
1704 # look at the first character of iFun, NOT of line, so we skip
1711 # look at the first character of iFun, NOT of line, so we skip
1705 # leading whitespace in multiline input
1712 # leading whitespace in multiline input
1706 handler = self.esc_handlers.get(iFun[0:1])
1713 handler = self.esc_handlers.get(iFun[0:1])
1707 if handler is not None:
1714 if handler is not None:
1708 return handler(line,continue_prompt,pre,iFun,theRest)
1715 return handler(line,continue_prompt,pre,iFun,theRest)
1709 # Emacs ipython-mode tags certain input lines
1716 # Emacs ipython-mode tags certain input lines
1710 if line.endswith('# PYTHON-MODE'):
1717 if line.endswith('# PYTHON-MODE'):
1711 return self.handle_emacs(line,continue_prompt)
1718 return self.handle_emacs(line,continue_prompt)
1712
1719
1713 # Next, check if we can automatically execute this thing
1720 # Next, check if we can automatically execute this thing
1714
1721
1715 # Allow ! in multi-line statements if multi_line_specials is on:
1722 # Allow ! in multi-line statements if multi_line_specials is on:
1716 if continue_prompt and self.rc.multi_line_specials and \
1723 if continue_prompt and self.rc.multi_line_specials and \
1717 iFun.startswith(self.ESC_SHELL):
1724 iFun.startswith(self.ESC_SHELL):
1718 return self.handle_shell_escape(line,continue_prompt,
1725 return self.handle_shell_escape(line,continue_prompt,
1719 pre=pre,iFun=iFun,
1726 pre=pre,iFun=iFun,
1720 theRest=theRest)
1727 theRest=theRest)
1721
1728
1722 # Let's try to find if the input line is a magic fn
1729 # Let's try to find if the input line is a magic fn
1723 oinfo = None
1730 oinfo = None
1724 if hasattr(self,'magic_'+iFun):
1731 if hasattr(self,'magic_'+iFun):
1725 # WARNING: _ofind uses getattr(), so it can consume generators and
1732 # WARNING: _ofind uses getattr(), so it can consume generators and
1726 # cause other side effects.
1733 # cause other side effects.
1727 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1734 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1728 if oinfo['ismagic']:
1735 if oinfo['ismagic']:
1729 # Be careful not to call magics when a variable assignment is
1736 # Be careful not to call magics when a variable assignment is
1730 # being made (ls='hi', for example)
1737 # being made (ls='hi', for example)
1731 if self.rc.automagic and \
1738 if self.rc.automagic and \
1732 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
1739 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
1733 (self.rc.multi_line_specials or not continue_prompt):
1740 (self.rc.multi_line_specials or not continue_prompt):
1734 return self.handle_magic(line,continue_prompt,
1741 return self.handle_magic(line,continue_prompt,
1735 pre,iFun,theRest)
1742 pre,iFun,theRest)
1736 else:
1743 else:
1737 return self.handle_normal(line,continue_prompt)
1744 return self.handle_normal(line,continue_prompt)
1738
1745
1739 # If the rest of the line begins with an (in)equality, assginment or
1746 # If the rest of the line begins with an (in)equality, assginment or
1740 # function call, we should not call _ofind but simply execute it.
1747 # function call, we should not call _ofind but simply execute it.
1741 # This avoids spurious geattr() accesses on objects upon assignment.
1748 # This avoids spurious geattr() accesses on objects upon assignment.
1742 #
1749 #
1743 # It also allows users to assign to either alias or magic names true
1750 # It also allows users to assign to either alias or magic names true
1744 # python variables (the magic/alias systems always take second seat to
1751 # python variables (the magic/alias systems always take second seat to
1745 # true python code).
1752 # true python code).
1746 if theRest and theRest[0] in '!=()':
1753 if theRest and theRest[0] in '!=()':
1747 return self.handle_normal(line,continue_prompt)
1754 return self.handle_normal(line,continue_prompt)
1748
1755
1749 if oinfo is None:
1756 if oinfo is None:
1750 # let's try to ensure that _oinfo is ONLY called when autocall is
1757 # let's try to ensure that _oinfo is ONLY called when autocall is
1751 # on. Since it has inevitable potential side effects, at least
1758 # on. Since it has inevitable potential side effects, at least
1752 # having autocall off should be a guarantee to the user that no
1759 # having autocall off should be a guarantee to the user that no
1753 # weird things will happen.
1760 # weird things will happen.
1754
1761
1755 if self.rc.autocall:
1762 if self.rc.autocall:
1756 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1763 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1757 else:
1764 else:
1758 # in this case, all that's left is either an alias or
1765 # in this case, all that's left is either an alias or
1759 # processing the line normally.
1766 # processing the line normally.
1760 if iFun in self.alias_table:
1767 if iFun in self.alias_table:
1761 return self.handle_alias(line,continue_prompt,
1768 return self.handle_alias(line,continue_prompt,
1762 pre,iFun,theRest)
1769 pre,iFun,theRest)
1763 else:
1770 else:
1764 return self.handle_normal(line,continue_prompt)
1771 return self.handle_normal(line,continue_prompt)
1765
1772
1766 if not oinfo['found']:
1773 if not oinfo['found']:
1767 return self.handle_normal(line,continue_prompt)
1774 return self.handle_normal(line,continue_prompt)
1768 else:
1775 else:
1769 #print 'iFun <%s> rest <%s>' % (iFun,theRest) # dbg
1776 #print 'iFun <%s> rest <%s>' % (iFun,theRest) # dbg
1770 if oinfo['isalias']:
1777 if oinfo['isalias']:
1771 return self.handle_alias(line,continue_prompt,
1778 return self.handle_alias(line,continue_prompt,
1772 pre,iFun,theRest)
1779 pre,iFun,theRest)
1773
1780
1774 if self.rc.autocall and \
1781 if self.rc.autocall and \
1775 not self.re_exclude_auto.match(theRest) and \
1782 not self.re_exclude_auto.match(theRest) and \
1776 self.re_fun_name.match(iFun) and \
1783 self.re_fun_name.match(iFun) and \
1777 callable(oinfo['obj']) :
1784 callable(oinfo['obj']) :
1778 #print 'going auto' # dbg
1785 #print 'going auto' # dbg
1779 return self.handle_auto(line,continue_prompt,pre,iFun,theRest)
1786 return self.handle_auto(line,continue_prompt,pre,iFun,theRest)
1780 else:
1787 else:
1781 #print 'was callable?', callable(oinfo['obj']) # dbg
1788 #print 'was callable?', callable(oinfo['obj']) # dbg
1782 return self.handle_normal(line,continue_prompt)
1789 return self.handle_normal(line,continue_prompt)
1783
1790
1784 # If we get here, we have a normal Python line. Log and return.
1791 # If we get here, we have a normal Python line. Log and return.
1785 return self.handle_normal(line,continue_prompt)
1792 return self.handle_normal(line,continue_prompt)
1786
1793
1787 def _prefilter_dumb(self, line, continue_prompt):
1794 def _prefilter_dumb(self, line, continue_prompt):
1788 """simple prefilter function, for debugging"""
1795 """simple prefilter function, for debugging"""
1789 return self.handle_normal(line,continue_prompt)
1796 return self.handle_normal(line,continue_prompt)
1790
1797
1791 # Set the default prefilter() function (this can be user-overridden)
1798 # Set the default prefilter() function (this can be user-overridden)
1792 prefilter = _prefilter
1799 prefilter = _prefilter
1793
1800
1794 def handle_normal(self,line,continue_prompt=None,
1801 def handle_normal(self,line,continue_prompt=None,
1795 pre=None,iFun=None,theRest=None):
1802 pre=None,iFun=None,theRest=None):
1796 """Handle normal input lines. Use as a template for handlers."""
1803 """Handle normal input lines. Use as a template for handlers."""
1797
1804
1798 # With autoindent on, we need some way to exit the input loop, and I
1805 # With autoindent on, we need some way to exit the input loop, and I
1799 # don't want to force the user to have to backspace all the way to
1806 # don't want to force the user to have to backspace all the way to
1800 # clear the line. The rule will be in this case, that either two
1807 # clear the line. The rule will be in this case, that either two
1801 # lines of pure whitespace in a row, or a line of pure whitespace but
1808 # lines of pure whitespace in a row, or a line of pure whitespace but
1802 # of a size different to the indent level, will exit the input loop.
1809 # of a size different to the indent level, will exit the input loop.
1803
1810
1804 if (continue_prompt and self.autoindent and isspace(line) and
1811 if (continue_prompt and self.autoindent and isspace(line) and
1805 (line != self.indent_current or isspace(self.buffer[-1]))):
1812 (line != self.indent_current or isspace(self.buffer[-1]))):
1806 line = ''
1813 line = ''
1807
1814
1808 self.log(line,continue_prompt)
1815 self.log(line,continue_prompt)
1809 return line
1816 return line
1810
1817
1811 def handle_alias(self,line,continue_prompt=None,
1818 def handle_alias(self,line,continue_prompt=None,
1812 pre=None,iFun=None,theRest=None):
1819 pre=None,iFun=None,theRest=None):
1813 """Handle alias input lines. """
1820 """Handle alias input lines. """
1814
1821
1815 # pre is needed, because it carries the leading whitespace. Otherwise
1822 # pre is needed, because it carries the leading whitespace. Otherwise
1816 # aliases won't work in indented sections.
1823 # aliases won't work in indented sections.
1817 line_out = '%sipalias("%s %s")' % (pre,iFun,esc_quotes(theRest))
1824 line_out = '%sipalias("%s %s")' % (pre,iFun,esc_quotes(theRest))
1818 self.log(line_out,continue_prompt)
1825 self.log(line_out,continue_prompt)
1819 return line_out
1826 return line_out
1820
1827
1821 def handle_shell_escape(self, line, continue_prompt=None,
1828 def handle_shell_escape(self, line, continue_prompt=None,
1822 pre=None,iFun=None,theRest=None):
1829 pre=None,iFun=None,theRest=None):
1823 """Execute the line in a shell, empty return value"""
1830 """Execute the line in a shell, empty return value"""
1824
1831
1825 #print 'line in :', `line` # dbg
1832 #print 'line in :', `line` # dbg
1826 # Example of a special handler. Others follow a similar pattern.
1833 # Example of a special handler. Others follow a similar pattern.
1827 if continue_prompt: # multi-line statements
1834 if continue_prompt: # multi-line statements
1828 if iFun.startswith('!!'):
1835 if iFun.startswith('!!'):
1829 print 'SyntaxError: !! is not allowed in multiline statements'
1836 print 'SyntaxError: !! is not allowed in multiline statements'
1830 return pre
1837 return pre
1831 else:
1838 else:
1832 cmd = ("%s %s" % (iFun[1:],theRest))
1839 cmd = ("%s %s" % (iFun[1:],theRest))
1833 line_out = '%sipsystem(r"""%s"""[:-1])' % (pre,cmd + "_")
1840 line_out = '%sipsystem(r"""%s"""[:-1])' % (pre,cmd + "_")
1834 else: # single-line input
1841 else: # single-line input
1835 if line.startswith('!!'):
1842 if line.startswith('!!'):
1836 # rewrite iFun/theRest to properly hold the call to %sx and
1843 # rewrite iFun/theRest to properly hold the call to %sx and
1837 # the actual command to be executed, so handle_magic can work
1844 # the actual command to be executed, so handle_magic can work
1838 # correctly
1845 # correctly
1839 theRest = '%s %s' % (iFun[2:],theRest)
1846 theRest = '%s %s' % (iFun[2:],theRest)
1840 iFun = 'sx'
1847 iFun = 'sx'
1841 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,line[2:]),
1848 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,line[2:]),
1842 continue_prompt,pre,iFun,theRest)
1849 continue_prompt,pre,iFun,theRest)
1843 else:
1850 else:
1844 cmd=line[1:]
1851 cmd=line[1:]
1845 line_out = '%sipsystem(r"""%s"""[:-1])' % (pre,cmd +"_")
1852 line_out = '%sipsystem(r"""%s"""[:-1])' % (pre,cmd +"_")
1846 # update cache/log and return
1853 # update cache/log and return
1847 self.log(line_out,continue_prompt)
1854 self.log(line_out,continue_prompt)
1848 return line_out
1855 return line_out
1849
1856
1850 def handle_magic(self, line, continue_prompt=None,
1857 def handle_magic(self, line, continue_prompt=None,
1851 pre=None,iFun=None,theRest=None):
1858 pre=None,iFun=None,theRest=None):
1852 """Execute magic functions.
1859 """Execute magic functions.
1853
1860
1854 Also log them with a prepended # so the log is clean Python."""
1861 Also log them with a prepended # so the log is clean Python."""
1855
1862
1856 cmd = '%sipmagic("%s")' % (pre,esc_quotes('%s %s' % (iFun,theRest)))
1863 cmd = '%sipmagic("%s")' % (pre,esc_quotes('%s %s' % (iFun,theRest)))
1857 self.log(cmd,continue_prompt)
1864 self.log(cmd,continue_prompt)
1858 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
1865 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
1859 return cmd
1866 return cmd
1860
1867
1861 def handle_auto(self, line, continue_prompt=None,
1868 def handle_auto(self, line, continue_prompt=None,
1862 pre=None,iFun=None,theRest=None):
1869 pre=None,iFun=None,theRest=None):
1863 """Hande lines which can be auto-executed, quoting if requested."""
1870 """Hande lines which can be auto-executed, quoting if requested."""
1864
1871
1865 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1872 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1866
1873
1867 # This should only be active for single-line input!
1874 # This should only be active for single-line input!
1868 if continue_prompt:
1875 if continue_prompt:
1869 return line
1876 return line
1870
1877
1871 if pre == self.ESC_QUOTE:
1878 if pre == self.ESC_QUOTE:
1872 # Auto-quote splitting on whitespace
1879 # Auto-quote splitting on whitespace
1873 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
1880 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
1874 elif pre == self.ESC_QUOTE2:
1881 elif pre == self.ESC_QUOTE2:
1875 # Auto-quote whole string
1882 # Auto-quote whole string
1876 newcmd = '%s("%s")' % (iFun,theRest)
1883 newcmd = '%s("%s")' % (iFun,theRest)
1877 else:
1884 else:
1878 # Auto-paren
1885 # Auto-paren
1879 if theRest[0:1] in ('=','['):
1886 if theRest[0:1] in ('=','['):
1880 # Don't autocall in these cases. They can be either
1887 # Don't autocall in these cases. They can be either
1881 # rebindings of an existing callable's name, or item access
1888 # rebindings of an existing callable's name, or item access
1882 # for an object which is BOTH callable and implements
1889 # for an object which is BOTH callable and implements
1883 # __getitem__.
1890 # __getitem__.
1884 return '%s %s' % (iFun,theRest)
1891 return '%s %s' % (iFun,theRest)
1885 if theRest.endswith(';'):
1892 if theRest.endswith(';'):
1886 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
1893 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
1887 else:
1894 else:
1888 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
1895 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
1889
1896
1890 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
1897 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
1891 # log what is now valid Python, not the actual user input (without the
1898 # log what is now valid Python, not the actual user input (without the
1892 # final newline)
1899 # final newline)
1893 self.log(newcmd,continue_prompt)
1900 self.log(newcmd,continue_prompt)
1894 return newcmd
1901 return newcmd
1895
1902
1896 def handle_help(self, line, continue_prompt=None,
1903 def handle_help(self, line, continue_prompt=None,
1897 pre=None,iFun=None,theRest=None):
1904 pre=None,iFun=None,theRest=None):
1898 """Try to get some help for the object.
1905 """Try to get some help for the object.
1899
1906
1900 obj? or ?obj -> basic information.
1907 obj? or ?obj -> basic information.
1901 obj?? or ??obj -> more details.
1908 obj?? or ??obj -> more details.
1902 """
1909 """
1903
1910
1904 # We need to make sure that we don't process lines which would be
1911 # We need to make sure that we don't process lines which would be
1905 # otherwise valid python, such as "x=1 # what?"
1912 # otherwise valid python, such as "x=1 # what?"
1906 try:
1913 try:
1907 codeop.compile_command(line)
1914 codeop.compile_command(line)
1908 except SyntaxError:
1915 except SyntaxError:
1909 # We should only handle as help stuff which is NOT valid syntax
1916 # We should only handle as help stuff which is NOT valid syntax
1910 if line[0]==self.ESC_HELP:
1917 if line[0]==self.ESC_HELP:
1911 line = line[1:]
1918 line = line[1:]
1912 elif line[-1]==self.ESC_HELP:
1919 elif line[-1]==self.ESC_HELP:
1913 line = line[:-1]
1920 line = line[:-1]
1914 self.log('#?'+line)
1921 self.log('#?'+line)
1915 if line:
1922 if line:
1916 self.magic_pinfo(line)
1923 self.magic_pinfo(line)
1917 else:
1924 else:
1918 page(self.usage,screen_lines=self.rc.screen_length)
1925 page(self.usage,screen_lines=self.rc.screen_length)
1919 return '' # Empty string is needed here!
1926 return '' # Empty string is needed here!
1920 except:
1927 except:
1921 # Pass any other exceptions through to the normal handler
1928 # Pass any other exceptions through to the normal handler
1922 return self.handle_normal(line,continue_prompt)
1929 return self.handle_normal(line,continue_prompt)
1923 else:
1930 else:
1924 # If the code compiles ok, we should handle it normally
1931 # If the code compiles ok, we should handle it normally
1925 return self.handle_normal(line,continue_prompt)
1932 return self.handle_normal(line,continue_prompt)
1926
1933
1927 def handle_emacs(self,line,continue_prompt=None,
1934 def handle_emacs(self,line,continue_prompt=None,
1928 pre=None,iFun=None,theRest=None):
1935 pre=None,iFun=None,theRest=None):
1929 """Handle input lines marked by python-mode."""
1936 """Handle input lines marked by python-mode."""
1930
1937
1931 # Currently, nothing is done. Later more functionality can be added
1938 # Currently, nothing is done. Later more functionality can be added
1932 # here if needed.
1939 # here if needed.
1933
1940
1934 # The input cache shouldn't be updated
1941 # The input cache shouldn't be updated
1935
1942
1936 return line
1943 return line
1937
1944
1938 def write(self,data):
1945 def write(self,data):
1939 """Write a string to the default output"""
1946 """Write a string to the default output"""
1940 Term.cout.write(data)
1947 Term.cout.write(data)
1941
1948
1942 def write_err(self,data):
1949 def write_err(self,data):
1943 """Write a string to the default error output"""
1950 """Write a string to the default error output"""
1944 Term.cerr.write(data)
1951 Term.cerr.write(data)
1945
1952
1946 def exit(self):
1953 def exit(self):
1947 """Handle interactive exit.
1954 """Handle interactive exit.
1948
1955
1949 This method sets the exit_now attribute."""
1956 This method sets the exit_now attribute."""
1950
1957
1951 if self.rc.confirm_exit:
1958 if self.rc.confirm_exit:
1952 if ask_yes_no('Do you really want to exit ([y]/n)?','y'):
1959 if ask_yes_no('Do you really want to exit ([y]/n)?','y'):
1953 self.exit_now = True
1960 self.exit_now = True
1954 else:
1961 else:
1955 self.exit_now = True
1962 self.exit_now = True
1956 return self.exit_now
1963 return self.exit_now
1957
1964
1958 def safe_execfile(self,fname,*where,**kw):
1965 def safe_execfile(self,fname,*where,**kw):
1959 fname = os.path.expanduser(fname)
1966 fname = os.path.expanduser(fname)
1960
1967
1961 # find things also in current directory
1968 # find things also in current directory
1962 dname = os.path.dirname(fname)
1969 dname = os.path.dirname(fname)
1963 if not sys.path.count(dname):
1970 if not sys.path.count(dname):
1964 sys.path.append(dname)
1971 sys.path.append(dname)
1965
1972
1966 try:
1973 try:
1967 xfile = open(fname)
1974 xfile = open(fname)
1968 except:
1975 except:
1969 print >> Term.cerr, \
1976 print >> Term.cerr, \
1970 'Could not open file <%s> for safe execution.' % fname
1977 'Could not open file <%s> for safe execution.' % fname
1971 return None
1978 return None
1972
1979
1973 kw.setdefault('islog',0)
1980 kw.setdefault('islog',0)
1974 kw.setdefault('quiet',1)
1981 kw.setdefault('quiet',1)
1975 kw.setdefault('exit_ignore',0)
1982 kw.setdefault('exit_ignore',0)
1976 first = xfile.readline()
1983 first = xfile.readline()
1977 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
1984 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
1978 xfile.close()
1985 xfile.close()
1979 # line by line execution
1986 # line by line execution
1980 if first.startswith(loghead) or kw['islog']:
1987 if first.startswith(loghead) or kw['islog']:
1981 print 'Loading log file <%s> one line at a time...' % fname
1988 print 'Loading log file <%s> one line at a time...' % fname
1982 if kw['quiet']:
1989 if kw['quiet']:
1983 stdout_save = sys.stdout
1990 stdout_save = sys.stdout
1984 sys.stdout = StringIO.StringIO()
1991 sys.stdout = StringIO.StringIO()
1985 try:
1992 try:
1986 globs,locs = where[0:2]
1993 globs,locs = where[0:2]
1987 except:
1994 except:
1988 try:
1995 try:
1989 globs = locs = where[0]
1996 globs = locs = where[0]
1990 except:
1997 except:
1991 globs = locs = globals()
1998 globs = locs = globals()
1992 badblocks = []
1999 badblocks = []
1993
2000
1994 # we also need to identify indented blocks of code when replaying
2001 # we also need to identify indented blocks of code when replaying
1995 # logs and put them together before passing them to an exec
2002 # logs and put them together before passing them to an exec
1996 # statement. This takes a bit of regexp and look-ahead work in the
2003 # statement. This takes a bit of regexp and look-ahead work in the
1997 # file. It's easiest if we swallow the whole thing in memory
2004 # file. It's easiest if we swallow the whole thing in memory
1998 # first, and manually walk through the lines list moving the
2005 # first, and manually walk through the lines list moving the
1999 # counter ourselves.
2006 # counter ourselves.
2000 indent_re = re.compile('\s+\S')
2007 indent_re = re.compile('\s+\S')
2001 xfile = open(fname)
2008 xfile = open(fname)
2002 filelines = xfile.readlines()
2009 filelines = xfile.readlines()
2003 xfile.close()
2010 xfile.close()
2004 nlines = len(filelines)
2011 nlines = len(filelines)
2005 lnum = 0
2012 lnum = 0
2006 while lnum < nlines:
2013 while lnum < nlines:
2007 line = filelines[lnum]
2014 line = filelines[lnum]
2008 lnum += 1
2015 lnum += 1
2009 # don't re-insert logger status info into cache
2016 # don't re-insert logger status info into cache
2010 if line.startswith('#log#'):
2017 if line.startswith('#log#'):
2011 continue
2018 continue
2012 else:
2019 else:
2013 # build a block of code (maybe a single line) for execution
2020 # build a block of code (maybe a single line) for execution
2014 block = line
2021 block = line
2015 try:
2022 try:
2016 next = filelines[lnum] # lnum has already incremented
2023 next = filelines[lnum] # lnum has already incremented
2017 except:
2024 except:
2018 next = None
2025 next = None
2019 while next and indent_re.match(next):
2026 while next and indent_re.match(next):
2020 block += next
2027 block += next
2021 lnum += 1
2028 lnum += 1
2022 try:
2029 try:
2023 next = filelines[lnum]
2030 next = filelines[lnum]
2024 except:
2031 except:
2025 next = None
2032 next = None
2026 # now execute the block of one or more lines
2033 # now execute the block of one or more lines
2027 try:
2034 try:
2028 exec block in globs,locs
2035 exec block in globs,locs
2029 except SystemExit:
2036 except SystemExit:
2030 pass
2037 pass
2031 except:
2038 except:
2032 badblocks.append(block.rstrip())
2039 badblocks.append(block.rstrip())
2033 if kw['quiet']: # restore stdout
2040 if kw['quiet']: # restore stdout
2034 sys.stdout.close()
2041 sys.stdout.close()
2035 sys.stdout = stdout_save
2042 sys.stdout = stdout_save
2036 print 'Finished replaying log file <%s>' % fname
2043 print 'Finished replaying log file <%s>' % fname
2037 if badblocks:
2044 if badblocks:
2038 print >> sys.stderr, ('\nThe following lines/blocks in file '
2045 print >> sys.stderr, ('\nThe following lines/blocks in file '
2039 '<%s> reported errors:' % fname)
2046 '<%s> reported errors:' % fname)
2040
2047
2041 for badline in badblocks:
2048 for badline in badblocks:
2042 print >> sys.stderr, badline
2049 print >> sys.stderr, badline
2043 else: # regular file execution
2050 else: # regular file execution
2044 try:
2051 try:
2045 execfile(fname,*where)
2052 execfile(fname,*where)
2046 except SyntaxError:
2053 except SyntaxError:
2047 etype,evalue = sys.exc_info()[:2]
2054 etype,evalue = sys.exc_info()[:2]
2048 self.SyntaxTB(etype,evalue,[])
2055 self.SyntaxTB(etype,evalue,[])
2049 warn('Failure executing file: <%s>' % fname)
2056 warn('Failure executing file: <%s>' % fname)
2050 except SystemExit,status:
2057 except SystemExit,status:
2051 if not kw['exit_ignore']:
2058 if not kw['exit_ignore']:
2052 self.InteractiveTB()
2059 self.InteractiveTB()
2053 warn('Failure executing file: <%s>' % fname)
2060 warn('Failure executing file: <%s>' % fname)
2054 except:
2061 except:
2055 self.InteractiveTB()
2062 self.InteractiveTB()
2056 warn('Failure executing file: <%s>' % fname)
2063 warn('Failure executing file: <%s>' % fname)
2057
2064
2058 #************************* end of file <iplib.py> *****************************
2065 #************************* end of file <iplib.py> *****************************
@@ -1,4721 +1,4726 b''
1 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2
2
3 * IPython/iplib.py (InteractiveShell.__init__): add .meta
4 namespace for users and extension writers to hold data in. This
5 follows the discussion in
6 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
7
3 * IPython/completer.py (IPCompleter.complete): small patch to help
8 * IPython/completer.py (IPCompleter.complete): small patch to help
4 tab-completion under Emacs, after a suggestion by John Barnard
9 tab-completion under Emacs, after a suggestion by John Barnard
5 <barnarj-AT-ccf.org>.
10 <barnarj-AT-ccf.org>.
6
11
7 * IPython/Magic.py (Magic.extract_input_slices): added support for
12 * IPython/Magic.py (Magic.extract_input_slices): added support for
8 the slice notation in magics to use N-M to represent numbers N...M
13 the slice notation in magics to use N-M to represent numbers N...M
9 (closed endpoints). This is used by %macro and %save.
14 (closed endpoints). This is used by %macro and %save.
10
15
11 * IPython/completer.py (Completer.attr_matches): for modules which
16 * IPython/completer.py (Completer.attr_matches): for modules which
12 define __all__, complete only on those. After a patch by Jeffrey
17 define __all__, complete only on those. After a patch by Jeffrey
13 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
18 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
14 speed up this routine.
19 speed up this routine.
15
20
16 * IPython/Logger.py (Logger.log): fix a history handling bug. I
21 * IPython/Logger.py (Logger.log): fix a history handling bug. I
17 don't know if this is the end of it, but the behavior now is
22 don't know if this is the end of it, but the behavior now is
18 certainly much more correct. Note that coupled with macros,
23 certainly much more correct. Note that coupled with macros,
19 slightly surprising (at first) behavior may occur: a macro will in
24 slightly surprising (at first) behavior may occur: a macro will in
20 general expand to multiple lines of input, so upon exiting, the
25 general expand to multiple lines of input, so upon exiting, the
21 in/out counters will both be bumped by the corresponding amount
26 in/out counters will both be bumped by the corresponding amount
22 (as if the macro's contents had been typed interactively). Typing
27 (as if the macro's contents had been typed interactively). Typing
23 %hist will reveal the intermediate (silently processed) lines.
28 %hist will reveal the intermediate (silently processed) lines.
24
29
25 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
30 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
26 pickle to fail (%run was overwriting __main__ and not restoring
31 pickle to fail (%run was overwriting __main__ and not restoring
27 it, but pickle relies on __main__ to operate).
32 it, but pickle relies on __main__ to operate).
28
33
29 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
34 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
30 using properties, but forgot to make the main InteractiveShell
35 using properties, but forgot to make the main InteractiveShell
31 class a new-style class. Properties fail silently, and
36 class a new-style class. Properties fail silently, and
32 misteriously, with old-style class (getters work, but
37 misteriously, with old-style class (getters work, but
33 setters don't do anything).
38 setters don't do anything).
34
39
35 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
40 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
36
41
37 * IPython/Magic.py (magic_history): fix history reporting bug (I
42 * IPython/Magic.py (magic_history): fix history reporting bug (I
38 know some nasties are still there, I just can't seem to find a
43 know some nasties are still there, I just can't seem to find a
39 reproducible test case to track them down; the input history is
44 reproducible test case to track them down; the input history is
40 falling out of sync...)
45 falling out of sync...)
41
46
42 * IPython/iplib.py (handle_shell_escape): fix bug where both
47 * IPython/iplib.py (handle_shell_escape): fix bug where both
43 aliases and system accesses where broken for indented code (such
48 aliases and system accesses where broken for indented code (such
44 as loops).
49 as loops).
45
50
46 * IPython/genutils.py (shell): fix small but critical bug for
51 * IPython/genutils.py (shell): fix small but critical bug for
47 win32 system access.
52 win32 system access.
48
53
49 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
54 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
50
55
51 * IPython/iplib.py (showtraceback): remove use of the
56 * IPython/iplib.py (showtraceback): remove use of the
52 sys.last_{type/value/traceback} structures, which are non
57 sys.last_{type/value/traceback} structures, which are non
53 thread-safe.
58 thread-safe.
54 (_prefilter): change control flow to ensure that we NEVER
59 (_prefilter): change control flow to ensure that we NEVER
55 introspect objects when autocall is off. This will guarantee that
60 introspect objects when autocall is off. This will guarantee that
56 having an input line of the form 'x.y', where access to attribute
61 having an input line of the form 'x.y', where access to attribute
57 'y' has side effects, doesn't trigger the side effect TWICE. It
62 'y' has side effects, doesn't trigger the side effect TWICE. It
58 is important to note that, with autocall on, these side effects
63 is important to note that, with autocall on, these side effects
59 can still happen.
64 can still happen.
60 (ipsystem): new builtin, to complete the ip{magic/alias/system}
65 (ipsystem): new builtin, to complete the ip{magic/alias/system}
61 trio. IPython offers these three kinds of special calls which are
66 trio. IPython offers these three kinds of special calls which are
62 not python code, and it's a good thing to have their call method
67 not python code, and it's a good thing to have their call method
63 be accessible as pure python functions (not just special syntax at
68 be accessible as pure python functions (not just special syntax at
64 the command line). It gives us a better internal implementation
69 the command line). It gives us a better internal implementation
65 structure, as well as exposing these for user scripting more
70 structure, as well as exposing these for user scripting more
66 cleanly.
71 cleanly.
67
72
68 * IPython/macro.py (Macro.__init__): moved macros to a standalone
73 * IPython/macro.py (Macro.__init__): moved macros to a standalone
69 file. Now that they'll be more likely to be used with the
74 file. Now that they'll be more likely to be used with the
70 persistance system (%store), I want to make sure their module path
75 persistance system (%store), I want to make sure their module path
71 doesn't change in the future, so that we don't break things for
76 doesn't change in the future, so that we don't break things for
72 users' persisted data.
77 users' persisted data.
73
78
74 * IPython/iplib.py (autoindent_update): move indentation
79 * IPython/iplib.py (autoindent_update): move indentation
75 management into the _text_ processing loop, not the keyboard
80 management into the _text_ processing loop, not the keyboard
76 interactive one. This is necessary to correctly process non-typed
81 interactive one. This is necessary to correctly process non-typed
77 multiline input (such as macros).
82 multiline input (such as macros).
78
83
79 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
84 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
80 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
85 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
81 which was producing problems in the resulting manual.
86 which was producing problems in the resulting manual.
82 (magic_whos): improve reporting of instances (show their class,
87 (magic_whos): improve reporting of instances (show their class,
83 instead of simply printing 'instance' which isn't terribly
88 instead of simply printing 'instance' which isn't terribly
84 informative).
89 informative).
85
90
86 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
91 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
87 (minor mods) to support network shares under win32.
92 (minor mods) to support network shares under win32.
88
93
89 * IPython/winconsole.py (get_console_size): add new winconsole
94 * IPython/winconsole.py (get_console_size): add new winconsole
90 module and fixes to page_dumb() to improve its behavior under
95 module and fixes to page_dumb() to improve its behavior under
91 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
96 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
92
97
93 * IPython/Magic.py (Macro): simplified Macro class to just
98 * IPython/Magic.py (Macro): simplified Macro class to just
94 subclass list. We've had only 2.2 compatibility for a very long
99 subclass list. We've had only 2.2 compatibility for a very long
95 time, yet I was still avoiding subclassing the builtin types. No
100 time, yet I was still avoiding subclassing the builtin types. No
96 more (I'm also starting to use properties, though I won't shift to
101 more (I'm also starting to use properties, though I won't shift to
97 2.3-specific features quite yet).
102 2.3-specific features quite yet).
98 (magic_store): added Ville's patch for lightweight variable
103 (magic_store): added Ville's patch for lightweight variable
99 persistence, after a request on the user list by Matt Wilkie
104 persistence, after a request on the user list by Matt Wilkie
100 <maphew-AT-gmail.com>. The new %store magic's docstring has full
105 <maphew-AT-gmail.com>. The new %store magic's docstring has full
101 details.
106 details.
102
107
103 * IPython/iplib.py (InteractiveShell.post_config_initialization):
108 * IPython/iplib.py (InteractiveShell.post_config_initialization):
104 changed the default logfile name from 'ipython.log' to
109 changed the default logfile name from 'ipython.log' to
105 'ipython_log.py'. These logs are real python files, and now that
110 'ipython_log.py'. These logs are real python files, and now that
106 we have much better multiline support, people are more likely to
111 we have much better multiline support, people are more likely to
107 want to use them as such. Might as well name them correctly.
112 want to use them as such. Might as well name them correctly.
108
113
109 * IPython/Magic.py: substantial cleanup. While we can't stop
114 * IPython/Magic.py: substantial cleanup. While we can't stop
110 using magics as mixins, due to the existing customizations 'out
115 using magics as mixins, due to the existing customizations 'out
111 there' which rely on the mixin naming conventions, at least I
116 there' which rely on the mixin naming conventions, at least I
112 cleaned out all cross-class name usage. So once we are OK with
117 cleaned out all cross-class name usage. So once we are OK with
113 breaking compatibility, the two systems can be separated.
118 breaking compatibility, the two systems can be separated.
114
119
115 * IPython/Logger.py: major cleanup. This one is NOT a mixin
120 * IPython/Logger.py: major cleanup. This one is NOT a mixin
116 anymore, and the class is a fair bit less hideous as well. New
121 anymore, and the class is a fair bit less hideous as well. New
117 features were also introduced: timestamping of input, and logging
122 features were also introduced: timestamping of input, and logging
118 of output results. These are user-visible with the -t and -o
123 of output results. These are user-visible with the -t and -o
119 options to %logstart. Closes
124 options to %logstart. Closes
120 http://www.scipy.net/roundup/ipython/issue11 and a request by
125 http://www.scipy.net/roundup/ipython/issue11 and a request by
121 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
126 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
122
127
123 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
128 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
124
129
125 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
130 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
126 better hadnle backslashes in paths. See the thread 'More Windows
131 better hadnle backslashes in paths. See the thread 'More Windows
127 questions part 2 - \/ characters revisited' on the iypthon user
132 questions part 2 - \/ characters revisited' on the iypthon user
128 list:
133 list:
129 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
134 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
130
135
131 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
136 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
132
137
133 (InteractiveShell.__init__): change threaded shells to not use the
138 (InteractiveShell.__init__): change threaded shells to not use the
134 ipython crash handler. This was causing more problems than not,
139 ipython crash handler. This was causing more problems than not,
135 as exceptions in the main thread (GUI code, typically) would
140 as exceptions in the main thread (GUI code, typically) would
136 always show up as a 'crash', when they really weren't.
141 always show up as a 'crash', when they really weren't.
137
142
138 The colors and exception mode commands (%colors/%xmode) have been
143 The colors and exception mode commands (%colors/%xmode) have been
139 synchronized to also take this into account, so users can get
144 synchronized to also take this into account, so users can get
140 verbose exceptions for their threaded code as well. I also added
145 verbose exceptions for their threaded code as well. I also added
141 support for activating pdb inside this exception handler as well,
146 support for activating pdb inside this exception handler as well,
142 so now GUI authors can use IPython's enhanced pdb at runtime.
147 so now GUI authors can use IPython's enhanced pdb at runtime.
143
148
144 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
149 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
145 true by default, and add it to the shipped ipythonrc file. Since
150 true by default, and add it to the shipped ipythonrc file. Since
146 this asks the user before proceeding, I think it's OK to make it
151 this asks the user before proceeding, I think it's OK to make it
147 true by default.
152 true by default.
148
153
149 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
154 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
150 of the previous special-casing of input in the eval loop. I think
155 of the previous special-casing of input in the eval loop. I think
151 this is cleaner, as they really are commands and shouldn't have
156 this is cleaner, as they really are commands and shouldn't have
152 a special role in the middle of the core code.
157 a special role in the middle of the core code.
153
158
154 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
159 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
155
160
156 * IPython/iplib.py (edit_syntax_error): added support for
161 * IPython/iplib.py (edit_syntax_error): added support for
157 automatically reopening the editor if the file had a syntax error
162 automatically reopening the editor if the file had a syntax error
158 in it. Thanks to scottt who provided the patch at:
163 in it. Thanks to scottt who provided the patch at:
159 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
164 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
160 version committed).
165 version committed).
161
166
162 * IPython/iplib.py (handle_normal): add suport for multi-line
167 * IPython/iplib.py (handle_normal): add suport for multi-line
163 input with emtpy lines. This fixes
168 input with emtpy lines. This fixes
164 http://www.scipy.net/roundup/ipython/issue43 and a similar
169 http://www.scipy.net/roundup/ipython/issue43 and a similar
165 discussion on the user list.
170 discussion on the user list.
166
171
167 WARNING: a behavior change is necessarily introduced to support
172 WARNING: a behavior change is necessarily introduced to support
168 blank lines: now a single blank line with whitespace does NOT
173 blank lines: now a single blank line with whitespace does NOT
169 break the input loop, which means that when autoindent is on, by
174 break the input loop, which means that when autoindent is on, by
170 default hitting return on the next (indented) line does NOT exit.
175 default hitting return on the next (indented) line does NOT exit.
171
176
172 Instead, to exit a multiline input you can either have:
177 Instead, to exit a multiline input you can either have:
173
178
174 - TWO whitespace lines (just hit return again), or
179 - TWO whitespace lines (just hit return again), or
175 - a single whitespace line of a different length than provided
180 - a single whitespace line of a different length than provided
176 by the autoindent (add or remove a space).
181 by the autoindent (add or remove a space).
177
182
178 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
183 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
179 module to better organize all readline-related functionality.
184 module to better organize all readline-related functionality.
180 I've deleted FlexCompleter and put all completion clases here.
185 I've deleted FlexCompleter and put all completion clases here.
181
186
182 * IPython/iplib.py (raw_input): improve indentation management.
187 * IPython/iplib.py (raw_input): improve indentation management.
183 It is now possible to paste indented code with autoindent on, and
188 It is now possible to paste indented code with autoindent on, and
184 the code is interpreted correctly (though it still looks bad on
189 the code is interpreted correctly (though it still looks bad on
185 screen, due to the line-oriented nature of ipython).
190 screen, due to the line-oriented nature of ipython).
186 (MagicCompleter.complete): change behavior so that a TAB key on an
191 (MagicCompleter.complete): change behavior so that a TAB key on an
187 otherwise empty line actually inserts a tab, instead of completing
192 otherwise empty line actually inserts a tab, instead of completing
188 on the entire global namespace. This makes it easier to use the
193 on the entire global namespace. This makes it easier to use the
189 TAB key for indentation. After a request by Hans Meine
194 TAB key for indentation. After a request by Hans Meine
190 <hans_meine-AT-gmx.net>
195 <hans_meine-AT-gmx.net>
191 (_prefilter): add support so that typing plain 'exit' or 'quit'
196 (_prefilter): add support so that typing plain 'exit' or 'quit'
192 does a sensible thing. Originally I tried to deviate as little as
197 does a sensible thing. Originally I tried to deviate as little as
193 possible from the default python behavior, but even that one may
198 possible from the default python behavior, but even that one may
194 change in this direction (thread on python-dev to that effect).
199 change in this direction (thread on python-dev to that effect).
195 Regardless, ipython should do the right thing even if CPython's
200 Regardless, ipython should do the right thing even if CPython's
196 '>>>' prompt doesn't.
201 '>>>' prompt doesn't.
197 (InteractiveShell): removed subclassing code.InteractiveConsole
202 (InteractiveShell): removed subclassing code.InteractiveConsole
198 class. By now we'd overridden just about all of its methods: I've
203 class. By now we'd overridden just about all of its methods: I've
199 copied the remaining two over, and now ipython is a standalone
204 copied the remaining two over, and now ipython is a standalone
200 class. This will provide a clearer picture for the chainsaw
205 class. This will provide a clearer picture for the chainsaw
201 branch refactoring.
206 branch refactoring.
202
207
203 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
208 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
204
209
205 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
210 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
206 failures for objects which break when dir() is called on them.
211 failures for objects which break when dir() is called on them.
207
212
208 * IPython/FlexCompleter.py (Completer.__init__): Added support for
213 * IPython/FlexCompleter.py (Completer.__init__): Added support for
209 distinct local and global namespaces in the completer API. This
214 distinct local and global namespaces in the completer API. This
210 change allows us top properly handle completion with distinct
215 change allows us top properly handle completion with distinct
211 scopes, including in embedded instances (this had never really
216 scopes, including in embedded instances (this had never really
212 worked correctly).
217 worked correctly).
213
218
214 Note: this introduces a change in the constructor for
219 Note: this introduces a change in the constructor for
215 MagicCompleter, as a new global_namespace parameter is now the
220 MagicCompleter, as a new global_namespace parameter is now the
216 second argument (the others were bumped one position).
221 second argument (the others were bumped one position).
217
222
218 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
223 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
219
224
220 * IPython/iplib.py (embed_mainloop): fix tab-completion in
225 * IPython/iplib.py (embed_mainloop): fix tab-completion in
221 embedded instances (which can be done now thanks to Vivian's
226 embedded instances (which can be done now thanks to Vivian's
222 frame-handling fixes for pdb).
227 frame-handling fixes for pdb).
223 (InteractiveShell.__init__): Fix namespace handling problem in
228 (InteractiveShell.__init__): Fix namespace handling problem in
224 embedded instances. We were overwriting __main__ unconditionally,
229 embedded instances. We were overwriting __main__ unconditionally,
225 and this should only be done for 'full' (non-embedded) IPython;
230 and this should only be done for 'full' (non-embedded) IPython;
226 embedded instances must respect the caller's __main__. Thanks to
231 embedded instances must respect the caller's __main__. Thanks to
227 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
232 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
228
233
229 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
234 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
230
235
231 * setup.py: added download_url to setup(). This registers the
236 * setup.py: added download_url to setup(). This registers the
232 download address at PyPI, which is not only useful to humans
237 download address at PyPI, which is not only useful to humans
233 browsing the site, but is also picked up by setuptools (the Eggs
238 browsing the site, but is also picked up by setuptools (the Eggs
234 machinery). Thanks to Ville and R. Kern for the info/discussion
239 machinery). Thanks to Ville and R. Kern for the info/discussion
235 on this.
240 on this.
236
241
237 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
242 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
238
243
239 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
244 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
240 This brings a lot of nice functionality to the pdb mode, which now
245 This brings a lot of nice functionality to the pdb mode, which now
241 has tab-completion, syntax highlighting, and better stack handling
246 has tab-completion, syntax highlighting, and better stack handling
242 than before. Many thanks to Vivian De Smedt
247 than before. Many thanks to Vivian De Smedt
243 <vivian-AT-vdesmedt.com> for the original patches.
248 <vivian-AT-vdesmedt.com> for the original patches.
244
249
245 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
250 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
246
251
247 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
252 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
248 sequence to consistently accept the banner argument. The
253 sequence to consistently accept the banner argument. The
249 inconsistency was tripping SAGE, thanks to Gary Zablackis
254 inconsistency was tripping SAGE, thanks to Gary Zablackis
250 <gzabl-AT-yahoo.com> for the report.
255 <gzabl-AT-yahoo.com> for the report.
251
256
252 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
257 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
253
258
254 * IPython/iplib.py (InteractiveShell.post_config_initialization):
259 * IPython/iplib.py (InteractiveShell.post_config_initialization):
255 Fix bug where a naked 'alias' call in the ipythonrc file would
260 Fix bug where a naked 'alias' call in the ipythonrc file would
256 cause a crash. Bug reported by Jorgen Stenarson.
261 cause a crash. Bug reported by Jorgen Stenarson.
257
262
258 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
263 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
259
264
260 * IPython/ipmaker.py (make_IPython): cleanups which should improve
265 * IPython/ipmaker.py (make_IPython): cleanups which should improve
261 startup time.
266 startup time.
262
267
263 * IPython/iplib.py (runcode): my globals 'fix' for embedded
268 * IPython/iplib.py (runcode): my globals 'fix' for embedded
264 instances had introduced a bug with globals in normal code. Now
269 instances had introduced a bug with globals in normal code. Now
265 it's working in all cases.
270 it's working in all cases.
266
271
267 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
272 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
268 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
273 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
269 has been introduced to set the default case sensitivity of the
274 has been introduced to set the default case sensitivity of the
270 searches. Users can still select either mode at runtime on a
275 searches. Users can still select either mode at runtime on a
271 per-search basis.
276 per-search basis.
272
277
273 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
278 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
274
279
275 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
280 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
276 attributes in wildcard searches for subclasses. Modified version
281 attributes in wildcard searches for subclasses. Modified version
277 of a patch by Jorgen.
282 of a patch by Jorgen.
278
283
279 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
284 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
280
285
281 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
286 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
282 embedded instances. I added a user_global_ns attribute to the
287 embedded instances. I added a user_global_ns attribute to the
283 InteractiveShell class to handle this.
288 InteractiveShell class to handle this.
284
289
285 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
290 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
286
291
287 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
292 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
288 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
293 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
289 (reported under win32, but may happen also in other platforms).
294 (reported under win32, but may happen also in other platforms).
290 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
295 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
291
296
292 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
297 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
293
298
294 * IPython/Magic.py (magic_psearch): new support for wildcard
299 * IPython/Magic.py (magic_psearch): new support for wildcard
295 patterns. Now, typing ?a*b will list all names which begin with a
300 patterns. Now, typing ?a*b will list all names which begin with a
296 and end in b, for example. The %psearch magic has full
301 and end in b, for example. The %psearch magic has full
297 docstrings. Many thanks to JΓΆrgen Stenarson
302 docstrings. Many thanks to JΓΆrgen Stenarson
298 <jorgen.stenarson-AT-bostream.nu>, author of the patches
303 <jorgen.stenarson-AT-bostream.nu>, author of the patches
299 implementing this functionality.
304 implementing this functionality.
300
305
301 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
306 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
302
307
303 * Manual: fixed long-standing annoyance of double-dashes (as in
308 * Manual: fixed long-standing annoyance of double-dashes (as in
304 --prefix=~, for example) being stripped in the HTML version. This
309 --prefix=~, for example) being stripped in the HTML version. This
305 is a latex2html bug, but a workaround was provided. Many thanks
310 is a latex2html bug, but a workaround was provided. Many thanks
306 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
311 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
307 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
312 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
308 rolling. This seemingly small issue had tripped a number of users
313 rolling. This seemingly small issue had tripped a number of users
309 when first installing, so I'm glad to see it gone.
314 when first installing, so I'm glad to see it gone.
310
315
311 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
316 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
312
317
313 * IPython/Extensions/numeric_formats.py: fix missing import,
318 * IPython/Extensions/numeric_formats.py: fix missing import,
314 reported by Stephen Walton.
319 reported by Stephen Walton.
315
320
316 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
321 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
317
322
318 * IPython/demo.py: finish demo module, fully documented now.
323 * IPython/demo.py: finish demo module, fully documented now.
319
324
320 * IPython/genutils.py (file_read): simple little utility to read a
325 * IPython/genutils.py (file_read): simple little utility to read a
321 file and ensure it's closed afterwards.
326 file and ensure it's closed afterwards.
322
327
323 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
328 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
324
329
325 * IPython/demo.py (Demo.__init__): added support for individually
330 * IPython/demo.py (Demo.__init__): added support for individually
326 tagging blocks for automatic execution.
331 tagging blocks for automatic execution.
327
332
328 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
333 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
329 syntax-highlighted python sources, requested by John.
334 syntax-highlighted python sources, requested by John.
330
335
331 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
336 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
332
337
333 * IPython/demo.py (Demo.again): fix bug where again() blocks after
338 * IPython/demo.py (Demo.again): fix bug where again() blocks after
334 finishing.
339 finishing.
335
340
336 * IPython/genutils.py (shlex_split): moved from Magic to here,
341 * IPython/genutils.py (shlex_split): moved from Magic to here,
337 where all 2.2 compatibility stuff lives. I needed it for demo.py.
342 where all 2.2 compatibility stuff lives. I needed it for demo.py.
338
343
339 * IPython/demo.py (Demo.__init__): added support for silent
344 * IPython/demo.py (Demo.__init__): added support for silent
340 blocks, improved marks as regexps, docstrings written.
345 blocks, improved marks as regexps, docstrings written.
341 (Demo.__init__): better docstring, added support for sys.argv.
346 (Demo.__init__): better docstring, added support for sys.argv.
342
347
343 * IPython/genutils.py (marquee): little utility used by the demo
348 * IPython/genutils.py (marquee): little utility used by the demo
344 code, handy in general.
349 code, handy in general.
345
350
346 * IPython/demo.py (Demo.__init__): new class for interactive
351 * IPython/demo.py (Demo.__init__): new class for interactive
347 demos. Not documented yet, I just wrote it in a hurry for
352 demos. Not documented yet, I just wrote it in a hurry for
348 scipy'05. Will docstring later.
353 scipy'05. Will docstring later.
349
354
350 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
355 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
351
356
352 * IPython/Shell.py (sigint_handler): Drastic simplification which
357 * IPython/Shell.py (sigint_handler): Drastic simplification which
353 also seems to make Ctrl-C work correctly across threads! This is
358 also seems to make Ctrl-C work correctly across threads! This is
354 so simple, that I can't beleive I'd missed it before. Needs more
359 so simple, that I can't beleive I'd missed it before. Needs more
355 testing, though.
360 testing, though.
356 (KBINT): Never mind, revert changes. I'm sure I'd tried something
361 (KBINT): Never mind, revert changes. I'm sure I'd tried something
357 like this before...
362 like this before...
358
363
359 * IPython/genutils.py (get_home_dir): add protection against
364 * IPython/genutils.py (get_home_dir): add protection against
360 non-dirs in win32 registry.
365 non-dirs in win32 registry.
361
366
362 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
367 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
363 bug where dict was mutated while iterating (pysh crash).
368 bug where dict was mutated while iterating (pysh crash).
364
369
365 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
370 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
366
371
367 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
372 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
368 spurious newlines added by this routine. After a report by
373 spurious newlines added by this routine. After a report by
369 F. Mantegazza.
374 F. Mantegazza.
370
375
371 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
376 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
372
377
373 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
378 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
374 calls. These were a leftover from the GTK 1.x days, and can cause
379 calls. These were a leftover from the GTK 1.x days, and can cause
375 problems in certain cases (after a report by John Hunter).
380 problems in certain cases (after a report by John Hunter).
376
381
377 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
382 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
378 os.getcwd() fails at init time. Thanks to patch from David Remahl
383 os.getcwd() fails at init time. Thanks to patch from David Remahl
379 <chmod007-AT-mac.com>.
384 <chmod007-AT-mac.com>.
380 (InteractiveShell.__init__): prevent certain special magics from
385 (InteractiveShell.__init__): prevent certain special magics from
381 being shadowed by aliases. Closes
386 being shadowed by aliases. Closes
382 http://www.scipy.net/roundup/ipython/issue41.
387 http://www.scipy.net/roundup/ipython/issue41.
383
388
384 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
389 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
385
390
386 * IPython/iplib.py (InteractiveShell.complete): Added new
391 * IPython/iplib.py (InteractiveShell.complete): Added new
387 top-level completion method to expose the completion mechanism
392 top-level completion method to expose the completion mechanism
388 beyond readline-based environments.
393 beyond readline-based environments.
389
394
390 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
395 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
391
396
392 * tools/ipsvnc (svnversion): fix svnversion capture.
397 * tools/ipsvnc (svnversion): fix svnversion capture.
393
398
394 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
399 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
395 attribute to self, which was missing. Before, it was set by a
400 attribute to self, which was missing. Before, it was set by a
396 routine which in certain cases wasn't being called, so the
401 routine which in certain cases wasn't being called, so the
397 instance could end up missing the attribute. This caused a crash.
402 instance could end up missing the attribute. This caused a crash.
398 Closes http://www.scipy.net/roundup/ipython/issue40.
403 Closes http://www.scipy.net/roundup/ipython/issue40.
399
404
400 2005-08-16 Fernando Perez <fperez@colorado.edu>
405 2005-08-16 Fernando Perez <fperez@colorado.edu>
401
406
402 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
407 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
403 contains non-string attribute. Closes
408 contains non-string attribute. Closes
404 http://www.scipy.net/roundup/ipython/issue38.
409 http://www.scipy.net/roundup/ipython/issue38.
405
410
406 2005-08-14 Fernando Perez <fperez@colorado.edu>
411 2005-08-14 Fernando Perez <fperez@colorado.edu>
407
412
408 * tools/ipsvnc: Minor improvements, to add changeset info.
413 * tools/ipsvnc: Minor improvements, to add changeset info.
409
414
410 2005-08-12 Fernando Perez <fperez@colorado.edu>
415 2005-08-12 Fernando Perez <fperez@colorado.edu>
411
416
412 * IPython/iplib.py (runsource): remove self.code_to_run_src
417 * IPython/iplib.py (runsource): remove self.code_to_run_src
413 attribute. I realized this is nothing more than
418 attribute. I realized this is nothing more than
414 '\n'.join(self.buffer), and having the same data in two different
419 '\n'.join(self.buffer), and having the same data in two different
415 places is just asking for synchronization bugs. This may impact
420 places is just asking for synchronization bugs. This may impact
416 people who have custom exception handlers, so I need to warn
421 people who have custom exception handlers, so I need to warn
417 ipython-dev about it (F. Mantegazza may use them).
422 ipython-dev about it (F. Mantegazza may use them).
418
423
419 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
424 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
420
425
421 * IPython/genutils.py: fix 2.2 compatibility (generators)
426 * IPython/genutils.py: fix 2.2 compatibility (generators)
422
427
423 2005-07-18 Fernando Perez <fperez@colorado.edu>
428 2005-07-18 Fernando Perez <fperez@colorado.edu>
424
429
425 * IPython/genutils.py (get_home_dir): fix to help users with
430 * IPython/genutils.py (get_home_dir): fix to help users with
426 invalid $HOME under win32.
431 invalid $HOME under win32.
427
432
428 2005-07-17 Fernando Perez <fperez@colorado.edu>
433 2005-07-17 Fernando Perez <fperez@colorado.edu>
429
434
430 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
435 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
431 some old hacks and clean up a bit other routines; code should be
436 some old hacks and clean up a bit other routines; code should be
432 simpler and a bit faster.
437 simpler and a bit faster.
433
438
434 * IPython/iplib.py (interact): removed some last-resort attempts
439 * IPython/iplib.py (interact): removed some last-resort attempts
435 to survive broken stdout/stderr. That code was only making it
440 to survive broken stdout/stderr. That code was only making it
436 harder to abstract out the i/o (necessary for gui integration),
441 harder to abstract out the i/o (necessary for gui integration),
437 and the crashes it could prevent were extremely rare in practice
442 and the crashes it could prevent were extremely rare in practice
438 (besides being fully user-induced in a pretty violent manner).
443 (besides being fully user-induced in a pretty violent manner).
439
444
440 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
445 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
441 Nothing major yet, but the code is simpler to read; this should
446 Nothing major yet, but the code is simpler to read; this should
442 make it easier to do more serious modifications in the future.
447 make it easier to do more serious modifications in the future.
443
448
444 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
449 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
445 which broke in .15 (thanks to a report by Ville).
450 which broke in .15 (thanks to a report by Ville).
446
451
447 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
452 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
448 be quite correct, I know next to nothing about unicode). This
453 be quite correct, I know next to nothing about unicode). This
449 will allow unicode strings to be used in prompts, amongst other
454 will allow unicode strings to be used in prompts, amongst other
450 cases. It also will prevent ipython from crashing when unicode
455 cases. It also will prevent ipython from crashing when unicode
451 shows up unexpectedly in many places. If ascii encoding fails, we
456 shows up unexpectedly in many places. If ascii encoding fails, we
452 assume utf_8. Currently the encoding is not a user-visible
457 assume utf_8. Currently the encoding is not a user-visible
453 setting, though it could be made so if there is demand for it.
458 setting, though it could be made so if there is demand for it.
454
459
455 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
460 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
456
461
457 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
462 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
458
463
459 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
464 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
460
465
461 * IPython/genutils.py: Add 2.2 compatibility here, so all other
466 * IPython/genutils.py: Add 2.2 compatibility here, so all other
462 code can work transparently for 2.2/2.3.
467 code can work transparently for 2.2/2.3.
463
468
464 2005-07-16 Fernando Perez <fperez@colorado.edu>
469 2005-07-16 Fernando Perez <fperez@colorado.edu>
465
470
466 * IPython/ultraTB.py (ExceptionColors): Make a global variable
471 * IPython/ultraTB.py (ExceptionColors): Make a global variable
467 out of the color scheme table used for coloring exception
472 out of the color scheme table used for coloring exception
468 tracebacks. This allows user code to add new schemes at runtime.
473 tracebacks. This allows user code to add new schemes at runtime.
469 This is a minimally modified version of the patch at
474 This is a minimally modified version of the patch at
470 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
475 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
471 for the contribution.
476 for the contribution.
472
477
473 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
478 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
474 slightly modified version of the patch in
479 slightly modified version of the patch in
475 http://www.scipy.net/roundup/ipython/issue34, which also allows me
480 http://www.scipy.net/roundup/ipython/issue34, which also allows me
476 to remove the previous try/except solution (which was costlier).
481 to remove the previous try/except solution (which was costlier).
477 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
482 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
478
483
479 2005-06-08 Fernando Perez <fperez@colorado.edu>
484 2005-06-08 Fernando Perez <fperez@colorado.edu>
480
485
481 * IPython/iplib.py (write/write_err): Add methods to abstract all
486 * IPython/iplib.py (write/write_err): Add methods to abstract all
482 I/O a bit more.
487 I/O a bit more.
483
488
484 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
489 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
485 warning, reported by Aric Hagberg, fix by JD Hunter.
490 warning, reported by Aric Hagberg, fix by JD Hunter.
486
491
487 2005-06-02 *** Released version 0.6.15
492 2005-06-02 *** Released version 0.6.15
488
493
489 2005-06-01 Fernando Perez <fperez@colorado.edu>
494 2005-06-01 Fernando Perez <fperez@colorado.edu>
490
495
491 * IPython/iplib.py (MagicCompleter.file_matches): Fix
496 * IPython/iplib.py (MagicCompleter.file_matches): Fix
492 tab-completion of filenames within open-quoted strings. Note that
497 tab-completion of filenames within open-quoted strings. Note that
493 this requires that in ~/.ipython/ipythonrc, users change the
498 this requires that in ~/.ipython/ipythonrc, users change the
494 readline delimiters configuration to read:
499 readline delimiters configuration to read:
495
500
496 readline_remove_delims -/~
501 readline_remove_delims -/~
497
502
498
503
499 2005-05-31 *** Released version 0.6.14
504 2005-05-31 *** Released version 0.6.14
500
505
501 2005-05-29 Fernando Perez <fperez@colorado.edu>
506 2005-05-29 Fernando Perez <fperez@colorado.edu>
502
507
503 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
508 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
504 with files not on the filesystem. Reported by Eliyahu Sandler
509 with files not on the filesystem. Reported by Eliyahu Sandler
505 <eli@gondolin.net>
510 <eli@gondolin.net>
506
511
507 2005-05-22 Fernando Perez <fperez@colorado.edu>
512 2005-05-22 Fernando Perez <fperez@colorado.edu>
508
513
509 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
514 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
510 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
515 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
511
516
512 2005-05-19 Fernando Perez <fperez@colorado.edu>
517 2005-05-19 Fernando Perez <fperez@colorado.edu>
513
518
514 * IPython/iplib.py (safe_execfile): close a file which could be
519 * IPython/iplib.py (safe_execfile): close a file which could be
515 left open (causing problems in win32, which locks open files).
520 left open (causing problems in win32, which locks open files).
516 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
521 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
517
522
518 2005-05-18 Fernando Perez <fperez@colorado.edu>
523 2005-05-18 Fernando Perez <fperez@colorado.edu>
519
524
520 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
525 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
521 keyword arguments correctly to safe_execfile().
526 keyword arguments correctly to safe_execfile().
522
527
523 2005-05-13 Fernando Perez <fperez@colorado.edu>
528 2005-05-13 Fernando Perez <fperez@colorado.edu>
524
529
525 * ipython.1: Added info about Qt to manpage, and threads warning
530 * ipython.1: Added info about Qt to manpage, and threads warning
526 to usage page (invoked with --help).
531 to usage page (invoked with --help).
527
532
528 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
533 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
529 new matcher (it goes at the end of the priority list) to do
534 new matcher (it goes at the end of the priority list) to do
530 tab-completion on named function arguments. Submitted by George
535 tab-completion on named function arguments. Submitted by George
531 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
536 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
532 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
537 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
533 for more details.
538 for more details.
534
539
535 * IPython/Magic.py (magic_run): Added new -e flag to ignore
540 * IPython/Magic.py (magic_run): Added new -e flag to ignore
536 SystemExit exceptions in the script being run. Thanks to a report
541 SystemExit exceptions in the script being run. Thanks to a report
537 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
542 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
538 producing very annoying behavior when running unit tests.
543 producing very annoying behavior when running unit tests.
539
544
540 2005-05-12 Fernando Perez <fperez@colorado.edu>
545 2005-05-12 Fernando Perez <fperez@colorado.edu>
541
546
542 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
547 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
543 which I'd broken (again) due to a changed regexp. In the process,
548 which I'd broken (again) due to a changed regexp. In the process,
544 added ';' as an escape to auto-quote the whole line without
549 added ';' as an escape to auto-quote the whole line without
545 splitting its arguments. Thanks to a report by Jerry McRae
550 splitting its arguments. Thanks to a report by Jerry McRae
546 <qrs0xyc02-AT-sneakemail.com>.
551 <qrs0xyc02-AT-sneakemail.com>.
547
552
548 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
553 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
549 possible crashes caused by a TokenError. Reported by Ed Schofield
554 possible crashes caused by a TokenError. Reported by Ed Schofield
550 <schofield-AT-ftw.at>.
555 <schofield-AT-ftw.at>.
551
556
552 2005-05-06 Fernando Perez <fperez@colorado.edu>
557 2005-05-06 Fernando Perez <fperez@colorado.edu>
553
558
554 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
559 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
555
560
556 2005-04-29 Fernando Perez <fperez@colorado.edu>
561 2005-04-29 Fernando Perez <fperez@colorado.edu>
557
562
558 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
563 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
559 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
564 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
560 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
565 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
561 which provides support for Qt interactive usage (similar to the
566 which provides support for Qt interactive usage (similar to the
562 existing one for WX and GTK). This had been often requested.
567 existing one for WX and GTK). This had been often requested.
563
568
564 2005-04-14 *** Released version 0.6.13
569 2005-04-14 *** Released version 0.6.13
565
570
566 2005-04-08 Fernando Perez <fperez@colorado.edu>
571 2005-04-08 Fernando Perez <fperez@colorado.edu>
567
572
568 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
573 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
569 from _ofind, which gets called on almost every input line. Now,
574 from _ofind, which gets called on almost every input line. Now,
570 we only try to get docstrings if they are actually going to be
575 we only try to get docstrings if they are actually going to be
571 used (the overhead of fetching unnecessary docstrings can be
576 used (the overhead of fetching unnecessary docstrings can be
572 noticeable for certain objects, such as Pyro proxies).
577 noticeable for certain objects, such as Pyro proxies).
573
578
574 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
579 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
575 for completers. For some reason I had been passing them the state
580 for completers. For some reason I had been passing them the state
576 variable, which completers never actually need, and was in
581 variable, which completers never actually need, and was in
577 conflict with the rlcompleter API. Custom completers ONLY need to
582 conflict with the rlcompleter API. Custom completers ONLY need to
578 take the text parameter.
583 take the text parameter.
579
584
580 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
585 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
581 work correctly in pysh. I've also moved all the logic which used
586 work correctly in pysh. I've also moved all the logic which used
582 to be in pysh.py here, which will prevent problems with future
587 to be in pysh.py here, which will prevent problems with future
583 upgrades. However, this time I must warn users to update their
588 upgrades. However, this time I must warn users to update their
584 pysh profile to include the line
589 pysh profile to include the line
585
590
586 import_all IPython.Extensions.InterpreterExec
591 import_all IPython.Extensions.InterpreterExec
587
592
588 because otherwise things won't work for them. They MUST also
593 because otherwise things won't work for them. They MUST also
589 delete pysh.py and the line
594 delete pysh.py and the line
590
595
591 execfile pysh.py
596 execfile pysh.py
592
597
593 from their ipythonrc-pysh.
598 from their ipythonrc-pysh.
594
599
595 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
600 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
596 robust in the face of objects whose dir() returns non-strings
601 robust in the face of objects whose dir() returns non-strings
597 (which it shouldn't, but some broken libs like ITK do). Thanks to
602 (which it shouldn't, but some broken libs like ITK do). Thanks to
598 a patch by John Hunter (implemented differently, though). Also
603 a patch by John Hunter (implemented differently, though). Also
599 minor improvements by using .extend instead of + on lists.
604 minor improvements by using .extend instead of + on lists.
600
605
601 * pysh.py:
606 * pysh.py:
602
607
603 2005-04-06 Fernando Perez <fperez@colorado.edu>
608 2005-04-06 Fernando Perez <fperez@colorado.edu>
604
609
605 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
610 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
606 by default, so that all users benefit from it. Those who don't
611 by default, so that all users benefit from it. Those who don't
607 want it can still turn it off.
612 want it can still turn it off.
608
613
609 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
614 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
610 config file, I'd forgotten about this, so users were getting it
615 config file, I'd forgotten about this, so users were getting it
611 off by default.
616 off by default.
612
617
613 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
618 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
614 consistency. Now magics can be called in multiline statements,
619 consistency. Now magics can be called in multiline statements,
615 and python variables can be expanded in magic calls via $var.
620 and python variables can be expanded in magic calls via $var.
616 This makes the magic system behave just like aliases or !system
621 This makes the magic system behave just like aliases or !system
617 calls.
622 calls.
618
623
619 2005-03-28 Fernando Perez <fperez@colorado.edu>
624 2005-03-28 Fernando Perez <fperez@colorado.edu>
620
625
621 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
626 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
622 expensive string additions for building command. Add support for
627 expensive string additions for building command. Add support for
623 trailing ';' when autocall is used.
628 trailing ';' when autocall is used.
624
629
625 2005-03-26 Fernando Perez <fperez@colorado.edu>
630 2005-03-26 Fernando Perez <fperez@colorado.edu>
626
631
627 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
632 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
628 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
633 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
629 ipython.el robust against prompts with any number of spaces
634 ipython.el robust against prompts with any number of spaces
630 (including 0) after the ':' character.
635 (including 0) after the ':' character.
631
636
632 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
637 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
633 continuation prompt, which misled users to think the line was
638 continuation prompt, which misled users to think the line was
634 already indented. Closes debian Bug#300847, reported to me by
639 already indented. Closes debian Bug#300847, reported to me by
635 Norbert Tretkowski <tretkowski-AT-inittab.de>.
640 Norbert Tretkowski <tretkowski-AT-inittab.de>.
636
641
637 2005-03-23 Fernando Perez <fperez@colorado.edu>
642 2005-03-23 Fernando Perez <fperez@colorado.edu>
638
643
639 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
644 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
640 properly aligned if they have embedded newlines.
645 properly aligned if they have embedded newlines.
641
646
642 * IPython/iplib.py (runlines): Add a public method to expose
647 * IPython/iplib.py (runlines): Add a public method to expose
643 IPython's code execution machinery, so that users can run strings
648 IPython's code execution machinery, so that users can run strings
644 as if they had been typed at the prompt interactively.
649 as if they had been typed at the prompt interactively.
645 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
650 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
646 methods which can call the system shell, but with python variable
651 methods which can call the system shell, but with python variable
647 expansion. The three such methods are: __IPYTHON__.system,
652 expansion. The three such methods are: __IPYTHON__.system,
648 .getoutput and .getoutputerror. These need to be documented in a
653 .getoutput and .getoutputerror. These need to be documented in a
649 'public API' section (to be written) of the manual.
654 'public API' section (to be written) of the manual.
650
655
651 2005-03-20 Fernando Perez <fperez@colorado.edu>
656 2005-03-20 Fernando Perez <fperez@colorado.edu>
652
657
653 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
658 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
654 for custom exception handling. This is quite powerful, and it
659 for custom exception handling. This is quite powerful, and it
655 allows for user-installable exception handlers which can trap
660 allows for user-installable exception handlers which can trap
656 custom exceptions at runtime and treat them separately from
661 custom exceptions at runtime and treat them separately from
657 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
662 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
658 Mantegazza <mantegazza-AT-ill.fr>.
663 Mantegazza <mantegazza-AT-ill.fr>.
659 (InteractiveShell.set_custom_completer): public API function to
664 (InteractiveShell.set_custom_completer): public API function to
660 add new completers at runtime.
665 add new completers at runtime.
661
666
662 2005-03-19 Fernando Perez <fperez@colorado.edu>
667 2005-03-19 Fernando Perez <fperez@colorado.edu>
663
668
664 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
669 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
665 allow objects which provide their docstrings via non-standard
670 allow objects which provide their docstrings via non-standard
666 mechanisms (like Pyro proxies) to still be inspected by ipython's
671 mechanisms (like Pyro proxies) to still be inspected by ipython's
667 ? system.
672 ? system.
668
673
669 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
674 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
670 automatic capture system. I tried quite hard to make it work
675 automatic capture system. I tried quite hard to make it work
671 reliably, and simply failed. I tried many combinations with the
676 reliably, and simply failed. I tried many combinations with the
672 subprocess module, but eventually nothing worked in all needed
677 subprocess module, but eventually nothing worked in all needed
673 cases (not blocking stdin for the child, duplicating stdout
678 cases (not blocking stdin for the child, duplicating stdout
674 without blocking, etc). The new %sc/%sx still do capture to these
679 without blocking, etc). The new %sc/%sx still do capture to these
675 magical list/string objects which make shell use much more
680 magical list/string objects which make shell use much more
676 conveninent, so not all is lost.
681 conveninent, so not all is lost.
677
682
678 XXX - FIX MANUAL for the change above!
683 XXX - FIX MANUAL for the change above!
679
684
680 (runsource): I copied code.py's runsource() into ipython to modify
685 (runsource): I copied code.py's runsource() into ipython to modify
681 it a bit. Now the code object and source to be executed are
686 it a bit. Now the code object and source to be executed are
682 stored in ipython. This makes this info accessible to third-party
687 stored in ipython. This makes this info accessible to third-party
683 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
688 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
684 Mantegazza <mantegazza-AT-ill.fr>.
689 Mantegazza <mantegazza-AT-ill.fr>.
685
690
686 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
691 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
687 history-search via readline (like C-p/C-n). I'd wanted this for a
692 history-search via readline (like C-p/C-n). I'd wanted this for a
688 long time, but only recently found out how to do it. For users
693 long time, but only recently found out how to do it. For users
689 who already have their ipythonrc files made and want this, just
694 who already have their ipythonrc files made and want this, just
690 add:
695 add:
691
696
692 readline_parse_and_bind "\e[A": history-search-backward
697 readline_parse_and_bind "\e[A": history-search-backward
693 readline_parse_and_bind "\e[B": history-search-forward
698 readline_parse_and_bind "\e[B": history-search-forward
694
699
695 2005-03-18 Fernando Perez <fperez@colorado.edu>
700 2005-03-18 Fernando Perez <fperez@colorado.edu>
696
701
697 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
702 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
698 LSString and SList classes which allow transparent conversions
703 LSString and SList classes which allow transparent conversions
699 between list mode and whitespace-separated string.
704 between list mode and whitespace-separated string.
700 (magic_r): Fix recursion problem in %r.
705 (magic_r): Fix recursion problem in %r.
701
706
702 * IPython/genutils.py (LSString): New class to be used for
707 * IPython/genutils.py (LSString): New class to be used for
703 automatic storage of the results of all alias/system calls in _o
708 automatic storage of the results of all alias/system calls in _o
704 and _e (stdout/err). These provide a .l/.list attribute which
709 and _e (stdout/err). These provide a .l/.list attribute which
705 does automatic splitting on newlines. This means that for most
710 does automatic splitting on newlines. This means that for most
706 uses, you'll never need to do capturing of output with %sc/%sx
711 uses, you'll never need to do capturing of output with %sc/%sx
707 anymore, since ipython keeps this always done for you. Note that
712 anymore, since ipython keeps this always done for you. Note that
708 only the LAST results are stored, the _o/e variables are
713 only the LAST results are stored, the _o/e variables are
709 overwritten on each call. If you need to save their contents
714 overwritten on each call. If you need to save their contents
710 further, simply bind them to any other name.
715 further, simply bind them to any other name.
711
716
712 2005-03-17 Fernando Perez <fperez@colorado.edu>
717 2005-03-17 Fernando Perez <fperez@colorado.edu>
713
718
714 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
719 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
715 prompt namespace handling.
720 prompt namespace handling.
716
721
717 2005-03-16 Fernando Perez <fperez@colorado.edu>
722 2005-03-16 Fernando Perez <fperez@colorado.edu>
718
723
719 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
724 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
720 classic prompts to be '>>> ' (final space was missing, and it
725 classic prompts to be '>>> ' (final space was missing, and it
721 trips the emacs python mode).
726 trips the emacs python mode).
722 (BasePrompt.__str__): Added safe support for dynamic prompt
727 (BasePrompt.__str__): Added safe support for dynamic prompt
723 strings. Now you can set your prompt string to be '$x', and the
728 strings. Now you can set your prompt string to be '$x', and the
724 value of x will be printed from your interactive namespace. The
729 value of x will be printed from your interactive namespace. The
725 interpolation syntax includes the full Itpl support, so
730 interpolation syntax includes the full Itpl support, so
726 ${foo()+x+bar()} is a valid prompt string now, and the function
731 ${foo()+x+bar()} is a valid prompt string now, and the function
727 calls will be made at runtime.
732 calls will be made at runtime.
728
733
729 2005-03-15 Fernando Perez <fperez@colorado.edu>
734 2005-03-15 Fernando Perez <fperez@colorado.edu>
730
735
731 * IPython/Magic.py (magic_history): renamed %hist to %history, to
736 * IPython/Magic.py (magic_history): renamed %hist to %history, to
732 avoid name clashes in pylab. %hist still works, it just forwards
737 avoid name clashes in pylab. %hist still works, it just forwards
733 the call to %history.
738 the call to %history.
734
739
735 2005-03-02 *** Released version 0.6.12
740 2005-03-02 *** Released version 0.6.12
736
741
737 2005-03-02 Fernando Perez <fperez@colorado.edu>
742 2005-03-02 Fernando Perez <fperez@colorado.edu>
738
743
739 * IPython/iplib.py (handle_magic): log magic calls properly as
744 * IPython/iplib.py (handle_magic): log magic calls properly as
740 ipmagic() function calls.
745 ipmagic() function calls.
741
746
742 * IPython/Magic.py (magic_time): Improved %time to support
747 * IPython/Magic.py (magic_time): Improved %time to support
743 statements and provide wall-clock as well as CPU time.
748 statements and provide wall-clock as well as CPU time.
744
749
745 2005-02-27 Fernando Perez <fperez@colorado.edu>
750 2005-02-27 Fernando Perez <fperez@colorado.edu>
746
751
747 * IPython/hooks.py: New hooks module, to expose user-modifiable
752 * IPython/hooks.py: New hooks module, to expose user-modifiable
748 IPython functionality in a clean manner. For now only the editor
753 IPython functionality in a clean manner. For now only the editor
749 hook is actually written, and other thigns which I intend to turn
754 hook is actually written, and other thigns which I intend to turn
750 into proper hooks aren't yet there. The display and prefilter
755 into proper hooks aren't yet there. The display and prefilter
751 stuff, for example, should be hooks. But at least now the
756 stuff, for example, should be hooks. But at least now the
752 framework is in place, and the rest can be moved here with more
757 framework is in place, and the rest can be moved here with more
753 time later. IPython had had a .hooks variable for a long time for
758 time later. IPython had had a .hooks variable for a long time for
754 this purpose, but I'd never actually used it for anything.
759 this purpose, but I'd never actually used it for anything.
755
760
756 2005-02-26 Fernando Perez <fperez@colorado.edu>
761 2005-02-26 Fernando Perez <fperez@colorado.edu>
757
762
758 * IPython/ipmaker.py (make_IPython): make the default ipython
763 * IPython/ipmaker.py (make_IPython): make the default ipython
759 directory be called _ipython under win32, to follow more the
764 directory be called _ipython under win32, to follow more the
760 naming peculiarities of that platform (where buggy software like
765 naming peculiarities of that platform (where buggy software like
761 Visual Sourcesafe breaks with .named directories). Reported by
766 Visual Sourcesafe breaks with .named directories). Reported by
762 Ville Vainio.
767 Ville Vainio.
763
768
764 2005-02-23 Fernando Perez <fperez@colorado.edu>
769 2005-02-23 Fernando Perez <fperez@colorado.edu>
765
770
766 * IPython/iplib.py (InteractiveShell.__init__): removed a few
771 * IPython/iplib.py (InteractiveShell.__init__): removed a few
767 auto_aliases for win32 which were causing problems. Users can
772 auto_aliases for win32 which were causing problems. Users can
768 define the ones they personally like.
773 define the ones they personally like.
769
774
770 2005-02-21 Fernando Perez <fperez@colorado.edu>
775 2005-02-21 Fernando Perez <fperez@colorado.edu>
771
776
772 * IPython/Magic.py (magic_time): new magic to time execution of
777 * IPython/Magic.py (magic_time): new magic to time execution of
773 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
778 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
774
779
775 2005-02-19 Fernando Perez <fperez@colorado.edu>
780 2005-02-19 Fernando Perez <fperez@colorado.edu>
776
781
777 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
782 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
778 into keys (for prompts, for example).
783 into keys (for prompts, for example).
779
784
780 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
785 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
781 prompts in case users want them. This introduces a small behavior
786 prompts in case users want them. This introduces a small behavior
782 change: ipython does not automatically add a space to all prompts
787 change: ipython does not automatically add a space to all prompts
783 anymore. To get the old prompts with a space, users should add it
788 anymore. To get the old prompts with a space, users should add it
784 manually to their ipythonrc file, so for example prompt_in1 should
789 manually to their ipythonrc file, so for example prompt_in1 should
785 now read 'In [\#]: ' instead of 'In [\#]:'.
790 now read 'In [\#]: ' instead of 'In [\#]:'.
786 (BasePrompt.__init__): New option prompts_pad_left (only in rc
791 (BasePrompt.__init__): New option prompts_pad_left (only in rc
787 file) to control left-padding of secondary prompts.
792 file) to control left-padding of secondary prompts.
788
793
789 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
794 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
790 the profiler can't be imported. Fix for Debian, which removed
795 the profiler can't be imported. Fix for Debian, which removed
791 profile.py because of License issues. I applied a slightly
796 profile.py because of License issues. I applied a slightly
792 modified version of the original Debian patch at
797 modified version of the original Debian patch at
793 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
798 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
794
799
795 2005-02-17 Fernando Perez <fperez@colorado.edu>
800 2005-02-17 Fernando Perez <fperez@colorado.edu>
796
801
797 * IPython/genutils.py (native_line_ends): Fix bug which would
802 * IPython/genutils.py (native_line_ends): Fix bug which would
798 cause improper line-ends under win32 b/c I was not opening files
803 cause improper line-ends under win32 b/c I was not opening files
799 in binary mode. Bug report and fix thanks to Ville.
804 in binary mode. Bug report and fix thanks to Ville.
800
805
801 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
806 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
802 trying to catch spurious foo[1] autocalls. My fix actually broke
807 trying to catch spurious foo[1] autocalls. My fix actually broke
803 ',/' autoquote/call with explicit escape (bad regexp).
808 ',/' autoquote/call with explicit escape (bad regexp).
804
809
805 2005-02-15 *** Released version 0.6.11
810 2005-02-15 *** Released version 0.6.11
806
811
807 2005-02-14 Fernando Perez <fperez@colorado.edu>
812 2005-02-14 Fernando Perez <fperez@colorado.edu>
808
813
809 * IPython/background_jobs.py: New background job management
814 * IPython/background_jobs.py: New background job management
810 subsystem. This is implemented via a new set of classes, and
815 subsystem. This is implemented via a new set of classes, and
811 IPython now provides a builtin 'jobs' object for background job
816 IPython now provides a builtin 'jobs' object for background job
812 execution. A convenience %bg magic serves as a lightweight
817 execution. A convenience %bg magic serves as a lightweight
813 frontend for starting the more common type of calls. This was
818 frontend for starting the more common type of calls. This was
814 inspired by discussions with B. Granger and the BackgroundCommand
819 inspired by discussions with B. Granger and the BackgroundCommand
815 class described in the book Python Scripting for Computational
820 class described in the book Python Scripting for Computational
816 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
821 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
817 (although ultimately no code from this text was used, as IPython's
822 (although ultimately no code from this text was used, as IPython's
818 system is a separate implementation).
823 system is a separate implementation).
819
824
820 * IPython/iplib.py (MagicCompleter.python_matches): add new option
825 * IPython/iplib.py (MagicCompleter.python_matches): add new option
821 to control the completion of single/double underscore names
826 to control the completion of single/double underscore names
822 separately. As documented in the example ipytonrc file, the
827 separately. As documented in the example ipytonrc file, the
823 readline_omit__names variable can now be set to 2, to omit even
828 readline_omit__names variable can now be set to 2, to omit even
824 single underscore names. Thanks to a patch by Brian Wong
829 single underscore names. Thanks to a patch by Brian Wong
825 <BrianWong-AT-AirgoNetworks.Com>.
830 <BrianWong-AT-AirgoNetworks.Com>.
826 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
831 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
827 be autocalled as foo([1]) if foo were callable. A problem for
832 be autocalled as foo([1]) if foo were callable. A problem for
828 things which are both callable and implement __getitem__.
833 things which are both callable and implement __getitem__.
829 (init_readline): Fix autoindentation for win32. Thanks to a patch
834 (init_readline): Fix autoindentation for win32. Thanks to a patch
830 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
835 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
831
836
832 2005-02-12 Fernando Perez <fperez@colorado.edu>
837 2005-02-12 Fernando Perez <fperez@colorado.edu>
833
838
834 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
839 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
835 which I had written long ago to sort out user error messages which
840 which I had written long ago to sort out user error messages which
836 may occur during startup. This seemed like a good idea initially,
841 may occur during startup. This seemed like a good idea initially,
837 but it has proven a disaster in retrospect. I don't want to
842 but it has proven a disaster in retrospect. I don't want to
838 change much code for now, so my fix is to set the internal 'debug'
843 change much code for now, so my fix is to set the internal 'debug'
839 flag to true everywhere, whose only job was precisely to control
844 flag to true everywhere, whose only job was precisely to control
840 this subsystem. This closes issue 28 (as well as avoiding all
845 this subsystem. This closes issue 28 (as well as avoiding all
841 sorts of strange hangups which occur from time to time).
846 sorts of strange hangups which occur from time to time).
842
847
843 2005-02-07 Fernando Perez <fperez@colorado.edu>
848 2005-02-07 Fernando Perez <fperez@colorado.edu>
844
849
845 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
850 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
846 previous call produced a syntax error.
851 previous call produced a syntax error.
847
852
848 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
853 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
849 classes without constructor.
854 classes without constructor.
850
855
851 2005-02-06 Fernando Perez <fperez@colorado.edu>
856 2005-02-06 Fernando Perez <fperez@colorado.edu>
852
857
853 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
858 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
854 completions with the results of each matcher, so we return results
859 completions with the results of each matcher, so we return results
855 to the user from all namespaces. This breaks with ipython
860 to the user from all namespaces. This breaks with ipython
856 tradition, but I think it's a nicer behavior. Now you get all
861 tradition, but I think it's a nicer behavior. Now you get all
857 possible completions listed, from all possible namespaces (python,
862 possible completions listed, from all possible namespaces (python,
858 filesystem, magics...) After a request by John Hunter
863 filesystem, magics...) After a request by John Hunter
859 <jdhunter-AT-nitace.bsd.uchicago.edu>.
864 <jdhunter-AT-nitace.bsd.uchicago.edu>.
860
865
861 2005-02-05 Fernando Perez <fperez@colorado.edu>
866 2005-02-05 Fernando Perez <fperez@colorado.edu>
862
867
863 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
868 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
864 the call had quote characters in it (the quotes were stripped).
869 the call had quote characters in it (the quotes were stripped).
865
870
866 2005-01-31 Fernando Perez <fperez@colorado.edu>
871 2005-01-31 Fernando Perez <fperez@colorado.edu>
867
872
868 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
873 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
869 Itpl.itpl() to make the code more robust against psyco
874 Itpl.itpl() to make the code more robust against psyco
870 optimizations.
875 optimizations.
871
876
872 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
877 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
873 of causing an exception. Quicker, cleaner.
878 of causing an exception. Quicker, cleaner.
874
879
875 2005-01-28 Fernando Perez <fperez@colorado.edu>
880 2005-01-28 Fernando Perez <fperez@colorado.edu>
876
881
877 * scripts/ipython_win_post_install.py (install): hardcode
882 * scripts/ipython_win_post_install.py (install): hardcode
878 sys.prefix+'python.exe' as the executable path. It turns out that
883 sys.prefix+'python.exe' as the executable path. It turns out that
879 during the post-installation run, sys.executable resolves to the
884 during the post-installation run, sys.executable resolves to the
880 name of the binary installer! I should report this as a distutils
885 name of the binary installer! I should report this as a distutils
881 bug, I think. I updated the .10 release with this tiny fix, to
886 bug, I think. I updated the .10 release with this tiny fix, to
882 avoid annoying the lists further.
887 avoid annoying the lists further.
883
888
884 2005-01-27 *** Released version 0.6.10
889 2005-01-27 *** Released version 0.6.10
885
890
886 2005-01-27 Fernando Perez <fperez@colorado.edu>
891 2005-01-27 Fernando Perez <fperez@colorado.edu>
887
892
888 * IPython/numutils.py (norm): Added 'inf' as optional name for
893 * IPython/numutils.py (norm): Added 'inf' as optional name for
889 L-infinity norm, included references to mathworld.com for vector
894 L-infinity norm, included references to mathworld.com for vector
890 norm definitions.
895 norm definitions.
891 (amin/amax): added amin/amax for array min/max. Similar to what
896 (amin/amax): added amin/amax for array min/max. Similar to what
892 pylab ships with after the recent reorganization of names.
897 pylab ships with after the recent reorganization of names.
893 (spike/spike_odd): removed deprecated spike/spike_odd functions.
898 (spike/spike_odd): removed deprecated spike/spike_odd functions.
894
899
895 * ipython.el: committed Alex's recent fixes and improvements.
900 * ipython.el: committed Alex's recent fixes and improvements.
896 Tested with python-mode from CVS, and it looks excellent. Since
901 Tested with python-mode from CVS, and it looks excellent. Since
897 python-mode hasn't released anything in a while, I'm temporarily
902 python-mode hasn't released anything in a while, I'm temporarily
898 putting a copy of today's CVS (v 4.70) of python-mode in:
903 putting a copy of today's CVS (v 4.70) of python-mode in:
899 http://ipython.scipy.org/tmp/python-mode.el
904 http://ipython.scipy.org/tmp/python-mode.el
900
905
901 * scripts/ipython_win_post_install.py (install): Win32 fix to use
906 * scripts/ipython_win_post_install.py (install): Win32 fix to use
902 sys.executable for the executable name, instead of assuming it's
907 sys.executable for the executable name, instead of assuming it's
903 called 'python.exe' (the post-installer would have produced broken
908 called 'python.exe' (the post-installer would have produced broken
904 setups on systems with a differently named python binary).
909 setups on systems with a differently named python binary).
905
910
906 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
911 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
907 references to os.linesep, to make the code more
912 references to os.linesep, to make the code more
908 platform-independent. This is also part of the win32 coloring
913 platform-independent. This is also part of the win32 coloring
909 fixes.
914 fixes.
910
915
911 * IPython/genutils.py (page_dumb): Remove attempts to chop long
916 * IPython/genutils.py (page_dumb): Remove attempts to chop long
912 lines, which actually cause coloring bugs because the length of
917 lines, which actually cause coloring bugs because the length of
913 the line is very difficult to correctly compute with embedded
918 the line is very difficult to correctly compute with embedded
914 escapes. This was the source of all the coloring problems under
919 escapes. This was the source of all the coloring problems under
915 Win32. I think that _finally_, Win32 users have a properly
920 Win32. I think that _finally_, Win32 users have a properly
916 working ipython in all respects. This would never have happened
921 working ipython in all respects. This would never have happened
917 if not for Gary Bishop and Viktor Ransmayr's great help and work.
922 if not for Gary Bishop and Viktor Ransmayr's great help and work.
918
923
919 2005-01-26 *** Released version 0.6.9
924 2005-01-26 *** Released version 0.6.9
920
925
921 2005-01-25 Fernando Perez <fperez@colorado.edu>
926 2005-01-25 Fernando Perez <fperez@colorado.edu>
922
927
923 * setup.py: finally, we have a true Windows installer, thanks to
928 * setup.py: finally, we have a true Windows installer, thanks to
924 the excellent work of Viktor Ransmayr
929 the excellent work of Viktor Ransmayr
925 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
930 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
926 Windows users. The setup routine is quite a bit cleaner thanks to
931 Windows users. The setup routine is quite a bit cleaner thanks to
927 this, and the post-install script uses the proper functions to
932 this, and the post-install script uses the proper functions to
928 allow a clean de-installation using the standard Windows Control
933 allow a clean de-installation using the standard Windows Control
929 Panel.
934 Panel.
930
935
931 * IPython/genutils.py (get_home_dir): changed to use the $HOME
936 * IPython/genutils.py (get_home_dir): changed to use the $HOME
932 environment variable under all OSes (including win32) if
937 environment variable under all OSes (including win32) if
933 available. This will give consistency to win32 users who have set
938 available. This will give consistency to win32 users who have set
934 this variable for any reason. If os.environ['HOME'] fails, the
939 this variable for any reason. If os.environ['HOME'] fails, the
935 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
940 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
936
941
937 2005-01-24 Fernando Perez <fperez@colorado.edu>
942 2005-01-24 Fernando Perez <fperez@colorado.edu>
938
943
939 * IPython/numutils.py (empty_like): add empty_like(), similar to
944 * IPython/numutils.py (empty_like): add empty_like(), similar to
940 zeros_like() but taking advantage of the new empty() Numeric routine.
945 zeros_like() but taking advantage of the new empty() Numeric routine.
941
946
942 2005-01-23 *** Released version 0.6.8
947 2005-01-23 *** Released version 0.6.8
943
948
944 2005-01-22 Fernando Perez <fperez@colorado.edu>
949 2005-01-22 Fernando Perez <fperez@colorado.edu>
945
950
946 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
951 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
947 automatic show() calls. After discussing things with JDH, it
952 automatic show() calls. After discussing things with JDH, it
948 turns out there are too many corner cases where this can go wrong.
953 turns out there are too many corner cases where this can go wrong.
949 It's best not to try to be 'too smart', and simply have ipython
954 It's best not to try to be 'too smart', and simply have ipython
950 reproduce as much as possible the default behavior of a normal
955 reproduce as much as possible the default behavior of a normal
951 python shell.
956 python shell.
952
957
953 * IPython/iplib.py (InteractiveShell.__init__): Modified the
958 * IPython/iplib.py (InteractiveShell.__init__): Modified the
954 line-splitting regexp and _prefilter() to avoid calling getattr()
959 line-splitting regexp and _prefilter() to avoid calling getattr()
955 on assignments. This closes
960 on assignments. This closes
956 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
961 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
957 readline uses getattr(), so a simple <TAB> keypress is still
962 readline uses getattr(), so a simple <TAB> keypress is still
958 enough to trigger getattr() calls on an object.
963 enough to trigger getattr() calls on an object.
959
964
960 2005-01-21 Fernando Perez <fperez@colorado.edu>
965 2005-01-21 Fernando Perez <fperez@colorado.edu>
961
966
962 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
967 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
963 docstring under pylab so it doesn't mask the original.
968 docstring under pylab so it doesn't mask the original.
964
969
965 2005-01-21 *** Released version 0.6.7
970 2005-01-21 *** Released version 0.6.7
966
971
967 2005-01-21 Fernando Perez <fperez@colorado.edu>
972 2005-01-21 Fernando Perez <fperez@colorado.edu>
968
973
969 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
974 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
970 signal handling for win32 users in multithreaded mode.
975 signal handling for win32 users in multithreaded mode.
971
976
972 2005-01-17 Fernando Perez <fperez@colorado.edu>
977 2005-01-17 Fernando Perez <fperez@colorado.edu>
973
978
974 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
979 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
975 instances with no __init__. After a crash report by Norbert Nemec
980 instances with no __init__. After a crash report by Norbert Nemec
976 <Norbert-AT-nemec-online.de>.
981 <Norbert-AT-nemec-online.de>.
977
982
978 2005-01-14 Fernando Perez <fperez@colorado.edu>
983 2005-01-14 Fernando Perez <fperez@colorado.edu>
979
984
980 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
985 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
981 names for verbose exceptions, when multiple dotted names and the
986 names for verbose exceptions, when multiple dotted names and the
982 'parent' object were present on the same line.
987 'parent' object were present on the same line.
983
988
984 2005-01-11 Fernando Perez <fperez@colorado.edu>
989 2005-01-11 Fernando Perez <fperez@colorado.edu>
985
990
986 * IPython/genutils.py (flag_calls): new utility to trap and flag
991 * IPython/genutils.py (flag_calls): new utility to trap and flag
987 calls in functions. I need it to clean up matplotlib support.
992 calls in functions. I need it to clean up matplotlib support.
988 Also removed some deprecated code in genutils.
993 Also removed some deprecated code in genutils.
989
994
990 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
995 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
991 that matplotlib scripts called with %run, which don't call show()
996 that matplotlib scripts called with %run, which don't call show()
992 themselves, still have their plotting windows open.
997 themselves, still have their plotting windows open.
993
998
994 2005-01-05 Fernando Perez <fperez@colorado.edu>
999 2005-01-05 Fernando Perez <fperez@colorado.edu>
995
1000
996 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1001 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
997 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1002 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
998
1003
999 2004-12-19 Fernando Perez <fperez@colorado.edu>
1004 2004-12-19 Fernando Perez <fperez@colorado.edu>
1000
1005
1001 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1006 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1002 parent_runcode, which was an eyesore. The same result can be
1007 parent_runcode, which was an eyesore. The same result can be
1003 obtained with Python's regular superclass mechanisms.
1008 obtained with Python's regular superclass mechanisms.
1004
1009
1005 2004-12-17 Fernando Perez <fperez@colorado.edu>
1010 2004-12-17 Fernando Perez <fperez@colorado.edu>
1006
1011
1007 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1012 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1008 reported by Prabhu.
1013 reported by Prabhu.
1009 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1014 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1010 sys.stderr) instead of explicitly calling sys.stderr. This helps
1015 sys.stderr) instead of explicitly calling sys.stderr. This helps
1011 maintain our I/O abstractions clean, for future GUI embeddings.
1016 maintain our I/O abstractions clean, for future GUI embeddings.
1012
1017
1013 * IPython/genutils.py (info): added new utility for sys.stderr
1018 * IPython/genutils.py (info): added new utility for sys.stderr
1014 unified info message handling (thin wrapper around warn()).
1019 unified info message handling (thin wrapper around warn()).
1015
1020
1016 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1021 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1017 composite (dotted) names on verbose exceptions.
1022 composite (dotted) names on verbose exceptions.
1018 (VerboseTB.nullrepr): harden against another kind of errors which
1023 (VerboseTB.nullrepr): harden against another kind of errors which
1019 Python's inspect module can trigger, and which were crashing
1024 Python's inspect module can trigger, and which were crashing
1020 IPython. Thanks to a report by Marco Lombardi
1025 IPython. Thanks to a report by Marco Lombardi
1021 <mlombard-AT-ma010192.hq.eso.org>.
1026 <mlombard-AT-ma010192.hq.eso.org>.
1022
1027
1023 2004-12-13 *** Released version 0.6.6
1028 2004-12-13 *** Released version 0.6.6
1024
1029
1025 2004-12-12 Fernando Perez <fperez@colorado.edu>
1030 2004-12-12 Fernando Perez <fperez@colorado.edu>
1026
1031
1027 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1032 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1028 generated by pygtk upon initialization if it was built without
1033 generated by pygtk upon initialization if it was built without
1029 threads (for matplotlib users). After a crash reported by
1034 threads (for matplotlib users). After a crash reported by
1030 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1035 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1031
1036
1032 * IPython/ipmaker.py (make_IPython): fix small bug in the
1037 * IPython/ipmaker.py (make_IPython): fix small bug in the
1033 import_some parameter for multiple imports.
1038 import_some parameter for multiple imports.
1034
1039
1035 * IPython/iplib.py (ipmagic): simplified the interface of
1040 * IPython/iplib.py (ipmagic): simplified the interface of
1036 ipmagic() to take a single string argument, just as it would be
1041 ipmagic() to take a single string argument, just as it would be
1037 typed at the IPython cmd line.
1042 typed at the IPython cmd line.
1038 (ipalias): Added new ipalias() with an interface identical to
1043 (ipalias): Added new ipalias() with an interface identical to
1039 ipmagic(). This completes exposing a pure python interface to the
1044 ipmagic(). This completes exposing a pure python interface to the
1040 alias and magic system, which can be used in loops or more complex
1045 alias and magic system, which can be used in loops or more complex
1041 code where IPython's automatic line mangling is not active.
1046 code where IPython's automatic line mangling is not active.
1042
1047
1043 * IPython/genutils.py (timing): changed interface of timing to
1048 * IPython/genutils.py (timing): changed interface of timing to
1044 simply run code once, which is the most common case. timings()
1049 simply run code once, which is the most common case. timings()
1045 remains unchanged, for the cases where you want multiple runs.
1050 remains unchanged, for the cases where you want multiple runs.
1046
1051
1047 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1052 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1048 bug where Python2.2 crashes with exec'ing code which does not end
1053 bug where Python2.2 crashes with exec'ing code which does not end
1049 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1054 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1050 before.
1055 before.
1051
1056
1052 2004-12-10 Fernando Perez <fperez@colorado.edu>
1057 2004-12-10 Fernando Perez <fperez@colorado.edu>
1053
1058
1054 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1059 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1055 -t to -T, to accomodate the new -t flag in %run (the %run and
1060 -t to -T, to accomodate the new -t flag in %run (the %run and
1056 %prun options are kind of intermixed, and it's not easy to change
1061 %prun options are kind of intermixed, and it's not easy to change
1057 this with the limitations of python's getopt).
1062 this with the limitations of python's getopt).
1058
1063
1059 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1064 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1060 the execution of scripts. It's not as fine-tuned as timeit.py,
1065 the execution of scripts. It's not as fine-tuned as timeit.py,
1061 but it works from inside ipython (and under 2.2, which lacks
1066 but it works from inside ipython (and under 2.2, which lacks
1062 timeit.py). Optionally a number of runs > 1 can be given for
1067 timeit.py). Optionally a number of runs > 1 can be given for
1063 timing very short-running code.
1068 timing very short-running code.
1064
1069
1065 * IPython/genutils.py (uniq_stable): new routine which returns a
1070 * IPython/genutils.py (uniq_stable): new routine which returns a
1066 list of unique elements in any iterable, but in stable order of
1071 list of unique elements in any iterable, but in stable order of
1067 appearance. I needed this for the ultraTB fixes, and it's a handy
1072 appearance. I needed this for the ultraTB fixes, and it's a handy
1068 utility.
1073 utility.
1069
1074
1070 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1075 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1071 dotted names in Verbose exceptions. This had been broken since
1076 dotted names in Verbose exceptions. This had been broken since
1072 the very start, now x.y will properly be printed in a Verbose
1077 the very start, now x.y will properly be printed in a Verbose
1073 traceback, instead of x being shown and y appearing always as an
1078 traceback, instead of x being shown and y appearing always as an
1074 'undefined global'. Getting this to work was a bit tricky,
1079 'undefined global'. Getting this to work was a bit tricky,
1075 because by default python tokenizers are stateless. Saved by
1080 because by default python tokenizers are stateless. Saved by
1076 python's ability to easily add a bit of state to an arbitrary
1081 python's ability to easily add a bit of state to an arbitrary
1077 function (without needing to build a full-blown callable object).
1082 function (without needing to build a full-blown callable object).
1078
1083
1079 Also big cleanup of this code, which had horrendous runtime
1084 Also big cleanup of this code, which had horrendous runtime
1080 lookups of zillions of attributes for colorization. Moved all
1085 lookups of zillions of attributes for colorization. Moved all
1081 this code into a few templates, which make it cleaner and quicker.
1086 this code into a few templates, which make it cleaner and quicker.
1082
1087
1083 Printout quality was also improved for Verbose exceptions: one
1088 Printout quality was also improved for Verbose exceptions: one
1084 variable per line, and memory addresses are printed (this can be
1089 variable per line, and memory addresses are printed (this can be
1085 quite handy in nasty debugging situations, which is what Verbose
1090 quite handy in nasty debugging situations, which is what Verbose
1086 is for).
1091 is for).
1087
1092
1088 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1093 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1089 the command line as scripts to be loaded by embedded instances.
1094 the command line as scripts to be loaded by embedded instances.
1090 Doing so has the potential for an infinite recursion if there are
1095 Doing so has the potential for an infinite recursion if there are
1091 exceptions thrown in the process. This fixes a strange crash
1096 exceptions thrown in the process. This fixes a strange crash
1092 reported by Philippe MULLER <muller-AT-irit.fr>.
1097 reported by Philippe MULLER <muller-AT-irit.fr>.
1093
1098
1094 2004-12-09 Fernando Perez <fperez@colorado.edu>
1099 2004-12-09 Fernando Perez <fperez@colorado.edu>
1095
1100
1096 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1101 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1097 to reflect new names in matplotlib, which now expose the
1102 to reflect new names in matplotlib, which now expose the
1098 matlab-compatible interface via a pylab module instead of the
1103 matlab-compatible interface via a pylab module instead of the
1099 'matlab' name. The new code is backwards compatible, so users of
1104 'matlab' name. The new code is backwards compatible, so users of
1100 all matplotlib versions are OK. Patch by J. Hunter.
1105 all matplotlib versions are OK. Patch by J. Hunter.
1101
1106
1102 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1107 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1103 of __init__ docstrings for instances (class docstrings are already
1108 of __init__ docstrings for instances (class docstrings are already
1104 automatically printed). Instances with customized docstrings
1109 automatically printed). Instances with customized docstrings
1105 (indep. of the class) are also recognized and all 3 separate
1110 (indep. of the class) are also recognized and all 3 separate
1106 docstrings are printed (instance, class, constructor). After some
1111 docstrings are printed (instance, class, constructor). After some
1107 comments/suggestions by J. Hunter.
1112 comments/suggestions by J. Hunter.
1108
1113
1109 2004-12-05 Fernando Perez <fperez@colorado.edu>
1114 2004-12-05 Fernando Perez <fperez@colorado.edu>
1110
1115
1111 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1116 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1112 warnings when tab-completion fails and triggers an exception.
1117 warnings when tab-completion fails and triggers an exception.
1113
1118
1114 2004-12-03 Fernando Perez <fperez@colorado.edu>
1119 2004-12-03 Fernando Perez <fperez@colorado.edu>
1115
1120
1116 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1121 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1117 be triggered when using 'run -p'. An incorrect option flag was
1122 be triggered when using 'run -p'. An incorrect option flag was
1118 being set ('d' instead of 'D').
1123 being set ('d' instead of 'D').
1119 (manpage): fix missing escaped \- sign.
1124 (manpage): fix missing escaped \- sign.
1120
1125
1121 2004-11-30 *** Released version 0.6.5
1126 2004-11-30 *** Released version 0.6.5
1122
1127
1123 2004-11-30 Fernando Perez <fperez@colorado.edu>
1128 2004-11-30 Fernando Perez <fperez@colorado.edu>
1124
1129
1125 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1130 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1126 setting with -d option.
1131 setting with -d option.
1127
1132
1128 * setup.py (docfiles): Fix problem where the doc glob I was using
1133 * setup.py (docfiles): Fix problem where the doc glob I was using
1129 was COMPLETELY BROKEN. It was giving the right files by pure
1134 was COMPLETELY BROKEN. It was giving the right files by pure
1130 accident, but failed once I tried to include ipython.el. Note:
1135 accident, but failed once I tried to include ipython.el. Note:
1131 glob() does NOT allow you to do exclusion on multiple endings!
1136 glob() does NOT allow you to do exclusion on multiple endings!
1132
1137
1133 2004-11-29 Fernando Perez <fperez@colorado.edu>
1138 2004-11-29 Fernando Perez <fperez@colorado.edu>
1134
1139
1135 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1140 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1136 the manpage as the source. Better formatting & consistency.
1141 the manpage as the source. Better formatting & consistency.
1137
1142
1138 * IPython/Magic.py (magic_run): Added new -d option, to run
1143 * IPython/Magic.py (magic_run): Added new -d option, to run
1139 scripts under the control of the python pdb debugger. Note that
1144 scripts under the control of the python pdb debugger. Note that
1140 this required changing the %prun option -d to -D, to avoid a clash
1145 this required changing the %prun option -d to -D, to avoid a clash
1141 (since %run must pass options to %prun, and getopt is too dumb to
1146 (since %run must pass options to %prun, and getopt is too dumb to
1142 handle options with string values with embedded spaces). Thanks
1147 handle options with string values with embedded spaces). Thanks
1143 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1148 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1144 (magic_who_ls): added type matching to %who and %whos, so that one
1149 (magic_who_ls): added type matching to %who and %whos, so that one
1145 can filter their output to only include variables of certain
1150 can filter their output to only include variables of certain
1146 types. Another suggestion by Matthew.
1151 types. Another suggestion by Matthew.
1147 (magic_whos): Added memory summaries in kb and Mb for arrays.
1152 (magic_whos): Added memory summaries in kb and Mb for arrays.
1148 (magic_who): Improve formatting (break lines every 9 vars).
1153 (magic_who): Improve formatting (break lines every 9 vars).
1149
1154
1150 2004-11-28 Fernando Perez <fperez@colorado.edu>
1155 2004-11-28 Fernando Perez <fperez@colorado.edu>
1151
1156
1152 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1157 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1153 cache when empty lines were present.
1158 cache when empty lines were present.
1154
1159
1155 2004-11-24 Fernando Perez <fperez@colorado.edu>
1160 2004-11-24 Fernando Perez <fperez@colorado.edu>
1156
1161
1157 * IPython/usage.py (__doc__): document the re-activated threading
1162 * IPython/usage.py (__doc__): document the re-activated threading
1158 options for WX and GTK.
1163 options for WX and GTK.
1159
1164
1160 2004-11-23 Fernando Perez <fperez@colorado.edu>
1165 2004-11-23 Fernando Perez <fperez@colorado.edu>
1161
1166
1162 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1167 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1163 the -wthread and -gthread options, along with a new -tk one to try
1168 the -wthread and -gthread options, along with a new -tk one to try
1164 and coordinate Tk threading with wx/gtk. The tk support is very
1169 and coordinate Tk threading with wx/gtk. The tk support is very
1165 platform dependent, since it seems to require Tcl and Tk to be
1170 platform dependent, since it seems to require Tcl and Tk to be
1166 built with threads (Fedora1/2 appears NOT to have it, but in
1171 built with threads (Fedora1/2 appears NOT to have it, but in
1167 Prabhu's Debian boxes it works OK). But even with some Tk
1172 Prabhu's Debian boxes it works OK). But even with some Tk
1168 limitations, this is a great improvement.
1173 limitations, this is a great improvement.
1169
1174
1170 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1175 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1171 info in user prompts. Patch by Prabhu.
1176 info in user prompts. Patch by Prabhu.
1172
1177
1173 2004-11-18 Fernando Perez <fperez@colorado.edu>
1178 2004-11-18 Fernando Perez <fperez@colorado.edu>
1174
1179
1175 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1180 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1176 EOFErrors and bail, to avoid infinite loops if a non-terminating
1181 EOFErrors and bail, to avoid infinite loops if a non-terminating
1177 file is fed into ipython. Patch submitted in issue 19 by user,
1182 file is fed into ipython. Patch submitted in issue 19 by user,
1178 many thanks.
1183 many thanks.
1179
1184
1180 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1185 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1181 autoquote/parens in continuation prompts, which can cause lots of
1186 autoquote/parens in continuation prompts, which can cause lots of
1182 problems. Closes roundup issue 20.
1187 problems. Closes roundup issue 20.
1183
1188
1184 2004-11-17 Fernando Perez <fperez@colorado.edu>
1189 2004-11-17 Fernando Perez <fperez@colorado.edu>
1185
1190
1186 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1191 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1187 reported as debian bug #280505. I'm not sure my local changelog
1192 reported as debian bug #280505. I'm not sure my local changelog
1188 entry has the proper debian format (Jack?).
1193 entry has the proper debian format (Jack?).
1189
1194
1190 2004-11-08 *** Released version 0.6.4
1195 2004-11-08 *** Released version 0.6.4
1191
1196
1192 2004-11-08 Fernando Perez <fperez@colorado.edu>
1197 2004-11-08 Fernando Perez <fperez@colorado.edu>
1193
1198
1194 * IPython/iplib.py (init_readline): Fix exit message for Windows
1199 * IPython/iplib.py (init_readline): Fix exit message for Windows
1195 when readline is active. Thanks to a report by Eric Jones
1200 when readline is active. Thanks to a report by Eric Jones
1196 <eric-AT-enthought.com>.
1201 <eric-AT-enthought.com>.
1197
1202
1198 2004-11-07 Fernando Perez <fperez@colorado.edu>
1203 2004-11-07 Fernando Perez <fperez@colorado.edu>
1199
1204
1200 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1205 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1201 sometimes seen by win2k/cygwin users.
1206 sometimes seen by win2k/cygwin users.
1202
1207
1203 2004-11-06 Fernando Perez <fperez@colorado.edu>
1208 2004-11-06 Fernando Perez <fperez@colorado.edu>
1204
1209
1205 * IPython/iplib.py (interact): Change the handling of %Exit from
1210 * IPython/iplib.py (interact): Change the handling of %Exit from
1206 trying to propagate a SystemExit to an internal ipython flag.
1211 trying to propagate a SystemExit to an internal ipython flag.
1207 This is less elegant than using Python's exception mechanism, but
1212 This is less elegant than using Python's exception mechanism, but
1208 I can't get that to work reliably with threads, so under -pylab
1213 I can't get that to work reliably with threads, so under -pylab
1209 %Exit was hanging IPython. Cross-thread exception handling is
1214 %Exit was hanging IPython. Cross-thread exception handling is
1210 really a bitch. Thaks to a bug report by Stephen Walton
1215 really a bitch. Thaks to a bug report by Stephen Walton
1211 <stephen.walton-AT-csun.edu>.
1216 <stephen.walton-AT-csun.edu>.
1212
1217
1213 2004-11-04 Fernando Perez <fperez@colorado.edu>
1218 2004-11-04 Fernando Perez <fperez@colorado.edu>
1214
1219
1215 * IPython/iplib.py (raw_input_original): store a pointer to the
1220 * IPython/iplib.py (raw_input_original): store a pointer to the
1216 true raw_input to harden against code which can modify it
1221 true raw_input to harden against code which can modify it
1217 (wx.py.PyShell does this and would otherwise crash ipython).
1222 (wx.py.PyShell does this and would otherwise crash ipython).
1218 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1223 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1219
1224
1220 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1225 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1221 Ctrl-C problem, which does not mess up the input line.
1226 Ctrl-C problem, which does not mess up the input line.
1222
1227
1223 2004-11-03 Fernando Perez <fperez@colorado.edu>
1228 2004-11-03 Fernando Perez <fperez@colorado.edu>
1224
1229
1225 * IPython/Release.py: Changed licensing to BSD, in all files.
1230 * IPython/Release.py: Changed licensing to BSD, in all files.
1226 (name): lowercase name for tarball/RPM release.
1231 (name): lowercase name for tarball/RPM release.
1227
1232
1228 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1233 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1229 use throughout ipython.
1234 use throughout ipython.
1230
1235
1231 * IPython/Magic.py (Magic._ofind): Switch to using the new
1236 * IPython/Magic.py (Magic._ofind): Switch to using the new
1232 OInspect.getdoc() function.
1237 OInspect.getdoc() function.
1233
1238
1234 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1239 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1235 of the line currently being canceled via Ctrl-C. It's extremely
1240 of the line currently being canceled via Ctrl-C. It's extremely
1236 ugly, but I don't know how to do it better (the problem is one of
1241 ugly, but I don't know how to do it better (the problem is one of
1237 handling cross-thread exceptions).
1242 handling cross-thread exceptions).
1238
1243
1239 2004-10-28 Fernando Perez <fperez@colorado.edu>
1244 2004-10-28 Fernando Perez <fperez@colorado.edu>
1240
1245
1241 * IPython/Shell.py (signal_handler): add signal handlers to trap
1246 * IPython/Shell.py (signal_handler): add signal handlers to trap
1242 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1247 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1243 report by Francesc Alted.
1248 report by Francesc Alted.
1244
1249
1245 2004-10-21 Fernando Perez <fperez@colorado.edu>
1250 2004-10-21 Fernando Perez <fperez@colorado.edu>
1246
1251
1247 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1252 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1248 to % for pysh syntax extensions.
1253 to % for pysh syntax extensions.
1249
1254
1250 2004-10-09 Fernando Perez <fperez@colorado.edu>
1255 2004-10-09 Fernando Perez <fperez@colorado.edu>
1251
1256
1252 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1257 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1253 arrays to print a more useful summary, without calling str(arr).
1258 arrays to print a more useful summary, without calling str(arr).
1254 This avoids the problem of extremely lengthy computations which
1259 This avoids the problem of extremely lengthy computations which
1255 occur if arr is large, and appear to the user as a system lockup
1260 occur if arr is large, and appear to the user as a system lockup
1256 with 100% cpu activity. After a suggestion by Kristian Sandberg
1261 with 100% cpu activity. After a suggestion by Kristian Sandberg
1257 <Kristian.Sandberg@colorado.edu>.
1262 <Kristian.Sandberg@colorado.edu>.
1258 (Magic.__init__): fix bug in global magic escapes not being
1263 (Magic.__init__): fix bug in global magic escapes not being
1259 correctly set.
1264 correctly set.
1260
1265
1261 2004-10-08 Fernando Perez <fperez@colorado.edu>
1266 2004-10-08 Fernando Perez <fperez@colorado.edu>
1262
1267
1263 * IPython/Magic.py (__license__): change to absolute imports of
1268 * IPython/Magic.py (__license__): change to absolute imports of
1264 ipython's own internal packages, to start adapting to the absolute
1269 ipython's own internal packages, to start adapting to the absolute
1265 import requirement of PEP-328.
1270 import requirement of PEP-328.
1266
1271
1267 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1272 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1268 files, and standardize author/license marks through the Release
1273 files, and standardize author/license marks through the Release
1269 module instead of having per/file stuff (except for files with
1274 module instead of having per/file stuff (except for files with
1270 particular licenses, like the MIT/PSF-licensed codes).
1275 particular licenses, like the MIT/PSF-licensed codes).
1271
1276
1272 * IPython/Debugger.py: remove dead code for python 2.1
1277 * IPython/Debugger.py: remove dead code for python 2.1
1273
1278
1274 2004-10-04 Fernando Perez <fperez@colorado.edu>
1279 2004-10-04 Fernando Perez <fperez@colorado.edu>
1275
1280
1276 * IPython/iplib.py (ipmagic): New function for accessing magics
1281 * IPython/iplib.py (ipmagic): New function for accessing magics
1277 via a normal python function call.
1282 via a normal python function call.
1278
1283
1279 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1284 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1280 from '@' to '%', to accomodate the new @decorator syntax of python
1285 from '@' to '%', to accomodate the new @decorator syntax of python
1281 2.4.
1286 2.4.
1282
1287
1283 2004-09-29 Fernando Perez <fperez@colorado.edu>
1288 2004-09-29 Fernando Perez <fperez@colorado.edu>
1284
1289
1285 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1290 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1286 matplotlib.use to prevent running scripts which try to switch
1291 matplotlib.use to prevent running scripts which try to switch
1287 interactive backends from within ipython. This will just crash
1292 interactive backends from within ipython. This will just crash
1288 the python interpreter, so we can't allow it (but a detailed error
1293 the python interpreter, so we can't allow it (but a detailed error
1289 is given to the user).
1294 is given to the user).
1290
1295
1291 2004-09-28 Fernando Perez <fperez@colorado.edu>
1296 2004-09-28 Fernando Perez <fperez@colorado.edu>
1292
1297
1293 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1298 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1294 matplotlib-related fixes so that using @run with non-matplotlib
1299 matplotlib-related fixes so that using @run with non-matplotlib
1295 scripts doesn't pop up spurious plot windows. This requires
1300 scripts doesn't pop up spurious plot windows. This requires
1296 matplotlib >= 0.63, where I had to make some changes as well.
1301 matplotlib >= 0.63, where I had to make some changes as well.
1297
1302
1298 * IPython/ipmaker.py (make_IPython): update version requirement to
1303 * IPython/ipmaker.py (make_IPython): update version requirement to
1299 python 2.2.
1304 python 2.2.
1300
1305
1301 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1306 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1302 banner arg for embedded customization.
1307 banner arg for embedded customization.
1303
1308
1304 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1309 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1305 explicit uses of __IP as the IPython's instance name. Now things
1310 explicit uses of __IP as the IPython's instance name. Now things
1306 are properly handled via the shell.name value. The actual code
1311 are properly handled via the shell.name value. The actual code
1307 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1312 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1308 is much better than before. I'll clean things completely when the
1313 is much better than before. I'll clean things completely when the
1309 magic stuff gets a real overhaul.
1314 magic stuff gets a real overhaul.
1310
1315
1311 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1316 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1312 minor changes to debian dir.
1317 minor changes to debian dir.
1313
1318
1314 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1319 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1315 pointer to the shell itself in the interactive namespace even when
1320 pointer to the shell itself in the interactive namespace even when
1316 a user-supplied dict is provided. This is needed for embedding
1321 a user-supplied dict is provided. This is needed for embedding
1317 purposes (found by tests with Michel Sanner).
1322 purposes (found by tests with Michel Sanner).
1318
1323
1319 2004-09-27 Fernando Perez <fperez@colorado.edu>
1324 2004-09-27 Fernando Perez <fperez@colorado.edu>
1320
1325
1321 * IPython/UserConfig/ipythonrc: remove []{} from
1326 * IPython/UserConfig/ipythonrc: remove []{} from
1322 readline_remove_delims, so that things like [modname.<TAB> do
1327 readline_remove_delims, so that things like [modname.<TAB> do
1323 proper completion. This disables [].TAB, but that's a less common
1328 proper completion. This disables [].TAB, but that's a less common
1324 case than module names in list comprehensions, for example.
1329 case than module names in list comprehensions, for example.
1325 Thanks to a report by Andrea Riciputi.
1330 Thanks to a report by Andrea Riciputi.
1326
1331
1327 2004-09-09 Fernando Perez <fperez@colorado.edu>
1332 2004-09-09 Fernando Perez <fperez@colorado.edu>
1328
1333
1329 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1334 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1330 blocking problems in win32 and osx. Fix by John.
1335 blocking problems in win32 and osx. Fix by John.
1331
1336
1332 2004-09-08 Fernando Perez <fperez@colorado.edu>
1337 2004-09-08 Fernando Perez <fperez@colorado.edu>
1333
1338
1334 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1339 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1335 for Win32 and OSX. Fix by John Hunter.
1340 for Win32 and OSX. Fix by John Hunter.
1336
1341
1337 2004-08-30 *** Released version 0.6.3
1342 2004-08-30 *** Released version 0.6.3
1338
1343
1339 2004-08-30 Fernando Perez <fperez@colorado.edu>
1344 2004-08-30 Fernando Perez <fperez@colorado.edu>
1340
1345
1341 * setup.py (isfile): Add manpages to list of dependent files to be
1346 * setup.py (isfile): Add manpages to list of dependent files to be
1342 updated.
1347 updated.
1343
1348
1344 2004-08-27 Fernando Perez <fperez@colorado.edu>
1349 2004-08-27 Fernando Perez <fperez@colorado.edu>
1345
1350
1346 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1351 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1347 for now. They don't really work with standalone WX/GTK code
1352 for now. They don't really work with standalone WX/GTK code
1348 (though matplotlib IS working fine with both of those backends).
1353 (though matplotlib IS working fine with both of those backends).
1349 This will neeed much more testing. I disabled most things with
1354 This will neeed much more testing. I disabled most things with
1350 comments, so turning it back on later should be pretty easy.
1355 comments, so turning it back on later should be pretty easy.
1351
1356
1352 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1357 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1353 autocalling of expressions like r'foo', by modifying the line
1358 autocalling of expressions like r'foo', by modifying the line
1354 split regexp. Closes
1359 split regexp. Closes
1355 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1360 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1356 Riley <ipythonbugs-AT-sabi.net>.
1361 Riley <ipythonbugs-AT-sabi.net>.
1357 (InteractiveShell.mainloop): honor --nobanner with banner
1362 (InteractiveShell.mainloop): honor --nobanner with banner
1358 extensions.
1363 extensions.
1359
1364
1360 * IPython/Shell.py: Significant refactoring of all classes, so
1365 * IPython/Shell.py: Significant refactoring of all classes, so
1361 that we can really support ALL matplotlib backends and threading
1366 that we can really support ALL matplotlib backends and threading
1362 models (John spotted a bug with Tk which required this). Now we
1367 models (John spotted a bug with Tk which required this). Now we
1363 should support single-threaded, WX-threads and GTK-threads, both
1368 should support single-threaded, WX-threads and GTK-threads, both
1364 for generic code and for matplotlib.
1369 for generic code and for matplotlib.
1365
1370
1366 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1371 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1367 -pylab, to simplify things for users. Will also remove the pylab
1372 -pylab, to simplify things for users. Will also remove the pylab
1368 profile, since now all of matplotlib configuration is directly
1373 profile, since now all of matplotlib configuration is directly
1369 handled here. This also reduces startup time.
1374 handled here. This also reduces startup time.
1370
1375
1371 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1376 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1372 shell wasn't being correctly called. Also in IPShellWX.
1377 shell wasn't being correctly called. Also in IPShellWX.
1373
1378
1374 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1379 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1375 fine-tune banner.
1380 fine-tune banner.
1376
1381
1377 * IPython/numutils.py (spike): Deprecate these spike functions,
1382 * IPython/numutils.py (spike): Deprecate these spike functions,
1378 delete (long deprecated) gnuplot_exec handler.
1383 delete (long deprecated) gnuplot_exec handler.
1379
1384
1380 2004-08-26 Fernando Perez <fperez@colorado.edu>
1385 2004-08-26 Fernando Perez <fperez@colorado.edu>
1381
1386
1382 * ipython.1: Update for threading options, plus some others which
1387 * ipython.1: Update for threading options, plus some others which
1383 were missing.
1388 were missing.
1384
1389
1385 * IPython/ipmaker.py (__call__): Added -wthread option for
1390 * IPython/ipmaker.py (__call__): Added -wthread option for
1386 wxpython thread handling. Make sure threading options are only
1391 wxpython thread handling. Make sure threading options are only
1387 valid at the command line.
1392 valid at the command line.
1388
1393
1389 * scripts/ipython: moved shell selection into a factory function
1394 * scripts/ipython: moved shell selection into a factory function
1390 in Shell.py, to keep the starter script to a minimum.
1395 in Shell.py, to keep the starter script to a minimum.
1391
1396
1392 2004-08-25 Fernando Perez <fperez@colorado.edu>
1397 2004-08-25 Fernando Perez <fperez@colorado.edu>
1393
1398
1394 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1399 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1395 John. Along with some recent changes he made to matplotlib, the
1400 John. Along with some recent changes he made to matplotlib, the
1396 next versions of both systems should work very well together.
1401 next versions of both systems should work very well together.
1397
1402
1398 2004-08-24 Fernando Perez <fperez@colorado.edu>
1403 2004-08-24 Fernando Perez <fperez@colorado.edu>
1399
1404
1400 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1405 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1401 tried to switch the profiling to using hotshot, but I'm getting
1406 tried to switch the profiling to using hotshot, but I'm getting
1402 strange errors from prof.runctx() there. I may be misreading the
1407 strange errors from prof.runctx() there. I may be misreading the
1403 docs, but it looks weird. For now the profiling code will
1408 docs, but it looks weird. For now the profiling code will
1404 continue to use the standard profiler.
1409 continue to use the standard profiler.
1405
1410
1406 2004-08-23 Fernando Perez <fperez@colorado.edu>
1411 2004-08-23 Fernando Perez <fperez@colorado.edu>
1407
1412
1408 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1413 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1409 threaded shell, by John Hunter. It's not quite ready yet, but
1414 threaded shell, by John Hunter. It's not quite ready yet, but
1410 close.
1415 close.
1411
1416
1412 2004-08-22 Fernando Perez <fperez@colorado.edu>
1417 2004-08-22 Fernando Perez <fperez@colorado.edu>
1413
1418
1414 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1419 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1415 in Magic and ultraTB.
1420 in Magic and ultraTB.
1416
1421
1417 * ipython.1: document threading options in manpage.
1422 * ipython.1: document threading options in manpage.
1418
1423
1419 * scripts/ipython: Changed name of -thread option to -gthread,
1424 * scripts/ipython: Changed name of -thread option to -gthread,
1420 since this is GTK specific. I want to leave the door open for a
1425 since this is GTK specific. I want to leave the door open for a
1421 -wthread option for WX, which will most likely be necessary. This
1426 -wthread option for WX, which will most likely be necessary. This
1422 change affects usage and ipmaker as well.
1427 change affects usage and ipmaker as well.
1423
1428
1424 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1429 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1425 handle the matplotlib shell issues. Code by John Hunter
1430 handle the matplotlib shell issues. Code by John Hunter
1426 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1431 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1427 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1432 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1428 broken (and disabled for end users) for now, but it puts the
1433 broken (and disabled for end users) for now, but it puts the
1429 infrastructure in place.
1434 infrastructure in place.
1430
1435
1431 2004-08-21 Fernando Perez <fperez@colorado.edu>
1436 2004-08-21 Fernando Perez <fperez@colorado.edu>
1432
1437
1433 * ipythonrc-pylab: Add matplotlib support.
1438 * ipythonrc-pylab: Add matplotlib support.
1434
1439
1435 * matplotlib_config.py: new files for matplotlib support, part of
1440 * matplotlib_config.py: new files for matplotlib support, part of
1436 the pylab profile.
1441 the pylab profile.
1437
1442
1438 * IPython/usage.py (__doc__): documented the threading options.
1443 * IPython/usage.py (__doc__): documented the threading options.
1439
1444
1440 2004-08-20 Fernando Perez <fperez@colorado.edu>
1445 2004-08-20 Fernando Perez <fperez@colorado.edu>
1441
1446
1442 * ipython: Modified the main calling routine to handle the -thread
1447 * ipython: Modified the main calling routine to handle the -thread
1443 and -mpthread options. This needs to be done as a top-level hack,
1448 and -mpthread options. This needs to be done as a top-level hack,
1444 because it determines which class to instantiate for IPython
1449 because it determines which class to instantiate for IPython
1445 itself.
1450 itself.
1446
1451
1447 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1452 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1448 classes to support multithreaded GTK operation without blocking,
1453 classes to support multithreaded GTK operation without blocking,
1449 and matplotlib with all backends. This is a lot of still very
1454 and matplotlib with all backends. This is a lot of still very
1450 experimental code, and threads are tricky. So it may still have a
1455 experimental code, and threads are tricky. So it may still have a
1451 few rough edges... This code owes a lot to
1456 few rough edges... This code owes a lot to
1452 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1457 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1453 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1458 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1454 to John Hunter for all the matplotlib work.
1459 to John Hunter for all the matplotlib work.
1455
1460
1456 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
1461 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
1457 options for gtk thread and matplotlib support.
1462 options for gtk thread and matplotlib support.
1458
1463
1459 2004-08-16 Fernando Perez <fperez@colorado.edu>
1464 2004-08-16 Fernando Perez <fperez@colorado.edu>
1460
1465
1461 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
1466 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
1462 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
1467 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
1463 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
1468 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
1464
1469
1465 2004-08-11 Fernando Perez <fperez@colorado.edu>
1470 2004-08-11 Fernando Perez <fperez@colorado.edu>
1466
1471
1467 * setup.py (isfile): Fix build so documentation gets updated for
1472 * setup.py (isfile): Fix build so documentation gets updated for
1468 rpms (it was only done for .tgz builds).
1473 rpms (it was only done for .tgz builds).
1469
1474
1470 2004-08-10 Fernando Perez <fperez@colorado.edu>
1475 2004-08-10 Fernando Perez <fperez@colorado.edu>
1471
1476
1472 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
1477 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
1473
1478
1474 * iplib.py : Silence syntax error exceptions in tab-completion.
1479 * iplib.py : Silence syntax error exceptions in tab-completion.
1475
1480
1476 2004-08-05 Fernando Perez <fperez@colorado.edu>
1481 2004-08-05 Fernando Perez <fperez@colorado.edu>
1477
1482
1478 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
1483 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
1479 'color off' mark for continuation prompts. This was causing long
1484 'color off' mark for continuation prompts. This was causing long
1480 continuation lines to mis-wrap.
1485 continuation lines to mis-wrap.
1481
1486
1482 2004-08-01 Fernando Perez <fperez@colorado.edu>
1487 2004-08-01 Fernando Perez <fperez@colorado.edu>
1483
1488
1484 * IPython/ipmaker.py (make_IPython): Allow the shell class used
1489 * IPython/ipmaker.py (make_IPython): Allow the shell class used
1485 for building ipython to be a parameter. All this is necessary
1490 for building ipython to be a parameter. All this is necessary
1486 right now to have a multithreaded version, but this insane
1491 right now to have a multithreaded version, but this insane
1487 non-design will be cleaned up soon. For now, it's a hack that
1492 non-design will be cleaned up soon. For now, it's a hack that
1488 works.
1493 works.
1489
1494
1490 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
1495 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
1491 args in various places. No bugs so far, but it's a dangerous
1496 args in various places. No bugs so far, but it's a dangerous
1492 practice.
1497 practice.
1493
1498
1494 2004-07-31 Fernando Perez <fperez@colorado.edu>
1499 2004-07-31 Fernando Perez <fperez@colorado.edu>
1495
1500
1496 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
1501 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
1497 fix completion of files with dots in their names under most
1502 fix completion of files with dots in their names under most
1498 profiles (pysh was OK because the completion order is different).
1503 profiles (pysh was OK because the completion order is different).
1499
1504
1500 2004-07-27 Fernando Perez <fperez@colorado.edu>
1505 2004-07-27 Fernando Perez <fperez@colorado.edu>
1501
1506
1502 * IPython/iplib.py (InteractiveShell.__init__): build dict of
1507 * IPython/iplib.py (InteractiveShell.__init__): build dict of
1503 keywords manually, b/c the one in keyword.py was removed in python
1508 keywords manually, b/c the one in keyword.py was removed in python
1504 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
1509 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
1505 This is NOT a bug under python 2.3 and earlier.
1510 This is NOT a bug under python 2.3 and earlier.
1506
1511
1507 2004-07-26 Fernando Perez <fperez@colorado.edu>
1512 2004-07-26 Fernando Perez <fperez@colorado.edu>
1508
1513
1509 * IPython/ultraTB.py (VerboseTB.text): Add another
1514 * IPython/ultraTB.py (VerboseTB.text): Add another
1510 linecache.checkcache() call to try to prevent inspect.py from
1515 linecache.checkcache() call to try to prevent inspect.py from
1511 crashing under python 2.3. I think this fixes
1516 crashing under python 2.3. I think this fixes
1512 http://www.scipy.net/roundup/ipython/issue17.
1517 http://www.scipy.net/roundup/ipython/issue17.
1513
1518
1514 2004-07-26 *** Released version 0.6.2
1519 2004-07-26 *** Released version 0.6.2
1515
1520
1516 2004-07-26 Fernando Perez <fperez@colorado.edu>
1521 2004-07-26 Fernando Perez <fperez@colorado.edu>
1517
1522
1518 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
1523 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
1519 fail for any number.
1524 fail for any number.
1520 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
1525 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
1521 empty bookmarks.
1526 empty bookmarks.
1522
1527
1523 2004-07-26 *** Released version 0.6.1
1528 2004-07-26 *** Released version 0.6.1
1524
1529
1525 2004-07-26 Fernando Perez <fperez@colorado.edu>
1530 2004-07-26 Fernando Perez <fperez@colorado.edu>
1526
1531
1527 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
1532 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
1528
1533
1529 * IPython/iplib.py (protect_filename): Applied Ville's patch for
1534 * IPython/iplib.py (protect_filename): Applied Ville's patch for
1530 escaping '()[]{}' in filenames.
1535 escaping '()[]{}' in filenames.
1531
1536
1532 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
1537 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
1533 Python 2.2 users who lack a proper shlex.split.
1538 Python 2.2 users who lack a proper shlex.split.
1534
1539
1535 2004-07-19 Fernando Perez <fperez@colorado.edu>
1540 2004-07-19 Fernando Perez <fperez@colorado.edu>
1536
1541
1537 * IPython/iplib.py (InteractiveShell.init_readline): Add support
1542 * IPython/iplib.py (InteractiveShell.init_readline): Add support
1538 for reading readline's init file. I follow the normal chain:
1543 for reading readline's init file. I follow the normal chain:
1539 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
1544 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
1540 report by Mike Heeter. This closes
1545 report by Mike Heeter. This closes
1541 http://www.scipy.net/roundup/ipython/issue16.
1546 http://www.scipy.net/roundup/ipython/issue16.
1542
1547
1543 2004-07-18 Fernando Perez <fperez@colorado.edu>
1548 2004-07-18 Fernando Perez <fperez@colorado.edu>
1544
1549
1545 * IPython/iplib.py (__init__): Add better handling of '\' under
1550 * IPython/iplib.py (__init__): Add better handling of '\' under
1546 Win32 for filenames. After a patch by Ville.
1551 Win32 for filenames. After a patch by Ville.
1547
1552
1548 2004-07-17 Fernando Perez <fperez@colorado.edu>
1553 2004-07-17 Fernando Perez <fperez@colorado.edu>
1549
1554
1550 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
1555 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
1551 autocalling would be triggered for 'foo is bar' if foo is
1556 autocalling would be triggered for 'foo is bar' if foo is
1552 callable. I also cleaned up the autocall detection code to use a
1557 callable. I also cleaned up the autocall detection code to use a
1553 regexp, which is faster. Bug reported by Alexander Schmolck.
1558 regexp, which is faster. Bug reported by Alexander Schmolck.
1554
1559
1555 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
1560 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
1556 '?' in them would confuse the help system. Reported by Alex
1561 '?' in them would confuse the help system. Reported by Alex
1557 Schmolck.
1562 Schmolck.
1558
1563
1559 2004-07-16 Fernando Perez <fperez@colorado.edu>
1564 2004-07-16 Fernando Perez <fperez@colorado.edu>
1560
1565
1561 * IPython/GnuplotInteractive.py (__all__): added plot2.
1566 * IPython/GnuplotInteractive.py (__all__): added plot2.
1562
1567
1563 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
1568 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
1564 plotting dictionaries, lists or tuples of 1d arrays.
1569 plotting dictionaries, lists or tuples of 1d arrays.
1565
1570
1566 * IPython/Magic.py (Magic.magic_hist): small clenaups and
1571 * IPython/Magic.py (Magic.magic_hist): small clenaups and
1567 optimizations.
1572 optimizations.
1568
1573
1569 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
1574 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
1570 the information which was there from Janko's original IPP code:
1575 the information which was there from Janko's original IPP code:
1571
1576
1572 03.05.99 20:53 porto.ifm.uni-kiel.de
1577 03.05.99 20:53 porto.ifm.uni-kiel.de
1573 --Started changelog.
1578 --Started changelog.
1574 --make clear do what it say it does
1579 --make clear do what it say it does
1575 --added pretty output of lines from inputcache
1580 --added pretty output of lines from inputcache
1576 --Made Logger a mixin class, simplifies handling of switches
1581 --Made Logger a mixin class, simplifies handling of switches
1577 --Added own completer class. .string<TAB> expands to last history
1582 --Added own completer class. .string<TAB> expands to last history
1578 line which starts with string. The new expansion is also present
1583 line which starts with string. The new expansion is also present
1579 with Ctrl-r from the readline library. But this shows, who this
1584 with Ctrl-r from the readline library. But this shows, who this
1580 can be done for other cases.
1585 can be done for other cases.
1581 --Added convention that all shell functions should accept a
1586 --Added convention that all shell functions should accept a
1582 parameter_string This opens the door for different behaviour for
1587 parameter_string This opens the door for different behaviour for
1583 each function. @cd is a good example of this.
1588 each function. @cd is a good example of this.
1584
1589
1585 04.05.99 12:12 porto.ifm.uni-kiel.de
1590 04.05.99 12:12 porto.ifm.uni-kiel.de
1586 --added logfile rotation
1591 --added logfile rotation
1587 --added new mainloop method which freezes first the namespace
1592 --added new mainloop method which freezes first the namespace
1588
1593
1589 07.05.99 21:24 porto.ifm.uni-kiel.de
1594 07.05.99 21:24 porto.ifm.uni-kiel.de
1590 --added the docreader classes. Now there is a help system.
1595 --added the docreader classes. Now there is a help system.
1591 -This is only a first try. Currently it's not easy to put new
1596 -This is only a first try. Currently it's not easy to put new
1592 stuff in the indices. But this is the way to go. Info would be
1597 stuff in the indices. But this is the way to go. Info would be
1593 better, but HTML is every where and not everybody has an info
1598 better, but HTML is every where and not everybody has an info
1594 system installed and it's not so easy to change html-docs to info.
1599 system installed and it's not so easy to change html-docs to info.
1595 --added global logfile option
1600 --added global logfile option
1596 --there is now a hook for object inspection method pinfo needs to
1601 --there is now a hook for object inspection method pinfo needs to
1597 be provided for this. Can be reached by two '??'.
1602 be provided for this. Can be reached by two '??'.
1598
1603
1599 08.05.99 20:51 porto.ifm.uni-kiel.de
1604 08.05.99 20:51 porto.ifm.uni-kiel.de
1600 --added a README
1605 --added a README
1601 --bug in rc file. Something has changed so functions in the rc
1606 --bug in rc file. Something has changed so functions in the rc
1602 file need to reference the shell and not self. Not clear if it's a
1607 file need to reference the shell and not self. Not clear if it's a
1603 bug or feature.
1608 bug or feature.
1604 --changed rc file for new behavior
1609 --changed rc file for new behavior
1605
1610
1606 2004-07-15 Fernando Perez <fperez@colorado.edu>
1611 2004-07-15 Fernando Perez <fperez@colorado.edu>
1607
1612
1608 * IPython/Logger.py (Logger.log): fixed recent bug where the input
1613 * IPython/Logger.py (Logger.log): fixed recent bug where the input
1609 cache was falling out of sync in bizarre manners when multi-line
1614 cache was falling out of sync in bizarre manners when multi-line
1610 input was present. Minor optimizations and cleanup.
1615 input was present. Minor optimizations and cleanup.
1611
1616
1612 (Logger): Remove old Changelog info for cleanup. This is the
1617 (Logger): Remove old Changelog info for cleanup. This is the
1613 information which was there from Janko's original code:
1618 information which was there from Janko's original code:
1614
1619
1615 Changes to Logger: - made the default log filename a parameter
1620 Changes to Logger: - made the default log filename a parameter
1616
1621
1617 - put a check for lines beginning with !@? in log(). Needed
1622 - put a check for lines beginning with !@? in log(). Needed
1618 (even if the handlers properly log their lines) for mid-session
1623 (even if the handlers properly log their lines) for mid-session
1619 logging activation to work properly. Without this, lines logged
1624 logging activation to work properly. Without this, lines logged
1620 in mid session, which get read from the cache, would end up
1625 in mid session, which get read from the cache, would end up
1621 'bare' (with !@? in the open) in the log. Now they are caught
1626 'bare' (with !@? in the open) in the log. Now they are caught
1622 and prepended with a #.
1627 and prepended with a #.
1623
1628
1624 * IPython/iplib.py (InteractiveShell.init_readline): added check
1629 * IPython/iplib.py (InteractiveShell.init_readline): added check
1625 in case MagicCompleter fails to be defined, so we don't crash.
1630 in case MagicCompleter fails to be defined, so we don't crash.
1626
1631
1627 2004-07-13 Fernando Perez <fperez@colorado.edu>
1632 2004-07-13 Fernando Perez <fperez@colorado.edu>
1628
1633
1629 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
1634 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
1630 of EPS if the requested filename ends in '.eps'.
1635 of EPS if the requested filename ends in '.eps'.
1631
1636
1632 2004-07-04 Fernando Perez <fperez@colorado.edu>
1637 2004-07-04 Fernando Perez <fperez@colorado.edu>
1633
1638
1634 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
1639 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
1635 escaping of quotes when calling the shell.
1640 escaping of quotes when calling the shell.
1636
1641
1637 2004-07-02 Fernando Perez <fperez@colorado.edu>
1642 2004-07-02 Fernando Perez <fperez@colorado.edu>
1638
1643
1639 * IPython/Prompts.py (CachedOutput.update): Fix problem with
1644 * IPython/Prompts.py (CachedOutput.update): Fix problem with
1640 gettext not working because we were clobbering '_'. Fixes
1645 gettext not working because we were clobbering '_'. Fixes
1641 http://www.scipy.net/roundup/ipython/issue6.
1646 http://www.scipy.net/roundup/ipython/issue6.
1642
1647
1643 2004-07-01 Fernando Perez <fperez@colorado.edu>
1648 2004-07-01 Fernando Perez <fperez@colorado.edu>
1644
1649
1645 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
1650 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
1646 into @cd. Patch by Ville.
1651 into @cd. Patch by Ville.
1647
1652
1648 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1653 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1649 new function to store things after ipmaker runs. Patch by Ville.
1654 new function to store things after ipmaker runs. Patch by Ville.
1650 Eventually this will go away once ipmaker is removed and the class
1655 Eventually this will go away once ipmaker is removed and the class
1651 gets cleaned up, but for now it's ok. Key functionality here is
1656 gets cleaned up, but for now it's ok. Key functionality here is
1652 the addition of the persistent storage mechanism, a dict for
1657 the addition of the persistent storage mechanism, a dict for
1653 keeping data across sessions (for now just bookmarks, but more can
1658 keeping data across sessions (for now just bookmarks, but more can
1654 be implemented later).
1659 be implemented later).
1655
1660
1656 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
1661 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
1657 persistent across sections. Patch by Ville, I modified it
1662 persistent across sections. Patch by Ville, I modified it
1658 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
1663 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
1659 added a '-l' option to list all bookmarks.
1664 added a '-l' option to list all bookmarks.
1660
1665
1661 * IPython/iplib.py (InteractiveShell.atexit_operations): new
1666 * IPython/iplib.py (InteractiveShell.atexit_operations): new
1662 center for cleanup. Registered with atexit.register(). I moved
1667 center for cleanup. Registered with atexit.register(). I moved
1663 here the old exit_cleanup(). After a patch by Ville.
1668 here the old exit_cleanup(). After a patch by Ville.
1664
1669
1665 * IPython/Magic.py (get_py_filename): added '~' to the accepted
1670 * IPython/Magic.py (get_py_filename): added '~' to the accepted
1666 characters in the hacked shlex_split for python 2.2.
1671 characters in the hacked shlex_split for python 2.2.
1667
1672
1668 * IPython/iplib.py (file_matches): more fixes to filenames with
1673 * IPython/iplib.py (file_matches): more fixes to filenames with
1669 whitespace in them. It's not perfect, but limitations in python's
1674 whitespace in them. It's not perfect, but limitations in python's
1670 readline make it impossible to go further.
1675 readline make it impossible to go further.
1671
1676
1672 2004-06-29 Fernando Perez <fperez@colorado.edu>
1677 2004-06-29 Fernando Perez <fperez@colorado.edu>
1673
1678
1674 * IPython/iplib.py (file_matches): escape whitespace correctly in
1679 * IPython/iplib.py (file_matches): escape whitespace correctly in
1675 filename completions. Bug reported by Ville.
1680 filename completions. Bug reported by Ville.
1676
1681
1677 2004-06-28 Fernando Perez <fperez@colorado.edu>
1682 2004-06-28 Fernando Perez <fperez@colorado.edu>
1678
1683
1679 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
1684 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
1680 the history file will be called 'history-PROFNAME' (or just
1685 the history file will be called 'history-PROFNAME' (or just
1681 'history' if no profile is loaded). I was getting annoyed at
1686 'history' if no profile is loaded). I was getting annoyed at
1682 getting my Numerical work history clobbered by pysh sessions.
1687 getting my Numerical work history clobbered by pysh sessions.
1683
1688
1684 * IPython/iplib.py (InteractiveShell.__init__): Internal
1689 * IPython/iplib.py (InteractiveShell.__init__): Internal
1685 getoutputerror() function so that we can honor the system_verbose
1690 getoutputerror() function so that we can honor the system_verbose
1686 flag for _all_ system calls. I also added escaping of #
1691 flag for _all_ system calls. I also added escaping of #
1687 characters here to avoid confusing Itpl.
1692 characters here to avoid confusing Itpl.
1688
1693
1689 * IPython/Magic.py (shlex_split): removed call to shell in
1694 * IPython/Magic.py (shlex_split): removed call to shell in
1690 parse_options and replaced it with shlex.split(). The annoying
1695 parse_options and replaced it with shlex.split(). The annoying
1691 part was that in Python 2.2, shlex.split() doesn't exist, so I had
1696 part was that in Python 2.2, shlex.split() doesn't exist, so I had
1692 to backport it from 2.3, with several frail hacks (the shlex
1697 to backport it from 2.3, with several frail hacks (the shlex
1693 module is rather limited in 2.2). Thanks to a suggestion by Ville
1698 module is rather limited in 2.2). Thanks to a suggestion by Ville
1694 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
1699 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
1695 problem.
1700 problem.
1696
1701
1697 (Magic.magic_system_verbose): new toggle to print the actual
1702 (Magic.magic_system_verbose): new toggle to print the actual
1698 system calls made by ipython. Mainly for debugging purposes.
1703 system calls made by ipython. Mainly for debugging purposes.
1699
1704
1700 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
1705 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
1701 doesn't support persistence. Reported (and fix suggested) by
1706 doesn't support persistence. Reported (and fix suggested) by
1702 Travis Caldwell <travis_caldwell2000@yahoo.com>.
1707 Travis Caldwell <travis_caldwell2000@yahoo.com>.
1703
1708
1704 2004-06-26 Fernando Perez <fperez@colorado.edu>
1709 2004-06-26 Fernando Perez <fperez@colorado.edu>
1705
1710
1706 * IPython/Logger.py (Logger.log): fix to handle correctly empty
1711 * IPython/Logger.py (Logger.log): fix to handle correctly empty
1707 continue prompts.
1712 continue prompts.
1708
1713
1709 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
1714 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
1710 function (basically a big docstring) and a few more things here to
1715 function (basically a big docstring) and a few more things here to
1711 speedup startup. pysh.py is now very lightweight. We want because
1716 speedup startup. pysh.py is now very lightweight. We want because
1712 it gets execfile'd, while InterpreterExec gets imported, so
1717 it gets execfile'd, while InterpreterExec gets imported, so
1713 byte-compilation saves time.
1718 byte-compilation saves time.
1714
1719
1715 2004-06-25 Fernando Perez <fperez@colorado.edu>
1720 2004-06-25 Fernando Perez <fperez@colorado.edu>
1716
1721
1717 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
1722 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
1718 -NUM', which was recently broken.
1723 -NUM', which was recently broken.
1719
1724
1720 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
1725 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
1721 in multi-line input (but not !!, which doesn't make sense there).
1726 in multi-line input (but not !!, which doesn't make sense there).
1722
1727
1723 * IPython/UserConfig/ipythonrc: made autoindent on by default.
1728 * IPython/UserConfig/ipythonrc: made autoindent on by default.
1724 It's just too useful, and people can turn it off in the less
1729 It's just too useful, and people can turn it off in the less
1725 common cases where it's a problem.
1730 common cases where it's a problem.
1726
1731
1727 2004-06-24 Fernando Perez <fperez@colorado.edu>
1732 2004-06-24 Fernando Perez <fperez@colorado.edu>
1728
1733
1729 * IPython/iplib.py (InteractiveShell._prefilter): big change -
1734 * IPython/iplib.py (InteractiveShell._prefilter): big change -
1730 special syntaxes (like alias calling) is now allied in multi-line
1735 special syntaxes (like alias calling) is now allied in multi-line
1731 input. This is still _very_ experimental, but it's necessary for
1736 input. This is still _very_ experimental, but it's necessary for
1732 efficient shell usage combining python looping syntax with system
1737 efficient shell usage combining python looping syntax with system
1733 calls. For now it's restricted to aliases, I don't think it
1738 calls. For now it's restricted to aliases, I don't think it
1734 really even makes sense to have this for magics.
1739 really even makes sense to have this for magics.
1735
1740
1736 2004-06-23 Fernando Perez <fperez@colorado.edu>
1741 2004-06-23 Fernando Perez <fperez@colorado.edu>
1737
1742
1738 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
1743 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
1739 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
1744 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
1740
1745
1741 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
1746 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
1742 extensions under Windows (after code sent by Gary Bishop). The
1747 extensions under Windows (after code sent by Gary Bishop). The
1743 extensions considered 'executable' are stored in IPython's rc
1748 extensions considered 'executable' are stored in IPython's rc
1744 structure as win_exec_ext.
1749 structure as win_exec_ext.
1745
1750
1746 * IPython/genutils.py (shell): new function, like system() but
1751 * IPython/genutils.py (shell): new function, like system() but
1747 without return value. Very useful for interactive shell work.
1752 without return value. Very useful for interactive shell work.
1748
1753
1749 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
1754 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
1750 delete aliases.
1755 delete aliases.
1751
1756
1752 * IPython/iplib.py (InteractiveShell.alias_table_update): make
1757 * IPython/iplib.py (InteractiveShell.alias_table_update): make
1753 sure that the alias table doesn't contain python keywords.
1758 sure that the alias table doesn't contain python keywords.
1754
1759
1755 2004-06-21 Fernando Perez <fperez@colorado.edu>
1760 2004-06-21 Fernando Perez <fperez@colorado.edu>
1756
1761
1757 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
1762 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
1758 non-existent items are found in $PATH. Reported by Thorsten.
1763 non-existent items are found in $PATH. Reported by Thorsten.
1759
1764
1760 2004-06-20 Fernando Perez <fperez@colorado.edu>
1765 2004-06-20 Fernando Perez <fperez@colorado.edu>
1761
1766
1762 * IPython/iplib.py (complete): modified the completer so that the
1767 * IPython/iplib.py (complete): modified the completer so that the
1763 order of priorities can be easily changed at runtime.
1768 order of priorities can be easily changed at runtime.
1764
1769
1765 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
1770 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
1766 Modified to auto-execute all lines beginning with '~', '/' or '.'.
1771 Modified to auto-execute all lines beginning with '~', '/' or '.'.
1767
1772
1768 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
1773 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
1769 expand Python variables prepended with $ in all system calls. The
1774 expand Python variables prepended with $ in all system calls. The
1770 same was done to InteractiveShell.handle_shell_escape. Now all
1775 same was done to InteractiveShell.handle_shell_escape. Now all
1771 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
1776 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
1772 expansion of python variables and expressions according to the
1777 expansion of python variables and expressions according to the
1773 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
1778 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
1774
1779
1775 Though PEP-215 has been rejected, a similar (but simpler) one
1780 Though PEP-215 has been rejected, a similar (but simpler) one
1776 seems like it will go into Python 2.4, PEP-292 -
1781 seems like it will go into Python 2.4, PEP-292 -
1777 http://www.python.org/peps/pep-0292.html.
1782 http://www.python.org/peps/pep-0292.html.
1778
1783
1779 I'll keep the full syntax of PEP-215, since IPython has since the
1784 I'll keep the full syntax of PEP-215, since IPython has since the
1780 start used Ka-Ping Yee's reference implementation discussed there
1785 start used Ka-Ping Yee's reference implementation discussed there
1781 (Itpl), and I actually like the powerful semantics it offers.
1786 (Itpl), and I actually like the powerful semantics it offers.
1782
1787
1783 In order to access normal shell variables, the $ has to be escaped
1788 In order to access normal shell variables, the $ has to be escaped
1784 via an extra $. For example:
1789 via an extra $. For example:
1785
1790
1786 In [7]: PATH='a python variable'
1791 In [7]: PATH='a python variable'
1787
1792
1788 In [8]: !echo $PATH
1793 In [8]: !echo $PATH
1789 a python variable
1794 a python variable
1790
1795
1791 In [9]: !echo $$PATH
1796 In [9]: !echo $$PATH
1792 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
1797 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
1793
1798
1794 (Magic.parse_options): escape $ so the shell doesn't evaluate
1799 (Magic.parse_options): escape $ so the shell doesn't evaluate
1795 things prematurely.
1800 things prematurely.
1796
1801
1797 * IPython/iplib.py (InteractiveShell.call_alias): added the
1802 * IPython/iplib.py (InteractiveShell.call_alias): added the
1798 ability for aliases to expand python variables via $.
1803 ability for aliases to expand python variables via $.
1799
1804
1800 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
1805 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
1801 system, now there's a @rehash/@rehashx pair of magics. These work
1806 system, now there's a @rehash/@rehashx pair of magics. These work
1802 like the csh rehash command, and can be invoked at any time. They
1807 like the csh rehash command, and can be invoked at any time. They
1803 build a table of aliases to everything in the user's $PATH
1808 build a table of aliases to everything in the user's $PATH
1804 (@rehash uses everything, @rehashx is slower but only adds
1809 (@rehash uses everything, @rehashx is slower but only adds
1805 executable files). With this, the pysh.py-based shell profile can
1810 executable files). With this, the pysh.py-based shell profile can
1806 now simply call rehash upon startup, and full access to all
1811 now simply call rehash upon startup, and full access to all
1807 programs in the user's path is obtained.
1812 programs in the user's path is obtained.
1808
1813
1809 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
1814 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
1810 functionality is now fully in place. I removed the old dynamic
1815 functionality is now fully in place. I removed the old dynamic
1811 code generation based approach, in favor of a much lighter one
1816 code generation based approach, in favor of a much lighter one
1812 based on a simple dict. The advantage is that this allows me to
1817 based on a simple dict. The advantage is that this allows me to
1813 now have thousands of aliases with negligible cost (unthinkable
1818 now have thousands of aliases with negligible cost (unthinkable
1814 with the old system).
1819 with the old system).
1815
1820
1816 2004-06-19 Fernando Perez <fperez@colorado.edu>
1821 2004-06-19 Fernando Perez <fperez@colorado.edu>
1817
1822
1818 * IPython/iplib.py (__init__): extended MagicCompleter class to
1823 * IPython/iplib.py (__init__): extended MagicCompleter class to
1819 also complete (last in priority) on user aliases.
1824 also complete (last in priority) on user aliases.
1820
1825
1821 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
1826 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
1822 call to eval.
1827 call to eval.
1823 (ItplNS.__init__): Added a new class which functions like Itpl,
1828 (ItplNS.__init__): Added a new class which functions like Itpl,
1824 but allows configuring the namespace for the evaluation to occur
1829 but allows configuring the namespace for the evaluation to occur
1825 in.
1830 in.
1826
1831
1827 2004-06-18 Fernando Perez <fperez@colorado.edu>
1832 2004-06-18 Fernando Perez <fperez@colorado.edu>
1828
1833
1829 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
1834 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
1830 better message when 'exit' or 'quit' are typed (a common newbie
1835 better message when 'exit' or 'quit' are typed (a common newbie
1831 confusion).
1836 confusion).
1832
1837
1833 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
1838 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
1834 check for Windows users.
1839 check for Windows users.
1835
1840
1836 * IPython/iplib.py (InteractiveShell.user_setup): removed
1841 * IPython/iplib.py (InteractiveShell.user_setup): removed
1837 disabling of colors for Windows. I'll test at runtime and issue a
1842 disabling of colors for Windows. I'll test at runtime and issue a
1838 warning if Gary's readline isn't found, as to nudge users to
1843 warning if Gary's readline isn't found, as to nudge users to
1839 download it.
1844 download it.
1840
1845
1841 2004-06-16 Fernando Perez <fperez@colorado.edu>
1846 2004-06-16 Fernando Perez <fperez@colorado.edu>
1842
1847
1843 * IPython/genutils.py (Stream.__init__): changed to print errors
1848 * IPython/genutils.py (Stream.__init__): changed to print errors
1844 to sys.stderr. I had a circular dependency here. Now it's
1849 to sys.stderr. I had a circular dependency here. Now it's
1845 possible to run ipython as IDLE's shell (consider this pre-alpha,
1850 possible to run ipython as IDLE's shell (consider this pre-alpha,
1846 since true stdout things end up in the starting terminal instead
1851 since true stdout things end up in the starting terminal instead
1847 of IDLE's out).
1852 of IDLE's out).
1848
1853
1849 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
1854 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
1850 users who haven't # updated their prompt_in2 definitions. Remove
1855 users who haven't # updated their prompt_in2 definitions. Remove
1851 eventually.
1856 eventually.
1852 (multiple_replace): added credit to original ASPN recipe.
1857 (multiple_replace): added credit to original ASPN recipe.
1853
1858
1854 2004-06-15 Fernando Perez <fperez@colorado.edu>
1859 2004-06-15 Fernando Perez <fperez@colorado.edu>
1855
1860
1856 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
1861 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
1857 list of auto-defined aliases.
1862 list of auto-defined aliases.
1858
1863
1859 2004-06-13 Fernando Perez <fperez@colorado.edu>
1864 2004-06-13 Fernando Perez <fperez@colorado.edu>
1860
1865
1861 * setup.py (scriptfiles): Don't trigger win_post_install unless an
1866 * setup.py (scriptfiles): Don't trigger win_post_install unless an
1862 install was really requested (so setup.py can be used for other
1867 install was really requested (so setup.py can be used for other
1863 things under Windows).
1868 things under Windows).
1864
1869
1865 2004-06-10 Fernando Perez <fperez@colorado.edu>
1870 2004-06-10 Fernando Perez <fperez@colorado.edu>
1866
1871
1867 * IPython/Logger.py (Logger.create_log): Manually remove any old
1872 * IPython/Logger.py (Logger.create_log): Manually remove any old
1868 backup, since os.remove may fail under Windows. Fixes bug
1873 backup, since os.remove may fail under Windows. Fixes bug
1869 reported by Thorsten.
1874 reported by Thorsten.
1870
1875
1871 2004-06-09 Fernando Perez <fperez@colorado.edu>
1876 2004-06-09 Fernando Perez <fperez@colorado.edu>
1872
1877
1873 * examples/example-embed.py: fixed all references to %n (replaced
1878 * examples/example-embed.py: fixed all references to %n (replaced
1874 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
1879 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
1875 for all examples and the manual as well.
1880 for all examples and the manual as well.
1876
1881
1877 2004-06-08 Fernando Perez <fperez@colorado.edu>
1882 2004-06-08 Fernando Perez <fperez@colorado.edu>
1878
1883
1879 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
1884 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
1880 alignment and color management. All 3 prompt subsystems now
1885 alignment and color management. All 3 prompt subsystems now
1881 inherit from BasePrompt.
1886 inherit from BasePrompt.
1882
1887
1883 * tools/release: updates for windows installer build and tag rpms
1888 * tools/release: updates for windows installer build and tag rpms
1884 with python version (since paths are fixed).
1889 with python version (since paths are fixed).
1885
1890
1886 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
1891 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
1887 which will become eventually obsolete. Also fixed the default
1892 which will become eventually obsolete. Also fixed the default
1888 prompt_in2 to use \D, so at least new users start with the correct
1893 prompt_in2 to use \D, so at least new users start with the correct
1889 defaults.
1894 defaults.
1890 WARNING: Users with existing ipythonrc files will need to apply
1895 WARNING: Users with existing ipythonrc files will need to apply
1891 this fix manually!
1896 this fix manually!
1892
1897
1893 * setup.py: make windows installer (.exe). This is finally the
1898 * setup.py: make windows installer (.exe). This is finally the
1894 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
1899 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
1895 which I hadn't included because it required Python 2.3 (or recent
1900 which I hadn't included because it required Python 2.3 (or recent
1896 distutils).
1901 distutils).
1897
1902
1898 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
1903 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
1899 usage of new '\D' escape.
1904 usage of new '\D' escape.
1900
1905
1901 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
1906 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
1902 lacks os.getuid())
1907 lacks os.getuid())
1903 (CachedOutput.set_colors): Added the ability to turn coloring
1908 (CachedOutput.set_colors): Added the ability to turn coloring
1904 on/off with @colors even for manually defined prompt colors. It
1909 on/off with @colors even for manually defined prompt colors. It
1905 uses a nasty global, but it works safely and via the generic color
1910 uses a nasty global, but it works safely and via the generic color
1906 handling mechanism.
1911 handling mechanism.
1907 (Prompt2.__init__): Introduced new escape '\D' for continuation
1912 (Prompt2.__init__): Introduced new escape '\D' for continuation
1908 prompts. It represents the counter ('\#') as dots.
1913 prompts. It represents the counter ('\#') as dots.
1909 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
1914 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
1910 need to update their ipythonrc files and replace '%n' with '\D' in
1915 need to update their ipythonrc files and replace '%n' with '\D' in
1911 their prompt_in2 settings everywhere. Sorry, but there's
1916 their prompt_in2 settings everywhere. Sorry, but there's
1912 otherwise no clean way to get all prompts to properly align. The
1917 otherwise no clean way to get all prompts to properly align. The
1913 ipythonrc shipped with IPython has been updated.
1918 ipythonrc shipped with IPython has been updated.
1914
1919
1915 2004-06-07 Fernando Perez <fperez@colorado.edu>
1920 2004-06-07 Fernando Perez <fperez@colorado.edu>
1916
1921
1917 * setup.py (isfile): Pass local_icons option to latex2html, so the
1922 * setup.py (isfile): Pass local_icons option to latex2html, so the
1918 resulting HTML file is self-contained. Thanks to
1923 resulting HTML file is self-contained. Thanks to
1919 dryice-AT-liu.com.cn for the tip.
1924 dryice-AT-liu.com.cn for the tip.
1920
1925
1921 * pysh.py: I created a new profile 'shell', which implements a
1926 * pysh.py: I created a new profile 'shell', which implements a
1922 _rudimentary_ IPython-based shell. This is in NO WAY a realy
1927 _rudimentary_ IPython-based shell. This is in NO WAY a realy
1923 system shell, nor will it become one anytime soon. It's mainly
1928 system shell, nor will it become one anytime soon. It's mainly
1924 meant to illustrate the use of the new flexible bash-like prompts.
1929 meant to illustrate the use of the new flexible bash-like prompts.
1925 I guess it could be used by hardy souls for true shell management,
1930 I guess it could be used by hardy souls for true shell management,
1926 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
1931 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
1927 profile. This uses the InterpreterExec extension provided by
1932 profile. This uses the InterpreterExec extension provided by
1928 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
1933 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
1929
1934
1930 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
1935 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
1931 auto-align itself with the length of the previous input prompt
1936 auto-align itself with the length of the previous input prompt
1932 (taking into account the invisible color escapes).
1937 (taking into account the invisible color escapes).
1933 (CachedOutput.__init__): Large restructuring of this class. Now
1938 (CachedOutput.__init__): Large restructuring of this class. Now
1934 all three prompts (primary1, primary2, output) are proper objects,
1939 all three prompts (primary1, primary2, output) are proper objects,
1935 managed by the 'parent' CachedOutput class. The code is still a
1940 managed by the 'parent' CachedOutput class. The code is still a
1936 bit hackish (all prompts share state via a pointer to the cache),
1941 bit hackish (all prompts share state via a pointer to the cache),
1937 but it's overall far cleaner than before.
1942 but it's overall far cleaner than before.
1938
1943
1939 * IPython/genutils.py (getoutputerror): modified to add verbose,
1944 * IPython/genutils.py (getoutputerror): modified to add verbose,
1940 debug and header options. This makes the interface of all getout*
1945 debug and header options. This makes the interface of all getout*
1941 functions uniform.
1946 functions uniform.
1942 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
1947 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
1943
1948
1944 * IPython/Magic.py (Magic.default_option): added a function to
1949 * IPython/Magic.py (Magic.default_option): added a function to
1945 allow registering default options for any magic command. This
1950 allow registering default options for any magic command. This
1946 makes it easy to have profiles which customize the magics globally
1951 makes it easy to have profiles which customize the magics globally
1947 for a certain use. The values set through this function are
1952 for a certain use. The values set through this function are
1948 picked up by the parse_options() method, which all magics should
1953 picked up by the parse_options() method, which all magics should
1949 use to parse their options.
1954 use to parse their options.
1950
1955
1951 * IPython/genutils.py (warn): modified the warnings framework to
1956 * IPython/genutils.py (warn): modified the warnings framework to
1952 use the Term I/O class. I'm trying to slowly unify all of
1957 use the Term I/O class. I'm trying to slowly unify all of
1953 IPython's I/O operations to pass through Term.
1958 IPython's I/O operations to pass through Term.
1954
1959
1955 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
1960 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
1956 the secondary prompt to correctly match the length of the primary
1961 the secondary prompt to correctly match the length of the primary
1957 one for any prompt. Now multi-line code will properly line up
1962 one for any prompt. Now multi-line code will properly line up
1958 even for path dependent prompts, such as the new ones available
1963 even for path dependent prompts, such as the new ones available
1959 via the prompt_specials.
1964 via the prompt_specials.
1960
1965
1961 2004-06-06 Fernando Perez <fperez@colorado.edu>
1966 2004-06-06 Fernando Perez <fperez@colorado.edu>
1962
1967
1963 * IPython/Prompts.py (prompt_specials): Added the ability to have
1968 * IPython/Prompts.py (prompt_specials): Added the ability to have
1964 bash-like special sequences in the prompts, which get
1969 bash-like special sequences in the prompts, which get
1965 automatically expanded. Things like hostname, current working
1970 automatically expanded. Things like hostname, current working
1966 directory and username are implemented already, but it's easy to
1971 directory and username are implemented already, but it's easy to
1967 add more in the future. Thanks to a patch by W.J. van der Laan
1972 add more in the future. Thanks to a patch by W.J. van der Laan
1968 <gnufnork-AT-hetdigitalegat.nl>
1973 <gnufnork-AT-hetdigitalegat.nl>
1969 (prompt_specials): Added color support for prompt strings, so
1974 (prompt_specials): Added color support for prompt strings, so
1970 users can define arbitrary color setups for their prompts.
1975 users can define arbitrary color setups for their prompts.
1971
1976
1972 2004-06-05 Fernando Perez <fperez@colorado.edu>
1977 2004-06-05 Fernando Perez <fperez@colorado.edu>
1973
1978
1974 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
1979 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
1975 code to load Gary Bishop's readline and configure it
1980 code to load Gary Bishop's readline and configure it
1976 automatically. Thanks to Gary for help on this.
1981 automatically. Thanks to Gary for help on this.
1977
1982
1978 2004-06-01 Fernando Perez <fperez@colorado.edu>
1983 2004-06-01 Fernando Perez <fperez@colorado.edu>
1979
1984
1980 * IPython/Logger.py (Logger.create_log): fix bug for logging
1985 * IPython/Logger.py (Logger.create_log): fix bug for logging
1981 with no filename (previous fix was incomplete).
1986 with no filename (previous fix was incomplete).
1982
1987
1983 2004-05-25 Fernando Perez <fperez@colorado.edu>
1988 2004-05-25 Fernando Perez <fperez@colorado.edu>
1984
1989
1985 * IPython/Magic.py (Magic.parse_options): fix bug where naked
1990 * IPython/Magic.py (Magic.parse_options): fix bug where naked
1986 parens would get passed to the shell.
1991 parens would get passed to the shell.
1987
1992
1988 2004-05-20 Fernando Perez <fperez@colorado.edu>
1993 2004-05-20 Fernando Perez <fperez@colorado.edu>
1989
1994
1990 * IPython/Magic.py (Magic.magic_prun): changed default profile
1995 * IPython/Magic.py (Magic.magic_prun): changed default profile
1991 sort order to 'time' (the more common profiling need).
1996 sort order to 'time' (the more common profiling need).
1992
1997
1993 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
1998 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
1994 so that source code shown is guaranteed in sync with the file on
1999 so that source code shown is guaranteed in sync with the file on
1995 disk (also changed in psource). Similar fix to the one for
2000 disk (also changed in psource). Similar fix to the one for
1996 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2001 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
1997 <yann.ledu-AT-noos.fr>.
2002 <yann.ledu-AT-noos.fr>.
1998
2003
1999 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2004 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2000 with a single option would not be correctly parsed. Closes
2005 with a single option would not be correctly parsed. Closes
2001 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2006 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2002 introduced in 0.6.0 (on 2004-05-06).
2007 introduced in 0.6.0 (on 2004-05-06).
2003
2008
2004 2004-05-13 *** Released version 0.6.0
2009 2004-05-13 *** Released version 0.6.0
2005
2010
2006 2004-05-13 Fernando Perez <fperez@colorado.edu>
2011 2004-05-13 Fernando Perez <fperez@colorado.edu>
2007
2012
2008 * debian/: Added debian/ directory to CVS, so that debian support
2013 * debian/: Added debian/ directory to CVS, so that debian support
2009 is publicly accessible. The debian package is maintained by Jack
2014 is publicly accessible. The debian package is maintained by Jack
2010 Moffit <jack-AT-xiph.org>.
2015 Moffit <jack-AT-xiph.org>.
2011
2016
2012 * Documentation: included the notes about an ipython-based system
2017 * Documentation: included the notes about an ipython-based system
2013 shell (the hypothetical 'pysh') into the new_design.pdf document,
2018 shell (the hypothetical 'pysh') into the new_design.pdf document,
2014 so that these ideas get distributed to users along with the
2019 so that these ideas get distributed to users along with the
2015 official documentation.
2020 official documentation.
2016
2021
2017 2004-05-10 Fernando Perez <fperez@colorado.edu>
2022 2004-05-10 Fernando Perez <fperez@colorado.edu>
2018
2023
2019 * IPython/Logger.py (Logger.create_log): fix recently introduced
2024 * IPython/Logger.py (Logger.create_log): fix recently introduced
2020 bug (misindented line) where logstart would fail when not given an
2025 bug (misindented line) where logstart would fail when not given an
2021 explicit filename.
2026 explicit filename.
2022
2027
2023 2004-05-09 Fernando Perez <fperez@colorado.edu>
2028 2004-05-09 Fernando Perez <fperez@colorado.edu>
2024
2029
2025 * IPython/Magic.py (Magic.parse_options): skip system call when
2030 * IPython/Magic.py (Magic.parse_options): skip system call when
2026 there are no options to look for. Faster, cleaner for the common
2031 there are no options to look for. Faster, cleaner for the common
2027 case.
2032 case.
2028
2033
2029 * Documentation: many updates to the manual: describing Windows
2034 * Documentation: many updates to the manual: describing Windows
2030 support better, Gnuplot updates, credits, misc small stuff. Also
2035 support better, Gnuplot updates, credits, misc small stuff. Also
2031 updated the new_design doc a bit.
2036 updated the new_design doc a bit.
2032
2037
2033 2004-05-06 *** Released version 0.6.0.rc1
2038 2004-05-06 *** Released version 0.6.0.rc1
2034
2039
2035 2004-05-06 Fernando Perez <fperez@colorado.edu>
2040 2004-05-06 Fernando Perez <fperez@colorado.edu>
2036
2041
2037 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2042 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2038 operations to use the vastly more efficient list/''.join() method.
2043 operations to use the vastly more efficient list/''.join() method.
2039 (FormattedTB.text): Fix
2044 (FormattedTB.text): Fix
2040 http://www.scipy.net/roundup/ipython/issue12 - exception source
2045 http://www.scipy.net/roundup/ipython/issue12 - exception source
2041 extract not updated after reload. Thanks to Mike Salib
2046 extract not updated after reload. Thanks to Mike Salib
2042 <msalib-AT-mit.edu> for pinning the source of the problem.
2047 <msalib-AT-mit.edu> for pinning the source of the problem.
2043 Fortunately, the solution works inside ipython and doesn't require
2048 Fortunately, the solution works inside ipython and doesn't require
2044 any changes to python proper.
2049 any changes to python proper.
2045
2050
2046 * IPython/Magic.py (Magic.parse_options): Improved to process the
2051 * IPython/Magic.py (Magic.parse_options): Improved to process the
2047 argument list as a true shell would (by actually using the
2052 argument list as a true shell would (by actually using the
2048 underlying system shell). This way, all @magics automatically get
2053 underlying system shell). This way, all @magics automatically get
2049 shell expansion for variables. Thanks to a comment by Alex
2054 shell expansion for variables. Thanks to a comment by Alex
2050 Schmolck.
2055 Schmolck.
2051
2056
2052 2004-04-04 Fernando Perez <fperez@colorado.edu>
2057 2004-04-04 Fernando Perez <fperez@colorado.edu>
2053
2058
2054 * IPython/iplib.py (InteractiveShell.interact): Added a special
2059 * IPython/iplib.py (InteractiveShell.interact): Added a special
2055 trap for a debugger quit exception, which is basically impossible
2060 trap for a debugger quit exception, which is basically impossible
2056 to handle by normal mechanisms, given what pdb does to the stack.
2061 to handle by normal mechanisms, given what pdb does to the stack.
2057 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2062 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2058
2063
2059 2004-04-03 Fernando Perez <fperez@colorado.edu>
2064 2004-04-03 Fernando Perez <fperez@colorado.edu>
2060
2065
2061 * IPython/genutils.py (Term): Standardized the names of the Term
2066 * IPython/genutils.py (Term): Standardized the names of the Term
2062 class streams to cin/cout/cerr, following C++ naming conventions
2067 class streams to cin/cout/cerr, following C++ naming conventions
2063 (I can't use in/out/err because 'in' is not a valid attribute
2068 (I can't use in/out/err because 'in' is not a valid attribute
2064 name).
2069 name).
2065
2070
2066 * IPython/iplib.py (InteractiveShell.interact): don't increment
2071 * IPython/iplib.py (InteractiveShell.interact): don't increment
2067 the prompt if there's no user input. By Daniel 'Dang' Griffith
2072 the prompt if there's no user input. By Daniel 'Dang' Griffith
2068 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2073 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2069 Francois Pinard.
2074 Francois Pinard.
2070
2075
2071 2004-04-02 Fernando Perez <fperez@colorado.edu>
2076 2004-04-02 Fernando Perez <fperez@colorado.edu>
2072
2077
2073 * IPython/genutils.py (Stream.__init__): Modified to survive at
2078 * IPython/genutils.py (Stream.__init__): Modified to survive at
2074 least importing in contexts where stdin/out/err aren't true file
2079 least importing in contexts where stdin/out/err aren't true file
2075 objects, such as PyCrust (they lack fileno() and mode). However,
2080 objects, such as PyCrust (they lack fileno() and mode). However,
2076 the recovery facilities which rely on these things existing will
2081 the recovery facilities which rely on these things existing will
2077 not work.
2082 not work.
2078
2083
2079 2004-04-01 Fernando Perez <fperez@colorado.edu>
2084 2004-04-01 Fernando Perez <fperez@colorado.edu>
2080
2085
2081 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2086 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2082 use the new getoutputerror() function, so it properly
2087 use the new getoutputerror() function, so it properly
2083 distinguishes stdout/err.
2088 distinguishes stdout/err.
2084
2089
2085 * IPython/genutils.py (getoutputerror): added a function to
2090 * IPython/genutils.py (getoutputerror): added a function to
2086 capture separately the standard output and error of a command.
2091 capture separately the standard output and error of a command.
2087 After a comment from dang on the mailing lists. This code is
2092 After a comment from dang on the mailing lists. This code is
2088 basically a modified version of commands.getstatusoutput(), from
2093 basically a modified version of commands.getstatusoutput(), from
2089 the standard library.
2094 the standard library.
2090
2095
2091 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2096 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2092 '!!' as a special syntax (shorthand) to access @sx.
2097 '!!' as a special syntax (shorthand) to access @sx.
2093
2098
2094 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2099 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2095 command and return its output as a list split on '\n'.
2100 command and return its output as a list split on '\n'.
2096
2101
2097 2004-03-31 Fernando Perez <fperez@colorado.edu>
2102 2004-03-31 Fernando Perez <fperez@colorado.edu>
2098
2103
2099 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2104 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2100 method to dictionaries used as FakeModule instances if they lack
2105 method to dictionaries used as FakeModule instances if they lack
2101 it. At least pydoc in python2.3 breaks for runtime-defined
2106 it. At least pydoc in python2.3 breaks for runtime-defined
2102 functions without this hack. At some point I need to _really_
2107 functions without this hack. At some point I need to _really_
2103 understand what FakeModule is doing, because it's a gross hack.
2108 understand what FakeModule is doing, because it's a gross hack.
2104 But it solves Arnd's problem for now...
2109 But it solves Arnd's problem for now...
2105
2110
2106 2004-02-27 Fernando Perez <fperez@colorado.edu>
2111 2004-02-27 Fernando Perez <fperez@colorado.edu>
2107
2112
2108 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2113 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2109 mode would behave erratically. Also increased the number of
2114 mode would behave erratically. Also increased the number of
2110 possible logs in rotate mod to 999. Thanks to Rod Holland
2115 possible logs in rotate mod to 999. Thanks to Rod Holland
2111 <rhh@StructureLABS.com> for the report and fixes.
2116 <rhh@StructureLABS.com> for the report and fixes.
2112
2117
2113 2004-02-26 Fernando Perez <fperez@colorado.edu>
2118 2004-02-26 Fernando Perez <fperez@colorado.edu>
2114
2119
2115 * IPython/genutils.py (page): Check that the curses module really
2120 * IPython/genutils.py (page): Check that the curses module really
2116 has the initscr attribute before trying to use it. For some
2121 has the initscr attribute before trying to use it. For some
2117 reason, the Solaris curses module is missing this. I think this
2122 reason, the Solaris curses module is missing this. I think this
2118 should be considered a Solaris python bug, but I'm not sure.
2123 should be considered a Solaris python bug, but I'm not sure.
2119
2124
2120 2004-01-17 Fernando Perez <fperez@colorado.edu>
2125 2004-01-17 Fernando Perez <fperez@colorado.edu>
2121
2126
2122 * IPython/genutils.py (Stream.__init__): Changes to try to make
2127 * IPython/genutils.py (Stream.__init__): Changes to try to make
2123 ipython robust against stdin/out/err being closed by the user.
2128 ipython robust against stdin/out/err being closed by the user.
2124 This is 'user error' (and blocks a normal python session, at least
2129 This is 'user error' (and blocks a normal python session, at least
2125 the stdout case). However, Ipython should be able to survive such
2130 the stdout case). However, Ipython should be able to survive such
2126 instances of abuse as gracefully as possible. To simplify the
2131 instances of abuse as gracefully as possible. To simplify the
2127 coding and maintain compatibility with Gary Bishop's Term
2132 coding and maintain compatibility with Gary Bishop's Term
2128 contributions, I've made use of classmethods for this. I think
2133 contributions, I've made use of classmethods for this. I think
2129 this introduces a dependency on python 2.2.
2134 this introduces a dependency on python 2.2.
2130
2135
2131 2004-01-13 Fernando Perez <fperez@colorado.edu>
2136 2004-01-13 Fernando Perez <fperez@colorado.edu>
2132
2137
2133 * IPython/numutils.py (exp_safe): simplified the code a bit and
2138 * IPython/numutils.py (exp_safe): simplified the code a bit and
2134 removed the need for importing the kinds module altogether.
2139 removed the need for importing the kinds module altogether.
2135
2140
2136 2004-01-06 Fernando Perez <fperez@colorado.edu>
2141 2004-01-06 Fernando Perez <fperez@colorado.edu>
2137
2142
2138 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2143 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2139 a magic function instead, after some community feedback. No
2144 a magic function instead, after some community feedback. No
2140 special syntax will exist for it, but its name is deliberately
2145 special syntax will exist for it, but its name is deliberately
2141 very short.
2146 very short.
2142
2147
2143 2003-12-20 Fernando Perez <fperez@colorado.edu>
2148 2003-12-20 Fernando Perez <fperez@colorado.edu>
2144
2149
2145 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2150 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2146 new functionality, to automagically assign the result of a shell
2151 new functionality, to automagically assign the result of a shell
2147 command to a variable. I'll solicit some community feedback on
2152 command to a variable. I'll solicit some community feedback on
2148 this before making it permanent.
2153 this before making it permanent.
2149
2154
2150 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2155 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2151 requested about callables for which inspect couldn't obtain a
2156 requested about callables for which inspect couldn't obtain a
2152 proper argspec. Thanks to a crash report sent by Etienne
2157 proper argspec. Thanks to a crash report sent by Etienne
2153 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2158 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2154
2159
2155 2003-12-09 Fernando Perez <fperez@colorado.edu>
2160 2003-12-09 Fernando Perez <fperez@colorado.edu>
2156
2161
2157 * IPython/genutils.py (page): patch for the pager to work across
2162 * IPython/genutils.py (page): patch for the pager to work across
2158 various versions of Windows. By Gary Bishop.
2163 various versions of Windows. By Gary Bishop.
2159
2164
2160 2003-12-04 Fernando Perez <fperez@colorado.edu>
2165 2003-12-04 Fernando Perez <fperez@colorado.edu>
2161
2166
2162 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2167 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2163 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2168 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2164 While I tested this and it looks ok, there may still be corner
2169 While I tested this and it looks ok, there may still be corner
2165 cases I've missed.
2170 cases I've missed.
2166
2171
2167 2003-12-01 Fernando Perez <fperez@colorado.edu>
2172 2003-12-01 Fernando Perez <fperez@colorado.edu>
2168
2173
2169 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2174 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2170 where a line like 'p,q=1,2' would fail because the automagic
2175 where a line like 'p,q=1,2' would fail because the automagic
2171 system would be triggered for @p.
2176 system would be triggered for @p.
2172
2177
2173 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2178 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2174 cleanups, code unmodified.
2179 cleanups, code unmodified.
2175
2180
2176 * IPython/genutils.py (Term): added a class for IPython to handle
2181 * IPython/genutils.py (Term): added a class for IPython to handle
2177 output. In most cases it will just be a proxy for stdout/err, but
2182 output. In most cases it will just be a proxy for stdout/err, but
2178 having this allows modifications to be made for some platforms,
2183 having this allows modifications to be made for some platforms,
2179 such as handling color escapes under Windows. All of this code
2184 such as handling color escapes under Windows. All of this code
2180 was contributed by Gary Bishop, with minor modifications by me.
2185 was contributed by Gary Bishop, with minor modifications by me.
2181 The actual changes affect many files.
2186 The actual changes affect many files.
2182
2187
2183 2003-11-30 Fernando Perez <fperez@colorado.edu>
2188 2003-11-30 Fernando Perez <fperez@colorado.edu>
2184
2189
2185 * IPython/iplib.py (file_matches): new completion code, courtesy
2190 * IPython/iplib.py (file_matches): new completion code, courtesy
2186 of Jeff Collins. This enables filename completion again under
2191 of Jeff Collins. This enables filename completion again under
2187 python 2.3, which disabled it at the C level.
2192 python 2.3, which disabled it at the C level.
2188
2193
2189 2003-11-11 Fernando Perez <fperez@colorado.edu>
2194 2003-11-11 Fernando Perez <fperez@colorado.edu>
2190
2195
2191 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2196 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2192 for Numeric.array(map(...)), but often convenient.
2197 for Numeric.array(map(...)), but often convenient.
2193
2198
2194 2003-11-05 Fernando Perez <fperez@colorado.edu>
2199 2003-11-05 Fernando Perez <fperez@colorado.edu>
2195
2200
2196 * IPython/numutils.py (frange): Changed a call from int() to
2201 * IPython/numutils.py (frange): Changed a call from int() to
2197 int(round()) to prevent a problem reported with arange() in the
2202 int(round()) to prevent a problem reported with arange() in the
2198 numpy list.
2203 numpy list.
2199
2204
2200 2003-10-06 Fernando Perez <fperez@colorado.edu>
2205 2003-10-06 Fernando Perez <fperez@colorado.edu>
2201
2206
2202 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2207 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2203 prevent crashes if sys lacks an argv attribute (it happens with
2208 prevent crashes if sys lacks an argv attribute (it happens with
2204 embedded interpreters which build a bare-bones sys module).
2209 embedded interpreters which build a bare-bones sys module).
2205 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2210 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2206
2211
2207 2003-09-24 Fernando Perez <fperez@colorado.edu>
2212 2003-09-24 Fernando Perez <fperez@colorado.edu>
2208
2213
2209 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2214 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2210 to protect against poorly written user objects where __getattr__
2215 to protect against poorly written user objects where __getattr__
2211 raises exceptions other than AttributeError. Thanks to a bug
2216 raises exceptions other than AttributeError. Thanks to a bug
2212 report by Oliver Sander <osander-AT-gmx.de>.
2217 report by Oliver Sander <osander-AT-gmx.de>.
2213
2218
2214 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2219 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2215 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2220 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2216
2221
2217 2003-09-09 Fernando Perez <fperez@colorado.edu>
2222 2003-09-09 Fernando Perez <fperez@colorado.edu>
2218
2223
2219 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2224 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2220 unpacking a list whith a callable as first element would
2225 unpacking a list whith a callable as first element would
2221 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2226 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2222 Collins.
2227 Collins.
2223
2228
2224 2003-08-25 *** Released version 0.5.0
2229 2003-08-25 *** Released version 0.5.0
2225
2230
2226 2003-08-22 Fernando Perez <fperez@colorado.edu>
2231 2003-08-22 Fernando Perez <fperez@colorado.edu>
2227
2232
2228 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2233 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2229 improperly defined user exceptions. Thanks to feedback from Mark
2234 improperly defined user exceptions. Thanks to feedback from Mark
2230 Russell <mrussell-AT-verio.net>.
2235 Russell <mrussell-AT-verio.net>.
2231
2236
2232 2003-08-20 Fernando Perez <fperez@colorado.edu>
2237 2003-08-20 Fernando Perez <fperez@colorado.edu>
2233
2238
2234 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2239 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2235 printing so that it would print multi-line string forms starting
2240 printing so that it would print multi-line string forms starting
2236 with a new line. This way the formatting is better respected for
2241 with a new line. This way the formatting is better respected for
2237 objects which work hard to make nice string forms.
2242 objects which work hard to make nice string forms.
2238
2243
2239 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2244 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2240 autocall would overtake data access for objects with both
2245 autocall would overtake data access for objects with both
2241 __getitem__ and __call__.
2246 __getitem__ and __call__.
2242
2247
2243 2003-08-19 *** Released version 0.5.0-rc1
2248 2003-08-19 *** Released version 0.5.0-rc1
2244
2249
2245 2003-08-19 Fernando Perez <fperez@colorado.edu>
2250 2003-08-19 Fernando Perez <fperez@colorado.edu>
2246
2251
2247 * IPython/deep_reload.py (load_tail): single tiny change here
2252 * IPython/deep_reload.py (load_tail): single tiny change here
2248 seems to fix the long-standing bug of dreload() failing to work
2253 seems to fix the long-standing bug of dreload() failing to work
2249 for dotted names. But this module is pretty tricky, so I may have
2254 for dotted names. But this module is pretty tricky, so I may have
2250 missed some subtlety. Needs more testing!.
2255 missed some subtlety. Needs more testing!.
2251
2256
2252 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2257 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2253 exceptions which have badly implemented __str__ methods.
2258 exceptions which have badly implemented __str__ methods.
2254 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2259 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2255 which I've been getting reports about from Python 2.3 users. I
2260 which I've been getting reports about from Python 2.3 users. I
2256 wish I had a simple test case to reproduce the problem, so I could
2261 wish I had a simple test case to reproduce the problem, so I could
2257 either write a cleaner workaround or file a bug report if
2262 either write a cleaner workaround or file a bug report if
2258 necessary.
2263 necessary.
2259
2264
2260 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2265 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2261 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2266 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2262 a bug report by Tjabo Kloppenburg.
2267 a bug report by Tjabo Kloppenburg.
2263
2268
2264 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2269 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2265 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2270 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2266 seems rather unstable. Thanks to a bug report by Tjabo
2271 seems rather unstable. Thanks to a bug report by Tjabo
2267 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2272 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2268
2273
2269 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2274 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2270 this out soon because of the critical fixes in the inner loop for
2275 this out soon because of the critical fixes in the inner loop for
2271 generators.
2276 generators.
2272
2277
2273 * IPython/Magic.py (Magic.getargspec): removed. This (and
2278 * IPython/Magic.py (Magic.getargspec): removed. This (and
2274 _get_def) have been obsoleted by OInspect for a long time, I
2279 _get_def) have been obsoleted by OInspect for a long time, I
2275 hadn't noticed that they were dead code.
2280 hadn't noticed that they were dead code.
2276 (Magic._ofind): restored _ofind functionality for a few literals
2281 (Magic._ofind): restored _ofind functionality for a few literals
2277 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2282 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2278 for things like "hello".capitalize?, since that would require a
2283 for things like "hello".capitalize?, since that would require a
2279 potentially dangerous eval() again.
2284 potentially dangerous eval() again.
2280
2285
2281 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2286 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2282 logic a bit more to clean up the escapes handling and minimize the
2287 logic a bit more to clean up the escapes handling and minimize the
2283 use of _ofind to only necessary cases. The interactive 'feel' of
2288 use of _ofind to only necessary cases. The interactive 'feel' of
2284 IPython should have improved quite a bit with the changes in
2289 IPython should have improved quite a bit with the changes in
2285 _prefilter and _ofind (besides being far safer than before).
2290 _prefilter and _ofind (besides being far safer than before).
2286
2291
2287 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2292 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2288 obscure, never reported). Edit would fail to find the object to
2293 obscure, never reported). Edit would fail to find the object to
2289 edit under some circumstances.
2294 edit under some circumstances.
2290 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2295 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2291 which were causing double-calling of generators. Those eval calls
2296 which were causing double-calling of generators. Those eval calls
2292 were _very_ dangerous, since code with side effects could be
2297 were _very_ dangerous, since code with side effects could be
2293 triggered. As they say, 'eval is evil'... These were the
2298 triggered. As they say, 'eval is evil'... These were the
2294 nastiest evals in IPython. Besides, _ofind is now far simpler,
2299 nastiest evals in IPython. Besides, _ofind is now far simpler,
2295 and it should also be quite a bit faster. Its use of inspect is
2300 and it should also be quite a bit faster. Its use of inspect is
2296 also safer, so perhaps some of the inspect-related crashes I've
2301 also safer, so perhaps some of the inspect-related crashes I've
2297 seen lately with Python 2.3 might be taken care of. That will
2302 seen lately with Python 2.3 might be taken care of. That will
2298 need more testing.
2303 need more testing.
2299
2304
2300 2003-08-17 Fernando Perez <fperez@colorado.edu>
2305 2003-08-17 Fernando Perez <fperez@colorado.edu>
2301
2306
2302 * IPython/iplib.py (InteractiveShell._prefilter): significant
2307 * IPython/iplib.py (InteractiveShell._prefilter): significant
2303 simplifications to the logic for handling user escapes. Faster
2308 simplifications to the logic for handling user escapes. Faster
2304 and simpler code.
2309 and simpler code.
2305
2310
2306 2003-08-14 Fernando Perez <fperez@colorado.edu>
2311 2003-08-14 Fernando Perez <fperez@colorado.edu>
2307
2312
2308 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2313 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2309 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2314 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2310 but it should be quite a bit faster. And the recursive version
2315 but it should be quite a bit faster. And the recursive version
2311 generated O(log N) intermediate storage for all rank>1 arrays,
2316 generated O(log N) intermediate storage for all rank>1 arrays,
2312 even if they were contiguous.
2317 even if they were contiguous.
2313 (l1norm): Added this function.
2318 (l1norm): Added this function.
2314 (norm): Added this function for arbitrary norms (including
2319 (norm): Added this function for arbitrary norms (including
2315 l-infinity). l1 and l2 are still special cases for convenience
2320 l-infinity). l1 and l2 are still special cases for convenience
2316 and speed.
2321 and speed.
2317
2322
2318 2003-08-03 Fernando Perez <fperez@colorado.edu>
2323 2003-08-03 Fernando Perez <fperez@colorado.edu>
2319
2324
2320 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2325 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2321 exceptions, which now raise PendingDeprecationWarnings in Python
2326 exceptions, which now raise PendingDeprecationWarnings in Python
2322 2.3. There were some in Magic and some in Gnuplot2.
2327 2.3. There were some in Magic and some in Gnuplot2.
2323
2328
2324 2003-06-30 Fernando Perez <fperez@colorado.edu>
2329 2003-06-30 Fernando Perez <fperez@colorado.edu>
2325
2330
2326 * IPython/genutils.py (page): modified to call curses only for
2331 * IPython/genutils.py (page): modified to call curses only for
2327 terminals where TERM=='xterm'. After problems under many other
2332 terminals where TERM=='xterm'. After problems under many other
2328 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2333 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2329
2334
2330 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2335 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2331 would be triggered when readline was absent. This was just an old
2336 would be triggered when readline was absent. This was just an old
2332 debugging statement I'd forgotten to take out.
2337 debugging statement I'd forgotten to take out.
2333
2338
2334 2003-06-20 Fernando Perez <fperez@colorado.edu>
2339 2003-06-20 Fernando Perez <fperez@colorado.edu>
2335
2340
2336 * IPython/genutils.py (clock): modified to return only user time
2341 * IPython/genutils.py (clock): modified to return only user time
2337 (not counting system time), after a discussion on scipy. While
2342 (not counting system time), after a discussion on scipy. While
2338 system time may be a useful quantity occasionally, it may much
2343 system time may be a useful quantity occasionally, it may much
2339 more easily be skewed by occasional swapping or other similar
2344 more easily be skewed by occasional swapping or other similar
2340 activity.
2345 activity.
2341
2346
2342 2003-06-05 Fernando Perez <fperez@colorado.edu>
2347 2003-06-05 Fernando Perez <fperez@colorado.edu>
2343
2348
2344 * IPython/numutils.py (identity): new function, for building
2349 * IPython/numutils.py (identity): new function, for building
2345 arbitrary rank Kronecker deltas (mostly backwards compatible with
2350 arbitrary rank Kronecker deltas (mostly backwards compatible with
2346 Numeric.identity)
2351 Numeric.identity)
2347
2352
2348 2003-06-03 Fernando Perez <fperez@colorado.edu>
2353 2003-06-03 Fernando Perez <fperez@colorado.edu>
2349
2354
2350 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2355 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2351 arguments passed to magics with spaces, to allow trailing '\' to
2356 arguments passed to magics with spaces, to allow trailing '\' to
2352 work normally (mainly for Windows users).
2357 work normally (mainly for Windows users).
2353
2358
2354 2003-05-29 Fernando Perez <fperez@colorado.edu>
2359 2003-05-29 Fernando Perez <fperez@colorado.edu>
2355
2360
2356 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2361 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2357 instead of pydoc.help. This fixes a bizarre behavior where
2362 instead of pydoc.help. This fixes a bizarre behavior where
2358 printing '%s' % locals() would trigger the help system. Now
2363 printing '%s' % locals() would trigger the help system. Now
2359 ipython behaves like normal python does.
2364 ipython behaves like normal python does.
2360
2365
2361 Note that if one does 'from pydoc import help', the bizarre
2366 Note that if one does 'from pydoc import help', the bizarre
2362 behavior returns, but this will also happen in normal python, so
2367 behavior returns, but this will also happen in normal python, so
2363 it's not an ipython bug anymore (it has to do with how pydoc.help
2368 it's not an ipython bug anymore (it has to do with how pydoc.help
2364 is implemented).
2369 is implemented).
2365
2370
2366 2003-05-22 Fernando Perez <fperez@colorado.edu>
2371 2003-05-22 Fernando Perez <fperez@colorado.edu>
2367
2372
2368 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2373 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2369 return [] instead of None when nothing matches, also match to end
2374 return [] instead of None when nothing matches, also match to end
2370 of line. Patch by Gary Bishop.
2375 of line. Patch by Gary Bishop.
2371
2376
2372 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2377 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2373 protection as before, for files passed on the command line. This
2378 protection as before, for files passed on the command line. This
2374 prevents the CrashHandler from kicking in if user files call into
2379 prevents the CrashHandler from kicking in if user files call into
2375 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2380 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2376 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2381 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2377
2382
2378 2003-05-20 *** Released version 0.4.0
2383 2003-05-20 *** Released version 0.4.0
2379
2384
2380 2003-05-20 Fernando Perez <fperez@colorado.edu>
2385 2003-05-20 Fernando Perez <fperez@colorado.edu>
2381
2386
2382 * setup.py: added support for manpages. It's a bit hackish b/c of
2387 * setup.py: added support for manpages. It's a bit hackish b/c of
2383 a bug in the way the bdist_rpm distutils target handles gzipped
2388 a bug in the way the bdist_rpm distutils target handles gzipped
2384 manpages, but it works. After a patch by Jack.
2389 manpages, but it works. After a patch by Jack.
2385
2390
2386 2003-05-19 Fernando Perez <fperez@colorado.edu>
2391 2003-05-19 Fernando Perez <fperez@colorado.edu>
2387
2392
2388 * IPython/numutils.py: added a mockup of the kinds module, since
2393 * IPython/numutils.py: added a mockup of the kinds module, since
2389 it was recently removed from Numeric. This way, numutils will
2394 it was recently removed from Numeric. This way, numutils will
2390 work for all users even if they are missing kinds.
2395 work for all users even if they are missing kinds.
2391
2396
2392 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2397 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2393 failure, which can occur with SWIG-wrapped extensions. After a
2398 failure, which can occur with SWIG-wrapped extensions. After a
2394 crash report from Prabhu.
2399 crash report from Prabhu.
2395
2400
2396 2003-05-16 Fernando Perez <fperez@colorado.edu>
2401 2003-05-16 Fernando Perez <fperez@colorado.edu>
2397
2402
2398 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2403 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2399 protect ipython from user code which may call directly
2404 protect ipython from user code which may call directly
2400 sys.excepthook (this looks like an ipython crash to the user, even
2405 sys.excepthook (this looks like an ipython crash to the user, even
2401 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2406 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2402 This is especially important to help users of WxWindows, but may
2407 This is especially important to help users of WxWindows, but may
2403 also be useful in other cases.
2408 also be useful in other cases.
2404
2409
2405 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2410 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2406 an optional tb_offset to be specified, and to preserve exception
2411 an optional tb_offset to be specified, and to preserve exception
2407 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2412 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2408
2413
2409 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2414 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2410
2415
2411 2003-05-15 Fernando Perez <fperez@colorado.edu>
2416 2003-05-15 Fernando Perez <fperez@colorado.edu>
2412
2417
2413 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2418 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2414 installing for a new user under Windows.
2419 installing for a new user under Windows.
2415
2420
2416 2003-05-12 Fernando Perez <fperez@colorado.edu>
2421 2003-05-12 Fernando Perez <fperez@colorado.edu>
2417
2422
2418 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2423 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2419 handler for Emacs comint-based lines. Currently it doesn't do
2424 handler for Emacs comint-based lines. Currently it doesn't do
2420 much (but importantly, it doesn't update the history cache). In
2425 much (but importantly, it doesn't update the history cache). In
2421 the future it may be expanded if Alex needs more functionality
2426 the future it may be expanded if Alex needs more functionality
2422 there.
2427 there.
2423
2428
2424 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2429 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2425 info to crash reports.
2430 info to crash reports.
2426
2431
2427 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2432 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2428 just like Python's -c. Also fixed crash with invalid -color
2433 just like Python's -c. Also fixed crash with invalid -color
2429 option value at startup. Thanks to Will French
2434 option value at startup. Thanks to Will French
2430 <wfrench-AT-bestweb.net> for the bug report.
2435 <wfrench-AT-bestweb.net> for the bug report.
2431
2436
2432 2003-05-09 Fernando Perez <fperez@colorado.edu>
2437 2003-05-09 Fernando Perez <fperez@colorado.edu>
2433
2438
2434 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2439 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2435 to EvalDict (it's a mapping, after all) and simplified its code
2440 to EvalDict (it's a mapping, after all) and simplified its code
2436 quite a bit, after a nice discussion on c.l.py where Gustavo
2441 quite a bit, after a nice discussion on c.l.py where Gustavo
2437 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
2442 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
2438
2443
2439 2003-04-30 Fernando Perez <fperez@colorado.edu>
2444 2003-04-30 Fernando Perez <fperez@colorado.edu>
2440
2445
2441 * IPython/genutils.py (timings_out): modified it to reduce its
2446 * IPython/genutils.py (timings_out): modified it to reduce its
2442 overhead in the common reps==1 case.
2447 overhead in the common reps==1 case.
2443
2448
2444 2003-04-29 Fernando Perez <fperez@colorado.edu>
2449 2003-04-29 Fernando Perez <fperez@colorado.edu>
2445
2450
2446 * IPython/genutils.py (timings_out): Modified to use the resource
2451 * IPython/genutils.py (timings_out): Modified to use the resource
2447 module, which avoids the wraparound problems of time.clock().
2452 module, which avoids the wraparound problems of time.clock().
2448
2453
2449 2003-04-17 *** Released version 0.2.15pre4
2454 2003-04-17 *** Released version 0.2.15pre4
2450
2455
2451 2003-04-17 Fernando Perez <fperez@colorado.edu>
2456 2003-04-17 Fernando Perez <fperez@colorado.edu>
2452
2457
2453 * setup.py (scriptfiles): Split windows-specific stuff over to a
2458 * setup.py (scriptfiles): Split windows-specific stuff over to a
2454 separate file, in an attempt to have a Windows GUI installer.
2459 separate file, in an attempt to have a Windows GUI installer.
2455 That didn't work, but part of the groundwork is done.
2460 That didn't work, but part of the groundwork is done.
2456
2461
2457 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
2462 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
2458 indent/unindent with 4 spaces. Particularly useful in combination
2463 indent/unindent with 4 spaces. Particularly useful in combination
2459 with the new auto-indent option.
2464 with the new auto-indent option.
2460
2465
2461 2003-04-16 Fernando Perez <fperez@colorado.edu>
2466 2003-04-16 Fernando Perez <fperez@colorado.edu>
2462
2467
2463 * IPython/Magic.py: various replacements of self.rc for
2468 * IPython/Magic.py: various replacements of self.rc for
2464 self.shell.rc. A lot more remains to be done to fully disentangle
2469 self.shell.rc. A lot more remains to be done to fully disentangle
2465 this class from the main Shell class.
2470 this class from the main Shell class.
2466
2471
2467 * IPython/GnuplotRuntime.py: added checks for mouse support so
2472 * IPython/GnuplotRuntime.py: added checks for mouse support so
2468 that we don't try to enable it if the current gnuplot doesn't
2473 that we don't try to enable it if the current gnuplot doesn't
2469 really support it. Also added checks so that we don't try to
2474 really support it. Also added checks so that we don't try to
2470 enable persist under Windows (where Gnuplot doesn't recognize the
2475 enable persist under Windows (where Gnuplot doesn't recognize the
2471 option).
2476 option).
2472
2477
2473 * IPython/iplib.py (InteractiveShell.interact): Added optional
2478 * IPython/iplib.py (InteractiveShell.interact): Added optional
2474 auto-indenting code, after a patch by King C. Shu
2479 auto-indenting code, after a patch by King C. Shu
2475 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
2480 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
2476 get along well with pasting indented code. If I ever figure out
2481 get along well with pasting indented code. If I ever figure out
2477 how to make that part go well, it will become on by default.
2482 how to make that part go well, it will become on by default.
2478
2483
2479 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
2484 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
2480 crash ipython if there was an unmatched '%' in the user's prompt
2485 crash ipython if there was an unmatched '%' in the user's prompt
2481 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2486 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2482
2487
2483 * IPython/iplib.py (InteractiveShell.interact): removed the
2488 * IPython/iplib.py (InteractiveShell.interact): removed the
2484 ability to ask the user whether he wants to crash or not at the
2489 ability to ask the user whether he wants to crash or not at the
2485 'last line' exception handler. Calling functions at that point
2490 'last line' exception handler. Calling functions at that point
2486 changes the stack, and the error reports would have incorrect
2491 changes the stack, and the error reports would have incorrect
2487 tracebacks.
2492 tracebacks.
2488
2493
2489 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
2494 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
2490 pass through a peger a pretty-printed form of any object. After a
2495 pass through a peger a pretty-printed form of any object. After a
2491 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
2496 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
2492
2497
2493 2003-04-14 Fernando Perez <fperez@colorado.edu>
2498 2003-04-14 Fernando Perez <fperez@colorado.edu>
2494
2499
2495 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
2500 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
2496 all files in ~ would be modified at first install (instead of
2501 all files in ~ would be modified at first install (instead of
2497 ~/.ipython). This could be potentially disastrous, as the
2502 ~/.ipython). This could be potentially disastrous, as the
2498 modification (make line-endings native) could damage binary files.
2503 modification (make line-endings native) could damage binary files.
2499
2504
2500 2003-04-10 Fernando Perez <fperez@colorado.edu>
2505 2003-04-10 Fernando Perez <fperez@colorado.edu>
2501
2506
2502 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
2507 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
2503 handle only lines which are invalid python. This now means that
2508 handle only lines which are invalid python. This now means that
2504 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
2509 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
2505 for the bug report.
2510 for the bug report.
2506
2511
2507 2003-04-01 Fernando Perez <fperez@colorado.edu>
2512 2003-04-01 Fernando Perez <fperez@colorado.edu>
2508
2513
2509 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
2514 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
2510 where failing to set sys.last_traceback would crash pdb.pm().
2515 where failing to set sys.last_traceback would crash pdb.pm().
2511 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
2516 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
2512 report.
2517 report.
2513
2518
2514 2003-03-25 Fernando Perez <fperez@colorado.edu>
2519 2003-03-25 Fernando Perez <fperez@colorado.edu>
2515
2520
2516 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
2521 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
2517 before printing it (it had a lot of spurious blank lines at the
2522 before printing it (it had a lot of spurious blank lines at the
2518 end).
2523 end).
2519
2524
2520 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
2525 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
2521 output would be sent 21 times! Obviously people don't use this
2526 output would be sent 21 times! Obviously people don't use this
2522 too often, or I would have heard about it.
2527 too often, or I would have heard about it.
2523
2528
2524 2003-03-24 Fernando Perez <fperez@colorado.edu>
2529 2003-03-24 Fernando Perez <fperez@colorado.edu>
2525
2530
2526 * setup.py (scriptfiles): renamed the data_files parameter from
2531 * setup.py (scriptfiles): renamed the data_files parameter from
2527 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
2532 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
2528 for the patch.
2533 for the patch.
2529
2534
2530 2003-03-20 Fernando Perez <fperez@colorado.edu>
2535 2003-03-20 Fernando Perez <fperez@colorado.edu>
2531
2536
2532 * IPython/genutils.py (error): added error() and fatal()
2537 * IPython/genutils.py (error): added error() and fatal()
2533 functions.
2538 functions.
2534
2539
2535 2003-03-18 *** Released version 0.2.15pre3
2540 2003-03-18 *** Released version 0.2.15pre3
2536
2541
2537 2003-03-18 Fernando Perez <fperez@colorado.edu>
2542 2003-03-18 Fernando Perez <fperez@colorado.edu>
2538
2543
2539 * setupext/install_data_ext.py
2544 * setupext/install_data_ext.py
2540 (install_data_ext.initialize_options): Class contributed by Jack
2545 (install_data_ext.initialize_options): Class contributed by Jack
2541 Moffit for fixing the old distutils hack. He is sending this to
2546 Moffit for fixing the old distutils hack. He is sending this to
2542 the distutils folks so in the future we may not need it as a
2547 the distutils folks so in the future we may not need it as a
2543 private fix.
2548 private fix.
2544
2549
2545 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
2550 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
2546 changes for Debian packaging. See his patch for full details.
2551 changes for Debian packaging. See his patch for full details.
2547 The old distutils hack of making the ipythonrc* files carry a
2552 The old distutils hack of making the ipythonrc* files carry a
2548 bogus .py extension is gone, at last. Examples were moved to a
2553 bogus .py extension is gone, at last. Examples were moved to a
2549 separate subdir under doc/, and the separate executable scripts
2554 separate subdir under doc/, and the separate executable scripts
2550 now live in their own directory. Overall a great cleanup. The
2555 now live in their own directory. Overall a great cleanup. The
2551 manual was updated to use the new files, and setup.py has been
2556 manual was updated to use the new files, and setup.py has been
2552 fixed for this setup.
2557 fixed for this setup.
2553
2558
2554 * IPython/PyColorize.py (Parser.usage): made non-executable and
2559 * IPython/PyColorize.py (Parser.usage): made non-executable and
2555 created a pycolor wrapper around it to be included as a script.
2560 created a pycolor wrapper around it to be included as a script.
2556
2561
2557 2003-03-12 *** Released version 0.2.15pre2
2562 2003-03-12 *** Released version 0.2.15pre2
2558
2563
2559 2003-03-12 Fernando Perez <fperez@colorado.edu>
2564 2003-03-12 Fernando Perez <fperez@colorado.edu>
2560
2565
2561 * IPython/ColorANSI.py (make_color_table): Finally fixed the
2566 * IPython/ColorANSI.py (make_color_table): Finally fixed the
2562 long-standing problem with garbage characters in some terminals.
2567 long-standing problem with garbage characters in some terminals.
2563 The issue was really that the \001 and \002 escapes must _only_ be
2568 The issue was really that the \001 and \002 escapes must _only_ be
2564 passed to input prompts (which call readline), but _never_ to
2569 passed to input prompts (which call readline), but _never_ to
2565 normal text to be printed on screen. I changed ColorANSI to have
2570 normal text to be printed on screen. I changed ColorANSI to have
2566 two classes: TermColors and InputTermColors, each with the
2571 two classes: TermColors and InputTermColors, each with the
2567 appropriate escapes for input prompts or normal text. The code in
2572 appropriate escapes for input prompts or normal text. The code in
2568 Prompts.py got slightly more complicated, but this very old and
2573 Prompts.py got slightly more complicated, but this very old and
2569 annoying bug is finally fixed.
2574 annoying bug is finally fixed.
2570
2575
2571 All the credit for nailing down the real origin of this problem
2576 All the credit for nailing down the real origin of this problem
2572 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
2577 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
2573 *Many* thanks to him for spending quite a bit of effort on this.
2578 *Many* thanks to him for spending quite a bit of effort on this.
2574
2579
2575 2003-03-05 *** Released version 0.2.15pre1
2580 2003-03-05 *** Released version 0.2.15pre1
2576
2581
2577 2003-03-03 Fernando Perez <fperez@colorado.edu>
2582 2003-03-03 Fernando Perez <fperez@colorado.edu>
2578
2583
2579 * IPython/FakeModule.py: Moved the former _FakeModule to a
2584 * IPython/FakeModule.py: Moved the former _FakeModule to a
2580 separate file, because it's also needed by Magic (to fix a similar
2585 separate file, because it's also needed by Magic (to fix a similar
2581 pickle-related issue in @run).
2586 pickle-related issue in @run).
2582
2587
2583 2003-03-02 Fernando Perez <fperez@colorado.edu>
2588 2003-03-02 Fernando Perez <fperez@colorado.edu>
2584
2589
2585 * IPython/Magic.py (Magic.magic_autocall): new magic to control
2590 * IPython/Magic.py (Magic.magic_autocall): new magic to control
2586 the autocall option at runtime.
2591 the autocall option at runtime.
2587 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
2592 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
2588 across Magic.py to start separating Magic from InteractiveShell.
2593 across Magic.py to start separating Magic from InteractiveShell.
2589 (Magic._ofind): Fixed to return proper namespace for dotted
2594 (Magic._ofind): Fixed to return proper namespace for dotted
2590 names. Before, a dotted name would always return 'not currently
2595 names. Before, a dotted name would always return 'not currently
2591 defined', because it would find the 'parent'. s.x would be found,
2596 defined', because it would find the 'parent'. s.x would be found,
2592 but since 'x' isn't defined by itself, it would get confused.
2597 but since 'x' isn't defined by itself, it would get confused.
2593 (Magic.magic_run): Fixed pickling problems reported by Ralf
2598 (Magic.magic_run): Fixed pickling problems reported by Ralf
2594 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
2599 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
2595 that I'd used when Mike Heeter reported similar issues at the
2600 that I'd used when Mike Heeter reported similar issues at the
2596 top-level, but now for @run. It boils down to injecting the
2601 top-level, but now for @run. It boils down to injecting the
2597 namespace where code is being executed with something that looks
2602 namespace where code is being executed with something that looks
2598 enough like a module to fool pickle.dump(). Since a pickle stores
2603 enough like a module to fool pickle.dump(). Since a pickle stores
2599 a named reference to the importing module, we need this for
2604 a named reference to the importing module, we need this for
2600 pickles to save something sensible.
2605 pickles to save something sensible.
2601
2606
2602 * IPython/ipmaker.py (make_IPython): added an autocall option.
2607 * IPython/ipmaker.py (make_IPython): added an autocall option.
2603
2608
2604 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
2609 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
2605 the auto-eval code. Now autocalling is an option, and the code is
2610 the auto-eval code. Now autocalling is an option, and the code is
2606 also vastly safer. There is no more eval() involved at all.
2611 also vastly safer. There is no more eval() involved at all.
2607
2612
2608 2003-03-01 Fernando Perez <fperez@colorado.edu>
2613 2003-03-01 Fernando Perez <fperez@colorado.edu>
2609
2614
2610 * IPython/Magic.py (Magic._ofind): Changed interface to return a
2615 * IPython/Magic.py (Magic._ofind): Changed interface to return a
2611 dict with named keys instead of a tuple.
2616 dict with named keys instead of a tuple.
2612
2617
2613 * IPython: Started using CVS for IPython as of 0.2.15pre1.
2618 * IPython: Started using CVS for IPython as of 0.2.15pre1.
2614
2619
2615 * setup.py (make_shortcut): Fixed message about directories
2620 * setup.py (make_shortcut): Fixed message about directories
2616 created during Windows installation (the directories were ok, just
2621 created during Windows installation (the directories were ok, just
2617 the printed message was misleading). Thanks to Chris Liechti
2622 the printed message was misleading). Thanks to Chris Liechti
2618 <cliechti-AT-gmx.net> for the heads up.
2623 <cliechti-AT-gmx.net> for the heads up.
2619
2624
2620 2003-02-21 Fernando Perez <fperez@colorado.edu>
2625 2003-02-21 Fernando Perez <fperez@colorado.edu>
2621
2626
2622 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
2627 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
2623 of ValueError exception when checking for auto-execution. This
2628 of ValueError exception when checking for auto-execution. This
2624 one is raised by things like Numeric arrays arr.flat when the
2629 one is raised by things like Numeric arrays arr.flat when the
2625 array is non-contiguous.
2630 array is non-contiguous.
2626
2631
2627 2003-01-31 Fernando Perez <fperez@colorado.edu>
2632 2003-01-31 Fernando Perez <fperez@colorado.edu>
2628
2633
2629 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
2634 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
2630 not return any value at all (even though the command would get
2635 not return any value at all (even though the command would get
2631 executed).
2636 executed).
2632 (xsys): Flush stdout right after printing the command to ensure
2637 (xsys): Flush stdout right after printing the command to ensure
2633 proper ordering of commands and command output in the total
2638 proper ordering of commands and command output in the total
2634 output.
2639 output.
2635 (SystemExec/xsys/bq): Switched the names of xsys/bq and
2640 (SystemExec/xsys/bq): Switched the names of xsys/bq and
2636 system/getoutput as defaults. The old ones are kept for
2641 system/getoutput as defaults. The old ones are kept for
2637 compatibility reasons, so no code which uses this library needs
2642 compatibility reasons, so no code which uses this library needs
2638 changing.
2643 changing.
2639
2644
2640 2003-01-27 *** Released version 0.2.14
2645 2003-01-27 *** Released version 0.2.14
2641
2646
2642 2003-01-25 Fernando Perez <fperez@colorado.edu>
2647 2003-01-25 Fernando Perez <fperez@colorado.edu>
2643
2648
2644 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
2649 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
2645 functions defined in previous edit sessions could not be re-edited
2650 functions defined in previous edit sessions could not be re-edited
2646 (because the temp files were immediately removed). Now temp files
2651 (because the temp files were immediately removed). Now temp files
2647 are removed only at IPython's exit.
2652 are removed only at IPython's exit.
2648 (Magic.magic_run): Improved @run to perform shell-like expansions
2653 (Magic.magic_run): Improved @run to perform shell-like expansions
2649 on its arguments (~users and $VARS). With this, @run becomes more
2654 on its arguments (~users and $VARS). With this, @run becomes more
2650 like a normal command-line.
2655 like a normal command-line.
2651
2656
2652 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
2657 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
2653 bugs related to embedding and cleaned up that code. A fairly
2658 bugs related to embedding and cleaned up that code. A fairly
2654 important one was the impossibility to access the global namespace
2659 important one was the impossibility to access the global namespace
2655 through the embedded IPython (only local variables were visible).
2660 through the embedded IPython (only local variables were visible).
2656
2661
2657 2003-01-14 Fernando Perez <fperez@colorado.edu>
2662 2003-01-14 Fernando Perez <fperez@colorado.edu>
2658
2663
2659 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
2664 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
2660 auto-calling to be a bit more conservative. Now it doesn't get
2665 auto-calling to be a bit more conservative. Now it doesn't get
2661 triggered if any of '!=()<>' are in the rest of the input line, to
2666 triggered if any of '!=()<>' are in the rest of the input line, to
2662 allow comparing callables. Thanks to Alex for the heads up.
2667 allow comparing callables. Thanks to Alex for the heads up.
2663
2668
2664 2003-01-07 Fernando Perez <fperez@colorado.edu>
2669 2003-01-07 Fernando Perez <fperez@colorado.edu>
2665
2670
2666 * IPython/genutils.py (page): fixed estimation of the number of
2671 * IPython/genutils.py (page): fixed estimation of the number of
2667 lines in a string to be paged to simply count newlines. This
2672 lines in a string to be paged to simply count newlines. This
2668 prevents over-guessing due to embedded escape sequences. A better
2673 prevents over-guessing due to embedded escape sequences. A better
2669 long-term solution would involve stripping out the control chars
2674 long-term solution would involve stripping out the control chars
2670 for the count, but it's potentially so expensive I just don't
2675 for the count, but it's potentially so expensive I just don't
2671 think it's worth doing.
2676 think it's worth doing.
2672
2677
2673 2002-12-19 *** Released version 0.2.14pre50
2678 2002-12-19 *** Released version 0.2.14pre50
2674
2679
2675 2002-12-19 Fernando Perez <fperez@colorado.edu>
2680 2002-12-19 Fernando Perez <fperez@colorado.edu>
2676
2681
2677 * tools/release (version): Changed release scripts to inform
2682 * tools/release (version): Changed release scripts to inform
2678 Andrea and build a NEWS file with a list of recent changes.
2683 Andrea and build a NEWS file with a list of recent changes.
2679
2684
2680 * IPython/ColorANSI.py (__all__): changed terminal detection
2685 * IPython/ColorANSI.py (__all__): changed terminal detection
2681 code. Seems to work better for xterms without breaking
2686 code. Seems to work better for xterms without breaking
2682 konsole. Will need more testing to determine if WinXP and Mac OSX
2687 konsole. Will need more testing to determine if WinXP and Mac OSX
2683 also work ok.
2688 also work ok.
2684
2689
2685 2002-12-18 *** Released version 0.2.14pre49
2690 2002-12-18 *** Released version 0.2.14pre49
2686
2691
2687 2002-12-18 Fernando Perez <fperez@colorado.edu>
2692 2002-12-18 Fernando Perez <fperez@colorado.edu>
2688
2693
2689 * Docs: added new info about Mac OSX, from Andrea.
2694 * Docs: added new info about Mac OSX, from Andrea.
2690
2695
2691 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
2696 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
2692 allow direct plotting of python strings whose format is the same
2697 allow direct plotting of python strings whose format is the same
2693 of gnuplot data files.
2698 of gnuplot data files.
2694
2699
2695 2002-12-16 Fernando Perez <fperez@colorado.edu>
2700 2002-12-16 Fernando Perez <fperez@colorado.edu>
2696
2701
2697 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
2702 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
2698 value of exit question to be acknowledged.
2703 value of exit question to be acknowledged.
2699
2704
2700 2002-12-03 Fernando Perez <fperez@colorado.edu>
2705 2002-12-03 Fernando Perez <fperez@colorado.edu>
2701
2706
2702 * IPython/ipmaker.py: removed generators, which had been added
2707 * IPython/ipmaker.py: removed generators, which had been added
2703 by mistake in an earlier debugging run. This was causing trouble
2708 by mistake in an earlier debugging run. This was causing trouble
2704 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
2709 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
2705 for pointing this out.
2710 for pointing this out.
2706
2711
2707 2002-11-17 Fernando Perez <fperez@colorado.edu>
2712 2002-11-17 Fernando Perez <fperez@colorado.edu>
2708
2713
2709 * Manual: updated the Gnuplot section.
2714 * Manual: updated the Gnuplot section.
2710
2715
2711 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
2716 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
2712 a much better split of what goes in Runtime and what goes in
2717 a much better split of what goes in Runtime and what goes in
2713 Interactive.
2718 Interactive.
2714
2719
2715 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
2720 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
2716 being imported from iplib.
2721 being imported from iplib.
2717
2722
2718 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
2723 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
2719 for command-passing. Now the global Gnuplot instance is called
2724 for command-passing. Now the global Gnuplot instance is called
2720 'gp' instead of 'g', which was really a far too fragile and
2725 'gp' instead of 'g', which was really a far too fragile and
2721 common name.
2726 common name.
2722
2727
2723 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
2728 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
2724 bounding boxes generated by Gnuplot for square plots.
2729 bounding boxes generated by Gnuplot for square plots.
2725
2730
2726 * IPython/genutils.py (popkey): new function added. I should
2731 * IPython/genutils.py (popkey): new function added. I should
2727 suggest this on c.l.py as a dict method, it seems useful.
2732 suggest this on c.l.py as a dict method, it seems useful.
2728
2733
2729 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
2734 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
2730 to transparently handle PostScript generation. MUCH better than
2735 to transparently handle PostScript generation. MUCH better than
2731 the previous plot_eps/replot_eps (which I removed now). The code
2736 the previous plot_eps/replot_eps (which I removed now). The code
2732 is also fairly clean and well documented now (including
2737 is also fairly clean and well documented now (including
2733 docstrings).
2738 docstrings).
2734
2739
2735 2002-11-13 Fernando Perez <fperez@colorado.edu>
2740 2002-11-13 Fernando Perez <fperez@colorado.edu>
2736
2741
2737 * IPython/Magic.py (Magic.magic_edit): fixed docstring
2742 * IPython/Magic.py (Magic.magic_edit): fixed docstring
2738 (inconsistent with options).
2743 (inconsistent with options).
2739
2744
2740 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
2745 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
2741 manually disabled, I don't know why. Fixed it.
2746 manually disabled, I don't know why. Fixed it.
2742 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
2747 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
2743 eps output.
2748 eps output.
2744
2749
2745 2002-11-12 Fernando Perez <fperez@colorado.edu>
2750 2002-11-12 Fernando Perez <fperez@colorado.edu>
2746
2751
2747 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
2752 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
2748 don't propagate up to caller. Fixes crash reported by François
2753 don't propagate up to caller. Fixes crash reported by François
2749 Pinard.
2754 Pinard.
2750
2755
2751 2002-11-09 Fernando Perez <fperez@colorado.edu>
2756 2002-11-09 Fernando Perez <fperez@colorado.edu>
2752
2757
2753 * IPython/ipmaker.py (make_IPython): fixed problem with writing
2758 * IPython/ipmaker.py (make_IPython): fixed problem with writing
2754 history file for new users.
2759 history file for new users.
2755 (make_IPython): fixed bug where initial install would leave the
2760 (make_IPython): fixed bug where initial install would leave the
2756 user running in the .ipython dir.
2761 user running in the .ipython dir.
2757 (make_IPython): fixed bug where config dir .ipython would be
2762 (make_IPython): fixed bug where config dir .ipython would be
2758 created regardless of the given -ipythondir option. Thanks to Cory
2763 created regardless of the given -ipythondir option. Thanks to Cory
2759 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
2764 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
2760
2765
2761 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
2766 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
2762 type confirmations. Will need to use it in all of IPython's code
2767 type confirmations. Will need to use it in all of IPython's code
2763 consistently.
2768 consistently.
2764
2769
2765 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
2770 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
2766 context to print 31 lines instead of the default 5. This will make
2771 context to print 31 lines instead of the default 5. This will make
2767 the crash reports extremely detailed in case the problem is in
2772 the crash reports extremely detailed in case the problem is in
2768 libraries I don't have access to.
2773 libraries I don't have access to.
2769
2774
2770 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
2775 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
2771 line of defense' code to still crash, but giving users fair
2776 line of defense' code to still crash, but giving users fair
2772 warning. I don't want internal errors to go unreported: if there's
2777 warning. I don't want internal errors to go unreported: if there's
2773 an internal problem, IPython should crash and generate a full
2778 an internal problem, IPython should crash and generate a full
2774 report.
2779 report.
2775
2780
2776 2002-11-08 Fernando Perez <fperez@colorado.edu>
2781 2002-11-08 Fernando Perez <fperez@colorado.edu>
2777
2782
2778 * IPython/iplib.py (InteractiveShell.interact): added code to trap
2783 * IPython/iplib.py (InteractiveShell.interact): added code to trap
2779 otherwise uncaught exceptions which can appear if people set
2784 otherwise uncaught exceptions which can appear if people set
2780 sys.stdout to something badly broken. Thanks to a crash report
2785 sys.stdout to something badly broken. Thanks to a crash report
2781 from henni-AT-mail.brainbot.com.
2786 from henni-AT-mail.brainbot.com.
2782
2787
2783 2002-11-04 Fernando Perez <fperez@colorado.edu>
2788 2002-11-04 Fernando Perez <fperez@colorado.edu>
2784
2789
2785 * IPython/iplib.py (InteractiveShell.interact): added
2790 * IPython/iplib.py (InteractiveShell.interact): added
2786 __IPYTHON__active to the builtins. It's a flag which goes on when
2791 __IPYTHON__active to the builtins. It's a flag which goes on when
2787 the interaction starts and goes off again when it stops. This
2792 the interaction starts and goes off again when it stops. This
2788 allows embedding code to detect being inside IPython. Before this
2793 allows embedding code to detect being inside IPython. Before this
2789 was done via __IPYTHON__, but that only shows that an IPython
2794 was done via __IPYTHON__, but that only shows that an IPython
2790 instance has been created.
2795 instance has been created.
2791
2796
2792 * IPython/Magic.py (Magic.magic_env): I realized that in a
2797 * IPython/Magic.py (Magic.magic_env): I realized that in a
2793 UserDict, instance.data holds the data as a normal dict. So I
2798 UserDict, instance.data holds the data as a normal dict. So I
2794 modified @env to return os.environ.data instead of rebuilding a
2799 modified @env to return os.environ.data instead of rebuilding a
2795 dict by hand.
2800 dict by hand.
2796
2801
2797 2002-11-02 Fernando Perez <fperez@colorado.edu>
2802 2002-11-02 Fernando Perez <fperez@colorado.edu>
2798
2803
2799 * IPython/genutils.py (warn): changed so that level 1 prints no
2804 * IPython/genutils.py (warn): changed so that level 1 prints no
2800 header. Level 2 is now the default (with 'WARNING' header, as
2805 header. Level 2 is now the default (with 'WARNING' header, as
2801 before). I think I tracked all places where changes were needed in
2806 before). I think I tracked all places where changes were needed in
2802 IPython, but outside code using the old level numbering may have
2807 IPython, but outside code using the old level numbering may have
2803 broken.
2808 broken.
2804
2809
2805 * IPython/iplib.py (InteractiveShell.runcode): added this to
2810 * IPython/iplib.py (InteractiveShell.runcode): added this to
2806 handle the tracebacks in SystemExit traps correctly. The previous
2811 handle the tracebacks in SystemExit traps correctly. The previous
2807 code (through interact) was printing more of the stack than
2812 code (through interact) was printing more of the stack than
2808 necessary, showing IPython internal code to the user.
2813 necessary, showing IPython internal code to the user.
2809
2814
2810 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
2815 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
2811 default. Now that the default at the confirmation prompt is yes,
2816 default. Now that the default at the confirmation prompt is yes,
2812 it's not so intrusive. François' argument that ipython sessions
2817 it's not so intrusive. François' argument that ipython sessions
2813 tend to be complex enough not to lose them from an accidental C-d,
2818 tend to be complex enough not to lose them from an accidental C-d,
2814 is a valid one.
2819 is a valid one.
2815
2820
2816 * IPython/iplib.py (InteractiveShell.interact): added a
2821 * IPython/iplib.py (InteractiveShell.interact): added a
2817 showtraceback() call to the SystemExit trap, and modified the exit
2822 showtraceback() call to the SystemExit trap, and modified the exit
2818 confirmation to have yes as the default.
2823 confirmation to have yes as the default.
2819
2824
2820 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
2825 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
2821 this file. It's been gone from the code for a long time, this was
2826 this file. It's been gone from the code for a long time, this was
2822 simply leftover junk.
2827 simply leftover junk.
2823
2828
2824 2002-11-01 Fernando Perez <fperez@colorado.edu>
2829 2002-11-01 Fernando Perez <fperez@colorado.edu>
2825
2830
2826 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
2831 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
2827 added. If set, IPython now traps EOF and asks for
2832 added. If set, IPython now traps EOF and asks for
2828 confirmation. After a request by François Pinard.
2833 confirmation. After a request by François Pinard.
2829
2834
2830 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
2835 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
2831 of @abort, and with a new (better) mechanism for handling the
2836 of @abort, and with a new (better) mechanism for handling the
2832 exceptions.
2837 exceptions.
2833
2838
2834 2002-10-27 Fernando Perez <fperez@colorado.edu>
2839 2002-10-27 Fernando Perez <fperez@colorado.edu>
2835
2840
2836 * IPython/usage.py (__doc__): updated the --help information and
2841 * IPython/usage.py (__doc__): updated the --help information and
2837 the ipythonrc file to indicate that -log generates
2842 the ipythonrc file to indicate that -log generates
2838 ./ipython.log. Also fixed the corresponding info in @logstart.
2843 ./ipython.log. Also fixed the corresponding info in @logstart.
2839 This and several other fixes in the manuals thanks to reports by
2844 This and several other fixes in the manuals thanks to reports by
2840 François Pinard <pinard-AT-iro.umontreal.ca>.
2845 François Pinard <pinard-AT-iro.umontreal.ca>.
2841
2846
2842 * IPython/Logger.py (Logger.switch_log): Fixed error message to
2847 * IPython/Logger.py (Logger.switch_log): Fixed error message to
2843 refer to @logstart (instead of @log, which doesn't exist).
2848 refer to @logstart (instead of @log, which doesn't exist).
2844
2849
2845 * IPython/iplib.py (InteractiveShell._prefilter): fixed
2850 * IPython/iplib.py (InteractiveShell._prefilter): fixed
2846 AttributeError crash. Thanks to Christopher Armstrong
2851 AttributeError crash. Thanks to Christopher Armstrong
2847 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
2852 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
2848 introduced recently (in 0.2.14pre37) with the fix to the eval
2853 introduced recently (in 0.2.14pre37) with the fix to the eval
2849 problem mentioned below.
2854 problem mentioned below.
2850
2855
2851 2002-10-17 Fernando Perez <fperez@colorado.edu>
2856 2002-10-17 Fernando Perez <fperez@colorado.edu>
2852
2857
2853 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
2858 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
2854 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
2859 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
2855
2860
2856 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
2861 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
2857 this function to fix a problem reported by Alex Schmolck. He saw
2862 this function to fix a problem reported by Alex Schmolck. He saw
2858 it with list comprehensions and generators, which were getting
2863 it with list comprehensions and generators, which were getting
2859 called twice. The real problem was an 'eval' call in testing for
2864 called twice. The real problem was an 'eval' call in testing for
2860 automagic which was evaluating the input line silently.
2865 automagic which was evaluating the input line silently.
2861
2866
2862 This is a potentially very nasty bug, if the input has side
2867 This is a potentially very nasty bug, if the input has side
2863 effects which must not be repeated. The code is much cleaner now,
2868 effects which must not be repeated. The code is much cleaner now,
2864 without any blanket 'except' left and with a regexp test for
2869 without any blanket 'except' left and with a regexp test for
2865 actual function names.
2870 actual function names.
2866
2871
2867 But an eval remains, which I'm not fully comfortable with. I just
2872 But an eval remains, which I'm not fully comfortable with. I just
2868 don't know how to find out if an expression could be a callable in
2873 don't know how to find out if an expression could be a callable in
2869 the user's namespace without doing an eval on the string. However
2874 the user's namespace without doing an eval on the string. However
2870 that string is now much more strictly checked so that no code
2875 that string is now much more strictly checked so that no code
2871 slips by, so the eval should only happen for things that can
2876 slips by, so the eval should only happen for things that can
2872 really be only function/method names.
2877 really be only function/method names.
2873
2878
2874 2002-10-15 Fernando Perez <fperez@colorado.edu>
2879 2002-10-15 Fernando Perez <fperez@colorado.edu>
2875
2880
2876 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
2881 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
2877 OSX information to main manual, removed README_Mac_OSX file from
2882 OSX information to main manual, removed README_Mac_OSX file from
2878 distribution. Also updated credits for recent additions.
2883 distribution. Also updated credits for recent additions.
2879
2884
2880 2002-10-10 Fernando Perez <fperez@colorado.edu>
2885 2002-10-10 Fernando Perez <fperez@colorado.edu>
2881
2886
2882 * README_Mac_OSX: Added a README for Mac OSX users for fixing
2887 * README_Mac_OSX: Added a README for Mac OSX users for fixing
2883 terminal-related issues. Many thanks to Andrea Riciputi
2888 terminal-related issues. Many thanks to Andrea Riciputi
2884 <andrea.riciputi-AT-libero.it> for writing it.
2889 <andrea.riciputi-AT-libero.it> for writing it.
2885
2890
2886 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
2891 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
2887 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2892 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2888
2893
2889 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
2894 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
2890 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
2895 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
2891 <syver-en-AT-online.no> who both submitted patches for this problem.
2896 <syver-en-AT-online.no> who both submitted patches for this problem.
2892
2897
2893 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
2898 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
2894 global embedding to make sure that things don't overwrite user
2899 global embedding to make sure that things don't overwrite user
2895 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
2900 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
2896
2901
2897 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
2902 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
2898 compatibility. Thanks to Hayden Callow
2903 compatibility. Thanks to Hayden Callow
2899 <h.callow-AT-elec.canterbury.ac.nz>
2904 <h.callow-AT-elec.canterbury.ac.nz>
2900
2905
2901 2002-10-04 Fernando Perez <fperez@colorado.edu>
2906 2002-10-04 Fernando Perez <fperez@colorado.edu>
2902
2907
2903 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
2908 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
2904 Gnuplot.File objects.
2909 Gnuplot.File objects.
2905
2910
2906 2002-07-23 Fernando Perez <fperez@colorado.edu>
2911 2002-07-23 Fernando Perez <fperez@colorado.edu>
2907
2912
2908 * IPython/genutils.py (timing): Added timings() and timing() for
2913 * IPython/genutils.py (timing): Added timings() and timing() for
2909 quick access to the most commonly needed data, the execution
2914 quick access to the most commonly needed data, the execution
2910 times. Old timing() renamed to timings_out().
2915 times. Old timing() renamed to timings_out().
2911
2916
2912 2002-07-18 Fernando Perez <fperez@colorado.edu>
2917 2002-07-18 Fernando Perez <fperez@colorado.edu>
2913
2918
2914 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
2919 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
2915 bug with nested instances disrupting the parent's tab completion.
2920 bug with nested instances disrupting the parent's tab completion.
2916
2921
2917 * IPython/iplib.py (all_completions): Added Alex Schmolck's
2922 * IPython/iplib.py (all_completions): Added Alex Schmolck's
2918 all_completions code to begin the emacs integration.
2923 all_completions code to begin the emacs integration.
2919
2924
2920 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
2925 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
2921 argument to allow titling individual arrays when plotting.
2926 argument to allow titling individual arrays when plotting.
2922
2927
2923 2002-07-15 Fernando Perez <fperez@colorado.edu>
2928 2002-07-15 Fernando Perez <fperez@colorado.edu>
2924
2929
2925 * setup.py (make_shortcut): changed to retrieve the value of
2930 * setup.py (make_shortcut): changed to retrieve the value of
2926 'Program Files' directory from the registry (this value changes in
2931 'Program Files' directory from the registry (this value changes in
2927 non-english versions of Windows). Thanks to Thomas Fanslau
2932 non-english versions of Windows). Thanks to Thomas Fanslau
2928 <tfanslau-AT-gmx.de> for the report.
2933 <tfanslau-AT-gmx.de> for the report.
2929
2934
2930 2002-07-10 Fernando Perez <fperez@colorado.edu>
2935 2002-07-10 Fernando Perez <fperez@colorado.edu>
2931
2936
2932 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
2937 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
2933 a bug in pdb, which crashes if a line with only whitespace is
2938 a bug in pdb, which crashes if a line with only whitespace is
2934 entered. Bug report submitted to sourceforge.
2939 entered. Bug report submitted to sourceforge.
2935
2940
2936 2002-07-09 Fernando Perez <fperez@colorado.edu>
2941 2002-07-09 Fernando Perez <fperez@colorado.edu>
2937
2942
2938 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
2943 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
2939 reporting exceptions (it's a bug in inspect.py, I just set a
2944 reporting exceptions (it's a bug in inspect.py, I just set a
2940 workaround).
2945 workaround).
2941
2946
2942 2002-07-08 Fernando Perez <fperez@colorado.edu>
2947 2002-07-08 Fernando Perez <fperez@colorado.edu>
2943
2948
2944 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
2949 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
2945 __IPYTHON__ in __builtins__ to show up in user_ns.
2950 __IPYTHON__ in __builtins__ to show up in user_ns.
2946
2951
2947 2002-07-03 Fernando Perez <fperez@colorado.edu>
2952 2002-07-03 Fernando Perez <fperez@colorado.edu>
2948
2953
2949 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
2954 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
2950 name from @gp_set_instance to @gp_set_default.
2955 name from @gp_set_instance to @gp_set_default.
2951
2956
2952 * IPython/ipmaker.py (make_IPython): default editor value set to
2957 * IPython/ipmaker.py (make_IPython): default editor value set to
2953 '0' (a string), to match the rc file. Otherwise will crash when
2958 '0' (a string), to match the rc file. Otherwise will crash when
2954 .strip() is called on it.
2959 .strip() is called on it.
2955
2960
2956
2961
2957 2002-06-28 Fernando Perez <fperez@colorado.edu>
2962 2002-06-28 Fernando Perez <fperez@colorado.edu>
2958
2963
2959 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
2964 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
2960 of files in current directory when a file is executed via
2965 of files in current directory when a file is executed via
2961 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
2966 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
2962
2967
2963 * setup.py (manfiles): fix for rpm builds, submitted by RA
2968 * setup.py (manfiles): fix for rpm builds, submitted by RA
2964 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
2969 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
2965
2970
2966 * IPython/ipmaker.py (make_IPython): fixed lookup of default
2971 * IPython/ipmaker.py (make_IPython): fixed lookup of default
2967 editor when set to '0'. Problem was, '0' evaluates to True (it's a
2972 editor when set to '0'. Problem was, '0' evaluates to True (it's a
2968 string!). A. Schmolck caught this one.
2973 string!). A. Schmolck caught this one.
2969
2974
2970 2002-06-27 Fernando Perez <fperez@colorado.edu>
2975 2002-06-27 Fernando Perez <fperez@colorado.edu>
2971
2976
2972 * IPython/ipmaker.py (make_IPython): fixed bug when running user
2977 * IPython/ipmaker.py (make_IPython): fixed bug when running user
2973 defined files at the cmd line. __name__ wasn't being set to
2978 defined files at the cmd line. __name__ wasn't being set to
2974 __main__.
2979 __main__.
2975
2980
2976 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
2981 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
2977 regular lists and tuples besides Numeric arrays.
2982 regular lists and tuples besides Numeric arrays.
2978
2983
2979 * IPython/Prompts.py (CachedOutput.__call__): Added output
2984 * IPython/Prompts.py (CachedOutput.__call__): Added output
2980 supression for input ending with ';'. Similar to Mathematica and
2985 supression for input ending with ';'. Similar to Mathematica and
2981 Matlab. The _* vars and Out[] list are still updated, just like
2986 Matlab. The _* vars and Out[] list are still updated, just like
2982 Mathematica behaves.
2987 Mathematica behaves.
2983
2988
2984 2002-06-25 Fernando Perez <fperez@colorado.edu>
2989 2002-06-25 Fernando Perez <fperez@colorado.edu>
2985
2990
2986 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
2991 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
2987 .ini extensions for profiels under Windows.
2992 .ini extensions for profiels under Windows.
2988
2993
2989 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
2994 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
2990 string form. Fix contributed by Alexander Schmolck
2995 string form. Fix contributed by Alexander Schmolck
2991 <a.schmolck-AT-gmx.net>
2996 <a.schmolck-AT-gmx.net>
2992
2997
2993 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
2998 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
2994 pre-configured Gnuplot instance.
2999 pre-configured Gnuplot instance.
2995
3000
2996 2002-06-21 Fernando Perez <fperez@colorado.edu>
3001 2002-06-21 Fernando Perez <fperez@colorado.edu>
2997
3002
2998 * IPython/numutils.py (exp_safe): new function, works around the
3003 * IPython/numutils.py (exp_safe): new function, works around the
2999 underflow problems in Numeric.
3004 underflow problems in Numeric.
3000 (log2): New fn. Safe log in base 2: returns exact integer answer
3005 (log2): New fn. Safe log in base 2: returns exact integer answer
3001 for exact integer powers of 2.
3006 for exact integer powers of 2.
3002
3007
3003 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3008 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3004 properly.
3009 properly.
3005
3010
3006 2002-06-20 Fernando Perez <fperez@colorado.edu>
3011 2002-06-20 Fernando Perez <fperez@colorado.edu>
3007
3012
3008 * IPython/genutils.py (timing): new function like
3013 * IPython/genutils.py (timing): new function like
3009 Mathematica's. Similar to time_test, but returns more info.
3014 Mathematica's. Similar to time_test, but returns more info.
3010
3015
3011 2002-06-18 Fernando Perez <fperez@colorado.edu>
3016 2002-06-18 Fernando Perez <fperez@colorado.edu>
3012
3017
3013 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3018 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3014 according to Mike Heeter's suggestions.
3019 according to Mike Heeter's suggestions.
3015
3020
3016 2002-06-16 Fernando Perez <fperez@colorado.edu>
3021 2002-06-16 Fernando Perez <fperez@colorado.edu>
3017
3022
3018 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3023 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3019 system. GnuplotMagic is gone as a user-directory option. New files
3024 system. GnuplotMagic is gone as a user-directory option. New files
3020 make it easier to use all the gnuplot stuff both from external
3025 make it easier to use all the gnuplot stuff both from external
3021 programs as well as from IPython. Had to rewrite part of
3026 programs as well as from IPython. Had to rewrite part of
3022 hardcopy() b/c of a strange bug: often the ps files simply don't
3027 hardcopy() b/c of a strange bug: often the ps files simply don't
3023 get created, and require a repeat of the command (often several
3028 get created, and require a repeat of the command (often several
3024 times).
3029 times).
3025
3030
3026 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3031 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3027 resolve output channel at call time, so that if sys.stderr has
3032 resolve output channel at call time, so that if sys.stderr has
3028 been redirected by user this gets honored.
3033 been redirected by user this gets honored.
3029
3034
3030 2002-06-13 Fernando Perez <fperez@colorado.edu>
3035 2002-06-13 Fernando Perez <fperez@colorado.edu>
3031
3036
3032 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3037 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3033 IPShell. Kept a copy with the old names to avoid breaking people's
3038 IPShell. Kept a copy with the old names to avoid breaking people's
3034 embedded code.
3039 embedded code.
3035
3040
3036 * IPython/ipython: simplified it to the bare minimum after
3041 * IPython/ipython: simplified it to the bare minimum after
3037 Holger's suggestions. Added info about how to use it in
3042 Holger's suggestions. Added info about how to use it in
3038 PYTHONSTARTUP.
3043 PYTHONSTARTUP.
3039
3044
3040 * IPython/Shell.py (IPythonShell): changed the options passing
3045 * IPython/Shell.py (IPythonShell): changed the options passing
3041 from a string with funky %s replacements to a straight list. Maybe
3046 from a string with funky %s replacements to a straight list. Maybe
3042 a bit more typing, but it follows sys.argv conventions, so there's
3047 a bit more typing, but it follows sys.argv conventions, so there's
3043 less special-casing to remember.
3048 less special-casing to remember.
3044
3049
3045 2002-06-12 Fernando Perez <fperez@colorado.edu>
3050 2002-06-12 Fernando Perez <fperez@colorado.edu>
3046
3051
3047 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3052 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3048 command. Thanks to a suggestion by Mike Heeter.
3053 command. Thanks to a suggestion by Mike Heeter.
3049 (Magic.magic_pfile): added behavior to look at filenames if given
3054 (Magic.magic_pfile): added behavior to look at filenames if given
3050 arg is not a defined object.
3055 arg is not a defined object.
3051 (Magic.magic_save): New @save function to save code snippets. Also
3056 (Magic.magic_save): New @save function to save code snippets. Also
3052 a Mike Heeter idea.
3057 a Mike Heeter idea.
3053
3058
3054 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3059 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3055 plot() and replot(). Much more convenient now, especially for
3060 plot() and replot(). Much more convenient now, especially for
3056 interactive use.
3061 interactive use.
3057
3062
3058 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3063 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3059 filenames.
3064 filenames.
3060
3065
3061 2002-06-02 Fernando Perez <fperez@colorado.edu>
3066 2002-06-02 Fernando Perez <fperez@colorado.edu>
3062
3067
3063 * IPython/Struct.py (Struct.__init__): modified to admit
3068 * IPython/Struct.py (Struct.__init__): modified to admit
3064 initialization via another struct.
3069 initialization via another struct.
3065
3070
3066 * IPython/genutils.py (SystemExec.__init__): New stateful
3071 * IPython/genutils.py (SystemExec.__init__): New stateful
3067 interface to xsys and bq. Useful for writing system scripts.
3072 interface to xsys and bq. Useful for writing system scripts.
3068
3073
3069 2002-05-30 Fernando Perez <fperez@colorado.edu>
3074 2002-05-30 Fernando Perez <fperez@colorado.edu>
3070
3075
3071 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3076 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3072 documents. This will make the user download smaller (it's getting
3077 documents. This will make the user download smaller (it's getting
3073 too big).
3078 too big).
3074
3079
3075 2002-05-29 Fernando Perez <fperez@colorado.edu>
3080 2002-05-29 Fernando Perez <fperez@colorado.edu>
3076
3081
3077 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3082 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3078 fix problems with shelve and pickle. Seems to work, but I don't
3083 fix problems with shelve and pickle. Seems to work, but I don't
3079 know if corner cases break it. Thanks to Mike Heeter
3084 know if corner cases break it. Thanks to Mike Heeter
3080 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3085 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3081
3086
3082 2002-05-24 Fernando Perez <fperez@colorado.edu>
3087 2002-05-24 Fernando Perez <fperez@colorado.edu>
3083
3088
3084 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3089 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3085 macros having broken.
3090 macros having broken.
3086
3091
3087 2002-05-21 Fernando Perez <fperez@colorado.edu>
3092 2002-05-21 Fernando Perez <fperez@colorado.edu>
3088
3093
3089 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3094 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3090 introduced logging bug: all history before logging started was
3095 introduced logging bug: all history before logging started was
3091 being written one character per line! This came from the redesign
3096 being written one character per line! This came from the redesign
3092 of the input history as a special list which slices to strings,
3097 of the input history as a special list which slices to strings,
3093 not to lists.
3098 not to lists.
3094
3099
3095 2002-05-20 Fernando Perez <fperez@colorado.edu>
3100 2002-05-20 Fernando Perez <fperez@colorado.edu>
3096
3101
3097 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3102 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3098 be an attribute of all classes in this module. The design of these
3103 be an attribute of all classes in this module. The design of these
3099 classes needs some serious overhauling.
3104 classes needs some serious overhauling.
3100
3105
3101 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3106 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3102 which was ignoring '_' in option names.
3107 which was ignoring '_' in option names.
3103
3108
3104 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3109 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3105 'Verbose_novars' to 'Context' and made it the new default. It's a
3110 'Verbose_novars' to 'Context' and made it the new default. It's a
3106 bit more readable and also safer than verbose.
3111 bit more readable and also safer than verbose.
3107
3112
3108 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3113 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3109 triple-quoted strings.
3114 triple-quoted strings.
3110
3115
3111 * IPython/OInspect.py (__all__): new module exposing the object
3116 * IPython/OInspect.py (__all__): new module exposing the object
3112 introspection facilities. Now the corresponding magics are dummy
3117 introspection facilities. Now the corresponding magics are dummy
3113 wrappers around this. Having this module will make it much easier
3118 wrappers around this. Having this module will make it much easier
3114 to put these functions into our modified pdb.
3119 to put these functions into our modified pdb.
3115 This new object inspector system uses the new colorizing module,
3120 This new object inspector system uses the new colorizing module,
3116 so source code and other things are nicely syntax highlighted.
3121 so source code and other things are nicely syntax highlighted.
3117
3122
3118 2002-05-18 Fernando Perez <fperez@colorado.edu>
3123 2002-05-18 Fernando Perez <fperez@colorado.edu>
3119
3124
3120 * IPython/ColorANSI.py: Split the coloring tools into a separate
3125 * IPython/ColorANSI.py: Split the coloring tools into a separate
3121 module so I can use them in other code easier (they were part of
3126 module so I can use them in other code easier (they were part of
3122 ultraTB).
3127 ultraTB).
3123
3128
3124 2002-05-17 Fernando Perez <fperez@colorado.edu>
3129 2002-05-17 Fernando Perez <fperez@colorado.edu>
3125
3130
3126 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3131 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3127 fixed it to set the global 'g' also to the called instance, as
3132 fixed it to set the global 'g' also to the called instance, as
3128 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3133 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3129 user's 'g' variables).
3134 user's 'g' variables).
3130
3135
3131 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3136 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3132 global variables (aliases to _ih,_oh) so that users which expect
3137 global variables (aliases to _ih,_oh) so that users which expect
3133 In[5] or Out[7] to work aren't unpleasantly surprised.
3138 In[5] or Out[7] to work aren't unpleasantly surprised.
3134 (InputList.__getslice__): new class to allow executing slices of
3139 (InputList.__getslice__): new class to allow executing slices of
3135 input history directly. Very simple class, complements the use of
3140 input history directly. Very simple class, complements the use of
3136 macros.
3141 macros.
3137
3142
3138 2002-05-16 Fernando Perez <fperez@colorado.edu>
3143 2002-05-16 Fernando Perez <fperez@colorado.edu>
3139
3144
3140 * setup.py (docdirbase): make doc directory be just doc/IPython
3145 * setup.py (docdirbase): make doc directory be just doc/IPython
3141 without version numbers, it will reduce clutter for users.
3146 without version numbers, it will reduce clutter for users.
3142
3147
3143 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3148 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3144 execfile call to prevent possible memory leak. See for details:
3149 execfile call to prevent possible memory leak. See for details:
3145 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3150 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3146
3151
3147 2002-05-15 Fernando Perez <fperez@colorado.edu>
3152 2002-05-15 Fernando Perez <fperez@colorado.edu>
3148
3153
3149 * IPython/Magic.py (Magic.magic_psource): made the object
3154 * IPython/Magic.py (Magic.magic_psource): made the object
3150 introspection names be more standard: pdoc, pdef, pfile and
3155 introspection names be more standard: pdoc, pdef, pfile and
3151 psource. They all print/page their output, and it makes
3156 psource. They all print/page their output, and it makes
3152 remembering them easier. Kept old names for compatibility as
3157 remembering them easier. Kept old names for compatibility as
3153 aliases.
3158 aliases.
3154
3159
3155 2002-05-14 Fernando Perez <fperez@colorado.edu>
3160 2002-05-14 Fernando Perez <fperez@colorado.edu>
3156
3161
3157 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3162 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3158 what the mouse problem was. The trick is to use gnuplot with temp
3163 what the mouse problem was. The trick is to use gnuplot with temp
3159 files and NOT with pipes (for data communication), because having
3164 files and NOT with pipes (for data communication), because having
3160 both pipes and the mouse on is bad news.
3165 both pipes and the mouse on is bad news.
3161
3166
3162 2002-05-13 Fernando Perez <fperez@colorado.edu>
3167 2002-05-13 Fernando Perez <fperez@colorado.edu>
3163
3168
3164 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3169 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3165 bug. Information would be reported about builtins even when
3170 bug. Information would be reported about builtins even when
3166 user-defined functions overrode them.
3171 user-defined functions overrode them.
3167
3172
3168 2002-05-11 Fernando Perez <fperez@colorado.edu>
3173 2002-05-11 Fernando Perez <fperez@colorado.edu>
3169
3174
3170 * IPython/__init__.py (__all__): removed FlexCompleter from
3175 * IPython/__init__.py (__all__): removed FlexCompleter from
3171 __all__ so that things don't fail in platforms without readline.
3176 __all__ so that things don't fail in platforms without readline.
3172
3177
3173 2002-05-10 Fernando Perez <fperez@colorado.edu>
3178 2002-05-10 Fernando Perez <fperez@colorado.edu>
3174
3179
3175 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3180 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3176 it requires Numeric, effectively making Numeric a dependency for
3181 it requires Numeric, effectively making Numeric a dependency for
3177 IPython.
3182 IPython.
3178
3183
3179 * Released 0.2.13
3184 * Released 0.2.13
3180
3185
3181 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3186 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3182 profiler interface. Now all the major options from the profiler
3187 profiler interface. Now all the major options from the profiler
3183 module are directly supported in IPython, both for single
3188 module are directly supported in IPython, both for single
3184 expressions (@prun) and for full programs (@run -p).
3189 expressions (@prun) and for full programs (@run -p).
3185
3190
3186 2002-05-09 Fernando Perez <fperez@colorado.edu>
3191 2002-05-09 Fernando Perez <fperez@colorado.edu>
3187
3192
3188 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3193 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3189 magic properly formatted for screen.
3194 magic properly formatted for screen.
3190
3195
3191 * setup.py (make_shortcut): Changed things to put pdf version in
3196 * setup.py (make_shortcut): Changed things to put pdf version in
3192 doc/ instead of doc/manual (had to change lyxport a bit).
3197 doc/ instead of doc/manual (had to change lyxport a bit).
3193
3198
3194 * IPython/Magic.py (Profile.string_stats): made profile runs go
3199 * IPython/Magic.py (Profile.string_stats): made profile runs go
3195 through pager (they are long and a pager allows searching, saving,
3200 through pager (they are long and a pager allows searching, saving,
3196 etc.)
3201 etc.)
3197
3202
3198 2002-05-08 Fernando Perez <fperez@colorado.edu>
3203 2002-05-08 Fernando Perez <fperez@colorado.edu>
3199
3204
3200 * Released 0.2.12
3205 * Released 0.2.12
3201
3206
3202 2002-05-06 Fernando Perez <fperez@colorado.edu>
3207 2002-05-06 Fernando Perez <fperez@colorado.edu>
3203
3208
3204 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3209 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3205 introduced); 'hist n1 n2' was broken.
3210 introduced); 'hist n1 n2' was broken.
3206 (Magic.magic_pdb): added optional on/off arguments to @pdb
3211 (Magic.magic_pdb): added optional on/off arguments to @pdb
3207 (Magic.magic_run): added option -i to @run, which executes code in
3212 (Magic.magic_run): added option -i to @run, which executes code in
3208 the IPython namespace instead of a clean one. Also added @irun as
3213 the IPython namespace instead of a clean one. Also added @irun as
3209 an alias to @run -i.
3214 an alias to @run -i.
3210
3215
3211 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3216 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3212 fixed (it didn't really do anything, the namespaces were wrong).
3217 fixed (it didn't really do anything, the namespaces were wrong).
3213
3218
3214 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3219 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3215
3220
3216 * IPython/__init__.py (__all__): Fixed package namespace, now
3221 * IPython/__init__.py (__all__): Fixed package namespace, now
3217 'import IPython' does give access to IPython.<all> as
3222 'import IPython' does give access to IPython.<all> as
3218 expected. Also renamed __release__ to Release.
3223 expected. Also renamed __release__ to Release.
3219
3224
3220 * IPython/Debugger.py (__license__): created new Pdb class which
3225 * IPython/Debugger.py (__license__): created new Pdb class which
3221 functions like a drop-in for the normal pdb.Pdb but does NOT
3226 functions like a drop-in for the normal pdb.Pdb but does NOT
3222 import readline by default. This way it doesn't muck up IPython's
3227 import readline by default. This way it doesn't muck up IPython's
3223 readline handling, and now tab-completion finally works in the
3228 readline handling, and now tab-completion finally works in the
3224 debugger -- sort of. It completes things globally visible, but the
3229 debugger -- sort of. It completes things globally visible, but the
3225 completer doesn't track the stack as pdb walks it. That's a bit
3230 completer doesn't track the stack as pdb walks it. That's a bit
3226 tricky, and I'll have to implement it later.
3231 tricky, and I'll have to implement it later.
3227
3232
3228 2002-05-05 Fernando Perez <fperez@colorado.edu>
3233 2002-05-05 Fernando Perez <fperez@colorado.edu>
3229
3234
3230 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3235 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3231 magic docstrings when printed via ? (explicit \'s were being
3236 magic docstrings when printed via ? (explicit \'s were being
3232 printed).
3237 printed).
3233
3238
3234 * IPython/ipmaker.py (make_IPython): fixed namespace
3239 * IPython/ipmaker.py (make_IPython): fixed namespace
3235 identification bug. Now variables loaded via logs or command-line
3240 identification bug. Now variables loaded via logs or command-line
3236 files are recognized in the interactive namespace by @who.
3241 files are recognized in the interactive namespace by @who.
3237
3242
3238 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3243 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3239 log replay system stemming from the string form of Structs.
3244 log replay system stemming from the string form of Structs.
3240
3245
3241 * IPython/Magic.py (Macro.__init__): improved macros to properly
3246 * IPython/Magic.py (Macro.__init__): improved macros to properly
3242 handle magic commands in them.
3247 handle magic commands in them.
3243 (Magic.magic_logstart): usernames are now expanded so 'logstart
3248 (Magic.magic_logstart): usernames are now expanded so 'logstart
3244 ~/mylog' now works.
3249 ~/mylog' now works.
3245
3250
3246 * IPython/iplib.py (complete): fixed bug where paths starting with
3251 * IPython/iplib.py (complete): fixed bug where paths starting with
3247 '/' would be completed as magic names.
3252 '/' would be completed as magic names.
3248
3253
3249 2002-05-04 Fernando Perez <fperez@colorado.edu>
3254 2002-05-04 Fernando Perez <fperez@colorado.edu>
3250
3255
3251 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3256 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3252 allow running full programs under the profiler's control.
3257 allow running full programs under the profiler's control.
3253
3258
3254 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3259 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3255 mode to report exceptions verbosely but without formatting
3260 mode to report exceptions verbosely but without formatting
3256 variables. This addresses the issue of ipython 'freezing' (it's
3261 variables. This addresses the issue of ipython 'freezing' (it's
3257 not frozen, but caught in an expensive formatting loop) when huge
3262 not frozen, but caught in an expensive formatting loop) when huge
3258 variables are in the context of an exception.
3263 variables are in the context of an exception.
3259 (VerboseTB.text): Added '--->' markers at line where exception was
3264 (VerboseTB.text): Added '--->' markers at line where exception was
3260 triggered. Much clearer to read, especially in NoColor modes.
3265 triggered. Much clearer to read, especially in NoColor modes.
3261
3266
3262 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3267 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3263 implemented in reverse when changing to the new parse_options().
3268 implemented in reverse when changing to the new parse_options().
3264
3269
3265 2002-05-03 Fernando Perez <fperez@colorado.edu>
3270 2002-05-03 Fernando Perez <fperez@colorado.edu>
3266
3271
3267 * IPython/Magic.py (Magic.parse_options): new function so that
3272 * IPython/Magic.py (Magic.parse_options): new function so that
3268 magics can parse options easier.
3273 magics can parse options easier.
3269 (Magic.magic_prun): new function similar to profile.run(),
3274 (Magic.magic_prun): new function similar to profile.run(),
3270 suggested by Chris Hart.
3275 suggested by Chris Hart.
3271 (Magic.magic_cd): fixed behavior so that it only changes if
3276 (Magic.magic_cd): fixed behavior so that it only changes if
3272 directory actually is in history.
3277 directory actually is in history.
3273
3278
3274 * IPython/usage.py (__doc__): added information about potential
3279 * IPython/usage.py (__doc__): added information about potential
3275 slowness of Verbose exception mode when there are huge data
3280 slowness of Verbose exception mode when there are huge data
3276 structures to be formatted (thanks to Archie Paulson).
3281 structures to be formatted (thanks to Archie Paulson).
3277
3282
3278 * IPython/ipmaker.py (make_IPython): Changed default logging
3283 * IPython/ipmaker.py (make_IPython): Changed default logging
3279 (when simply called with -log) to use curr_dir/ipython.log in
3284 (when simply called with -log) to use curr_dir/ipython.log in
3280 rotate mode. Fixed crash which was occuring with -log before
3285 rotate mode. Fixed crash which was occuring with -log before
3281 (thanks to Jim Boyle).
3286 (thanks to Jim Boyle).
3282
3287
3283 2002-05-01 Fernando Perez <fperez@colorado.edu>
3288 2002-05-01 Fernando Perez <fperez@colorado.edu>
3284
3289
3285 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3290 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3286 was nasty -- though somewhat of a corner case).
3291 was nasty -- though somewhat of a corner case).
3287
3292
3288 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3293 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3289 text (was a bug).
3294 text (was a bug).
3290
3295
3291 2002-04-30 Fernando Perez <fperez@colorado.edu>
3296 2002-04-30 Fernando Perez <fperez@colorado.edu>
3292
3297
3293 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3298 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3294 a print after ^D or ^C from the user so that the In[] prompt
3299 a print after ^D or ^C from the user so that the In[] prompt
3295 doesn't over-run the gnuplot one.
3300 doesn't over-run the gnuplot one.
3296
3301
3297 2002-04-29 Fernando Perez <fperez@colorado.edu>
3302 2002-04-29 Fernando Perez <fperez@colorado.edu>
3298
3303
3299 * Released 0.2.10
3304 * Released 0.2.10
3300
3305
3301 * IPython/__release__.py (version): get date dynamically.
3306 * IPython/__release__.py (version): get date dynamically.
3302
3307
3303 * Misc. documentation updates thanks to Arnd's comments. Also ran
3308 * Misc. documentation updates thanks to Arnd's comments. Also ran
3304 a full spellcheck on the manual (hadn't been done in a while).
3309 a full spellcheck on the manual (hadn't been done in a while).
3305
3310
3306 2002-04-27 Fernando Perez <fperez@colorado.edu>
3311 2002-04-27 Fernando Perez <fperez@colorado.edu>
3307
3312
3308 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3313 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3309 starting a log in mid-session would reset the input history list.
3314 starting a log in mid-session would reset the input history list.
3310
3315
3311 2002-04-26 Fernando Perez <fperez@colorado.edu>
3316 2002-04-26 Fernando Perez <fperez@colorado.edu>
3312
3317
3313 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3318 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3314 all files were being included in an update. Now anything in
3319 all files were being included in an update. Now anything in
3315 UserConfig that matches [A-Za-z]*.py will go (this excludes
3320 UserConfig that matches [A-Za-z]*.py will go (this excludes
3316 __init__.py)
3321 __init__.py)
3317
3322
3318 2002-04-25 Fernando Perez <fperez@colorado.edu>
3323 2002-04-25 Fernando Perez <fperez@colorado.edu>
3319
3324
3320 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3325 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3321 to __builtins__ so that any form of embedded or imported code can
3326 to __builtins__ so that any form of embedded or imported code can
3322 test for being inside IPython.
3327 test for being inside IPython.
3323
3328
3324 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3329 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3325 changed to GnuplotMagic because it's now an importable module,
3330 changed to GnuplotMagic because it's now an importable module,
3326 this makes the name follow that of the standard Gnuplot module.
3331 this makes the name follow that of the standard Gnuplot module.
3327 GnuplotMagic can now be loaded at any time in mid-session.
3332 GnuplotMagic can now be loaded at any time in mid-session.
3328
3333
3329 2002-04-24 Fernando Perez <fperez@colorado.edu>
3334 2002-04-24 Fernando Perez <fperez@colorado.edu>
3330
3335
3331 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3336 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3332 the globals (IPython has its own namespace) and the
3337 the globals (IPython has its own namespace) and the
3333 PhysicalQuantity stuff is much better anyway.
3338 PhysicalQuantity stuff is much better anyway.
3334
3339
3335 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3340 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3336 embedding example to standard user directory for
3341 embedding example to standard user directory for
3337 distribution. Also put it in the manual.
3342 distribution. Also put it in the manual.
3338
3343
3339 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3344 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3340 instance as first argument (so it doesn't rely on some obscure
3345 instance as first argument (so it doesn't rely on some obscure
3341 hidden global).
3346 hidden global).
3342
3347
3343 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3348 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3344 delimiters. While it prevents ().TAB from working, it allows
3349 delimiters. While it prevents ().TAB from working, it allows
3345 completions in open (... expressions. This is by far a more common
3350 completions in open (... expressions. This is by far a more common
3346 case.
3351 case.
3347
3352
3348 2002-04-23 Fernando Perez <fperez@colorado.edu>
3353 2002-04-23 Fernando Perez <fperez@colorado.edu>
3349
3354
3350 * IPython/Extensions/InterpreterPasteInput.py: new
3355 * IPython/Extensions/InterpreterPasteInput.py: new
3351 syntax-processing module for pasting lines with >>> or ... at the
3356 syntax-processing module for pasting lines with >>> or ... at the
3352 start.
3357 start.
3353
3358
3354 * IPython/Extensions/PhysicalQ_Interactive.py
3359 * IPython/Extensions/PhysicalQ_Interactive.py
3355 (PhysicalQuantityInteractive.__int__): fixed to work with either
3360 (PhysicalQuantityInteractive.__int__): fixed to work with either
3356 Numeric or math.
3361 Numeric or math.
3357
3362
3358 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3363 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3359 provided profiles. Now we have:
3364 provided profiles. Now we have:
3360 -math -> math module as * and cmath with its own namespace.
3365 -math -> math module as * and cmath with its own namespace.
3361 -numeric -> Numeric as *, plus gnuplot & grace
3366 -numeric -> Numeric as *, plus gnuplot & grace
3362 -physics -> same as before
3367 -physics -> same as before
3363
3368
3364 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3369 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3365 user-defined magics wouldn't be found by @magic if they were
3370 user-defined magics wouldn't be found by @magic if they were
3366 defined as class methods. Also cleaned up the namespace search
3371 defined as class methods. Also cleaned up the namespace search
3367 logic and the string building (to use %s instead of many repeated
3372 logic and the string building (to use %s instead of many repeated
3368 string adds).
3373 string adds).
3369
3374
3370 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3375 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3371 of user-defined magics to operate with class methods (cleaner, in
3376 of user-defined magics to operate with class methods (cleaner, in
3372 line with the gnuplot code).
3377 line with the gnuplot code).
3373
3378
3374 2002-04-22 Fernando Perez <fperez@colorado.edu>
3379 2002-04-22 Fernando Perez <fperez@colorado.edu>
3375
3380
3376 * setup.py: updated dependency list so that manual is updated when
3381 * setup.py: updated dependency list so that manual is updated when
3377 all included files change.
3382 all included files change.
3378
3383
3379 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3384 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3380 the delimiter removal option (the fix is ugly right now).
3385 the delimiter removal option (the fix is ugly right now).
3381
3386
3382 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3387 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3383 all of the math profile (quicker loading, no conflict between
3388 all of the math profile (quicker loading, no conflict between
3384 g-9.8 and g-gnuplot).
3389 g-9.8 and g-gnuplot).
3385
3390
3386 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3391 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3387 name of post-mortem files to IPython_crash_report.txt.
3392 name of post-mortem files to IPython_crash_report.txt.
3388
3393
3389 * Cleanup/update of the docs. Added all the new readline info and
3394 * Cleanup/update of the docs. Added all the new readline info and
3390 formatted all lists as 'real lists'.
3395 formatted all lists as 'real lists'.
3391
3396
3392 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3397 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3393 tab-completion options, since the full readline parse_and_bind is
3398 tab-completion options, since the full readline parse_and_bind is
3394 now accessible.
3399 now accessible.
3395
3400
3396 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3401 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3397 handling of readline options. Now users can specify any string to
3402 handling of readline options. Now users can specify any string to
3398 be passed to parse_and_bind(), as well as the delimiters to be
3403 be passed to parse_and_bind(), as well as the delimiters to be
3399 removed.
3404 removed.
3400 (InteractiveShell.__init__): Added __name__ to the global
3405 (InteractiveShell.__init__): Added __name__ to the global
3401 namespace so that things like Itpl which rely on its existence
3406 namespace so that things like Itpl which rely on its existence
3402 don't crash.
3407 don't crash.
3403 (InteractiveShell._prefilter): Defined the default with a _ so
3408 (InteractiveShell._prefilter): Defined the default with a _ so
3404 that prefilter() is easier to override, while the default one
3409 that prefilter() is easier to override, while the default one
3405 remains available.
3410 remains available.
3406
3411
3407 2002-04-18 Fernando Perez <fperez@colorado.edu>
3412 2002-04-18 Fernando Perez <fperez@colorado.edu>
3408
3413
3409 * Added information about pdb in the docs.
3414 * Added information about pdb in the docs.
3410
3415
3411 2002-04-17 Fernando Perez <fperez@colorado.edu>
3416 2002-04-17 Fernando Perez <fperez@colorado.edu>
3412
3417
3413 * IPython/ipmaker.py (make_IPython): added rc_override option to
3418 * IPython/ipmaker.py (make_IPython): added rc_override option to
3414 allow passing config options at creation time which may override
3419 allow passing config options at creation time which may override
3415 anything set in the config files or command line. This is
3420 anything set in the config files or command line. This is
3416 particularly useful for configuring embedded instances.
3421 particularly useful for configuring embedded instances.
3417
3422
3418 2002-04-15 Fernando Perez <fperez@colorado.edu>
3423 2002-04-15 Fernando Perez <fperez@colorado.edu>
3419
3424
3420 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3425 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3421 crash embedded instances because of the input cache falling out of
3426 crash embedded instances because of the input cache falling out of
3422 sync with the output counter.
3427 sync with the output counter.
3423
3428
3424 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3429 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3425 mode which calls pdb after an uncaught exception in IPython itself.
3430 mode which calls pdb after an uncaught exception in IPython itself.
3426
3431
3427 2002-04-14 Fernando Perez <fperez@colorado.edu>
3432 2002-04-14 Fernando Perez <fperez@colorado.edu>
3428
3433
3429 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3434 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3430 readline, fix it back after each call.
3435 readline, fix it back after each call.
3431
3436
3432 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3437 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3433 method to force all access via __call__(), which guarantees that
3438 method to force all access via __call__(), which guarantees that
3434 traceback references are properly deleted.
3439 traceback references are properly deleted.
3435
3440
3436 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3441 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3437 improve printing when pprint is in use.
3442 improve printing when pprint is in use.
3438
3443
3439 2002-04-13 Fernando Perez <fperez@colorado.edu>
3444 2002-04-13 Fernando Perez <fperez@colorado.edu>
3440
3445
3441 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3446 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3442 exceptions aren't caught anymore. If the user triggers one, he
3447 exceptions aren't caught anymore. If the user triggers one, he
3443 should know why he's doing it and it should go all the way up,
3448 should know why he's doing it and it should go all the way up,
3444 just like any other exception. So now @abort will fully kill the
3449 just like any other exception. So now @abort will fully kill the
3445 embedded interpreter and the embedding code (unless that happens
3450 embedded interpreter and the embedding code (unless that happens
3446 to catch SystemExit).
3451 to catch SystemExit).
3447
3452
3448 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3453 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3449 and a debugger() method to invoke the interactive pdb debugger
3454 and a debugger() method to invoke the interactive pdb debugger
3450 after printing exception information. Also added the corresponding
3455 after printing exception information. Also added the corresponding
3451 -pdb option and @pdb magic to control this feature, and updated
3456 -pdb option and @pdb magic to control this feature, and updated
3452 the docs. After a suggestion from Christopher Hart
3457 the docs. After a suggestion from Christopher Hart
3453 (hart-AT-caltech.edu).
3458 (hart-AT-caltech.edu).
3454
3459
3455 2002-04-12 Fernando Perez <fperez@colorado.edu>
3460 2002-04-12 Fernando Perez <fperez@colorado.edu>
3456
3461
3457 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
3462 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
3458 the exception handlers defined by the user (not the CrashHandler)
3463 the exception handlers defined by the user (not the CrashHandler)
3459 so that user exceptions don't trigger an ipython bug report.
3464 so that user exceptions don't trigger an ipython bug report.
3460
3465
3461 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
3466 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
3462 configurable (it should have always been so).
3467 configurable (it should have always been so).
3463
3468
3464 2002-03-26 Fernando Perez <fperez@colorado.edu>
3469 2002-03-26 Fernando Perez <fperez@colorado.edu>
3465
3470
3466 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
3471 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
3467 and there to fix embedding namespace issues. This should all be
3472 and there to fix embedding namespace issues. This should all be
3468 done in a more elegant way.
3473 done in a more elegant way.
3469
3474
3470 2002-03-25 Fernando Perez <fperez@colorado.edu>
3475 2002-03-25 Fernando Perez <fperez@colorado.edu>
3471
3476
3472 * IPython/genutils.py (get_home_dir): Try to make it work under
3477 * IPython/genutils.py (get_home_dir): Try to make it work under
3473 win9x also.
3478 win9x also.
3474
3479
3475 2002-03-20 Fernando Perez <fperez@colorado.edu>
3480 2002-03-20 Fernando Perez <fperez@colorado.edu>
3476
3481
3477 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
3482 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
3478 sys.displayhook untouched upon __init__.
3483 sys.displayhook untouched upon __init__.
3479
3484
3480 2002-03-19 Fernando Perez <fperez@colorado.edu>
3485 2002-03-19 Fernando Perez <fperez@colorado.edu>
3481
3486
3482 * Released 0.2.9 (for embedding bug, basically).
3487 * Released 0.2.9 (for embedding bug, basically).
3483
3488
3484 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
3489 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
3485 exceptions so that enclosing shell's state can be restored.
3490 exceptions so that enclosing shell's state can be restored.
3486
3491
3487 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
3492 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
3488 naming conventions in the .ipython/ dir.
3493 naming conventions in the .ipython/ dir.
3489
3494
3490 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
3495 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
3491 from delimiters list so filenames with - in them get expanded.
3496 from delimiters list so filenames with - in them get expanded.
3492
3497
3493 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
3498 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
3494 sys.displayhook not being properly restored after an embedded call.
3499 sys.displayhook not being properly restored after an embedded call.
3495
3500
3496 2002-03-18 Fernando Perez <fperez@colorado.edu>
3501 2002-03-18 Fernando Perez <fperez@colorado.edu>
3497
3502
3498 * Released 0.2.8
3503 * Released 0.2.8
3499
3504
3500 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
3505 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
3501 some files weren't being included in a -upgrade.
3506 some files weren't being included in a -upgrade.
3502 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
3507 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
3503 on' so that the first tab completes.
3508 on' so that the first tab completes.
3504 (InteractiveShell.handle_magic): fixed bug with spaces around
3509 (InteractiveShell.handle_magic): fixed bug with spaces around
3505 quotes breaking many magic commands.
3510 quotes breaking many magic commands.
3506
3511
3507 * setup.py: added note about ignoring the syntax error messages at
3512 * setup.py: added note about ignoring the syntax error messages at
3508 installation.
3513 installation.
3509
3514
3510 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
3515 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
3511 streamlining the gnuplot interface, now there's only one magic @gp.
3516 streamlining the gnuplot interface, now there's only one magic @gp.
3512
3517
3513 2002-03-17 Fernando Perez <fperez@colorado.edu>
3518 2002-03-17 Fernando Perez <fperez@colorado.edu>
3514
3519
3515 * IPython/UserConfig/magic_gnuplot.py: new name for the
3520 * IPython/UserConfig/magic_gnuplot.py: new name for the
3516 example-magic_pm.py file. Much enhanced system, now with a shell
3521 example-magic_pm.py file. Much enhanced system, now with a shell
3517 for communicating directly with gnuplot, one command at a time.
3522 for communicating directly with gnuplot, one command at a time.
3518
3523
3519 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
3524 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
3520 setting __name__=='__main__'.
3525 setting __name__=='__main__'.
3521
3526
3522 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
3527 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
3523 mini-shell for accessing gnuplot from inside ipython. Should
3528 mini-shell for accessing gnuplot from inside ipython. Should
3524 extend it later for grace access too. Inspired by Arnd's
3529 extend it later for grace access too. Inspired by Arnd's
3525 suggestion.
3530 suggestion.
3526
3531
3527 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
3532 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
3528 calling magic functions with () in their arguments. Thanks to Arnd
3533 calling magic functions with () in their arguments. Thanks to Arnd
3529 Baecker for pointing this to me.
3534 Baecker for pointing this to me.
3530
3535
3531 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
3536 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
3532 infinitely for integer or complex arrays (only worked with floats).
3537 infinitely for integer or complex arrays (only worked with floats).
3533
3538
3534 2002-03-16 Fernando Perez <fperez@colorado.edu>
3539 2002-03-16 Fernando Perez <fperez@colorado.edu>
3535
3540
3536 * setup.py: Merged setup and setup_windows into a single script
3541 * setup.py: Merged setup and setup_windows into a single script
3537 which properly handles things for windows users.
3542 which properly handles things for windows users.
3538
3543
3539 2002-03-15 Fernando Perez <fperez@colorado.edu>
3544 2002-03-15 Fernando Perez <fperez@colorado.edu>
3540
3545
3541 * Big change to the manual: now the magics are all automatically
3546 * Big change to the manual: now the magics are all automatically
3542 documented. This information is generated from their docstrings
3547 documented. This information is generated from their docstrings
3543 and put in a latex file included by the manual lyx file. This way
3548 and put in a latex file included by the manual lyx file. This way
3544 we get always up to date information for the magics. The manual
3549 we get always up to date information for the magics. The manual
3545 now also has proper version information, also auto-synced.
3550 now also has proper version information, also auto-synced.
3546
3551
3547 For this to work, an undocumented --magic_docstrings option was added.
3552 For this to work, an undocumented --magic_docstrings option was added.
3548
3553
3549 2002-03-13 Fernando Perez <fperez@colorado.edu>
3554 2002-03-13 Fernando Perez <fperez@colorado.edu>
3550
3555
3551 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
3556 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
3552 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
3557 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
3553
3558
3554 2002-03-12 Fernando Perez <fperez@colorado.edu>
3559 2002-03-12 Fernando Perez <fperez@colorado.edu>
3555
3560
3556 * IPython/ultraTB.py (TermColors): changed color escapes again to
3561 * IPython/ultraTB.py (TermColors): changed color escapes again to
3557 fix the (old, reintroduced) line-wrapping bug. Basically, if
3562 fix the (old, reintroduced) line-wrapping bug. Basically, if
3558 \001..\002 aren't given in the color escapes, lines get wrapped
3563 \001..\002 aren't given in the color escapes, lines get wrapped
3559 weirdly. But giving those screws up old xterms and emacs terms. So
3564 weirdly. But giving those screws up old xterms and emacs terms. So
3560 I added some logic for emacs terms to be ok, but I can't identify old
3565 I added some logic for emacs terms to be ok, but I can't identify old
3561 xterms separately ($TERM=='xterm' for many terminals, like konsole).
3566 xterms separately ($TERM=='xterm' for many terminals, like konsole).
3562
3567
3563 2002-03-10 Fernando Perez <fperez@colorado.edu>
3568 2002-03-10 Fernando Perez <fperez@colorado.edu>
3564
3569
3565 * IPython/usage.py (__doc__): Various documentation cleanups and
3570 * IPython/usage.py (__doc__): Various documentation cleanups and
3566 updates, both in usage docstrings and in the manual.
3571 updates, both in usage docstrings and in the manual.
3567
3572
3568 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
3573 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
3569 handling of caching. Set minimum acceptabe value for having a
3574 handling of caching. Set minimum acceptabe value for having a
3570 cache at 20 values.
3575 cache at 20 values.
3571
3576
3572 * IPython/iplib.py (InteractiveShell.user_setup): moved the
3577 * IPython/iplib.py (InteractiveShell.user_setup): moved the
3573 install_first_time function to a method, renamed it and added an
3578 install_first_time function to a method, renamed it and added an
3574 'upgrade' mode. Now people can update their config directory with
3579 'upgrade' mode. Now people can update their config directory with
3575 a simple command line switch (-upgrade, also new).
3580 a simple command line switch (-upgrade, also new).
3576
3581
3577 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
3582 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
3578 @file (convenient for automagic users under Python >= 2.2).
3583 @file (convenient for automagic users under Python >= 2.2).
3579 Removed @files (it seemed more like a plural than an abbrev. of
3584 Removed @files (it seemed more like a plural than an abbrev. of
3580 'file show').
3585 'file show').
3581
3586
3582 * IPython/iplib.py (install_first_time): Fixed crash if there were
3587 * IPython/iplib.py (install_first_time): Fixed crash if there were
3583 backup files ('~') in .ipython/ install directory.
3588 backup files ('~') in .ipython/ install directory.
3584
3589
3585 * IPython/ipmaker.py (make_IPython): fixes for new prompt
3590 * IPython/ipmaker.py (make_IPython): fixes for new prompt
3586 system. Things look fine, but these changes are fairly
3591 system. Things look fine, but these changes are fairly
3587 intrusive. Test them for a few days.
3592 intrusive. Test them for a few days.
3588
3593
3589 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
3594 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
3590 the prompts system. Now all in/out prompt strings are user
3595 the prompts system. Now all in/out prompt strings are user
3591 controllable. This is particularly useful for embedding, as one
3596 controllable. This is particularly useful for embedding, as one
3592 can tag embedded instances with particular prompts.
3597 can tag embedded instances with particular prompts.
3593
3598
3594 Also removed global use of sys.ps1/2, which now allows nested
3599 Also removed global use of sys.ps1/2, which now allows nested
3595 embeddings without any problems. Added command-line options for
3600 embeddings without any problems. Added command-line options for
3596 the prompt strings.
3601 the prompt strings.
3597
3602
3598 2002-03-08 Fernando Perez <fperez@colorado.edu>
3603 2002-03-08 Fernando Perez <fperez@colorado.edu>
3599
3604
3600 * IPython/UserConfig/example-embed-short.py (ipshell): added
3605 * IPython/UserConfig/example-embed-short.py (ipshell): added
3601 example file with the bare minimum code for embedding.
3606 example file with the bare minimum code for embedding.
3602
3607
3603 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
3608 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
3604 functionality for the embeddable shell to be activated/deactivated
3609 functionality for the embeddable shell to be activated/deactivated
3605 either globally or at each call.
3610 either globally or at each call.
3606
3611
3607 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
3612 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
3608 rewriting the prompt with '--->' for auto-inputs with proper
3613 rewriting the prompt with '--->' for auto-inputs with proper
3609 coloring. Now the previous UGLY hack in handle_auto() is gone, and
3614 coloring. Now the previous UGLY hack in handle_auto() is gone, and
3610 this is handled by the prompts class itself, as it should.
3615 this is handled by the prompts class itself, as it should.
3611
3616
3612 2002-03-05 Fernando Perez <fperez@colorado.edu>
3617 2002-03-05 Fernando Perez <fperez@colorado.edu>
3613
3618
3614 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
3619 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
3615 @logstart to avoid name clashes with the math log function.
3620 @logstart to avoid name clashes with the math log function.
3616
3621
3617 * Big updates to X/Emacs section of the manual.
3622 * Big updates to X/Emacs section of the manual.
3618
3623
3619 * Removed ipython_emacs. Milan explained to me how to pass
3624 * Removed ipython_emacs. Milan explained to me how to pass
3620 arguments to ipython through Emacs. Some day I'm going to end up
3625 arguments to ipython through Emacs. Some day I'm going to end up
3621 learning some lisp...
3626 learning some lisp...
3622
3627
3623 2002-03-04 Fernando Perez <fperez@colorado.edu>
3628 2002-03-04 Fernando Perez <fperez@colorado.edu>
3624
3629
3625 * IPython/ipython_emacs: Created script to be used as the
3630 * IPython/ipython_emacs: Created script to be used as the
3626 py-python-command Emacs variable so we can pass IPython
3631 py-python-command Emacs variable so we can pass IPython
3627 parameters. I can't figure out how to tell Emacs directly to pass
3632 parameters. I can't figure out how to tell Emacs directly to pass
3628 parameters to IPython, so a dummy shell script will do it.
3633 parameters to IPython, so a dummy shell script will do it.
3629
3634
3630 Other enhancements made for things to work better under Emacs'
3635 Other enhancements made for things to work better under Emacs'
3631 various types of terminals. Many thanks to Milan Zamazal
3636 various types of terminals. Many thanks to Milan Zamazal
3632 <pdm-AT-zamazal.org> for all the suggestions and pointers.
3637 <pdm-AT-zamazal.org> for all the suggestions and pointers.
3633
3638
3634 2002-03-01 Fernando Perez <fperez@colorado.edu>
3639 2002-03-01 Fernando Perez <fperez@colorado.edu>
3635
3640
3636 * IPython/ipmaker.py (make_IPython): added a --readline! option so
3641 * IPython/ipmaker.py (make_IPython): added a --readline! option so
3637 that loading of readline is now optional. This gives better
3642 that loading of readline is now optional. This gives better
3638 control to emacs users.
3643 control to emacs users.
3639
3644
3640 * IPython/ultraTB.py (__date__): Modified color escape sequences
3645 * IPython/ultraTB.py (__date__): Modified color escape sequences
3641 and now things work fine under xterm and in Emacs' term buffers
3646 and now things work fine under xterm and in Emacs' term buffers
3642 (though not shell ones). Well, in emacs you get colors, but all
3647 (though not shell ones). Well, in emacs you get colors, but all
3643 seem to be 'light' colors (no difference between dark and light
3648 seem to be 'light' colors (no difference between dark and light
3644 ones). But the garbage chars are gone, and also in xterms. It
3649 ones). But the garbage chars are gone, and also in xterms. It
3645 seems that now I'm using 'cleaner' ansi sequences.
3650 seems that now I'm using 'cleaner' ansi sequences.
3646
3651
3647 2002-02-21 Fernando Perez <fperez@colorado.edu>
3652 2002-02-21 Fernando Perez <fperez@colorado.edu>
3648
3653
3649 * Released 0.2.7 (mainly to publish the scoping fix).
3654 * Released 0.2.7 (mainly to publish the scoping fix).
3650
3655
3651 * IPython/Logger.py (Logger.logstate): added. A corresponding
3656 * IPython/Logger.py (Logger.logstate): added. A corresponding
3652 @logstate magic was created.
3657 @logstate magic was created.
3653
3658
3654 * IPython/Magic.py: fixed nested scoping problem under Python
3659 * IPython/Magic.py: fixed nested scoping problem under Python
3655 2.1.x (automagic wasn't working).
3660 2.1.x (automagic wasn't working).
3656
3661
3657 2002-02-20 Fernando Perez <fperez@colorado.edu>
3662 2002-02-20 Fernando Perez <fperez@colorado.edu>
3658
3663
3659 * Released 0.2.6.
3664 * Released 0.2.6.
3660
3665
3661 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
3666 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
3662 option so that logs can come out without any headers at all.
3667 option so that logs can come out without any headers at all.
3663
3668
3664 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
3669 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
3665 SciPy.
3670 SciPy.
3666
3671
3667 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
3672 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
3668 that embedded IPython calls don't require vars() to be explicitly
3673 that embedded IPython calls don't require vars() to be explicitly
3669 passed. Now they are extracted from the caller's frame (code
3674 passed. Now they are extracted from the caller's frame (code
3670 snatched from Eric Jones' weave). Added better documentation to
3675 snatched from Eric Jones' weave). Added better documentation to
3671 the section on embedding and the example file.
3676 the section on embedding and the example file.
3672
3677
3673 * IPython/genutils.py (page): Changed so that under emacs, it just
3678 * IPython/genutils.py (page): Changed so that under emacs, it just
3674 prints the string. You can then page up and down in the emacs
3679 prints the string. You can then page up and down in the emacs
3675 buffer itself. This is how the builtin help() works.
3680 buffer itself. This is how the builtin help() works.
3676
3681
3677 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
3682 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
3678 macro scoping: macros need to be executed in the user's namespace
3683 macro scoping: macros need to be executed in the user's namespace
3679 to work as if they had been typed by the user.
3684 to work as if they had been typed by the user.
3680
3685
3681 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
3686 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
3682 execute automatically (no need to type 'exec...'). They then
3687 execute automatically (no need to type 'exec...'). They then
3683 behave like 'true macros'. The printing system was also modified
3688 behave like 'true macros'. The printing system was also modified
3684 for this to work.
3689 for this to work.
3685
3690
3686 2002-02-19 Fernando Perez <fperez@colorado.edu>
3691 2002-02-19 Fernando Perez <fperez@colorado.edu>
3687
3692
3688 * IPython/genutils.py (page_file): new function for paging files
3693 * IPython/genutils.py (page_file): new function for paging files
3689 in an OS-independent way. Also necessary for file viewing to work
3694 in an OS-independent way. Also necessary for file viewing to work
3690 well inside Emacs buffers.
3695 well inside Emacs buffers.
3691 (page): Added checks for being in an emacs buffer.
3696 (page): Added checks for being in an emacs buffer.
3692 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
3697 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
3693 same bug in iplib.
3698 same bug in iplib.
3694
3699
3695 2002-02-18 Fernando Perez <fperez@colorado.edu>
3700 2002-02-18 Fernando Perez <fperez@colorado.edu>
3696
3701
3697 * IPython/iplib.py (InteractiveShell.init_readline): modified use
3702 * IPython/iplib.py (InteractiveShell.init_readline): modified use
3698 of readline so that IPython can work inside an Emacs buffer.
3703 of readline so that IPython can work inside an Emacs buffer.
3699
3704
3700 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
3705 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
3701 method signatures (they weren't really bugs, but it looks cleaner
3706 method signatures (they weren't really bugs, but it looks cleaner
3702 and keeps PyChecker happy).
3707 and keeps PyChecker happy).
3703
3708
3704 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
3709 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
3705 for implementing various user-defined hooks. Currently only
3710 for implementing various user-defined hooks. Currently only
3706 display is done.
3711 display is done.
3707
3712
3708 * IPython/Prompts.py (CachedOutput._display): changed display
3713 * IPython/Prompts.py (CachedOutput._display): changed display
3709 functions so that they can be dynamically changed by users easily.
3714 functions so that they can be dynamically changed by users easily.
3710
3715
3711 * IPython/Extensions/numeric_formats.py (num_display): added an
3716 * IPython/Extensions/numeric_formats.py (num_display): added an
3712 extension for printing NumPy arrays in flexible manners. It
3717 extension for printing NumPy arrays in flexible manners. It
3713 doesn't do anything yet, but all the structure is in
3718 doesn't do anything yet, but all the structure is in
3714 place. Ultimately the plan is to implement output format control
3719 place. Ultimately the plan is to implement output format control
3715 like in Octave.
3720 like in Octave.
3716
3721
3717 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
3722 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
3718 methods are found at run-time by all the automatic machinery.
3723 methods are found at run-time by all the automatic machinery.
3719
3724
3720 2002-02-17 Fernando Perez <fperez@colorado.edu>
3725 2002-02-17 Fernando Perez <fperez@colorado.edu>
3721
3726
3722 * setup_Windows.py (make_shortcut): documented. Cleaned up the
3727 * setup_Windows.py (make_shortcut): documented. Cleaned up the
3723 whole file a little.
3728 whole file a little.
3724
3729
3725 * ToDo: closed this document. Now there's a new_design.lyx
3730 * ToDo: closed this document. Now there's a new_design.lyx
3726 document for all new ideas. Added making a pdf of it for the
3731 document for all new ideas. Added making a pdf of it for the
3727 end-user distro.
3732 end-user distro.
3728
3733
3729 * IPython/Logger.py (Logger.switch_log): Created this to replace
3734 * IPython/Logger.py (Logger.switch_log): Created this to replace
3730 logon() and logoff(). It also fixes a nasty crash reported by
3735 logon() and logoff(). It also fixes a nasty crash reported by
3731 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
3736 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
3732
3737
3733 * IPython/iplib.py (complete): got auto-completion to work with
3738 * IPython/iplib.py (complete): got auto-completion to work with
3734 automagic (I had wanted this for a long time).
3739 automagic (I had wanted this for a long time).
3735
3740
3736 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
3741 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
3737 to @file, since file() is now a builtin and clashes with automagic
3742 to @file, since file() is now a builtin and clashes with automagic
3738 for @file.
3743 for @file.
3739
3744
3740 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
3745 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
3741 of this was previously in iplib, which had grown to more than 2000
3746 of this was previously in iplib, which had grown to more than 2000
3742 lines, way too long. No new functionality, but it makes managing
3747 lines, way too long. No new functionality, but it makes managing
3743 the code a bit easier.
3748 the code a bit easier.
3744
3749
3745 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
3750 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
3746 information to crash reports.
3751 information to crash reports.
3747
3752
3748 2002-02-12 Fernando Perez <fperez@colorado.edu>
3753 2002-02-12 Fernando Perez <fperez@colorado.edu>
3749
3754
3750 * Released 0.2.5.
3755 * Released 0.2.5.
3751
3756
3752 2002-02-11 Fernando Perez <fperez@colorado.edu>
3757 2002-02-11 Fernando Perez <fperez@colorado.edu>
3753
3758
3754 * Wrote a relatively complete Windows installer. It puts
3759 * Wrote a relatively complete Windows installer. It puts
3755 everything in place, creates Start Menu entries and fixes the
3760 everything in place, creates Start Menu entries and fixes the
3756 color issues. Nothing fancy, but it works.
3761 color issues. Nothing fancy, but it works.
3757
3762
3758 2002-02-10 Fernando Perez <fperez@colorado.edu>
3763 2002-02-10 Fernando Perez <fperez@colorado.edu>
3759
3764
3760 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
3765 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
3761 os.path.expanduser() call so that we can type @run ~/myfile.py and
3766 os.path.expanduser() call so that we can type @run ~/myfile.py and
3762 have thigs work as expected.
3767 have thigs work as expected.
3763
3768
3764 * IPython/genutils.py (page): fixed exception handling so things
3769 * IPython/genutils.py (page): fixed exception handling so things
3765 work both in Unix and Windows correctly. Quitting a pager triggers
3770 work both in Unix and Windows correctly. Quitting a pager triggers
3766 an IOError/broken pipe in Unix, and in windows not finding a pager
3771 an IOError/broken pipe in Unix, and in windows not finding a pager
3767 is also an IOError, so I had to actually look at the return value
3772 is also an IOError, so I had to actually look at the return value
3768 of the exception, not just the exception itself. Should be ok now.
3773 of the exception, not just the exception itself. Should be ok now.
3769
3774
3770 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
3775 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
3771 modified to allow case-insensitive color scheme changes.
3776 modified to allow case-insensitive color scheme changes.
3772
3777
3773 2002-02-09 Fernando Perez <fperez@colorado.edu>
3778 2002-02-09 Fernando Perez <fperez@colorado.edu>
3774
3779
3775 * IPython/genutils.py (native_line_ends): new function to leave
3780 * IPython/genutils.py (native_line_ends): new function to leave
3776 user config files with os-native line-endings.
3781 user config files with os-native line-endings.
3777
3782
3778 * README and manual updates.
3783 * README and manual updates.
3779
3784
3780 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
3785 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
3781 instead of StringType to catch Unicode strings.
3786 instead of StringType to catch Unicode strings.
3782
3787
3783 * IPython/genutils.py (filefind): fixed bug for paths with
3788 * IPython/genutils.py (filefind): fixed bug for paths with
3784 embedded spaces (very common in Windows).
3789 embedded spaces (very common in Windows).
3785
3790
3786 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
3791 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
3787 files under Windows, so that they get automatically associated
3792 files under Windows, so that they get automatically associated
3788 with a text editor. Windows makes it a pain to handle
3793 with a text editor. Windows makes it a pain to handle
3789 extension-less files.
3794 extension-less files.
3790
3795
3791 * IPython/iplib.py (InteractiveShell.init_readline): Made the
3796 * IPython/iplib.py (InteractiveShell.init_readline): Made the
3792 warning about readline only occur for Posix. In Windows there's no
3797 warning about readline only occur for Posix. In Windows there's no
3793 way to get readline, so why bother with the warning.
3798 way to get readline, so why bother with the warning.
3794
3799
3795 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
3800 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
3796 for __str__ instead of dir(self), since dir() changed in 2.2.
3801 for __str__ instead of dir(self), since dir() changed in 2.2.
3797
3802
3798 * Ported to Windows! Tested on XP, I suspect it should work fine
3803 * Ported to Windows! Tested on XP, I suspect it should work fine
3799 on NT/2000, but I don't think it will work on 98 et al. That
3804 on NT/2000, but I don't think it will work on 98 et al. That
3800 series of Windows is such a piece of junk anyway that I won't try
3805 series of Windows is such a piece of junk anyway that I won't try
3801 porting it there. The XP port was straightforward, showed a few
3806 porting it there. The XP port was straightforward, showed a few
3802 bugs here and there (fixed all), in particular some string
3807 bugs here and there (fixed all), in particular some string
3803 handling stuff which required considering Unicode strings (which
3808 handling stuff which required considering Unicode strings (which
3804 Windows uses). This is good, but hasn't been too tested :) No
3809 Windows uses). This is good, but hasn't been too tested :) No
3805 fancy installer yet, I'll put a note in the manual so people at
3810 fancy installer yet, I'll put a note in the manual so people at
3806 least make manually a shortcut.
3811 least make manually a shortcut.
3807
3812
3808 * IPython/iplib.py (Magic.magic_colors): Unified the color options
3813 * IPython/iplib.py (Magic.magic_colors): Unified the color options
3809 into a single one, "colors". This now controls both prompt and
3814 into a single one, "colors". This now controls both prompt and
3810 exception color schemes, and can be changed both at startup
3815 exception color schemes, and can be changed both at startup
3811 (either via command-line switches or via ipythonrc files) and at
3816 (either via command-line switches or via ipythonrc files) and at
3812 runtime, with @colors.
3817 runtime, with @colors.
3813 (Magic.magic_run): renamed @prun to @run and removed the old
3818 (Magic.magic_run): renamed @prun to @run and removed the old
3814 @run. The two were too similar to warrant keeping both.
3819 @run. The two were too similar to warrant keeping both.
3815
3820
3816 2002-02-03 Fernando Perez <fperez@colorado.edu>
3821 2002-02-03 Fernando Perez <fperez@colorado.edu>
3817
3822
3818 * IPython/iplib.py (install_first_time): Added comment on how to
3823 * IPython/iplib.py (install_first_time): Added comment on how to
3819 configure the color options for first-time users. Put a <return>
3824 configure the color options for first-time users. Put a <return>
3820 request at the end so that small-terminal users get a chance to
3825 request at the end so that small-terminal users get a chance to
3821 read the startup info.
3826 read the startup info.
3822
3827
3823 2002-01-23 Fernando Perez <fperez@colorado.edu>
3828 2002-01-23 Fernando Perez <fperez@colorado.edu>
3824
3829
3825 * IPython/iplib.py (CachedOutput.update): Changed output memory
3830 * IPython/iplib.py (CachedOutput.update): Changed output memory
3826 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
3831 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
3827 input history we still use _i. Did this b/c these variable are
3832 input history we still use _i. Did this b/c these variable are
3828 very commonly used in interactive work, so the less we need to
3833 very commonly used in interactive work, so the less we need to
3829 type the better off we are.
3834 type the better off we are.
3830 (Magic.magic_prun): updated @prun to better handle the namespaces
3835 (Magic.magic_prun): updated @prun to better handle the namespaces
3831 the file will run in, including a fix for __name__ not being set
3836 the file will run in, including a fix for __name__ not being set
3832 before.
3837 before.
3833
3838
3834 2002-01-20 Fernando Perez <fperez@colorado.edu>
3839 2002-01-20 Fernando Perez <fperez@colorado.edu>
3835
3840
3836 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
3841 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
3837 extra garbage for Python 2.2. Need to look more carefully into
3842 extra garbage for Python 2.2. Need to look more carefully into
3838 this later.
3843 this later.
3839
3844
3840 2002-01-19 Fernando Perez <fperez@colorado.edu>
3845 2002-01-19 Fernando Perez <fperez@colorado.edu>
3841
3846
3842 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
3847 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
3843 display SyntaxError exceptions properly formatted when they occur
3848 display SyntaxError exceptions properly formatted when they occur
3844 (they can be triggered by imported code).
3849 (they can be triggered by imported code).
3845
3850
3846 2002-01-18 Fernando Perez <fperez@colorado.edu>
3851 2002-01-18 Fernando Perez <fperez@colorado.edu>
3847
3852
3848 * IPython/iplib.py (InteractiveShell.safe_execfile): now
3853 * IPython/iplib.py (InteractiveShell.safe_execfile): now
3849 SyntaxError exceptions are reported nicely formatted, instead of
3854 SyntaxError exceptions are reported nicely formatted, instead of
3850 spitting out only offset information as before.
3855 spitting out only offset information as before.
3851 (Magic.magic_prun): Added the @prun function for executing
3856 (Magic.magic_prun): Added the @prun function for executing
3852 programs with command line args inside IPython.
3857 programs with command line args inside IPython.
3853
3858
3854 2002-01-16 Fernando Perez <fperez@colorado.edu>
3859 2002-01-16 Fernando Perez <fperez@colorado.edu>
3855
3860
3856 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
3861 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
3857 to *not* include the last item given in a range. This brings their
3862 to *not* include the last item given in a range. This brings their
3858 behavior in line with Python's slicing:
3863 behavior in line with Python's slicing:
3859 a[n1:n2] -> a[n1]...a[n2-1]
3864 a[n1:n2] -> a[n1]...a[n2-1]
3860 It may be a bit less convenient, but I prefer to stick to Python's
3865 It may be a bit less convenient, but I prefer to stick to Python's
3861 conventions *everywhere*, so users never have to wonder.
3866 conventions *everywhere*, so users never have to wonder.
3862 (Magic.magic_macro): Added @macro function to ease the creation of
3867 (Magic.magic_macro): Added @macro function to ease the creation of
3863 macros.
3868 macros.
3864
3869
3865 2002-01-05 Fernando Perez <fperez@colorado.edu>
3870 2002-01-05 Fernando Perez <fperez@colorado.edu>
3866
3871
3867 * Released 0.2.4.
3872 * Released 0.2.4.
3868
3873
3869 * IPython/iplib.py (Magic.magic_pdef):
3874 * IPython/iplib.py (Magic.magic_pdef):
3870 (InteractiveShell.safe_execfile): report magic lines and error
3875 (InteractiveShell.safe_execfile): report magic lines and error
3871 lines without line numbers so one can easily copy/paste them for
3876 lines without line numbers so one can easily copy/paste them for
3872 re-execution.
3877 re-execution.
3873
3878
3874 * Updated manual with recent changes.
3879 * Updated manual with recent changes.
3875
3880
3876 * IPython/iplib.py (Magic.magic_oinfo): added constructor
3881 * IPython/iplib.py (Magic.magic_oinfo): added constructor
3877 docstring printing when class? is called. Very handy for knowing
3882 docstring printing when class? is called. Very handy for knowing
3878 how to create class instances (as long as __init__ is well
3883 how to create class instances (as long as __init__ is well
3879 documented, of course :)
3884 documented, of course :)
3880 (Magic.magic_doc): print both class and constructor docstrings.
3885 (Magic.magic_doc): print both class and constructor docstrings.
3881 (Magic.magic_pdef): give constructor info if passed a class and
3886 (Magic.magic_pdef): give constructor info if passed a class and
3882 __call__ info for callable object instances.
3887 __call__ info for callable object instances.
3883
3888
3884 2002-01-04 Fernando Perez <fperez@colorado.edu>
3889 2002-01-04 Fernando Perez <fperez@colorado.edu>
3885
3890
3886 * Made deep_reload() off by default. It doesn't always work
3891 * Made deep_reload() off by default. It doesn't always work
3887 exactly as intended, so it's probably safer to have it off. It's
3892 exactly as intended, so it's probably safer to have it off. It's
3888 still available as dreload() anyway, so nothing is lost.
3893 still available as dreload() anyway, so nothing is lost.
3889
3894
3890 2002-01-02 Fernando Perez <fperez@colorado.edu>
3895 2002-01-02 Fernando Perez <fperez@colorado.edu>
3891
3896
3892 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
3897 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
3893 so I wanted an updated release).
3898 so I wanted an updated release).
3894
3899
3895 2001-12-27 Fernando Perez <fperez@colorado.edu>
3900 2001-12-27 Fernando Perez <fperez@colorado.edu>
3896
3901
3897 * IPython/iplib.py (InteractiveShell.interact): Added the original
3902 * IPython/iplib.py (InteractiveShell.interact): Added the original
3898 code from 'code.py' for this module in order to change the
3903 code from 'code.py' for this module in order to change the
3899 handling of a KeyboardInterrupt. This was necessary b/c otherwise
3904 handling of a KeyboardInterrupt. This was necessary b/c otherwise
3900 the history cache would break when the user hit Ctrl-C, and
3905 the history cache would break when the user hit Ctrl-C, and
3901 interact() offers no way to add any hooks to it.
3906 interact() offers no way to add any hooks to it.
3902
3907
3903 2001-12-23 Fernando Perez <fperez@colorado.edu>
3908 2001-12-23 Fernando Perez <fperez@colorado.edu>
3904
3909
3905 * setup.py: added check for 'MANIFEST' before trying to remove
3910 * setup.py: added check for 'MANIFEST' before trying to remove
3906 it. Thanks to Sean Reifschneider.
3911 it. Thanks to Sean Reifschneider.
3907
3912
3908 2001-12-22 Fernando Perez <fperez@colorado.edu>
3913 2001-12-22 Fernando Perez <fperez@colorado.edu>
3909
3914
3910 * Released 0.2.2.
3915 * Released 0.2.2.
3911
3916
3912 * Finished (reasonably) writing the manual. Later will add the
3917 * Finished (reasonably) writing the manual. Later will add the
3913 python-standard navigation stylesheets, but for the time being
3918 python-standard navigation stylesheets, but for the time being
3914 it's fairly complete. Distribution will include html and pdf
3919 it's fairly complete. Distribution will include html and pdf
3915 versions.
3920 versions.
3916
3921
3917 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
3922 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
3918 (MayaVi author).
3923 (MayaVi author).
3919
3924
3920 2001-12-21 Fernando Perez <fperez@colorado.edu>
3925 2001-12-21 Fernando Perez <fperez@colorado.edu>
3921
3926
3922 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
3927 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
3923 good public release, I think (with the manual and the distutils
3928 good public release, I think (with the manual and the distutils
3924 installer). The manual can use some work, but that can go
3929 installer). The manual can use some work, but that can go
3925 slowly. Otherwise I think it's quite nice for end users. Next
3930 slowly. Otherwise I think it's quite nice for end users. Next
3926 summer, rewrite the guts of it...
3931 summer, rewrite the guts of it...
3927
3932
3928 * Changed format of ipythonrc files to use whitespace as the
3933 * Changed format of ipythonrc files to use whitespace as the
3929 separator instead of an explicit '='. Cleaner.
3934 separator instead of an explicit '='. Cleaner.
3930
3935
3931 2001-12-20 Fernando Perez <fperez@colorado.edu>
3936 2001-12-20 Fernando Perez <fperez@colorado.edu>
3932
3937
3933 * Started a manual in LyX. For now it's just a quick merge of the
3938 * Started a manual in LyX. For now it's just a quick merge of the
3934 various internal docstrings and READMEs. Later it may grow into a
3939 various internal docstrings and READMEs. Later it may grow into a
3935 nice, full-blown manual.
3940 nice, full-blown manual.
3936
3941
3937 * Set up a distutils based installer. Installation should now be
3942 * Set up a distutils based installer. Installation should now be
3938 trivially simple for end-users.
3943 trivially simple for end-users.
3939
3944
3940 2001-12-11 Fernando Perez <fperez@colorado.edu>
3945 2001-12-11 Fernando Perez <fperez@colorado.edu>
3941
3946
3942 * Released 0.2.0. First public release, announced it at
3947 * Released 0.2.0. First public release, announced it at
3943 comp.lang.python. From now on, just bugfixes...
3948 comp.lang.python. From now on, just bugfixes...
3944
3949
3945 * Went through all the files, set copyright/license notices and
3950 * Went through all the files, set copyright/license notices and
3946 cleaned up things. Ready for release.
3951 cleaned up things. Ready for release.
3947
3952
3948 2001-12-10 Fernando Perez <fperez@colorado.edu>
3953 2001-12-10 Fernando Perez <fperez@colorado.edu>
3949
3954
3950 * Changed the first-time installer not to use tarfiles. It's more
3955 * Changed the first-time installer not to use tarfiles. It's more
3951 robust now and less unix-dependent. Also makes it easier for
3956 robust now and less unix-dependent. Also makes it easier for
3952 people to later upgrade versions.
3957 people to later upgrade versions.
3953
3958
3954 * Changed @exit to @abort to reflect the fact that it's pretty
3959 * Changed @exit to @abort to reflect the fact that it's pretty
3955 brutal (a sys.exit()). The difference between @abort and Ctrl-D
3960 brutal (a sys.exit()). The difference between @abort and Ctrl-D
3956 becomes significant only when IPyhton is embedded: in that case,
3961 becomes significant only when IPyhton is embedded: in that case,
3957 C-D closes IPython only, but @abort kills the enclosing program
3962 C-D closes IPython only, but @abort kills the enclosing program
3958 too (unless it had called IPython inside a try catching
3963 too (unless it had called IPython inside a try catching
3959 SystemExit).
3964 SystemExit).
3960
3965
3961 * Created Shell module which exposes the actuall IPython Shell
3966 * Created Shell module which exposes the actuall IPython Shell
3962 classes, currently the normal and the embeddable one. This at
3967 classes, currently the normal and the embeddable one. This at
3963 least offers a stable interface we won't need to change when
3968 least offers a stable interface we won't need to change when
3964 (later) the internals are rewritten. That rewrite will be confined
3969 (later) the internals are rewritten. That rewrite will be confined
3965 to iplib and ipmaker, but the Shell interface should remain as is.
3970 to iplib and ipmaker, but the Shell interface should remain as is.
3966
3971
3967 * Added embed module which offers an embeddable IPShell object,
3972 * Added embed module which offers an embeddable IPShell object,
3968 useful to fire up IPython *inside* a running program. Great for
3973 useful to fire up IPython *inside* a running program. Great for
3969 debugging or dynamical data analysis.
3974 debugging or dynamical data analysis.
3970
3975
3971 2001-12-08 Fernando Perez <fperez@colorado.edu>
3976 2001-12-08 Fernando Perez <fperez@colorado.edu>
3972
3977
3973 * Fixed small bug preventing seeing info from methods of defined
3978 * Fixed small bug preventing seeing info from methods of defined
3974 objects (incorrect namespace in _ofind()).
3979 objects (incorrect namespace in _ofind()).
3975
3980
3976 * Documentation cleanup. Moved the main usage docstrings to a
3981 * Documentation cleanup. Moved the main usage docstrings to a
3977 separate file, usage.py (cleaner to maintain, and hopefully in the
3982 separate file, usage.py (cleaner to maintain, and hopefully in the
3978 future some perlpod-like way of producing interactive, man and
3983 future some perlpod-like way of producing interactive, man and
3979 html docs out of it will be found).
3984 html docs out of it will be found).
3980
3985
3981 * Added @profile to see your profile at any time.
3986 * Added @profile to see your profile at any time.
3982
3987
3983 * Added @p as an alias for 'print'. It's especially convenient if
3988 * Added @p as an alias for 'print'. It's especially convenient if
3984 using automagic ('p x' prints x).
3989 using automagic ('p x' prints x).
3985
3990
3986 * Small cleanups and fixes after a pychecker run.
3991 * Small cleanups and fixes after a pychecker run.
3987
3992
3988 * Changed the @cd command to handle @cd - and @cd -<n> for
3993 * Changed the @cd command to handle @cd - and @cd -<n> for
3989 visiting any directory in _dh.
3994 visiting any directory in _dh.
3990
3995
3991 * Introduced _dh, a history of visited directories. @dhist prints
3996 * Introduced _dh, a history of visited directories. @dhist prints
3992 it out with numbers.
3997 it out with numbers.
3993
3998
3994 2001-12-07 Fernando Perez <fperez@colorado.edu>
3999 2001-12-07 Fernando Perez <fperez@colorado.edu>
3995
4000
3996 * Released 0.1.22
4001 * Released 0.1.22
3997
4002
3998 * Made initialization a bit more robust against invalid color
4003 * Made initialization a bit more robust against invalid color
3999 options in user input (exit, not traceback-crash).
4004 options in user input (exit, not traceback-crash).
4000
4005
4001 * Changed the bug crash reporter to write the report only in the
4006 * Changed the bug crash reporter to write the report only in the
4002 user's .ipython directory. That way IPython won't litter people's
4007 user's .ipython directory. That way IPython won't litter people's
4003 hard disks with crash files all over the place. Also print on
4008 hard disks with crash files all over the place. Also print on
4004 screen the necessary mail command.
4009 screen the necessary mail command.
4005
4010
4006 * With the new ultraTB, implemented LightBG color scheme for light
4011 * With the new ultraTB, implemented LightBG color scheme for light
4007 background terminals. A lot of people like white backgrounds, so I
4012 background terminals. A lot of people like white backgrounds, so I
4008 guess we should at least give them something readable.
4013 guess we should at least give them something readable.
4009
4014
4010 2001-12-06 Fernando Perez <fperez@colorado.edu>
4015 2001-12-06 Fernando Perez <fperez@colorado.edu>
4011
4016
4012 * Modified the structure of ultraTB. Now there's a proper class
4017 * Modified the structure of ultraTB. Now there's a proper class
4013 for tables of color schemes which allow adding schemes easily and
4018 for tables of color schemes which allow adding schemes easily and
4014 switching the active scheme without creating a new instance every
4019 switching the active scheme without creating a new instance every
4015 time (which was ridiculous). The syntax for creating new schemes
4020 time (which was ridiculous). The syntax for creating new schemes
4016 is also cleaner. I think ultraTB is finally done, with a clean
4021 is also cleaner. I think ultraTB is finally done, with a clean
4017 class structure. Names are also much cleaner (now there's proper
4022 class structure. Names are also much cleaner (now there's proper
4018 color tables, no need for every variable to also have 'color' in
4023 color tables, no need for every variable to also have 'color' in
4019 its name).
4024 its name).
4020
4025
4021 * Broke down genutils into separate files. Now genutils only
4026 * Broke down genutils into separate files. Now genutils only
4022 contains utility functions, and classes have been moved to their
4027 contains utility functions, and classes have been moved to their
4023 own files (they had enough independent functionality to warrant
4028 own files (they had enough independent functionality to warrant
4024 it): ConfigLoader, OutputTrap, Struct.
4029 it): ConfigLoader, OutputTrap, Struct.
4025
4030
4026 2001-12-05 Fernando Perez <fperez@colorado.edu>
4031 2001-12-05 Fernando Perez <fperez@colorado.edu>
4027
4032
4028 * IPython turns 21! Released version 0.1.21, as a candidate for
4033 * IPython turns 21! Released version 0.1.21, as a candidate for
4029 public consumption. If all goes well, release in a few days.
4034 public consumption. If all goes well, release in a few days.
4030
4035
4031 * Fixed path bug (files in Extensions/ directory wouldn't be found
4036 * Fixed path bug (files in Extensions/ directory wouldn't be found
4032 unless IPython/ was explicitly in sys.path).
4037 unless IPython/ was explicitly in sys.path).
4033
4038
4034 * Extended the FlexCompleter class as MagicCompleter to allow
4039 * Extended the FlexCompleter class as MagicCompleter to allow
4035 completion of @-starting lines.
4040 completion of @-starting lines.
4036
4041
4037 * Created __release__.py file as a central repository for release
4042 * Created __release__.py file as a central repository for release
4038 info that other files can read from.
4043 info that other files can read from.
4039
4044
4040 * Fixed small bug in logging: when logging was turned on in
4045 * Fixed small bug in logging: when logging was turned on in
4041 mid-session, old lines with special meanings (!@?) were being
4046 mid-session, old lines with special meanings (!@?) were being
4042 logged without the prepended comment, which is necessary since
4047 logged without the prepended comment, which is necessary since
4043 they are not truly valid python syntax. This should make session
4048 they are not truly valid python syntax. This should make session
4044 restores produce less errors.
4049 restores produce less errors.
4045
4050
4046 * The namespace cleanup forced me to make a FlexCompleter class
4051 * The namespace cleanup forced me to make a FlexCompleter class
4047 which is nothing but a ripoff of rlcompleter, but with selectable
4052 which is nothing but a ripoff of rlcompleter, but with selectable
4048 namespace (rlcompleter only works in __main__.__dict__). I'll try
4053 namespace (rlcompleter only works in __main__.__dict__). I'll try
4049 to submit a note to the authors to see if this change can be
4054 to submit a note to the authors to see if this change can be
4050 incorporated in future rlcompleter releases (Dec.6: done)
4055 incorporated in future rlcompleter releases (Dec.6: done)
4051
4056
4052 * More fixes to namespace handling. It was a mess! Now all
4057 * More fixes to namespace handling. It was a mess! Now all
4053 explicit references to __main__.__dict__ are gone (except when
4058 explicit references to __main__.__dict__ are gone (except when
4054 really needed) and everything is handled through the namespace
4059 really needed) and everything is handled through the namespace
4055 dicts in the IPython instance. We seem to be getting somewhere
4060 dicts in the IPython instance. We seem to be getting somewhere
4056 with this, finally...
4061 with this, finally...
4057
4062
4058 * Small documentation updates.
4063 * Small documentation updates.
4059
4064
4060 * Created the Extensions directory under IPython (with an
4065 * Created the Extensions directory under IPython (with an
4061 __init__.py). Put the PhysicalQ stuff there. This directory should
4066 __init__.py). Put the PhysicalQ stuff there. This directory should
4062 be used for all special-purpose extensions.
4067 be used for all special-purpose extensions.
4063
4068
4064 * File renaming:
4069 * File renaming:
4065 ipythonlib --> ipmaker
4070 ipythonlib --> ipmaker
4066 ipplib --> iplib
4071 ipplib --> iplib
4067 This makes a bit more sense in terms of what these files actually do.
4072 This makes a bit more sense in terms of what these files actually do.
4068
4073
4069 * Moved all the classes and functions in ipythonlib to ipplib, so
4074 * Moved all the classes and functions in ipythonlib to ipplib, so
4070 now ipythonlib only has make_IPython(). This will ease up its
4075 now ipythonlib only has make_IPython(). This will ease up its
4071 splitting in smaller functional chunks later.
4076 splitting in smaller functional chunks later.
4072
4077
4073 * Cleaned up (done, I think) output of @whos. Better column
4078 * Cleaned up (done, I think) output of @whos. Better column
4074 formatting, and now shows str(var) for as much as it can, which is
4079 formatting, and now shows str(var) for as much as it can, which is
4075 typically what one gets with a 'print var'.
4080 typically what one gets with a 'print var'.
4076
4081
4077 2001-12-04 Fernando Perez <fperez@colorado.edu>
4082 2001-12-04 Fernando Perez <fperez@colorado.edu>
4078
4083
4079 * Fixed namespace problems. Now builtin/IPyhton/user names get
4084 * Fixed namespace problems. Now builtin/IPyhton/user names get
4080 properly reported in their namespace. Internal namespace handling
4085 properly reported in their namespace. Internal namespace handling
4081 is finally getting decent (not perfect yet, but much better than
4086 is finally getting decent (not perfect yet, but much better than
4082 the ad-hoc mess we had).
4087 the ad-hoc mess we had).
4083
4088
4084 * Removed -exit option. If people just want to run a python
4089 * Removed -exit option. If people just want to run a python
4085 script, that's what the normal interpreter is for. Less
4090 script, that's what the normal interpreter is for. Less
4086 unnecessary options, less chances for bugs.
4091 unnecessary options, less chances for bugs.
4087
4092
4088 * Added a crash handler which generates a complete post-mortem if
4093 * Added a crash handler which generates a complete post-mortem if
4089 IPython crashes. This will help a lot in tracking bugs down the
4094 IPython crashes. This will help a lot in tracking bugs down the
4090 road.
4095 road.
4091
4096
4092 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4097 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4093 which were boud to functions being reassigned would bypass the
4098 which were boud to functions being reassigned would bypass the
4094 logger, breaking the sync of _il with the prompt counter. This
4099 logger, breaking the sync of _il with the prompt counter. This
4095 would then crash IPython later when a new line was logged.
4100 would then crash IPython later when a new line was logged.
4096
4101
4097 2001-12-02 Fernando Perez <fperez@colorado.edu>
4102 2001-12-02 Fernando Perez <fperez@colorado.edu>
4098
4103
4099 * Made IPython a package. This means people don't have to clutter
4104 * Made IPython a package. This means people don't have to clutter
4100 their sys.path with yet another directory. Changed the INSTALL
4105 their sys.path with yet another directory. Changed the INSTALL
4101 file accordingly.
4106 file accordingly.
4102
4107
4103 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4108 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4104 sorts its output (so @who shows it sorted) and @whos formats the
4109 sorts its output (so @who shows it sorted) and @whos formats the
4105 table according to the width of the first column. Nicer, easier to
4110 table according to the width of the first column. Nicer, easier to
4106 read. Todo: write a generic table_format() which takes a list of
4111 read. Todo: write a generic table_format() which takes a list of
4107 lists and prints it nicely formatted, with optional row/column
4112 lists and prints it nicely formatted, with optional row/column
4108 separators and proper padding and justification.
4113 separators and proper padding and justification.
4109
4114
4110 * Released 0.1.20
4115 * Released 0.1.20
4111
4116
4112 * Fixed bug in @log which would reverse the inputcache list (a
4117 * Fixed bug in @log which would reverse the inputcache list (a
4113 copy operation was missing).
4118 copy operation was missing).
4114
4119
4115 * Code cleanup. @config was changed to use page(). Better, since
4120 * Code cleanup. @config was changed to use page(). Better, since
4116 its output is always quite long.
4121 its output is always quite long.
4117
4122
4118 * Itpl is back as a dependency. I was having too many problems
4123 * Itpl is back as a dependency. I was having too many problems
4119 getting the parametric aliases to work reliably, and it's just
4124 getting the parametric aliases to work reliably, and it's just
4120 easier to code weird string operations with it than playing %()s
4125 easier to code weird string operations with it than playing %()s
4121 games. It's only ~6k, so I don't think it's too big a deal.
4126 games. It's only ~6k, so I don't think it's too big a deal.
4122
4127
4123 * Found (and fixed) a very nasty bug with history. !lines weren't
4128 * Found (and fixed) a very nasty bug with history. !lines weren't
4124 getting cached, and the out of sync caches would crash
4129 getting cached, and the out of sync caches would crash
4125 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4130 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4126 division of labor a bit better. Bug fixed, cleaner structure.
4131 division of labor a bit better. Bug fixed, cleaner structure.
4127
4132
4128 2001-12-01 Fernando Perez <fperez@colorado.edu>
4133 2001-12-01 Fernando Perez <fperez@colorado.edu>
4129
4134
4130 * Released 0.1.19
4135 * Released 0.1.19
4131
4136
4132 * Added option -n to @hist to prevent line number printing. Much
4137 * Added option -n to @hist to prevent line number printing. Much
4133 easier to copy/paste code this way.
4138 easier to copy/paste code this way.
4134
4139
4135 * Created global _il to hold the input list. Allows easy
4140 * Created global _il to hold the input list. Allows easy
4136 re-execution of blocks of code by slicing it (inspired by Janko's
4141 re-execution of blocks of code by slicing it (inspired by Janko's
4137 comment on 'macros').
4142 comment on 'macros').
4138
4143
4139 * Small fixes and doc updates.
4144 * Small fixes and doc updates.
4140
4145
4141 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4146 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4142 much too fragile with automagic. Handles properly multi-line
4147 much too fragile with automagic. Handles properly multi-line
4143 statements and takes parameters.
4148 statements and takes parameters.
4144
4149
4145 2001-11-30 Fernando Perez <fperez@colorado.edu>
4150 2001-11-30 Fernando Perez <fperez@colorado.edu>
4146
4151
4147 * Version 0.1.18 released.
4152 * Version 0.1.18 released.
4148
4153
4149 * Fixed nasty namespace bug in initial module imports.
4154 * Fixed nasty namespace bug in initial module imports.
4150
4155
4151 * Added copyright/license notes to all code files (except
4156 * Added copyright/license notes to all code files (except
4152 DPyGetOpt). For the time being, LGPL. That could change.
4157 DPyGetOpt). For the time being, LGPL. That could change.
4153
4158
4154 * Rewrote a much nicer README, updated INSTALL, cleaned up
4159 * Rewrote a much nicer README, updated INSTALL, cleaned up
4155 ipythonrc-* samples.
4160 ipythonrc-* samples.
4156
4161
4157 * Overall code/documentation cleanup. Basically ready for
4162 * Overall code/documentation cleanup. Basically ready for
4158 release. Only remaining thing: licence decision (LGPL?).
4163 release. Only remaining thing: licence decision (LGPL?).
4159
4164
4160 * Converted load_config to a class, ConfigLoader. Now recursion
4165 * Converted load_config to a class, ConfigLoader. Now recursion
4161 control is better organized. Doesn't include the same file twice.
4166 control is better organized. Doesn't include the same file twice.
4162
4167
4163 2001-11-29 Fernando Perez <fperez@colorado.edu>
4168 2001-11-29 Fernando Perez <fperez@colorado.edu>
4164
4169
4165 * Got input history working. Changed output history variables from
4170 * Got input history working. Changed output history variables from
4166 _p to _o so that _i is for input and _o for output. Just cleaner
4171 _p to _o so that _i is for input and _o for output. Just cleaner
4167 convention.
4172 convention.
4168
4173
4169 * Implemented parametric aliases. This pretty much allows the
4174 * Implemented parametric aliases. This pretty much allows the
4170 alias system to offer full-blown shell convenience, I think.
4175 alias system to offer full-blown shell convenience, I think.
4171
4176
4172 * Version 0.1.17 released, 0.1.18 opened.
4177 * Version 0.1.17 released, 0.1.18 opened.
4173
4178
4174 * dot_ipython/ipythonrc (alias): added documentation.
4179 * dot_ipython/ipythonrc (alias): added documentation.
4175 (xcolor): Fixed small bug (xcolors -> xcolor)
4180 (xcolor): Fixed small bug (xcolors -> xcolor)
4176
4181
4177 * Changed the alias system. Now alias is a magic command to define
4182 * Changed the alias system. Now alias is a magic command to define
4178 aliases just like the shell. Rationale: the builtin magics should
4183 aliases just like the shell. Rationale: the builtin magics should
4179 be there for things deeply connected to IPython's
4184 be there for things deeply connected to IPython's
4180 architecture. And this is a much lighter system for what I think
4185 architecture. And this is a much lighter system for what I think
4181 is the really important feature: allowing users to define quickly
4186 is the really important feature: allowing users to define quickly
4182 magics that will do shell things for them, so they can customize
4187 magics that will do shell things for them, so they can customize
4183 IPython easily to match their work habits. If someone is really
4188 IPython easily to match their work habits. If someone is really
4184 desperate to have another name for a builtin alias, they can
4189 desperate to have another name for a builtin alias, they can
4185 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4190 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4186 works.
4191 works.
4187
4192
4188 2001-11-28 Fernando Perez <fperez@colorado.edu>
4193 2001-11-28 Fernando Perez <fperez@colorado.edu>
4189
4194
4190 * Changed @file so that it opens the source file at the proper
4195 * Changed @file so that it opens the source file at the proper
4191 line. Since it uses less, if your EDITOR environment is
4196 line. Since it uses less, if your EDITOR environment is
4192 configured, typing v will immediately open your editor of choice
4197 configured, typing v will immediately open your editor of choice
4193 right at the line where the object is defined. Not as quick as
4198 right at the line where the object is defined. Not as quick as
4194 having a direct @edit command, but for all intents and purposes it
4199 having a direct @edit command, but for all intents and purposes it
4195 works. And I don't have to worry about writing @edit to deal with
4200 works. And I don't have to worry about writing @edit to deal with
4196 all the editors, less does that.
4201 all the editors, less does that.
4197
4202
4198 * Version 0.1.16 released, 0.1.17 opened.
4203 * Version 0.1.16 released, 0.1.17 opened.
4199
4204
4200 * Fixed some nasty bugs in the page/page_dumb combo that could
4205 * Fixed some nasty bugs in the page/page_dumb combo that could
4201 crash IPython.
4206 crash IPython.
4202
4207
4203 2001-11-27 Fernando Perez <fperez@colorado.edu>
4208 2001-11-27 Fernando Perez <fperez@colorado.edu>
4204
4209
4205 * Version 0.1.15 released, 0.1.16 opened.
4210 * Version 0.1.15 released, 0.1.16 opened.
4206
4211
4207 * Finally got ? and ?? to work for undefined things: now it's
4212 * Finally got ? and ?? to work for undefined things: now it's
4208 possible to type {}.get? and get information about the get method
4213 possible to type {}.get? and get information about the get method
4209 of dicts, or os.path? even if only os is defined (so technically
4214 of dicts, or os.path? even if only os is defined (so technically
4210 os.path isn't). Works at any level. For example, after import os,
4215 os.path isn't). Works at any level. For example, after import os,
4211 os?, os.path?, os.path.abspath? all work. This is great, took some
4216 os?, os.path?, os.path.abspath? all work. This is great, took some
4212 work in _ofind.
4217 work in _ofind.
4213
4218
4214 * Fixed more bugs with logging. The sanest way to do it was to add
4219 * Fixed more bugs with logging. The sanest way to do it was to add
4215 to @log a 'mode' parameter. Killed two in one shot (this mode
4220 to @log a 'mode' parameter. Killed two in one shot (this mode
4216 option was a request of Janko's). I think it's finally clean
4221 option was a request of Janko's). I think it's finally clean
4217 (famous last words).
4222 (famous last words).
4218
4223
4219 * Added a page_dumb() pager which does a decent job of paging on
4224 * Added a page_dumb() pager which does a decent job of paging on
4220 screen, if better things (like less) aren't available. One less
4225 screen, if better things (like less) aren't available. One less
4221 unix dependency (someday maybe somebody will port this to
4226 unix dependency (someday maybe somebody will port this to
4222 windows).
4227 windows).
4223
4228
4224 * Fixed problem in magic_log: would lock of logging out if log
4229 * Fixed problem in magic_log: would lock of logging out if log
4225 creation failed (because it would still think it had succeeded).
4230 creation failed (because it would still think it had succeeded).
4226
4231
4227 * Improved the page() function using curses to auto-detect screen
4232 * Improved the page() function using curses to auto-detect screen
4228 size. Now it can make a much better decision on whether to print
4233 size. Now it can make a much better decision on whether to print
4229 or page a string. Option screen_length was modified: a value 0
4234 or page a string. Option screen_length was modified: a value 0
4230 means auto-detect, and that's the default now.
4235 means auto-detect, and that's the default now.
4231
4236
4232 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4237 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4233 go out. I'll test it for a few days, then talk to Janko about
4238 go out. I'll test it for a few days, then talk to Janko about
4234 licences and announce it.
4239 licences and announce it.
4235
4240
4236 * Fixed the length of the auto-generated ---> prompt which appears
4241 * Fixed the length of the auto-generated ---> prompt which appears
4237 for auto-parens and auto-quotes. Getting this right isn't trivial,
4242 for auto-parens and auto-quotes. Getting this right isn't trivial,
4238 with all the color escapes, different prompt types and optional
4243 with all the color escapes, different prompt types and optional
4239 separators. But it seems to be working in all the combinations.
4244 separators. But it seems to be working in all the combinations.
4240
4245
4241 2001-11-26 Fernando Perez <fperez@colorado.edu>
4246 2001-11-26 Fernando Perez <fperez@colorado.edu>
4242
4247
4243 * Wrote a regexp filter to get option types from the option names
4248 * Wrote a regexp filter to get option types from the option names
4244 string. This eliminates the need to manually keep two duplicate
4249 string. This eliminates the need to manually keep two duplicate
4245 lists.
4250 lists.
4246
4251
4247 * Removed the unneeded check_option_names. Now options are handled
4252 * Removed the unneeded check_option_names. Now options are handled
4248 in a much saner manner and it's easy to visually check that things
4253 in a much saner manner and it's easy to visually check that things
4249 are ok.
4254 are ok.
4250
4255
4251 * Updated version numbers on all files I modified to carry a
4256 * Updated version numbers on all files I modified to carry a
4252 notice so Janko and Nathan have clear version markers.
4257 notice so Janko and Nathan have clear version markers.
4253
4258
4254 * Updated docstring for ultraTB with my changes. I should send
4259 * Updated docstring for ultraTB with my changes. I should send
4255 this to Nathan.
4260 this to Nathan.
4256
4261
4257 * Lots of small fixes. Ran everything through pychecker again.
4262 * Lots of small fixes. Ran everything through pychecker again.
4258
4263
4259 * Made loading of deep_reload an cmd line option. If it's not too
4264 * Made loading of deep_reload an cmd line option. If it's not too
4260 kosher, now people can just disable it. With -nodeep_reload it's
4265 kosher, now people can just disable it. With -nodeep_reload it's
4261 still available as dreload(), it just won't overwrite reload().
4266 still available as dreload(), it just won't overwrite reload().
4262
4267
4263 * Moved many options to the no| form (-opt and -noopt
4268 * Moved many options to the no| form (-opt and -noopt
4264 accepted). Cleaner.
4269 accepted). Cleaner.
4265
4270
4266 * Changed magic_log so that if called with no parameters, it uses
4271 * Changed magic_log so that if called with no parameters, it uses
4267 'rotate' mode. That way auto-generated logs aren't automatically
4272 'rotate' mode. That way auto-generated logs aren't automatically
4268 over-written. For normal logs, now a backup is made if it exists
4273 over-written. For normal logs, now a backup is made if it exists
4269 (only 1 level of backups). A new 'backup' mode was added to the
4274 (only 1 level of backups). A new 'backup' mode was added to the
4270 Logger class to support this. This was a request by Janko.
4275 Logger class to support this. This was a request by Janko.
4271
4276
4272 * Added @logoff/@logon to stop/restart an active log.
4277 * Added @logoff/@logon to stop/restart an active log.
4273
4278
4274 * Fixed a lot of bugs in log saving/replay. It was pretty
4279 * Fixed a lot of bugs in log saving/replay. It was pretty
4275 broken. Now special lines (!@,/) appear properly in the command
4280 broken. Now special lines (!@,/) appear properly in the command
4276 history after a log replay.
4281 history after a log replay.
4277
4282
4278 * Tried and failed to implement full session saving via pickle. My
4283 * Tried and failed to implement full session saving via pickle. My
4279 idea was to pickle __main__.__dict__, but modules can't be
4284 idea was to pickle __main__.__dict__, but modules can't be
4280 pickled. This would be a better alternative to replaying logs, but
4285 pickled. This would be a better alternative to replaying logs, but
4281 seems quite tricky to get to work. Changed -session to be called
4286 seems quite tricky to get to work. Changed -session to be called
4282 -logplay, which more accurately reflects what it does. And if we
4287 -logplay, which more accurately reflects what it does. And if we
4283 ever get real session saving working, -session is now available.
4288 ever get real session saving working, -session is now available.
4284
4289
4285 * Implemented color schemes for prompts also. As for tracebacks,
4290 * Implemented color schemes for prompts also. As for tracebacks,
4286 currently only NoColor and Linux are supported. But now the
4291 currently only NoColor and Linux are supported. But now the
4287 infrastructure is in place, based on a generic ColorScheme
4292 infrastructure is in place, based on a generic ColorScheme
4288 class. So writing and activating new schemes both for the prompts
4293 class. So writing and activating new schemes both for the prompts
4289 and the tracebacks should be straightforward.
4294 and the tracebacks should be straightforward.
4290
4295
4291 * Version 0.1.13 released, 0.1.14 opened.
4296 * Version 0.1.13 released, 0.1.14 opened.
4292
4297
4293 * Changed handling of options for output cache. Now counter is
4298 * Changed handling of options for output cache. Now counter is
4294 hardwired starting at 1 and one specifies the maximum number of
4299 hardwired starting at 1 and one specifies the maximum number of
4295 entries *in the outcache* (not the max prompt counter). This is
4300 entries *in the outcache* (not the max prompt counter). This is
4296 much better, since many statements won't increase the cache
4301 much better, since many statements won't increase the cache
4297 count. It also eliminated some confusing options, now there's only
4302 count. It also eliminated some confusing options, now there's only
4298 one: cache_size.
4303 one: cache_size.
4299
4304
4300 * Added 'alias' magic function and magic_alias option in the
4305 * Added 'alias' magic function and magic_alias option in the
4301 ipythonrc file. Now the user can easily define whatever names he
4306 ipythonrc file. Now the user can easily define whatever names he
4302 wants for the magic functions without having to play weird
4307 wants for the magic functions without having to play weird
4303 namespace games. This gives IPython a real shell-like feel.
4308 namespace games. This gives IPython a real shell-like feel.
4304
4309
4305 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4310 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4306 @ or not).
4311 @ or not).
4307
4312
4308 This was one of the last remaining 'visible' bugs (that I know
4313 This was one of the last remaining 'visible' bugs (that I know
4309 of). I think if I can clean up the session loading so it works
4314 of). I think if I can clean up the session loading so it works
4310 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4315 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4311 about licensing).
4316 about licensing).
4312
4317
4313 2001-11-25 Fernando Perez <fperez@colorado.edu>
4318 2001-11-25 Fernando Perez <fperez@colorado.edu>
4314
4319
4315 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4320 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4316 there's a cleaner distinction between what ? and ?? show.
4321 there's a cleaner distinction between what ? and ?? show.
4317
4322
4318 * Added screen_length option. Now the user can define his own
4323 * Added screen_length option. Now the user can define his own
4319 screen size for page() operations.
4324 screen size for page() operations.
4320
4325
4321 * Implemented magic shell-like functions with automatic code
4326 * Implemented magic shell-like functions with automatic code
4322 generation. Now adding another function is just a matter of adding
4327 generation. Now adding another function is just a matter of adding
4323 an entry to a dict, and the function is dynamically generated at
4328 an entry to a dict, and the function is dynamically generated at
4324 run-time. Python has some really cool features!
4329 run-time. Python has some really cool features!
4325
4330
4326 * Renamed many options to cleanup conventions a little. Now all
4331 * Renamed many options to cleanup conventions a little. Now all
4327 are lowercase, and only underscores where needed. Also in the code
4332 are lowercase, and only underscores where needed. Also in the code
4328 option name tables are clearer.
4333 option name tables are clearer.
4329
4334
4330 * Changed prompts a little. Now input is 'In [n]:' instead of
4335 * Changed prompts a little. Now input is 'In [n]:' instead of
4331 'In[n]:='. This allows it the numbers to be aligned with the
4336 'In[n]:='. This allows it the numbers to be aligned with the
4332 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4337 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4333 Python (it was a Mathematica thing). The '...' continuation prompt
4338 Python (it was a Mathematica thing). The '...' continuation prompt
4334 was also changed a little to align better.
4339 was also changed a little to align better.
4335
4340
4336 * Fixed bug when flushing output cache. Not all _p<n> variables
4341 * Fixed bug when flushing output cache. Not all _p<n> variables
4337 exist, so their deletion needs to be wrapped in a try:
4342 exist, so their deletion needs to be wrapped in a try:
4338
4343
4339 * Figured out how to properly use inspect.formatargspec() (it
4344 * Figured out how to properly use inspect.formatargspec() (it
4340 requires the args preceded by *). So I removed all the code from
4345 requires the args preceded by *). So I removed all the code from
4341 _get_pdef in Magic, which was just replicating that.
4346 _get_pdef in Magic, which was just replicating that.
4342
4347
4343 * Added test to prefilter to allow redefining magic function names
4348 * Added test to prefilter to allow redefining magic function names
4344 as variables. This is ok, since the @ form is always available,
4349 as variables. This is ok, since the @ form is always available,
4345 but whe should allow the user to define a variable called 'ls' if
4350 but whe should allow the user to define a variable called 'ls' if
4346 he needs it.
4351 he needs it.
4347
4352
4348 * Moved the ToDo information from README into a separate ToDo.
4353 * Moved the ToDo information from README into a separate ToDo.
4349
4354
4350 * General code cleanup and small bugfixes. I think it's close to a
4355 * General code cleanup and small bugfixes. I think it's close to a
4351 state where it can be released, obviously with a big 'beta'
4356 state where it can be released, obviously with a big 'beta'
4352 warning on it.
4357 warning on it.
4353
4358
4354 * Got the magic function split to work. Now all magics are defined
4359 * Got the magic function split to work. Now all magics are defined
4355 in a separate class. It just organizes things a bit, and now
4360 in a separate class. It just organizes things a bit, and now
4356 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4361 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4357 was too long).
4362 was too long).
4358
4363
4359 * Changed @clear to @reset to avoid potential confusions with
4364 * Changed @clear to @reset to avoid potential confusions with
4360 the shell command clear. Also renamed @cl to @clear, which does
4365 the shell command clear. Also renamed @cl to @clear, which does
4361 exactly what people expect it to from their shell experience.
4366 exactly what people expect it to from their shell experience.
4362
4367
4363 Added a check to the @reset command (since it's so
4368 Added a check to the @reset command (since it's so
4364 destructive, it's probably a good idea to ask for confirmation).
4369 destructive, it's probably a good idea to ask for confirmation).
4365 But now reset only works for full namespace resetting. Since the
4370 But now reset only works for full namespace resetting. Since the
4366 del keyword is already there for deleting a few specific
4371 del keyword is already there for deleting a few specific
4367 variables, I don't see the point of having a redundant magic
4372 variables, I don't see the point of having a redundant magic
4368 function for the same task.
4373 function for the same task.
4369
4374
4370 2001-11-24 Fernando Perez <fperez@colorado.edu>
4375 2001-11-24 Fernando Perez <fperez@colorado.edu>
4371
4376
4372 * Updated the builtin docs (esp. the ? ones).
4377 * Updated the builtin docs (esp. the ? ones).
4373
4378
4374 * Ran all the code through pychecker. Not terribly impressed with
4379 * Ran all the code through pychecker. Not terribly impressed with
4375 it: lots of spurious warnings and didn't really find anything of
4380 it: lots of spurious warnings and didn't really find anything of
4376 substance (just a few modules being imported and not used).
4381 substance (just a few modules being imported and not used).
4377
4382
4378 * Implemented the new ultraTB functionality into IPython. New
4383 * Implemented the new ultraTB functionality into IPython. New
4379 option: xcolors. This chooses color scheme. xmode now only selects
4384 option: xcolors. This chooses color scheme. xmode now only selects
4380 between Plain and Verbose. Better orthogonality.
4385 between Plain and Verbose. Better orthogonality.
4381
4386
4382 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4387 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4383 mode and color scheme for the exception handlers. Now it's
4388 mode and color scheme for the exception handlers. Now it's
4384 possible to have the verbose traceback with no coloring.
4389 possible to have the verbose traceback with no coloring.
4385
4390
4386 2001-11-23 Fernando Perez <fperez@colorado.edu>
4391 2001-11-23 Fernando Perez <fperez@colorado.edu>
4387
4392
4388 * Version 0.1.12 released, 0.1.13 opened.
4393 * Version 0.1.12 released, 0.1.13 opened.
4389
4394
4390 * Removed option to set auto-quote and auto-paren escapes by
4395 * Removed option to set auto-quote and auto-paren escapes by
4391 user. The chances of breaking valid syntax are just too high. If
4396 user. The chances of breaking valid syntax are just too high. If
4392 someone *really* wants, they can always dig into the code.
4397 someone *really* wants, they can always dig into the code.
4393
4398
4394 * Made prompt separators configurable.
4399 * Made prompt separators configurable.
4395
4400
4396 2001-11-22 Fernando Perez <fperez@colorado.edu>
4401 2001-11-22 Fernando Perez <fperez@colorado.edu>
4397
4402
4398 * Small bugfixes in many places.
4403 * Small bugfixes in many places.
4399
4404
4400 * Removed the MyCompleter class from ipplib. It seemed redundant
4405 * Removed the MyCompleter class from ipplib. It seemed redundant
4401 with the C-p,C-n history search functionality. Less code to
4406 with the C-p,C-n history search functionality. Less code to
4402 maintain.
4407 maintain.
4403
4408
4404 * Moved all the original ipython.py code into ipythonlib.py. Right
4409 * Moved all the original ipython.py code into ipythonlib.py. Right
4405 now it's just one big dump into a function called make_IPython, so
4410 now it's just one big dump into a function called make_IPython, so
4406 no real modularity has been gained. But at least it makes the
4411 no real modularity has been gained. But at least it makes the
4407 wrapper script tiny, and since ipythonlib is a module, it gets
4412 wrapper script tiny, and since ipythonlib is a module, it gets
4408 compiled and startup is much faster.
4413 compiled and startup is much faster.
4409
4414
4410 This is a reasobably 'deep' change, so we should test it for a
4415 This is a reasobably 'deep' change, so we should test it for a
4411 while without messing too much more with the code.
4416 while without messing too much more with the code.
4412
4417
4413 2001-11-21 Fernando Perez <fperez@colorado.edu>
4418 2001-11-21 Fernando Perez <fperez@colorado.edu>
4414
4419
4415 * Version 0.1.11 released, 0.1.12 opened for further work.
4420 * Version 0.1.11 released, 0.1.12 opened for further work.
4416
4421
4417 * Removed dependency on Itpl. It was only needed in one place. It
4422 * Removed dependency on Itpl. It was only needed in one place. It
4418 would be nice if this became part of python, though. It makes life
4423 would be nice if this became part of python, though. It makes life
4419 *a lot* easier in some cases.
4424 *a lot* easier in some cases.
4420
4425
4421 * Simplified the prefilter code a bit. Now all handlers are
4426 * Simplified the prefilter code a bit. Now all handlers are
4422 expected to explicitly return a value (at least a blank string).
4427 expected to explicitly return a value (at least a blank string).
4423
4428
4424 * Heavy edits in ipplib. Removed the help system altogether. Now
4429 * Heavy edits in ipplib. Removed the help system altogether. Now
4425 obj?/?? is used for inspecting objects, a magic @doc prints
4430 obj?/?? is used for inspecting objects, a magic @doc prints
4426 docstrings, and full-blown Python help is accessed via the 'help'
4431 docstrings, and full-blown Python help is accessed via the 'help'
4427 keyword. This cleans up a lot of code (less to maintain) and does
4432 keyword. This cleans up a lot of code (less to maintain) and does
4428 the job. Since 'help' is now a standard Python component, might as
4433 the job. Since 'help' is now a standard Python component, might as
4429 well use it and remove duplicate functionality.
4434 well use it and remove duplicate functionality.
4430
4435
4431 Also removed the option to use ipplib as a standalone program. By
4436 Also removed the option to use ipplib as a standalone program. By
4432 now it's too dependent on other parts of IPython to function alone.
4437 now it's too dependent on other parts of IPython to function alone.
4433
4438
4434 * Fixed bug in genutils.pager. It would crash if the pager was
4439 * Fixed bug in genutils.pager. It would crash if the pager was
4435 exited immediately after opening (broken pipe).
4440 exited immediately after opening (broken pipe).
4436
4441
4437 * Trimmed down the VerboseTB reporting a little. The header is
4442 * Trimmed down the VerboseTB reporting a little. The header is
4438 much shorter now and the repeated exception arguments at the end
4443 much shorter now and the repeated exception arguments at the end
4439 have been removed. For interactive use the old header seemed a bit
4444 have been removed. For interactive use the old header seemed a bit
4440 excessive.
4445 excessive.
4441
4446
4442 * Fixed small bug in output of @whos for variables with multi-word
4447 * Fixed small bug in output of @whos for variables with multi-word
4443 types (only first word was displayed).
4448 types (only first word was displayed).
4444
4449
4445 2001-11-17 Fernando Perez <fperez@colorado.edu>
4450 2001-11-17 Fernando Perez <fperez@colorado.edu>
4446
4451
4447 * Version 0.1.10 released, 0.1.11 opened for further work.
4452 * Version 0.1.10 released, 0.1.11 opened for further work.
4448
4453
4449 * Modified dirs and friends. dirs now *returns* the stack (not
4454 * Modified dirs and friends. dirs now *returns* the stack (not
4450 prints), so one can manipulate it as a variable. Convenient to
4455 prints), so one can manipulate it as a variable. Convenient to
4451 travel along many directories.
4456 travel along many directories.
4452
4457
4453 * Fixed bug in magic_pdef: would only work with functions with
4458 * Fixed bug in magic_pdef: would only work with functions with
4454 arguments with default values.
4459 arguments with default values.
4455
4460
4456 2001-11-14 Fernando Perez <fperez@colorado.edu>
4461 2001-11-14 Fernando Perez <fperez@colorado.edu>
4457
4462
4458 * Added the PhysicsInput stuff to dot_ipython so it ships as an
4463 * Added the PhysicsInput stuff to dot_ipython so it ships as an
4459 example with IPython. Various other minor fixes and cleanups.
4464 example with IPython. Various other minor fixes and cleanups.
4460
4465
4461 * Version 0.1.9 released, 0.1.10 opened for further work.
4466 * Version 0.1.9 released, 0.1.10 opened for further work.
4462
4467
4463 * Added sys.path to the list of directories searched in the
4468 * Added sys.path to the list of directories searched in the
4464 execfile= option. It used to be the current directory and the
4469 execfile= option. It used to be the current directory and the
4465 user's IPYTHONDIR only.
4470 user's IPYTHONDIR only.
4466
4471
4467 2001-11-13 Fernando Perez <fperez@colorado.edu>
4472 2001-11-13 Fernando Perez <fperez@colorado.edu>
4468
4473
4469 * Reinstated the raw_input/prefilter separation that Janko had
4474 * Reinstated the raw_input/prefilter separation that Janko had
4470 initially. This gives a more convenient setup for extending the
4475 initially. This gives a more convenient setup for extending the
4471 pre-processor from the outside: raw_input always gets a string,
4476 pre-processor from the outside: raw_input always gets a string,
4472 and prefilter has to process it. We can then redefine prefilter
4477 and prefilter has to process it. We can then redefine prefilter
4473 from the outside and implement extensions for special
4478 from the outside and implement extensions for special
4474 purposes.
4479 purposes.
4475
4480
4476 Today I got one for inputting PhysicalQuantity objects
4481 Today I got one for inputting PhysicalQuantity objects
4477 (from Scientific) without needing any function calls at
4482 (from Scientific) without needing any function calls at
4478 all. Extremely convenient, and it's all done as a user-level
4483 all. Extremely convenient, and it's all done as a user-level
4479 extension (no IPython code was touched). Now instead of:
4484 extension (no IPython code was touched). Now instead of:
4480 a = PhysicalQuantity(4.2,'m/s**2')
4485 a = PhysicalQuantity(4.2,'m/s**2')
4481 one can simply say
4486 one can simply say
4482 a = 4.2 m/s**2
4487 a = 4.2 m/s**2
4483 or even
4488 or even
4484 a = 4.2 m/s^2
4489 a = 4.2 m/s^2
4485
4490
4486 I use this, but it's also a proof of concept: IPython really is
4491 I use this, but it's also a proof of concept: IPython really is
4487 fully user-extensible, even at the level of the parsing of the
4492 fully user-extensible, even at the level of the parsing of the
4488 command line. It's not trivial, but it's perfectly doable.
4493 command line. It's not trivial, but it's perfectly doable.
4489
4494
4490 * Added 'add_flip' method to inclusion conflict resolver. Fixes
4495 * Added 'add_flip' method to inclusion conflict resolver. Fixes
4491 the problem of modules being loaded in the inverse order in which
4496 the problem of modules being loaded in the inverse order in which
4492 they were defined in
4497 they were defined in
4493
4498
4494 * Version 0.1.8 released, 0.1.9 opened for further work.
4499 * Version 0.1.8 released, 0.1.9 opened for further work.
4495
4500
4496 * Added magics pdef, source and file. They respectively show the
4501 * Added magics pdef, source and file. They respectively show the
4497 definition line ('prototype' in C), source code and full python
4502 definition line ('prototype' in C), source code and full python
4498 file for any callable object. The object inspector oinfo uses
4503 file for any callable object. The object inspector oinfo uses
4499 these to show the same information.
4504 these to show the same information.
4500
4505
4501 * Version 0.1.7 released, 0.1.8 opened for further work.
4506 * Version 0.1.7 released, 0.1.8 opened for further work.
4502
4507
4503 * Separated all the magic functions into a class called Magic. The
4508 * Separated all the magic functions into a class called Magic. The
4504 InteractiveShell class was becoming too big for Xemacs to handle
4509 InteractiveShell class was becoming too big for Xemacs to handle
4505 (de-indenting a line would lock it up for 10 seconds while it
4510 (de-indenting a line would lock it up for 10 seconds while it
4506 backtracked on the whole class!)
4511 backtracked on the whole class!)
4507
4512
4508 FIXME: didn't work. It can be done, but right now namespaces are
4513 FIXME: didn't work. It can be done, but right now namespaces are
4509 all messed up. Do it later (reverted it for now, so at least
4514 all messed up. Do it later (reverted it for now, so at least
4510 everything works as before).
4515 everything works as before).
4511
4516
4512 * Got the object introspection system (magic_oinfo) working! I
4517 * Got the object introspection system (magic_oinfo) working! I
4513 think this is pretty much ready for release to Janko, so he can
4518 think this is pretty much ready for release to Janko, so he can
4514 test it for a while and then announce it. Pretty much 100% of what
4519 test it for a while and then announce it. Pretty much 100% of what
4515 I wanted for the 'phase 1' release is ready. Happy, tired.
4520 I wanted for the 'phase 1' release is ready. Happy, tired.
4516
4521
4517 2001-11-12 Fernando Perez <fperez@colorado.edu>
4522 2001-11-12 Fernando Perez <fperez@colorado.edu>
4518
4523
4519 * Version 0.1.6 released, 0.1.7 opened for further work.
4524 * Version 0.1.6 released, 0.1.7 opened for further work.
4520
4525
4521 * Fixed bug in printing: it used to test for truth before
4526 * Fixed bug in printing: it used to test for truth before
4522 printing, so 0 wouldn't print. Now checks for None.
4527 printing, so 0 wouldn't print. Now checks for None.
4523
4528
4524 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
4529 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
4525 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
4530 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
4526 reaches by hand into the outputcache. Think of a better way to do
4531 reaches by hand into the outputcache. Think of a better way to do
4527 this later.
4532 this later.
4528
4533
4529 * Various small fixes thanks to Nathan's comments.
4534 * Various small fixes thanks to Nathan's comments.
4530
4535
4531 * Changed magic_pprint to magic_Pprint. This way it doesn't
4536 * Changed magic_pprint to magic_Pprint. This way it doesn't
4532 collide with pprint() and the name is consistent with the command
4537 collide with pprint() and the name is consistent with the command
4533 line option.
4538 line option.
4534
4539
4535 * Changed prompt counter behavior to be fully like
4540 * Changed prompt counter behavior to be fully like
4536 Mathematica's. That is, even input that doesn't return a result
4541 Mathematica's. That is, even input that doesn't return a result
4537 raises the prompt counter. The old behavior was kind of confusing
4542 raises the prompt counter. The old behavior was kind of confusing
4538 (getting the same prompt number several times if the operation
4543 (getting the same prompt number several times if the operation
4539 didn't return a result).
4544 didn't return a result).
4540
4545
4541 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
4546 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
4542
4547
4543 * Fixed -Classic mode (wasn't working anymore).
4548 * Fixed -Classic mode (wasn't working anymore).
4544
4549
4545 * Added colored prompts using Nathan's new code. Colors are
4550 * Added colored prompts using Nathan's new code. Colors are
4546 currently hardwired, they can be user-configurable. For
4551 currently hardwired, they can be user-configurable. For
4547 developers, they can be chosen in file ipythonlib.py, at the
4552 developers, they can be chosen in file ipythonlib.py, at the
4548 beginning of the CachedOutput class def.
4553 beginning of the CachedOutput class def.
4549
4554
4550 2001-11-11 Fernando Perez <fperez@colorado.edu>
4555 2001-11-11 Fernando Perez <fperez@colorado.edu>
4551
4556
4552 * Version 0.1.5 released, 0.1.6 opened for further work.
4557 * Version 0.1.5 released, 0.1.6 opened for further work.
4553
4558
4554 * Changed magic_env to *return* the environment as a dict (not to
4559 * Changed magic_env to *return* the environment as a dict (not to
4555 print it). This way it prints, but it can also be processed.
4560 print it). This way it prints, but it can also be processed.
4556
4561
4557 * Added Verbose exception reporting to interactive
4562 * Added Verbose exception reporting to interactive
4558 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
4563 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
4559 traceback. Had to make some changes to the ultraTB file. This is
4564 traceback. Had to make some changes to the ultraTB file. This is
4560 probably the last 'big' thing in my mental todo list. This ties
4565 probably the last 'big' thing in my mental todo list. This ties
4561 in with the next entry:
4566 in with the next entry:
4562
4567
4563 * Changed -Xi and -Xf to a single -xmode option. Now all the user
4568 * Changed -Xi and -Xf to a single -xmode option. Now all the user
4564 has to specify is Plain, Color or Verbose for all exception
4569 has to specify is Plain, Color or Verbose for all exception
4565 handling.
4570 handling.
4566
4571
4567 * Removed ShellServices option. All this can really be done via
4572 * Removed ShellServices option. All this can really be done via
4568 the magic system. It's easier to extend, cleaner and has automatic
4573 the magic system. It's easier to extend, cleaner and has automatic
4569 namespace protection and documentation.
4574 namespace protection and documentation.
4570
4575
4571 2001-11-09 Fernando Perez <fperez@colorado.edu>
4576 2001-11-09 Fernando Perez <fperez@colorado.edu>
4572
4577
4573 * Fixed bug in output cache flushing (missing parameter to
4578 * Fixed bug in output cache flushing (missing parameter to
4574 __init__). Other small bugs fixed (found using pychecker).
4579 __init__). Other small bugs fixed (found using pychecker).
4575
4580
4576 * Version 0.1.4 opened for bugfixing.
4581 * Version 0.1.4 opened for bugfixing.
4577
4582
4578 2001-11-07 Fernando Perez <fperez@colorado.edu>
4583 2001-11-07 Fernando Perez <fperez@colorado.edu>
4579
4584
4580 * Version 0.1.3 released, mainly because of the raw_input bug.
4585 * Version 0.1.3 released, mainly because of the raw_input bug.
4581
4586
4582 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
4587 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
4583 and when testing for whether things were callable, a call could
4588 and when testing for whether things were callable, a call could
4584 actually be made to certain functions. They would get called again
4589 actually be made to certain functions. They would get called again
4585 once 'really' executed, with a resulting double call. A disaster
4590 once 'really' executed, with a resulting double call. A disaster
4586 in many cases (list.reverse() would never work!).
4591 in many cases (list.reverse() would never work!).
4587
4592
4588 * Removed prefilter() function, moved its code to raw_input (which
4593 * Removed prefilter() function, moved its code to raw_input (which
4589 after all was just a near-empty caller for prefilter). This saves
4594 after all was just a near-empty caller for prefilter). This saves
4590 a function call on every prompt, and simplifies the class a tiny bit.
4595 a function call on every prompt, and simplifies the class a tiny bit.
4591
4596
4592 * Fix _ip to __ip name in magic example file.
4597 * Fix _ip to __ip name in magic example file.
4593
4598
4594 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
4599 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
4595 work with non-gnu versions of tar.
4600 work with non-gnu versions of tar.
4596
4601
4597 2001-11-06 Fernando Perez <fperez@colorado.edu>
4602 2001-11-06 Fernando Perez <fperez@colorado.edu>
4598
4603
4599 * Version 0.1.2. Just to keep track of the recent changes.
4604 * Version 0.1.2. Just to keep track of the recent changes.
4600
4605
4601 * Fixed nasty bug in output prompt routine. It used to check 'if
4606 * Fixed nasty bug in output prompt routine. It used to check 'if
4602 arg != None...'. Problem is, this fails if arg implements a
4607 arg != None...'. Problem is, this fails if arg implements a
4603 special comparison (__cmp__) which disallows comparing to
4608 special comparison (__cmp__) which disallows comparing to
4604 None. Found it when trying to use the PhysicalQuantity module from
4609 None. Found it when trying to use the PhysicalQuantity module from
4605 ScientificPython.
4610 ScientificPython.
4606
4611
4607 2001-11-05 Fernando Perez <fperez@colorado.edu>
4612 2001-11-05 Fernando Perez <fperez@colorado.edu>
4608
4613
4609 * Also added dirs. Now the pushd/popd/dirs family functions
4614 * Also added dirs. Now the pushd/popd/dirs family functions
4610 basically like the shell, with the added convenience of going home
4615 basically like the shell, with the added convenience of going home
4611 when called with no args.
4616 when called with no args.
4612
4617
4613 * pushd/popd slightly modified to mimic shell behavior more
4618 * pushd/popd slightly modified to mimic shell behavior more
4614 closely.
4619 closely.
4615
4620
4616 * Added env,pushd,popd from ShellServices as magic functions. I
4621 * Added env,pushd,popd from ShellServices as magic functions. I
4617 think the cleanest will be to port all desired functions from
4622 think the cleanest will be to port all desired functions from
4618 ShellServices as magics and remove ShellServices altogether. This
4623 ShellServices as magics and remove ShellServices altogether. This
4619 will provide a single, clean way of adding functionality
4624 will provide a single, clean way of adding functionality
4620 (shell-type or otherwise) to IP.
4625 (shell-type or otherwise) to IP.
4621
4626
4622 2001-11-04 Fernando Perez <fperez@colorado.edu>
4627 2001-11-04 Fernando Perez <fperez@colorado.edu>
4623
4628
4624 * Added .ipython/ directory to sys.path. This way users can keep
4629 * Added .ipython/ directory to sys.path. This way users can keep
4625 customizations there and access them via import.
4630 customizations there and access them via import.
4626
4631
4627 2001-11-03 Fernando Perez <fperez@colorado.edu>
4632 2001-11-03 Fernando Perez <fperez@colorado.edu>
4628
4633
4629 * Opened version 0.1.1 for new changes.
4634 * Opened version 0.1.1 for new changes.
4630
4635
4631 * Changed version number to 0.1.0: first 'public' release, sent to
4636 * Changed version number to 0.1.0: first 'public' release, sent to
4632 Nathan and Janko.
4637 Nathan and Janko.
4633
4638
4634 * Lots of small fixes and tweaks.
4639 * Lots of small fixes and tweaks.
4635
4640
4636 * Minor changes to whos format. Now strings are shown, snipped if
4641 * Minor changes to whos format. Now strings are shown, snipped if
4637 too long.
4642 too long.
4638
4643
4639 * Changed ShellServices to work on __main__ so they show up in @who
4644 * Changed ShellServices to work on __main__ so they show up in @who
4640
4645
4641 * Help also works with ? at the end of a line:
4646 * Help also works with ? at the end of a line:
4642 ?sin and sin?
4647 ?sin and sin?
4643 both produce the same effect. This is nice, as often I use the
4648 both produce the same effect. This is nice, as often I use the
4644 tab-complete to find the name of a method, but I used to then have
4649 tab-complete to find the name of a method, but I used to then have
4645 to go to the beginning of the line to put a ? if I wanted more
4650 to go to the beginning of the line to put a ? if I wanted more
4646 info. Now I can just add the ? and hit return. Convenient.
4651 info. Now I can just add the ? and hit return. Convenient.
4647
4652
4648 2001-11-02 Fernando Perez <fperez@colorado.edu>
4653 2001-11-02 Fernando Perez <fperez@colorado.edu>
4649
4654
4650 * Python version check (>=2.1) added.
4655 * Python version check (>=2.1) added.
4651
4656
4652 * Added LazyPython documentation. At this point the docs are quite
4657 * Added LazyPython documentation. At this point the docs are quite
4653 a mess. A cleanup is in order.
4658 a mess. A cleanup is in order.
4654
4659
4655 * Auto-installer created. For some bizarre reason, the zipfiles
4660 * Auto-installer created. For some bizarre reason, the zipfiles
4656 module isn't working on my system. So I made a tar version
4661 module isn't working on my system. So I made a tar version
4657 (hopefully the command line options in various systems won't kill
4662 (hopefully the command line options in various systems won't kill
4658 me).
4663 me).
4659
4664
4660 * Fixes to Struct in genutils. Now all dictionary-like methods are
4665 * Fixes to Struct in genutils. Now all dictionary-like methods are
4661 protected (reasonably).
4666 protected (reasonably).
4662
4667
4663 * Added pager function to genutils and changed ? to print usage
4668 * Added pager function to genutils and changed ? to print usage
4664 note through it (it was too long).
4669 note through it (it was too long).
4665
4670
4666 * Added the LazyPython functionality. Works great! I changed the
4671 * Added the LazyPython functionality. Works great! I changed the
4667 auto-quote escape to ';', it's on home row and next to '. But
4672 auto-quote escape to ';', it's on home row and next to '. But
4668 both auto-quote and auto-paren (still /) escapes are command-line
4673 both auto-quote and auto-paren (still /) escapes are command-line
4669 parameters.
4674 parameters.
4670
4675
4671
4676
4672 2001-11-01 Fernando Perez <fperez@colorado.edu>
4677 2001-11-01 Fernando Perez <fperez@colorado.edu>
4673
4678
4674 * Version changed to 0.0.7. Fairly large change: configuration now
4679 * Version changed to 0.0.7. Fairly large change: configuration now
4675 is all stored in a directory, by default .ipython. There, all
4680 is all stored in a directory, by default .ipython. There, all
4676 config files have normal looking names (not .names)
4681 config files have normal looking names (not .names)
4677
4682
4678 * Version 0.0.6 Released first to Lucas and Archie as a test
4683 * Version 0.0.6 Released first to Lucas and Archie as a test
4679 run. Since it's the first 'semi-public' release, change version to
4684 run. Since it's the first 'semi-public' release, change version to
4680 > 0.0.6 for any changes now.
4685 > 0.0.6 for any changes now.
4681
4686
4682 * Stuff I had put in the ipplib.py changelog:
4687 * Stuff I had put in the ipplib.py changelog:
4683
4688
4684 Changes to InteractiveShell:
4689 Changes to InteractiveShell:
4685
4690
4686 - Made the usage message a parameter.
4691 - Made the usage message a parameter.
4687
4692
4688 - Require the name of the shell variable to be given. It's a bit
4693 - Require the name of the shell variable to be given. It's a bit
4689 of a hack, but allows the name 'shell' not to be hardwire in the
4694 of a hack, but allows the name 'shell' not to be hardwire in the
4690 magic (@) handler, which is problematic b/c it requires
4695 magic (@) handler, which is problematic b/c it requires
4691 polluting the global namespace with 'shell'. This in turn is
4696 polluting the global namespace with 'shell'. This in turn is
4692 fragile: if a user redefines a variable called shell, things
4697 fragile: if a user redefines a variable called shell, things
4693 break.
4698 break.
4694
4699
4695 - magic @: all functions available through @ need to be defined
4700 - magic @: all functions available through @ need to be defined
4696 as magic_<name>, even though they can be called simply as
4701 as magic_<name>, even though they can be called simply as
4697 @<name>. This allows the special command @magic to gather
4702 @<name>. This allows the special command @magic to gather
4698 information automatically about all existing magic functions,
4703 information automatically about all existing magic functions,
4699 even if they are run-time user extensions, by parsing the shell
4704 even if they are run-time user extensions, by parsing the shell
4700 instance __dict__ looking for special magic_ names.
4705 instance __dict__ looking for special magic_ names.
4701
4706
4702 - mainloop: added *two* local namespace parameters. This allows
4707 - mainloop: added *two* local namespace parameters. This allows
4703 the class to differentiate between parameters which were there
4708 the class to differentiate between parameters which were there
4704 before and after command line initialization was processed. This
4709 before and after command line initialization was processed. This
4705 way, later @who can show things loaded at startup by the
4710 way, later @who can show things loaded at startup by the
4706 user. This trick was necessary to make session saving/reloading
4711 user. This trick was necessary to make session saving/reloading
4707 really work: ideally after saving/exiting/reloading a session,
4712 really work: ideally after saving/exiting/reloading a session,
4708 *everythin* should look the same, including the output of @who. I
4713 *everythin* should look the same, including the output of @who. I
4709 was only able to make this work with this double namespace
4714 was only able to make this work with this double namespace
4710 trick.
4715 trick.
4711
4716
4712 - added a header to the logfile which allows (almost) full
4717 - added a header to the logfile which allows (almost) full
4713 session restoring.
4718 session restoring.
4714
4719
4715 - prepend lines beginning with @ or !, with a and log
4720 - prepend lines beginning with @ or !, with a and log
4716 them. Why? !lines: may be useful to know what you did @lines:
4721 them. Why? !lines: may be useful to know what you did @lines:
4717 they may affect session state. So when restoring a session, at
4722 they may affect session state. So when restoring a session, at
4718 least inform the user of their presence. I couldn't quite get
4723 least inform the user of their presence. I couldn't quite get
4719 them to properly re-execute, but at least the user is warned.
4724 them to properly re-execute, but at least the user is warned.
4720
4725
4721 * Started ChangeLog.
4726 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now